Created
August 8, 2016 16:49
-
-
Save Xibanya/186537a45892039fce24797835c05149 to your computer and use it in GitHub Desktop.
simple fade shader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sampler ColorMapSampler : register(s0); | |
| float filterRed; | |
| float filterGreen; | |
| float filterBlue; | |
| float amount; | |
| float4 PixelShaderFunction(float2 TextureCoordinate : TEXCOORD0) : COLOR0 | |
| { | |
| float4 color = tex2D(ColorMapSampler, TextureCoordinate); | |
| color.r = lerp(filterRed / 255, color.r, amount); | |
| color.g = lerp(filterGreen / 255, color.g, amount); | |
| color.b = lerp(filterBlue / 255, color.b, amount); | |
| return color; | |
| } | |
| technique Fade | |
| { | |
| pass | |
| { | |
| PixelShader = compile ps_2_0 PixelShaderFunction(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment