Ignore:
Timestamp:
08/29/08 15:46:36 (16 years ago)
Author:
mattausch
Message:

found bug with lod levels
made env file for shaders

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/antialiasing.cg

    r2868 r2884  
    1111 
    1212// the barrier for detecting a discontinuity 
    13 uniform float4 e_barrier = float4(5e-4, 5e-4, 0, 0); // x = normal, y = depth 
     13uniform float4 e_barrier = float4(5e-5, 5e-5, 0, 0); // x = normal, y = depth 
    1414// the weights for normal / depth discontinuity 
     15//uniform float4 e_weights = float4(10.0f, 0.1f, 1.0f, 1.0f); // x = normal, y = depth 
    1516uniform float4 e_weights = float4(1.0f, 1.0f, 1.0f, 1.0f); // x = normal, y = depth 
    1617uniform float4 e_kernel = float4(0.35f, 1.0f, 1.0f, 1.0f);  
     
    2324{ 
    2425        //return tex2D(colors, IN.c.xy); 
     26 
    2527        // normal discontinuity filter 
    2628        float3 nc = (float3)tex2D(normals, IN.c.xy); 
     
    3739        float ne = saturate(dot(nd, e_weights.x)); 
    3840 
    39         // opposite coordinates 
     41        // construct opposite coordinates 
    4042        float4 lrr = IN.lr.wzyx; 
    4143        float4 tbr = IN.tb.wzyx; 
     
    6668 
    6769        dd = abs(2.0f * dc - dd) - e_barrier.y; 
    68         dd = step(dd, 0.0f); 
     70        dd = step(dd, (float4)0.0f); 
    6971 
    7072        float de = saturate(dot(dd, e_weights.y)); 
     
    7779        float2 offset = IN.c.xy * (1.0f - w); 
    7880 
    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)); 
    8385 
    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 
    8593        //return float4(w); 
    8694} 
Note: See TracChangeset for help on using the changeset viewer.