Ignore:
Timestamp:
11/25/08 12:02:58 (16 years ago)
Author:
mattausch
Message:

playing around with filter: returning to world space depth difference for filter kernel??

File:
1 edited

Legend:

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

    r3161 r3162  
    6363                //sampleDepth = aoSample.w; 
    6464                 
    65                 //depthFactor = max(step(1e-1f, 1.0f - abs(1.0f - eyeSpaceDepth / sampleDepth)), 1e-3f); 
    66                 depthFactor = 1.0f / max(abs(eyeSpaceDepth - sampleDepth), 1e-3f); 
    67                 //normalFactor = max(step(0.6f, dot(sampleNorm, centerNormal)), 1e-6f); 
    68                 normalFactor = max(dot(sampleNorm, centerNormal), 1e-6f); 
    69                 convergenceFactor = min(200.0f, aoSample.y) * 0.01f; 
     65                //depthFactor = 1.0f / max(abs(eyeSpaceDepth - sampleDepth), 1e-2f); 
     66                depthFactor = 1.0f - step(1e-2f, abs(1.0f - eyeSpaceDepth / sampleDepth)); 
     67                //normalFactor = max(step(0.6f, dot(sampleNorm, centerNormal)), 1e-3f); 
     68                normalFactor = max(dot(sampleNorm, centerNormal), 1e-3f); 
     69                //convergenceFactor = min(100.0f, aoSample.y); 
     70                convergenceFactor = aoSample.y; 
    7071 
    7172                // combine the weights 
    72                 w = depthFactor * normalFactor * convergenceFactor; 
     73                w = filterWeights[i] * convergenceFactor * depthFactor * normalFactor; 
     74                //w = normalFactor * convergenceFactor; 
    7375 
    7476                average += aoSample.x * w; 
     
    7678        } 
    7779 
    78         average /= max(total_w, 1e-1f); 
     80        average /= max(total_w, 1e-6f); 
    7981 
    8082        return saturate(average); 
     
    123125        } 
    124126 
    125         OUT.illum_col.xyz = col.xyz * ao.x; 
    126         //OUT.illum_col.xyz = float3(0, ao.x, 0); 
     127        //OUT.illum_col.xyz = col.xyz * ao.x; 
     128        OUT.illum_col.xyz = float3(ao.x, ao.x, ao.x); 
    127129        //OUT.illum_col.xyz = float3(0, clamp(1.0f - ao.y * 1e-2f, 0, 1), 1); 
    128130        OUT.illum_col.w = col.w; 
Note: See TracChangeset for help on using the changeset viewer.