struct VertexOut { float4 Position :POSITION; float4 Color :COLOR0; float2 TexCoord :TEXCOORD; float error :TEXCOORD1; float ID :TEXCOORD2; float PSize :PSIZE; }; VertexOut VertexProgram( float4 Position : POSITION, float2 TexCoord : TEXCOORD0, float4 Color : COLOR0, uniform float Opacity, uniform float4 PSize : state.point.size, uniform float4x4 modelView : state.matrix.modelview, uniform float4x4 modelViewProj:state.matrix.mvp ) { VertexOut Out; Out.ID=TexCoord.x; Out.Color=Color; Out.Color.a=Opacity; float4 pos_eye = mul(modelView, Position); float dist = length(pos_eye.xyz); Out.PSize =PSize.x*TexCoord.y*sqrt(1.0 / (1 + dist*dist)); Out.Position = mul(modelViewProj, Position); return Out; } float4 FragmentProgram(VertexOut In, uniform sampler2D BbTexture, uniform samplerRECT IllumTex ) : COLOR { /* float ds=texRECT(VisMap,float2(particle,direction)).g; float tau=1.0; //float alpha=1-exp(-ds*tau); float alpha=Alb_Op.y;*/ int particle=round(In.ID); float4 Color=texRECT(IllumTex,float2(particle,0))*In.Color; Color.a*=tex2D(BbTexture, In.TexCoord.xy).r; //Color.a=1; return Color; } /* float4 FragmentProgram(VertexOut In, uniform samplerRECT LVisMap, uniform sampler2D BbTexture, uniform float Ldir ) : COLOR { int particle=round(In.ID); float4 Color=texRECT(LVisMap,float2(particle,Ldir)); Color.a*=tex2D(BbTexture, In.TexCoord.xy).r; return Color; }*/