26 lines
660 B
GLSL
26 lines
660 B
GLSL
#version 450
|
|
#extension GL_ARB_separate_shader_objects : enable
|
|
|
|
layout(location = 0) in vec2 inTexCoord;
|
|
layout(location = 1) in vec4 inVertexColor;
|
|
|
|
layout(location = 0) out vec4 outColor;
|
|
|
|
layout(set = 2, binding = 0) uniform sampler2D texSampler;
|
|
layout(set = 3, binding = 0) uniform UniformBufferObject {
|
|
bool flippedH;
|
|
bool flippedV;
|
|
vec2 uvOffset;
|
|
vec4 colorOverlay;
|
|
} ubo;
|
|
|
|
void main()
|
|
{
|
|
vec2 uv = inTexCoord;
|
|
uv += ubo.uvOffset;
|
|
if(ubo.flippedH) uv.x = 1.0 - uv.x;
|
|
if(ubo.flippedV) uv.y = 1.0 - uv.y;
|
|
outColor = texture(texSampler, uv) * inVertexColor * ubo.colorOverlay;
|
|
if(outColor.w < 0.1)
|
|
discard;
|
|
} |