source: 2015/26/MikkoL/JRPG/JRPG/JRPGContent/Twirl.fx @ 6415

Revision 6281, 713 bytes checked in by mijoliim, 5 years ago (diff)

Wooo versionhallinta

Line 
1float4x4 World;
2float4x4 View;
3float4x4 Projection;
4
5
6float4 CenterRadius;
7float2 Rotation;
8
9sampler _MainTex;
10
11float4 frag (float2 coords: TEXCOORD0) : COLOR0
12{
13        float2 offset = coords.xy - CenterRadius.xy;
14        float2 distortedOffset = (offset.x*Rotation.x, offset.y*Rotation.y);
15        float2 tmp = offset / CenterRadius.zw / Rotation.xy;
16        float t = min (1, length(tmp));
17       
18        offset = lerp (distortedOffset, offset, t);
19        offset += CenterRadius.xy;
20       
21        return tex2D(_MainTex, offset);
22}
23
24technique Technique1
25{
26    pass Pass1
27    {
28        // TODO: set renderstates here.
29
30        //VertexShader = compile vs_2_0 VertexShaderFunction();
31        PixelShader = compile ps_2_0 frag();
32    }
33}
Note: See TracBrowser for help on using the repository browser.