Ignore:
Timestamp:
04/29/09 18:10:02 (15 years ago)
Author:
mattausch
Message:

completely changing concept: storing world space position for one lookup!!

File:
1 edited

Legend:

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

    r3364 r3365  
    547547                // they possibly have any influence on the ao 
    548548 
    549                 if (1)//cosAngle > 0) 
    550                 { 
    551                         float pixelValid = sampleColor.x; 
     549                if (cosAngle >= 0) 
     550                { 
     551                        float pixelValid = 0;//sampleColor.x; 
    552552 
    553553                        if (1)//pixelValid < 0.5f) 
     
    555555                                const float3 sampleDiffVec = tex2Dlod(attribsTex, float4(texcoord, .0f, .0f)).xyz; 
    556556                                //pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 100.0f); 
    557                                 //pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 4.0f); 
     557                                pixelValid = max(pixelValid, length(sampleDiffVec - diffVec) < 5e-3f ? .0f : 4.0f); 
    558558                                //pixelValid = length(sampleDiffVec - diffVec) < 1e-3f ? .0f : 10.0f; 
    559559                        } 
     
    686686#else 
    687687 
    688         const float3 diffVec = float3(.0f); 
     688        const float3 diffVec      = float3(.0f); 
    689689        const bool isMovingObject = false; 
    690         const float oldSsao = .0f; 
     690        const float oldSsao       = .0f; 
    691691         
    692692        float oldWeight = .0f; 
     
    754754                        const float factor = 4.0f; 
    755755                        //if (oldIdx >= factor * newWeight) oldIdx = 0; 
    756                         oldWeight = min(oldWeight, factor * newWeight); 
    757                         //oldWeight = oldIdx = .0f;  
     756                        //oldWeight = min(oldWeight, factor * newWeight); 
     757                        oldWeight = oldIdx = .0f;  
    758758                } 
    759759        } 
     
    771771        const float combinedWeight = clamp(newWeight + oldWeight, .0f, temporalCoherence); 
    772772 
    773         OUT.illum_col.y = ao.y;//combinedWeight; 
     773        OUT.illum_col.y = combinedWeight; 
    774774        OUT.illum_col.z = oldIdx + newWeight; // the new index 
    775775        OUT.illum_col.w = eyeSpaceDepth; 
Note: See TracChangeset for help on using the changeset viewer.