From 249f6c9fa384e9e3265cafb1357e502ea7db72f7 Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Tue, 20 Sep 2022 22:02:58 -0400 Subject: texture loading --- res/shaders/simple_shader.frag | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'res/shaders/simple_shader.frag') diff --git a/res/shaders/simple_shader.frag b/res/shaders/simple_shader.frag index b11a5a8..4eaaafc 100755 --- a/res/shaders/simple_shader.frag +++ b/res/shaders/simple_shader.frag @@ -1,19 +1,22 @@ #version 450 layout (location = 0) in vec3 fragColor; +layout (location = 1) in vec2 fragUv; layout (location = 0) out vec4 outColor; -layout(set = 0, binding = 0) uniform GlobalUbo { +layout (binding = 0) uniform GlobalUbo { mat4 projectionViewMatrix; vec3 directionToLight; } ubo; +layout (binding = 1) uniform sampler2D texSampler; + layout(push_constant) uniform Push { mat4 transform; mat4 normalMatrix; } push; void main() { - outColor = vec4(fragColor, 1.0); + outColor = mix(texture(texSampler, fragUv), vec4(fragColor, 1.0), .5); } \ No newline at end of file -- cgit v1.2.3-freya