Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sampler sampler0_: register(s0);
- static const float RENDER_WIDTH = 1024;
- static const float RENDER_HEIGHT = 1024;
- float frame;
- struct PSInput {
- float4 diffuse: COLOR0;
- float2 texCoord: TEXCOORD0;
- float2 vPos: VPOS;
- };
- struct PSOutput {
- float4 color: COLOR0;
- };
- // Thanks to http://www.chilliant.com/rgb2hsv.html
- float3 HUEtoRGB(in float H) {
- float R = abs(H * 6 - 3) - 1;
- float G = 2 - abs(H * 6 - 2);
- float B = 2 - abs(H * 6 - 4);
- return saturate(float3(R, G, B));
- }
- PSOutput PSColorful(PSInput In): COLOR0 {
- PSOutput Out;
- float hue = frac((2 * (In.vPos.x - In.vPos.y) + 5 * frame) / 360);
- float3 color = HUEtoRGB(hue);
- Out.color.a = In.diffuse.a;
- Out.color.rgb = 0.5 * color;
- return Out;
- }
- technique TecColorful {
- pass P0 {
- PixelShader = compile ps_3_0 PSColorful();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement