Files
palladium/tools/pdsg/shaders/shader.frag
T

24 lines
513 B
GLSL
Raw Normal View History

2026-03-19 09:22:46 +01:00
#version 460
layout(location = 0) in vec2 oUV;
layout(location = 1) in vec4 oColor;
uniform sampler2D tex;
layout(push_constant) uniform PushData {
int alfa;
2026-09-05 11:56:13 +02:00
int is_sdf;
2026-03-19 09:22:46 +01:00
} push;
out vec4 FragColor;
void main() {
vec4 tc = texture(tex, oUV);
2026-09-05 11:56:13 +02:00
if(push.is_sdf != 0) {
float alpha = smoothstep(0.45, 0.55, tc.a);
FragColor = vec4(oColor.rgb, alpha * oColor.a);
} else if (push.alfa != 0) {
2026-03-19 09:22:46 +01:00
FragColor = vec4(oColor.rgb, tc.a * oColor.a);
} else {
FragColor = tc * oColor;
}
}