Ignore:
Timestamp:
10/03/08 02:46:30 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2993 r2995  
    149149                   uniform float3 br, 
    150150                   uniform float3 tl, 
    151                    uniform float3 tr 
     151                   uniform float3 tr, 
     152                   const uniform float4x4 oldModelView 
    152153                   ) 
    153154{ 
     
    197198        float4 oldPos = mul(oldModelViewProj, realPos); 
    198199 
     200        // the depth projected into the old frame 
    199201        const float newDepth = oldPos.z / oldPos.w; 
    200202 
     203        // fit from unit cube into 0 .. 1 
    201204        float2 tex = (oldPos.xy / oldPos.w) * 0.5f + 0.5f; 
     205 
     206        // optain the sample frpm last frame 
    202207        float4 oldCol = tex2D(oldTex, tex); 
    203208 
     
    212217        // the number of valid samples in this frame 
    213218        const float newNumSamples = ao.y; 
     219 
    214220 
    215221        if (//(temporalCoherence > 0) && 
     
    219225                // if visibility changed in the surrounding area we have to recompute 
    220226                && (oldNumSamples > 0.8f * newNumSamples) 
    221                 //&& (oldAvgDepth / newAvgDepth > 0.99) 
    222227                ) 
    223228        { 
     
    225230                newWeight = oldWeight + 1.0f; 
    226231                OUT.illum_col.xy = (ao.xy + oldCol.xy * oldWeight) / newWeight; 
    227  
    228232                //if (!(oldNumSamples > ao.y - 1.5f)) newWeight = 0; 
    229233        } 
Note: See TracChangeset for help on using the changeset viewer.