From 7eb4ece49f1f09ec2a4982b40a249a4120789bde Mon Sep 17 00:00:00 2001 From: Melik Houij Date: Fri, 31 Mar 2023 23:59:59 +0200 Subject: [PATCH] it pans properly now --- resources/shaders/plane/shader.frag | 4 +--- resources/shaders/plane/shader.vert | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/resources/shaders/plane/shader.frag b/resources/shaders/plane/shader.frag index 725c0cb..6cc5589 100644 --- a/resources/shaders/plane/shader.frag +++ b/resources/shaders/plane/shader.frag @@ -8,9 +8,7 @@ uniform sampler2D tex; void main() { - // Sample the texture using the texture coordinates - vec4 tex_color = texture(tex, v_texcoord); + vec4 tex_color = texture(tex, v_texcoord*60); - // Output the final color frag_color = tex_color; } diff --git a/resources/shaders/plane/shader.vert b/resources/shaders/plane/shader.vert index 66ae781..49ef838 100644 --- a/resources/shaders/plane/shader.vert +++ b/resources/shaders/plane/shader.vert @@ -18,7 +18,5 @@ void main() gl_Position = projection * view * model * vec4(position, 1.0); // Calculate the texture coordinate offset based on the camera position - vec2 offset = (camera_position.xz - position.xz) / tile_size; - offset += scroll_speed * vec2(0, 1) * -(gl_Position.w / projection[1][1]); - v_texcoord = texcoord + offset; + v_texcoord = texcoord; }