Changeset 3130


Ignore:
Timestamp:
11/17/08 08:47:04 (16 years ago)
Author:
mattausch
Message:

worked on reducing flickering
try: use box filter instead of poisson kernel for blurring + for blurring temporal coherence values
try: use full resolution offset texture or try linear interpol, otherwise strange effects

File:
1 edited

Legend:

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

    r3129 r3130  
    8787 
    8888                //depthFactor = clamp(1.0f - abs(1.0f - eyeSpaceDepth / aoSample.w), 1e-3f, 1.0f); 
    89                 depthFactor = max(step(5e-2f, 1.0f - abs(1.0f - eyeSpaceDepth / aoSample.w)), 1e-3f); 
    90                 normalFactor = max(step(0.5f, dot(sampleNorm, norm)), 1e-3f); 
     89                depthFactor = max(step(5e-1f, 1.0f - abs(1.0f - eyeSpaceDepth / aoSample.w)), 1e-3f); 
     90                normalFactor = max(step(0.6f, dot(sampleNorm, norm)), 1e-3f); 
    9191 
    9292                w = filterWeights[i] * normalFactor * depthFactor; 
     
    119119        if (col.w < 1e10f) 
    120120        { 
    121                 //const static float scaleFactor = 50.0f; 
    122                 const static float scaleFactor = 10.0f; 
    123                 const static float adaptFactor = 10.0f; 
     121                const static float scaleFactor = 1.0f; 
     122                //const static float scaleFactor = 10.0f; 
     123                const static float adaptFactor = 50.0f; 
    124124 
    125125                //ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights); 
    126126                //ao.x = Filter(IN.texCoord, ssaoTex, filterOffs, filterWeights, 1.0f / (1.0f + ao.y)); 
    127                 //ao.x = DiscontinuityFilter(IN.texCoord, ao, ssaoTex, normalsTex, filterOffs, filterWeights, scaleFactor / (scaleFactor + ao.y)); 
    128                 ao.x = DiscontinuityFilter(IN.texCoord, ao, ssaoTex, normalsTex, filterOffs, filterWeights, adaptFactor * scaleFactor * ao.z / (adaptFactor + ao.y), 0); 
    129         } 
    130  
    131         OUT.illum_col.xyz = col.xyz * ao.x; 
     127                //ao.x = DiscontinuityFilter(IN.texCoord, ao, ssaoTex, normalsTex, filterOffs, filterWeights, adaptFactor * scaleFactor * ao.z  / (adaptFactor + ao.y), 0); 
     128                ao.x = DiscontinuityFilter(IN.texCoord, ao, ssaoTex, normalsTex, filterOffs, filterWeights, adaptFactor * scaleFactor / (adaptFactor + ao.y), 0); 
     129        } 
     130 
     131        //OUT.illum_col.xyz = col.xyz * ao.x; 
    132132        //OUT.illum_col = float4(ao.x, ao.x, ao.x, col.w); 
    133         //OUT.illum_col.xyz = float3(1.0f - ao.x, 1.0f - ao.y * 1e-2f, 1); 
     133        OUT.illum_col.xyz = float3(1.0f - ao.x, clamp(1.0f - ao.y * 1e-2f, 0, 1), 1); 
    134134        OUT.illum_col.w = col.w; 
    135135 
     
    168168                //depthFactor = clamp(1.0f - abs(1.0f - eyeSpaceDepth / aoSample.w), 1e-3f, 1.0f); 
    169169                depthFactor = max(step(5e-1f, 1.0f - abs(1.0f - eyeSpaceDepth / aoSample.w)), 1e-3f); 
    170                 normalFactor = max(step(0.3f, dot(sampleNorm, norm)), 1e-3f); 
     170                normalFactor = max(step(0.6f, dot(sampleNorm, norm)), 1e-3f); 
    171171 
    172172                //w = filterWeights[i] * normalFactor * depthFactor; 
     
    196196        const static float scaleFactor = 10.0f; 
    197197        ao.y = DiscontinuityFilter2(IN.texCoord, ao, ssaoTex, normalsTex, filterOffs, filterWeights, scaleFactor * ao.z, 1); 
     198        //ao.y = DiscontinuityFilter2(IN.texCoord, ao, ssaoTex, normalsTex, filterOffs, filterWeights, scaleFactor, 1); 
    198199         
    199200        OUT.illum_col = ao; 
Note: See TracChangeset for help on using the changeset viewer.