From 1a721b98caf7559f4a18baa8d3b92269e8f1f6ce Mon Sep 17 00:00:00 2001 From: Aaditya Dhruv Date: Fri, 30 Jan 2026 19:12:03 -0600 Subject: Add basic block textures - Remove the code that sent colors through uniform variables, instead send texture data - Each vertex now has a texture coordinate - struct texture is a easy way to represent textures, can be extended later - Shaders updated to use textures --- shaders/vertex.glsl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'shaders/vertex.glsl') diff --git a/shaders/vertex.glsl b/shaders/vertex.glsl index 2af2c7e..9323f87 100644 --- a/shaders/vertex.glsl +++ b/shaders/vertex.glsl @@ -2,14 +2,17 @@ layout(location=0) in vec3 pos; layout(location=1) in vec3 v_normal; +layout(location=2) in vec2 i_text_coord; uniform mat4 model; uniform mat4 view; uniform mat4 perspective; out vec3 normal; out vec3 frag_pos; +out vec2 text_coord; void main() { gl_Position = perspective*view*model*vec4(pos, 1.0); normal = v_normal; + text_coord = i_text_coord; frag_pos = vec3(model*vec4(pos, 1.0)); }; -- cgit