From 91069163f81aa93bc878a00db6c062d653f4da8d Mon Sep 17 00:00:00 2001 From: JozsefA Date: Tue, 5 Jan 2021 14:50:36 -0800 Subject: [PATCH] clean shader code --- src/main/resources/assets/create/shader/belt.vert | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/resources/assets/create/shader/belt.vert b/src/main/resources/assets/create/shader/belt.vert index 7e1a30b8f..76abae150 100644 --- a/src/main/resources/assets/create/shader/belt.vert +++ b/src/main/resources/assets/create/shader/belt.vert @@ -37,12 +37,14 @@ void main() { vec3 rot = fract(rotationDegrees / 360.) * PI * 2.; - vec4 renderPos = rotate(vec3(1, 0, 0), rot.x) * rotate(vec3(0, 0, 1), rot.z) * rotate(vec3(0, 1, 0), rot.y) * vec4(aPos - vec3(0.5), 1f); + mat4 rotation = rotate(vec3(0, 1, 0), rot.y) * rotate(vec3(0, 0, 1), rot.z) * rotate(vec3(1, 0, 0), rot.x); + + vec4 renderPos = rotation * vec4(aPos - vec3(0.5), 1f); renderPos += vec4(instancePos + vec3(0.5), 0); float scrollSize = scrollTexture.w - scrollTexture.y; - float scroll = fract(speed * time / (36. * 16.)) * scrollSize * scrollMult; + float scroll = fract(speed * time / (36 * 16.)) * scrollSize * scrollMult; Light = light; TexCoords = aTexCoords - sourceUV + scrollTexture.xy + vec2(0., scroll);