RogueLegacy1/RogueCastle/Shaders/BrightPass.fx
Ethan Lee 01f2eb5307
Some checks failed
CI / Linux (push) Has been cancelled
Add shader source!
2024-11-19 12:00:36 -05:00

18 lines
No EOL
534 B
HLSL

uniform extern float BloomThreshold;
float2 halfPixel;
sampler TextureSampler : register(s0);
float4 BrightPassPS(float2 texCoord : TEXCOORD0) : COLOR0
{
texCoord -= halfPixel;
// Look up the original image color.
float4 c = tex2D(TextureSampler, texCoord);
// Adjust it to keep only values brighter than the specified threshold.
return saturate((c - BloomThreshold) / (1 - BloomThreshold));
}
technique BloomExtract
{
pass P0
{
PixelShader = compile ps_2_0 BrightPassPS();
}
}