diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-27 12:32:09 -0400 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-27 12:32:09 -0400 |
commit | 6f9d3befb45a8fbf35d66b6aff9738ef4c509c3c (patch) | |
tree | 840cc6ed0de2b6129820f6af47042a446581ba7e /res | |
parent | disable anisotropic filtering on chunks (diff) | |
download | minecraftvulkan-6f9d3befb45a8fbf35d66b6aff9738ef4c509c3c.tar.gz minecraftvulkan-6f9d3befb45a8fbf35d66b6aff9738ef4c509c3c.tar.bz2 minecraftvulkan-6f9d3befb45a8fbf35d66b6aff9738ef4c509c3c.zip |
change shader lighting
Diffstat (limited to '')
-rwxr-xr-x | res/shaders/simple_shader.frag | 14 | ||||
-rwxr-xr-x | res/shaders/simple_shader.vert | 4 |
2 files changed, 4 insertions, 14 deletions
diff --git a/res/shaders/simple_shader.frag b/res/shaders/simple_shader.frag index f3e629b..1ea39c7 100755 --- a/res/shaders/simple_shader.frag +++ b/res/shaders/simple_shader.frag @@ -1,23 +1,13 @@ #version 450 -layout (location = 0) in vec3 fragColor; +layout (location = 0) in float fragLight; layout (location = 1) in vec2 fragUv; layout (location = 2) in flat int fragTex; layout (location = 0) out vec4 outColor; -layout (binding = 0) uniform GlobalUbo { - mat4 projectionViewMatrix; - vec3 directionToLight; -} ubo; - layout (binding = 1) uniform sampler2D texSampler[3]; -layout(push_constant) uniform Push { - mat4 transform; - mat4 normalMatrix; -} push; - void main() { - outColor = mix(texture(texSampler[fragTex], fragUv), vec4(fragColor, 1.0), .1); + outColor = texture(texSampler[fragTex], fragUv) + fragLight; }
\ No newline at end of file diff --git a/res/shaders/simple_shader.vert b/res/shaders/simple_shader.vert index 3887c4a..33504ff 100755 --- a/res/shaders/simple_shader.vert +++ b/res/shaders/simple_shader.vert @@ -5,7 +5,7 @@ layout (location = 1) in vec3 normal; layout (location = 2) in vec2 uv; layout (location = 3) in int tex; -layout (location = 0) out vec3 fragColor; +layout (location = 0) out float fragLight; layout (location = 1) out vec2 fragUv; layout (location = 2) out int fragTex; @@ -28,7 +28,7 @@ void main() { float lightIntensity = AMBIENT + max(dot(normalWorldSpace, ubo.directionToLight), 0); - fragColor = lightIntensity * vec3(1); + fragLight = lightIntensity / 5; fragUv = uv; fragTex = tex; }
\ No newline at end of file |