parent
f5253f16e8
commit
c17d5f8ce5
|
@ -8,7 +8,9 @@ uniform sampler2D tex;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 tex_color = texture(tex, v_texcoord*60);
|
// Sample the texture using the texture coordinates
|
||||||
|
vec4 tex_color = texture(tex, v_texcoord);
|
||||||
|
|
||||||
|
// Output the final color
|
||||||
frag_color = tex_color;
|
frag_color = tex_color;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,5 +18,7 @@ void main()
|
||||||
gl_Position = projection * view * model * vec4(position, 1.0);
|
gl_Position = projection * view * model * vec4(position, 1.0);
|
||||||
|
|
||||||
// Calculate the texture coordinate offset based on the camera position
|
// Calculate the texture coordinate offset based on the camera position
|
||||||
v_texcoord = texcoord;
|
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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue