From 379ff9302b46c20a7de81cfe63da6556e0822be1 Mon Sep 17 00:00:00 2001 From: JozsefA Date: Mon, 11 Jan 2021 01:04:18 -0800 Subject: [PATCH] rotating stuff renders too now --- .../resources/assets/create/shader/contraption_belt.vert | 2 +- .../resources/assets/create/shader/contraption_rotating.vert | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/resources/assets/create/shader/contraption_belt.vert b/src/main/resources/assets/create/shader/contraption_belt.vert index 65070364b..320cd8638 100644 --- a/src/main/resources/assets/create/shader/contraption_belt.vert +++ b/src/main/resources/assets/create/shader/contraption_belt.vert @@ -1,4 +1,4 @@ -#version 330 core +#version 420 core #define PI 3.1415926538 layout (location = 0) in vec3 aPos; diff --git a/src/main/resources/assets/create/shader/contraption_rotating.vert b/src/main/resources/assets/create/shader/contraption_rotating.vert index 532dc4681..7315d4a67 100644 --- a/src/main/resources/assets/create/shader/contraption_rotating.vert +++ b/src/main/resources/assets/create/shader/contraption_rotating.vert @@ -40,8 +40,7 @@ mat4 kineticRotation() { float degrees = rotationOffset + time * speed * -3./10.; float angle = fract(degrees / 360.) * PI * 2.; - vec3 axis = normalize(rotationAxis); - return rotate(axis, angle); + return rotate(normalize(rotationAxis), angle); } mat4 contraptionRotation() { @@ -64,7 +63,7 @@ void main() { vec4 worldPos = contraptionRotation * localPos + vec4(cPos + 0.5, 0); BoxCoord = (worldPos.xyz - lightBoxMin) / lightBoxSize; - Diffuse = diffuse(normalize(contraptionRotation * localRotation * vec4(aNormal, 0.)).xyz); + Diffuse = diffuse(normalize(contraptionRotation * kineticRotation * vec4(aNormal, 0.)).xyz); Color = vec4(1.); TexCoords = aTexCoords; gl_Position = projection * view * worldPos;