summaryrefslogtreecommitdiffstats
path: root/cwd
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-11-21 10:57:57 +0100
committerLaG1924 <lag1924@gmail.com>2021-11-21 10:57:57 +0100
commitf16c897522b6418c399b5699f8378a25c2e5de4f (patch)
tree9fd1490645de30330b6ae84eebd1fe961c3f1e52 /cwd
parentAdded Gbuffer (diff)
downloadAltCraft-f16c897522b6418c399b5699f8378a25c2e5de4f.tar
AltCraft-f16c897522b6418c399b5699f8378a25c2e5de4f.tar.gz
AltCraft-f16c897522b6418c399b5699f8378a25c2e5de4f.tar.bz2
AltCraft-f16c897522b6418c399b5699f8378a25c2e5de4f.tar.lz
AltCraft-f16c897522b6418c399b5699f8378a25c2e5de4f.tar.xz
AltCraft-f16c897522b6418c399b5699f8378a25c2e5de4f.tar.zst
AltCraft-f16c897522b6418c399b5699f8378a25c2e5de4f.zip
Diffstat (limited to 'cwd')
-rw-r--r--cwd/assets/altcraft/shaders/frag/face.fs3
-rw-r--r--cwd/assets/altcraft/shaders/frag/light.fs2
-rw-r--r--cwd/assets/altcraft/shaders/vert/face.vs15
3 files changed, 12 insertions, 8 deletions
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;
}
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;
}