25 lines
No EOL
594 B
GLSL
25 lines
No EOL
594 B
GLSL
#version 450
|
|
|
|
const int MAX_TEXTURES = 128;
|
|
const float GAMMA_CONST = 0.4545;
|
|
layout(location = 0) in vec2 inUV;
|
|
|
|
layout(location = 0) out vec4 outColor;
|
|
layout(push_constant) uniform pc {
|
|
layout(offset = 24) uint textureIndex;
|
|
} push_constants;
|
|
|
|
layout(set = 1, binding = 0) uniform sampler2D spriteTextures[MAX_TEXTURES];
|
|
|
|
vec4 gamma(vec4 color){
|
|
return color = vec4(pow(color.rgb,vec3(GAMMA_CONST)),color.a);
|
|
}
|
|
|
|
void main() {
|
|
vec4 tex = texture(spriteTextures[push_constants.textureIndex], inUV);
|
|
outColor = gamma(tex);
|
|
|
|
if (outColor.a <= 0.09) {
|
|
discard;
|
|
}
|
|
} |