What is a simple pixel shader script effect to apply brightness and contrast?
I found this one, but it doesn\'t seem to be correct:
sampler2D input :
Is this what you are looking for?
float Brightness : register(C0);
float Contrast : register(C1);
sampler2D Texture1Sampler : register(S0);
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 pixelColor = tex2D(Texture1Sampler, uv);
pixelColor.rgb /= pixelColor.a;
// Apply contrast.
pixelColor.rgb = ((pixelColor.rgb - 0.5f) * max(Contrast, 0)) + 0.5f;
// Apply brightness.
pixelColor.rgb += Brightness;
// Return final pixel color.
pixelColor.rgb *= pixelColor.a;
return pixelColor;
}
--- Tested with Shazzam Shader Editor http://shazzam-tool.com