[2186] | 1 | uniform float4x4 WorldViewProj;
|
---|
| 2 | uniform float2 prmAtlasTiles;
|
---|
| 3 | uniform float2 atlasHalfPixel;
|
---|
| 4 | uniform sampler2D filteredAtlasSampler : register(s0);
|
---|
| 5 |
|
---|
| 6 | struct vsInputWalk
|
---|
| 7 | {
|
---|
| 8 | float4 pos : POSITION;
|
---|
| 9 | float2 tex : TEXCOORD0;
|
---|
| 10 | float2 texAtlas : TEXCOORD1;
|
---|
| 11 | };
|
---|
| 12 |
|
---|
| 13 | struct vsOutputWalk
|
---|
| 14 | {
|
---|
| 15 | float4 pos : POSITION;
|
---|
| 16 | float2 tex : TEXCOORD0;
|
---|
| 17 | float2 texAtlas : TEXCOORD1;
|
---|
| 18 | };
|
---|
| 19 |
|
---|
| 20 |
|
---|
| 21 | vsOutputWalk vsWalk(vsInputWalk input)
|
---|
| 22 | {
|
---|
| 23 | vsOutputWalk output = (vsOutputWalk)0;
|
---|
| 24 | output.pos = mul(WorldViewProj, input.pos);
|
---|
| 25 | output.tex = input.tex;
|
---|
| 26 | output.texAtlas = input.texAtlas;
|
---|
| 27 | return output;
|
---|
| 28 | }
|
---|
| 29 |
|
---|
| 30 | float4 psWalk(vsOutputWalk input) : COLOR
|
---|
| 31 | {
|
---|
| 32 | /* float3 col = 0;
|
---|
| 33 | for(int iCluster=0; iCluster<16; iCluster++)
|
---|
| 34 | {
|
---|
| 35 | float2 prmTexPos = float2(
|
---|
| 36 | (input.texAtlas.x + (iCluster % prmAtlasTiles.x)) / prmAtlasTiles.x,
|
---|
| 37 | 1.0 - (input.texAtlas.y + (iCluster / prmAtlasTiles.x)) / prmAtlasTiles.y) + atlasHalfPixel;
|
---|
| 38 |
|
---|
| 39 | float4 weight = 0.065;
|
---|
| 40 | float3 val = tex2D(filteredAtlasSampler, prmTexPos);
|
---|
| 41 | col += val.xyz * weight.x;
|
---|
| 42 | iCluster++;
|
---|
| 43 |
|
---|
| 44 | prmTexPos.x += 1.0 / prmAtlasTiles.x;
|
---|
| 45 | val = tex2D(filteredAtlasSampler, prmTexPos);
|
---|
| 46 | col += val.xyz * weight.y;
|
---|
| 47 | iCluster++;
|
---|
| 48 |
|
---|
| 49 | prmTexPos.x += 1.0 / prmAtlasTiles.x;
|
---|
| 50 | val = tex2D(filteredAtlasSampler, prmTexPos);
|
---|
| 51 | col += val.xyz * weight.z;
|
---|
| 52 | iCluster++;
|
---|
| 53 |
|
---|
| 54 | prmTexPos.x += 1.0 / prmAtlasTiles.x;
|
---|
| 55 | val = tex2D(filteredAtlasSampler, prmTexPos);
|
---|
| 56 | col += val.xyz * weight.w;
|
---|
| 57 | }
|
---|
| 58 | */
|
---|
| 59 | float ff = (float)prmAtlasTiles.x;
|
---|
| 60 | return float4( float3(ff,ff,ff) / 128.0/* + col*0.000000001*/, 1);
|
---|
| 61 | }
|
---|
| 62 |
|
---|