summaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-05-07 17:53:37 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-05-07 17:53:37 +0200
commit17715403aff8ba1889c9e1ef473fe9319b87d1d2 (patch)
tree459d789562ef6c7279045e86b4df5751427a9023 /shaders
parentf0eb6a7b101afba52f33c5286e15a862ee68c64e (diff)
Use chunk-relative coordinates in nodes.
Diffstat (limited to 'shaders')
-rw-r--r--shaders/terrain_vertex.glsl3
1 files changed, 2 insertions, 1 deletions
diff --git a/shaders/terrain_vertex.glsl b/shaders/terrain_vertex.glsl
index 5fcd17b..27da83f 100644
--- a/shaders/terrain_vertex.glsl
+++ b/shaders/terrain_vertex.glsl
@@ -1,11 +1,12 @@
#version 120
varying vec3 normal, light_pos, pos;
+uniform vec2 chunk_pos;
void main() {
normal = gl_Normal;
light_pos = vec3(0, 1, 0);
- pos = gl_Vertex.xyz;
+ pos = gl_Vertex.xyz + vec3(chunk_pos.x, 0, chunk_pos.y);
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;