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, float ID : TEXCOORD0, float4 Color : COLOR0, uniform float4 PSize : state.point.size, uniform float4x4 modelView : state.matrix.modelview, uniform float4x4 modelViewProj:state.matrix.mvp ) { VertexOut Out; Out.ID=ID; Out.Color=Color; float4 pos_eye = mul(modelView, Position); float dist = length(pos_eye.xyz); Out.PSize =PSize.x*sqrt(1.0 / (1 + dist*dist)); Out.Position = mul(modelViewProj, Position); return Out; } float4 FragmentProgram(VertexOut In, uniform sampler2D BbTexture, uniform samplerRECT IllumTex, uniform samplerRECT DirectIllum, uniform float4 EyeDirsWeights ) : COLOR { float4 Color=float4(0,0,0,0); int newID=round(In.ID); int newDir=round(EyeDirsWeights.x); int newDir2=round(EyeDirsWeights.y); Color+=texRECT(IllumTex,float2(newID,newDir)).r; //Color+=texRECT(IllumTex,float2(newID,newDir2)).r*EyeDirsWeights.w; Color+=texRECT(DirectIllum,float2(newID,newDir)).r; //Color+=texRECT(DirectIllum,float2(newID,newDir2)).r*EyeDirsWeights.w; //Color=texRECT(DirectIllum,float2(newID,0)); Color.a=tex2D(BbTexture, In.TexCoord.xy).r; return Color; }