From 5a08c9c8e230fd952311f29bc02b22c7635d0178 Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Mon, 26 Sep 2022 20:57:53 -0400 Subject: vertex buffer is not a byte vector, multi texture loading --- res/shaders/simple_shader.frag | 6 +++--- res/shaders/simple_shader.vert | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'res/shaders') 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; -- cgit v1.2.3-freya