Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float4x4 ViewProj : ViewProjection;
- float4x4 World : World;
- float Time;
- float4 BlickColor;
- struct VertexOutput
- {
- float4 Pos: POSITION;
- float2 TexCoord: TEXCOORD0;
- };
- texture MainTexture : MainTexture;
- sampler MainTextureSampler = sampler_state {
- Texture = <MainTexture>;
- MinFilter=linear;
- MagFilter=linear;
- MipFilter=linear;
- };
- texture StencilTexture : StencilTexture;
- sampler StencilTextureSampler = sampler_state {
- Texture = <StencilTexture>;
- MinFilter=linear;
- MagFilter=linear;
- MipFilter=linear;
- };
- texture TimeTexture : TimeTexture;
- sampler TimeTextureSampler = sampler_state {
- Texture = <TimeTexture>;
- MinFilter=linear;
- MagFilter=linear;
- MipFilter=linear;
- };
- float4 PixelShaderFunction(VertexOutput input) : COLOR0
- {
- float4 ResultColor = tex2D(MainTextureSampler, input.TexCoord);
- float4 StencilColor = tex2D(StencilTextureSampler, input.TexCoord);
- if (all(StencilColor))
- {
- float4 MidT = tex2D(TimeTextureSampler, input.TexCoord);
- float Dt = (Time - MidT.x);
- float LerpValue;
- if (Dt < 0)
- {
- LerpValue = abs(Dt / MidT.x);
- }
- else
- {
- LerpValue = abs(Dt / (1 - MidT.x));
- }
- ResultColor = lerp(BlickColor, ResultColor, LerpValue);
- }
- return ResultColor;
- }
- technique Blick
- {
- pass Pass1
- {
- // TODO: set renderstates here.
- CullMode = None;
- PixelShader = compile ps_2_0 PixelShaderFunction();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment