Changeset 2996


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

Legend:

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

    r2995 r2996  
    196196        // by storing the position from last frame and the old model view matrix 
    197197 
     198        //float4 oldPos = mul(oldModelViewProj, realPos); 
    198199        float4 oldPos = mul(oldModelViewProj, realPos); 
    199200 
    200         // the depth projected into the old frame 
    201         const float newDepth = oldPos.z / oldPos.w; 
     201        //const float projEyeDepth = 
     202        // the current depth projected into the old frame 
     203        const float projDepth = oldPos.z / oldPos.w; 
    202204 
    203205        // fit from unit cube into 0 .. 1 
    204206        float2 tex = (oldPos.xy / oldPos.w) * 0.5f + 0.5f; 
    205207 
    206         // optain the sample frpm last frame 
     208        // optain the sample from the last frame 
    207209        float4 oldCol = tex2D(oldTex, tex); 
    208210 
    209211        const float oldDepth = oldCol.w; 
    210         const float depthDif = 1.0f - newDepth / oldDepth; 
    211  
    212         float oldWeight = clamp(oldCol.z, 0, temporalCoherence); 
    213         float oldNumSamples = oldCol.y; 
     212        const float oldNumSamples = oldCol.y; 
     213        const float oldWeight = clamp(oldCol.z, 0, temporalCoherence); 
     214 
     215        const float depthDif = 1.0f - projDepth / oldDepth; 
     216 
    214217 
    215218        float newWeight; 
Note: See TracChangeset for help on using the changeset viewer.