struct VertexOut { float4 VertexPosition :POSITION; float2 TexCoord :TEXCOORD; float4 Color :COLOR0; }; /* Vertex program for displaying particle system with rectangle rendertexture */ VertexOut VertexProgram( float4 Position :POSITION, float4 Texcoord: TEXCOORD, float4 Color:COLOR0, float3 BillboardSize: NORMAL, uniform float4x4 ModelViewProj :state.matrix.mvp ) { VertexOut Out; Out.Color=Color; Out.VertexPosition=mul(ModelViewProj, Position); Out.TexCoord=Texcoord.xy; return Out; } /* Fragment program for displaying particle system with rectangle rendertexture */ void FragmentProgram( VertexOut In, uniform sampler2D Texture ,out float4 Color:COLOR ) { Color=float4(0,0,0,tex2D(Texture,In.TexCoord).r*0.17*In.Color.a); }