- Timestamp:
- 08/29/08 15:46:36 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/antialiasing.cg
r2868 r2884 11 11 12 12 // the barrier for detecting a discontinuity 13 uniform float4 e_barrier = float4(5e- 4, 5e-4, 0, 0); // x = normal, y = depth13 uniform float4 e_barrier = float4(5e-5, 5e-5, 0, 0); // x = normal, y = depth 14 14 // the weights for normal / depth discontinuity 15 //uniform float4 e_weights = float4(10.0f, 0.1f, 1.0f, 1.0f); // x = normal, y = depth 15 16 uniform float4 e_weights = float4(1.0f, 1.0f, 1.0f, 1.0f); // x = normal, y = depth 16 17 uniform float4 e_kernel = float4(0.35f, 1.0f, 1.0f, 1.0f); … … 23 24 { 24 25 //return tex2D(colors, IN.c.xy); 26 25 27 // normal discontinuity filter 26 28 float3 nc = (float3)tex2D(normals, IN.c.xy); … … 37 39 float ne = saturate(dot(nd, e_weights.x)); 38 40 39 // opposite coordinates41 // construct opposite coordinates 40 42 float4 lrr = IN.lr.wzyx; 41 43 float4 tbr = IN.tb.wzyx; … … 66 68 67 69 dd = abs(2.0f * dc - dd) - e_barrier.y; 68 dd = step(dd, 0.0f);70 dd = step(dd, (float4)0.0f); 69 71 70 72 float de = saturate(dot(dd, e_weights.y)); … … 77 79 float2 offset = IN.c.xy * (1.0f - w); 78 80 79 float4 s0 = tex2D (colors, offset + IN.lt.xy * w);80 float4 s1 = tex2D (colors, offset + IN.rb.xy * w);81 float4 s2 = tex2D (colors, offset + IN.rt.xy * w);82 float4 s3 = tex2D (colors, offset + IN.lb.xy * w);81 float4 s0 = tex2Dlod(colors, float4(offset + IN.lt.xy * w, 0, 0)); 82 float4 s1 = tex2Dlod(colors, float4(offset + IN.rb.xy * w, 0, 0)); 83 float4 s2 = tex2Dlod(colors, float4(offset + IN.rt.xy * w, 0, 0)); 84 float4 s3 = tex2Dlod(colors, float4(offset + IN.lb.xy * w, 0, 0)); 83 85 84 return (s0 + s1 + s2 + s3) / 4.0f; 86 float4 sx = tex2D(colors, IN.c.xy); 87 88 //return (sx + sx) * 0.5f; 89 90 return (s0 + s1 + s2 + s3) * 0.25f; 91 //return (s0 + s1 + s2 + s3) * 0.25f; 92 85 93 //return float4(w); 86 94 }
Note: See TracChangeset
for help on using the changeset viewer.