Hi, I am playing around with the transition control and would like to write a custom transition. I have looked at the sample code in the demo, and found the following pixel shader code:
The problem is that I don't understand much of it. Can you give me some more info on the way these animated shaders work? I have googled around and found some info on static shaders, which more or less just act as a filter for an image or something. But nothing on the animated stuff that you guys are using for the transitions. I am trying to create a combination of a fade-in and a zoom effect where the content is faded in from 20% opacity to 100% and at the same time scaled from 150% to 100%. So both these changes should occur simultaneously. Any hints would be much appreciated.
sampler2D input : register(s0); |
sampler2D oldInput : register(s1); |
float progress : register(c0); |
float4 main(float2 uv : TEXCOORD) : COLOR |
{ |
float4 oldColor = tex2D(oldInput, uv); |
float4 newColor = tex2D(input, uv); |
float a = (4.0 * progress - (uv.x + uv.y)) * 0.5; |
if (a < 0) a = 0; |
if (a > 1) a = 1; |
return oldColor * (1 - a) + newColor * a; |
} |
The problem is that I don't understand much of it. Can you give me some more info on the way these animated shaders work? I have googled around and found some info on static shaders, which more or less just act as a filter for an image or something. But nothing on the animated stuff that you guys are using for the transitions. I am trying to create a combination of a fade-in and a zoom effect where the content is faded in from 20% opacity to 100% and at the same time scaled from 150% to 100%. So both these changes should occur simultaneously. Any hints would be much appreciated.