1 | float4x4 worldToProjMatrix;
|
---|
2 |
|
---|
3 | float aClusterWeight;
|
---|
4 |
|
---|
5 | struct vsInputDots
|
---|
6 | {
|
---|
7 | float4 pos : POSITION;
|
---|
8 | float3 rad : NORMAL;
|
---|
9 | };
|
---|
10 |
|
---|
11 | struct vsOutputDots
|
---|
12 | {
|
---|
13 | float4 pos : POSITION;
|
---|
14 | float3 rad : NORMAL;
|
---|
15 | float4 worldPos : TEXCOORD0;
|
---|
16 | };
|
---|
17 |
|
---|
18 | vsOutputDots
|
---|
19 | vsDots(vsInputDots input)
|
---|
20 | {
|
---|
21 | vsOutputDots output = (vsOutputDots)0;
|
---|
22 | output.worldPos = input.pos;
|
---|
23 | output.pos = mul(input.pos, worldToProjMatrix);
|
---|
24 | output.pos.z -= 0.0001;
|
---|
25 | output.rad = input.rad;
|
---|
26 | return output;
|
---|
27 | }
|
---|
28 |
|
---|
29 | float4
|
---|
30 | psDots(vsOutputDots input) : COLOR0
|
---|
31 | {
|
---|
32 | // return 1;
|
---|
33 | // return float4(input.rad, 1);
|
---|
34 | float4 ret;
|
---|
35 |
|
---|
36 | /* float4 occProjPos = mul(input.worldPos, occWorldToProjMatrix);
|
---|
37 | occProjPos /= occProjPos.w;
|
---|
38 | float2 occTexPos = mul( occProjPos.xyw, occProjToTexMatrix);
|
---|
39 | float visibility = tex2Dproj(depthMapSampler, float4(occTexPos, occProjPos.z, 1) );
|
---|
40 |
|
---|
41 | if(visibility >= 0.5)
|
---|
42 | ret = float4(1, 0.5, 0, 1);
|
---|
43 | else
|
---|
44 | ret = float4(1, 0, 1, 1);*/
|
---|
45 | // ret = float4(frac(aClusterWeight * 3.14), frac(aClusterWeight * 13.3), frac(aClusterWeight * 7.1) , 1.0);
|
---|
46 | // ret = float4(aClusterWeight * 1000.0, aClusterWeight * 400.0, aClusterWeight * 100.0, 1.0);
|
---|
47 | ret = float4(aClusterWeight % 2, aClusterWeight % 3 / 2.0, aClusterWeight % 5 / 4.0, 1.0);
|
---|
48 | // ret = float4(aClusterWeight, aClusterWeight, aClusterWeight, 1.0);
|
---|
49 |
|
---|
50 | return ret;
|
---|
51 | }
|
---|
52 |
|
---|
53 | technique Dots{
|
---|
54 | pass P0
|
---|
55 | {
|
---|
56 | VertexShader = compile vs_3_0 vsDots();
|
---|
57 | PixelShader = compile ps_3_0 psDots();
|
---|
58 | }
|
---|
59 | } |
---|