summaryrefslogtreecommitdiff
path: root/res/shaders
diff options
context:
space:
mode:
authortylermurphy534 <tylermurphy534@gmail.com>2022-09-26 20:57:53 -0400
committertylermurphy534 <tylermurphy534@gmail.com>2022-09-26 20:57:53 -0400
commit5a08c9c8e230fd952311f29bc02b22c7635d0178 (patch)
tree09bb647986461478ba8cc0671550d8488a6c434f /res/shaders
parenttexture arrays (diff)
downloadminecraftvulkan-5a08c9c8e230fd952311f29bc02b22c7635d0178.tar.gz
minecraftvulkan-5a08c9c8e230fd952311f29bc02b22c7635d0178.tar.bz2
minecraftvulkan-5a08c9c8e230fd952311f29bc02b22c7635d0178.zip
vertex buffer is not a byte vector, multi texture loading
Diffstat (limited to 'res/shaders')
-rwxr-xr-xres/shaders/simple_shader.frag6
-rwxr-xr-xres/shaders/simple_shader.vert4
2 files changed, 5 insertions, 5 deletions
diff --git a/res/shaders/simple_shader.frag b/res/shaders/simple_shader.frag
index 102ac22..f3e629b 100755
--- a/res/shaders/simple_shader.frag
+++ b/res/shaders/simple_shader.frag
@@ -2,7 +2,7 @@
layout (location = 0) in vec3 fragColor;
layout (location = 1) in vec2 fragUv;
-layout (location = 2) in float fragTex;
+layout (location = 2) in flat int fragTex;
layout (location = 0) out vec4 outColor;
@@ -11,7 +11,7 @@ layout (binding = 0) uniform GlobalUbo {
vec3 directionToLight;
} ubo;
-layout (binding = 1) uniform sampler2D texSampler[2];
+layout (binding = 1) uniform sampler2D texSampler[3];
layout(push_constant) uniform Push {
mat4 transform;
@@ -19,5 +19,5 @@ layout(push_constant) uniform Push {
} push;
void main() {
- outColor = mix(texture(texSampler[int(fragTex)], fragUv), vec4(fragColor, 1.0), .1);
+ outColor = mix(texture(texSampler[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 8a28a59..3887c4a 100755
--- a/res/shaders/simple_shader.vert
+++ b/res/shaders/simple_shader.vert
@@ -3,11 +3,11 @@
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 = 3) in int tex;
layout (location = 0) out vec3 fragColor;
layout (location = 1) out vec2 fragUv;
-layout (location = 2) out float fragTex;
+layout (location = 2) out int fragTex;
layout (binding = 0) uniform GlobalUbo {
mat4 projectionViewMatrix;