From f16c897522b6418c399b5699f8378a25c2e5de4f Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 21 Nov 2021 14:57:57 +0500 Subject: Added normals to faces --- cwd/assets/altcraft/shaders/vert/face.vs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'cwd/assets/altcraft/shaders/vert/face.vs') diff --git a/cwd/assets/altcraft/shaders/vert/face.vs b/cwd/assets/altcraft/shaders/vert/face.vs index 93e623d..21f7110 100644 --- a/cwd/assets/altcraft/shaders/vert/face.vs +++ b/cwd/assets/altcraft/shaders/vert/face.vs @@ -1,15 +1,17 @@ #version 330 core -layout (location = 0) in vec3 position[4]; -layout (location = 4) in vec2 uv[4]; -layout (location = 8) in float uvLayer; -layout (location = 9) in float animation; -layout (location = 10) in vec3 color; -layout (location = 11) in vec2 light; +in vec3 position[4]; +in vec3 normal; +in vec2 uv[4]; +in float uvLayer; +in float animation; +in vec3 color; +in vec2 light; out VS_OUT { vec3 Texture; vec3 Color; + vec3 faceNormal; } vs_out; uniform float GlobalTime; @@ -24,4 +26,5 @@ void main() { float faceLight = clamp(light.x / 15.0 + (light.y / 15.0) * DayTime, MinLightLevel, 1.0); vs_out.Color = mix(color.rgb * faceLight, vec3(1,1,1) * faceLight, float(color == vec3(0,0,0))); + vs_out.faceNormal = normal; } -- cgit v1.2.3