diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-20 22:02:58 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-20 22:02:58 -0400 |
commit | 249f6c9fa384e9e3265cafb1357e502ea7db72f7 (patch) | |
tree | 0c80d9a375453e9178dd5d45807302b00f57bd59 /res/shaders/simple_shader.vert | |
parent | destroy pipline layout (diff) | |
download | minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.tar.gz minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.tar.bz2 minecraftvulkan-249f6c9fa384e9e3265cafb1357e502ea7db72f7.zip |
texture loading
Diffstat (limited to 'res/shaders/simple_shader.vert')
-rwxr-xr-x | res/shaders/simple_shader.vert | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/res/shaders/simple_shader.vert b/res/shaders/simple_shader.vert index 55b0199..a61fa0b 100755 --- a/res/shaders/simple_shader.vert +++ b/res/shaders/simple_shader.vert @@ -1,18 +1,19 @@ #version 450 -layout(location = 0) in vec3 position; -layout(location = 1) in vec3 color; -layout(location = 2) in vec3 normal; -layout(location = 3) in vec2 uv; +layout (location = 0) in vec3 position; +layout (location = 1) in vec3 color; +layout (location = 2) in vec3 normal; +layout (location = 3) in vec2 uv; -layout(location = 0) out vec3 fragColor; +layout (location = 0) out vec3 fragColor; +layout (location = 1) out vec2 fragUv; -layout(set = 0, binding = 0) uniform GlobalUbo { +layout (binding = 0) uniform GlobalUbo { mat4 projectionViewMatrix; vec3 directionToLight; } ubo; -layout(push_constant) uniform Push { +layout (push_constant) uniform Push { mat4 modelMatrix; mat4 normalMatrix; } push; @@ -27,4 +28,5 @@ void main() { float lightIntensity = AMBIENT + max(dot(normalWorldSpace, ubo.directionToLight), 0); fragColor = lightIntensity * vec3(1/position.y,position.y,clamp(sin(position.x - position.z), 0, 1)); + fragUv = uv; }
\ No newline at end of file |