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/frag/face.fs | 3 ++- cwd/assets/altcraft/shaders/frag/light.fs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'cwd/assets/altcraft/shaders/frag') diff --git a/cwd/assets/altcraft/shaders/frag/face.fs b/cwd/assets/altcraft/shaders/frag/face.fs index 0eb5a21..2120697 100644 --- a/cwd/assets/altcraft/shaders/frag/face.fs +++ b/cwd/assets/altcraft/shaders/frag/face.fs @@ -3,6 +3,7 @@ in VS_OUT { vec3 Texture; vec3 Color; + vec3 faceNormal; } fs_in; layout (location = 0) out vec4 color; @@ -16,5 +17,5 @@ void main() { discard; color = vec4(col.rgb * fs_in.Color, 1.0f); - normal = vec4(1.0f - color.r, 1.0f - color.b, 1.0f, 1.0f); + normal = vec4(fs_in.faceNormal, 1.0f); } diff --git a/cwd/assets/altcraft/shaders/frag/light.fs b/cwd/assets/altcraft/shaders/frag/light.fs index 480e265..73686cc 100644 --- a/cwd/assets/altcraft/shaders/frag/light.fs +++ b/cwd/assets/altcraft/shaders/frag/light.fs @@ -12,5 +12,5 @@ void main() { vec4 c = texture(color, uv); vec4 n = texture(normal, uv); float d = texture(depthStencil, uv).r; - fragColor = vec4(c.r, n.r, d - 0.3f, 1.0f); + fragColor = n; } -- cgit v1.2.3