summaryrefslogtreecommitdiff
path: root/shaders/vertex.glsl
diff options
context:
space:
mode:
authorAaditya Dhruv <[email protected]>2026-01-30 19:12:03 -0600
committerAaditya Dhruv <[email protected]>2026-01-30 19:12:03 -0600
commit1a721b98caf7559f4a18baa8d3b92269e8f1f6ce (patch)
tree32be8966361f8f8ae74c6c0af226e39fe9feb375 /shaders/vertex.glsl
parent4992ce0098cac8caef6c9315816b688d96259bce (diff)
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
Diffstat (limited to 'shaders/vertex.glsl')
-rw-r--r--shaders/vertex.glsl3
1 files changed, 3 insertions, 0 deletions
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));
};