Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sampler s0 : register(s0);
- float4 p0 : register(c0);
- float4 p1 : register(c1);
- #define width (p0[0])
- #define height (p0[1])
- #define counter (p0[2])
- #define clock (p0[3])
- #define one_over_width (p1[0])
- #define one_over_height (p1[1])
- #define PI acos(-1)
- #define Curves_contrast 1.0
- #define Curves_formula 2
- float4 main(float2 tex : TEXCOORD0) : COLOR {
- float4 c0 = tex2D(s0, tex);
- float3 color = c0.rgb; //original input color
- float3 lumCoeff = float3(0.2126, 0.7154, 0.0721); //Values to calculate luma with
- float Curves_contrast_blend = Curves_contrast;
- float redChannel = color.r;
- float greenChannel = color.g;
- float blueChannel = color.b;
- // -- Curve 2 --
- #if Curves_formula == 2
- // Applies Curve to all 3 individual channels
- redChannel = ( (redChannel - 0.5) / (0.5 + abs(redChannel-0.5)) ) + 0.5; // 717 amd fps
- greenChannel = ( (greenChannel - 0.5) / (0.5 + abs(greenChannel-0.5)) ) + 0.5; // 717 amd fps
- blueChannel = ( (blueChannel - 0.5) / (0.5 + abs(blueChannel-0.5)) ) + 0.5; // 717 amd fps
- #endif
- // Blends the original color with the new processed colors
- float3 newColor = lerp(color, float3(redChannel, greenChannel, blueChannel), Curves_contrast_blend);
- //Blend by Curves_contrast
- c0.rgb = lerp(c0.rgb, newColor, Curves_contrast_blend);
- return c0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement