From 74757aff4aaf5315d04755f15456915bdbeb04a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9Fmur=20Oymak?= Date: Sun, 5 Jan 2020 19:28:31 +0300 Subject: [PATCH] Fix texture shift computation --- assignments/hw3/src/shader.vert | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assignments/hw3/src/shader.vert b/assignments/hw3/src/shader.vert index af9d22f..f1f855f 100644 --- a/assignments/hw3/src/shader.vert +++ b/assignments/hw3/src/shader.vert @@ -21,8 +21,8 @@ out vec3 VertexNormal; vec3 ComputeNeighbor(in vec3 Offset) { vec3 NeighborPosition = Position + Offset; - vec2 NeighborTextureCoordinate = vec2((-NeighborPosition.x + TextureHorizontalShift) / TextureWidth, - -NeighborPosition.z / TextureHeight); + vec2 NeighborTextureCoordinate = vec2(-NeighborPosition.x + TextureHorizontalShift / TextureWidth, + -NeighborPosition.z); vec4 NeighborHeightMapColor = texture(HeightMap, NeighborTextureCoordinate); float Height = HeightFactor * NeighborHeightMapColor.r; NeighborPosition.y = Height;