textures!!!

This commit is contained in:
2019-08-02 23:50:37 +02:00
parent c582af5138
commit 4f261fa708
5 changed files with 108 additions and 27 deletions

View File

@@ -1,9 +1,11 @@
#version 450
layout(location = 0) in vec3 pos;
layout(location = 0) in vec2 tex_coords;
layout(location = 0) out vec4 f_color;
layout(set = 0, binding = 0) uniform sampler2D tex;
void main() {
f_color = vec4(.3, (pos.y + 5.) / 10., .8, 1.0);
f_color = texture(tex, tex_coords);
}

View File

@@ -2,8 +2,9 @@
#extension GL_ARB_separate_shader_objects : enable
layout(location = 0) in vec3 position;
layout(location = 1) in vec2 uv;
layout(location = 0) out vec3 pos;
layout(location = 0) out vec2 tex_coords;
layout(push_constant) uniform PushConstants {
float time;
@@ -14,5 +15,5 @@ layout(push_constant) uniform PushConstants {
void main() {
gl_Position = push.projection * push.view * push.model * vec4(position, 1.0);
pos = gl_Position.xyz;
tex_coords = uv;
}