Pong/resources/shaders/LightBillboard.frag
Karutoh b905a949f2
Some checks failed
Build & Release / Linux-AARCH64-Build (push) Failing after 1m29s
Build & Release / Windows-AMD64-Build (push) Failing after 1m40s
Build & Release / Linux-AMD64-Build (push) Successful in 3m5s
Added CI/CD.
2024-07-01 19:55:24 -07:00

27 lines
493 B
GLSL

#version 450
#extension GL_ARB_separate_shader_objects : enable
layout(location = 0) in vec2 fUv;
layout(location = 0) out vec4 result;
layout(binding = 1) uniform Opt
{
vec3 color;
bool preMultiply;
} opt;
layout(binding = 2) uniform sampler2D render;
void main()
{
result = texture(render, fUv).rgba;
if (result.rgb == vec3(1.0f, 1.0f, 1.0f))
result *= vec4(opt.color, 1.0f);
if (opt.preMultiply)
result = vec4(result.rgb * result.a, result.a);
}