struct VertexOut { float4 VertexPosition :POSITION; float2 TexCoord :TEXCOORD; float3 Position :TEXCOORD1; float ID :TEXCOORD2; }; /* Vertex program for cloud rendering */ VertexOut VertexProgram( float4 Position :POSITION, float ID: TEXCOORD, uniform float WindowSize, uniform float4x4 ModelViewProj :state.matrix.mvp ) { VertexOut Out; Out.VertexPosition=mul(ModelViewProj, Position); Out.ID=ID; Out.Position=Out.VertexPosition.xyz/2+0.5; Out.Position.xy*=WindowSize; return Out; } /* Fragment program for cloud rendering */ void FragmentProgram( VertexOut In, uniform samplerRECT PrevFrame, out float4 Color:COLOR, uniform float peel //,out float Depth:DEPTH ) { float z0=texRECT(PrevFrame,In.Position.xy).g; Color=float4(1,In.Position.z,0,1); if(In.Position.z<=peel) { Color.a=0; } }