From 8d9b24b1b84107c90a77d94c86a810cc068fe073 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 19 Feb 2020 22:14:12 +0100 Subject: Fix rendering of texture with multiple frames --- shaders/sand_vertex.vert | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'shaders/sand_vertex.vert') diff --git a/shaders/sand_vertex.vert b/shaders/sand_vertex.vert index f254dbc..8f746ad 100644 --- a/shaders/sand_vertex.vert +++ b/shaders/sand_vertex.vert @@ -1,15 +1,21 @@ #version 330 core in vec3 position; +in vec2 texcoord_vert; + +out vec2 texcoord_frag; uniform float time; uniform mat4 proj; uniform mat4 view; uniform mat4 model; +uniform sampler2D tex; void main() { + texcoord_frag = texcoord_vert; vec3 pos = position; - pos.z = sin(pos.x + time) * cos(pos.y + time); + //pos.z = sin(pos.x + time) * cos(pos.y + time); + pos.z = texture2D(tex, pos.xy).r * 0.05; gl_Position = proj * view * model * vec4(pos, 1.0); } \ No newline at end of file -- cgit v1.2.3