float4x4 worldToProjMatrix; float aClusterWeight; struct vsInputDots { float4 pos : POSITION; float3 rad : NORMAL; }; struct vsOutputDots { float4 pos : POSITION; float3 rad : NORMAL; float4 worldPos : TEXCOORD0; }; vsOutputDots vsDots(vsInputDots input) { vsOutputDots output = (vsOutputDots)0; output.worldPos = input.pos; output.pos = mul(input.pos, worldToProjMatrix); output.pos.z -= 0.0001; output.rad = input.rad; return output; } float4 psDots(vsOutputDots input) : COLOR0 { // return 1; // return float4(input.rad, 1); float4 ret; /* float4 occProjPos = mul(input.worldPos, occWorldToProjMatrix); occProjPos /= occProjPos.w; float2 occTexPos = mul( occProjPos.xyw, occProjToTexMatrix); float visibility = tex2Dproj(depthMapSampler, float4(occTexPos, occProjPos.z, 1) ); if(visibility >= 0.5) ret = float4(1, 0.5, 0, 1); else ret = float4(1, 0, 1, 1);*/ // ret = float4(frac(aClusterWeight * 3.14), frac(aClusterWeight * 13.3), frac(aClusterWeight * 7.1) , 1.0); // ret = float4(aClusterWeight * 1000.0, aClusterWeight * 400.0, aClusterWeight * 100.0, 1.0); ret = float4(aClusterWeight % 2, aClusterWeight % 3 / 2.0, aClusterWeight % 5 / 4.0, 1.0); // ret = float4(aClusterWeight, aClusterWeight, aClusterWeight, 1.0); return ret; } technique Dots{ pass P0 { VertexShader = compile vs_3_0 vsDots(); PixelShader = compile ps_3_0 psDots(); } }