diff options
author | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-26 18:03:07 -0400 |
---|---|---|
committer | Tyler Murphy <tylermurphy534@gmail.com> | 2022-09-26 18:03:07 -0400 |
commit | 873ca38c0dc8966cd54a18dd74d40c709d83eb32 (patch) | |
tree | 0d49e34d566d23bb73f534294737e253613a2a01 /res | |
parent | undo nearest neighbor (diff) | |
download | minecraftvulkan-873ca38c0dc8966cd54a18dd74d40c709d83eb32.tar.gz minecraftvulkan-873ca38c0dc8966cd54a18dd74d40c709d83eb32.tar.bz2 minecraftvulkan-873ca38c0dc8966cd54a18dd74d40c709d83eb32.zip |
texture arrays
Diffstat (limited to 'res')
-rw-r--r-- | res/image/blocks.png | bin | 7481 -> 0 bytes | |||
-rw-r--r-- | res/image/grass.png | bin | 0 -> 6160 bytes | |||
-rw-r--r-- | res/image/scaly.png | bin | 3227705 -> 0 bytes | |||
-rw-r--r-- | res/image/texture.png | bin | 1338368 -> 0 bytes | |||
-rwxr-xr-x | res/shaders/simple_shader.frag | 10 | ||||
-rwxr-xr-x | res/shaders/simple_shader.vert | 8 |
6 files changed, 6 insertions, 12 deletions
diff --git a/res/image/blocks.png b/res/image/blocks.png Binary files differdeleted file mode 100644 index 24f734a..0000000 --- a/res/image/blocks.png +++ /dev/null diff --git a/res/image/grass.png b/res/image/grass.png Binary files differnew file mode 100644 index 0000000..48823f2 --- /dev/null +++ b/res/image/grass.png diff --git a/res/image/scaly.png b/res/image/scaly.png Binary files differdeleted file mode 100644 index cefdd5f..0000000 --- a/res/image/scaly.png +++ /dev/null diff --git a/res/image/texture.png b/res/image/texture.png Binary files differdeleted file mode 100644 index e1db6c1..0000000 --- a/res/image/texture.png +++ /dev/null diff --git a/res/shaders/simple_shader.frag b/res/shaders/simple_shader.frag index f3ae526..102ac22 100755 --- a/res/shaders/simple_shader.frag +++ b/res/shaders/simple_shader.frag @@ -2,6 +2,7 @@ layout (location = 0) in vec3 fragColor; layout (location = 1) in vec2 fragUv; +layout (location = 2) in float fragTex; layout (location = 0) out vec4 outColor; @@ -10,12 +11,7 @@ layout (binding = 0) uniform GlobalUbo { vec3 directionToLight; } ubo; -layout (binding = 2) uniform Deez { - mat4 projectionViewMatrix; - vec3 directionToLight; -} deez; - -layout (binding = 1) uniform sampler2D texSampler; +layout (binding = 1) uniform sampler2D texSampler[2]; layout(push_constant) uniform Push { mat4 transform; @@ -23,5 +19,5 @@ layout(push_constant) uniform Push { } push; void main() { - outColor = mix(texture(texSampler, fragUv), vec4(fragColor, 1.0), .1); + outColor = mix(texture(texSampler[int(fragTex)], fragUv), vec4(fragColor, 1.0), .1); }
\ No newline at end of file diff --git a/res/shaders/simple_shader.vert b/res/shaders/simple_shader.vert index 30e7a79..8a28a59 100755 --- a/res/shaders/simple_shader.vert +++ b/res/shaders/simple_shader.vert @@ -3,20 +3,17 @@ layout (location = 0) in vec3 position; layout (location = 1) in vec3 normal; layout (location = 2) in vec2 uv; +layout (location = 3) in float tex; layout (location = 0) out vec3 fragColor; layout (location = 1) out vec2 fragUv; +layout (location = 2) out float fragTex; layout (binding = 0) uniform GlobalUbo { mat4 projectionViewMatrix; vec3 directionToLight; } ubo; -layout (binding = 2) uniform Deez { - mat4 projectionViewMatrix; - vec3 directionToLight; -} deez; - layout (push_constant) uniform Push { mat4 modelMatrix; mat4 normalMatrix; @@ -33,4 +30,5 @@ void main() { fragColor = lightIntensity * vec3(1); fragUv = uv; + fragTex = tex; }
\ No newline at end of file |