#extension GL_EXT_buffer_reference : require #extension GL_EXT_scalar_block_layout : require #extension GL_EXT_nonuniform_qualifier : require #include "global.glsl" #if VERTEX_SHADER // QUAD vec2 positions[6] = vec2[]( vec2(-1, -1), vec2(-1, 1), vec2(1, 1), vec2(1, 1), vec2(1, -1), vec2(-1, -1) ); layout(location = 0) out vec2 OutUV; void main() { OutUV = positions[gl_VertexIndex] * 0.5 + 0.5; OutUV.y = 1 - OutUV.y; gl_Position = vec4(positions[gl_VertexIndex] + vec2(gl_InstanceIndex, 0), gl_InstanceIndex, 1.0) * Global.view.world_to_clip; } #endif #if FRAGMENT_SHADER layout(location = 0) in vec2 InUV; layout(location = 0) out vec4 FragColor; layout(push_constant, std430) uniform constants { uint color_texture; uint color_sampler; } PushConstants; void main() { FragColor = vec4(texture(sampler2D(global_textures2d[PushConstants.color_texture], global_samplers[PushConstants.color_sampler]), InUV).rgb, 1.0); } #endif