Ignore:
Timestamp:
11/05/08 15:14:22 (16 years ago)
Author:
mattausch
Message:

depth queries not working

File:
1 edited

Legend:

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

    r3100 r3101  
    8888         
    8989        const float sampleEyeSpaceDepth = tex2Dlod(colors, float4(texCoord, 0, 0)).w; 
    90         //float3 viewVec = normalize(Interpol(texcoord, bl, br, tl, tr)); 
     90         
    9191        const float3 viewVec = Interpol(texCoord, bl, br, tl, tr); 
    9292        const float3 samplePos = -viewVec * sampleEyeSpaceDepth; 
     
    158158        // fit from unit cube into 0 .. 1 
    159159        const float2 oldTexCoords = backProjPos.xy * 0.5f + 0.5f; 
    160         //const float2 oldTexCoords = texcoord0; 
     160         
    161161 
    162162        // retrieve the sample from the last frame 
     
    166166 
    167167        // vector from eye pos to old sample  
    168         //const float3 viewVec = normalize(Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr)); 
    169168        const float3 viewVec = Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr); 
    170         //const float3 oldWorldPos = oldEyePos - oldEyeSpaceDepth * viewVec; 
    171         //const float3 oldWorldPos = - viewVec * eyeSpaceDepth; 
    172         //const float3 dummy14 = Interpol(texcoord0, bl, br, tl, tr); 
    173  
    174         // the euclidian world space distance 
    175         //const float depthDif = length(oldWorldPos - worldPos.xyz); 
    176         //const float depthDif = length(dummy14 - viewVec); 
    177         //const float projectedEyeSpaceDepth = length(worldPos + oldEyePos); 
     169         
    178170        const float invlen = 1.0f / length(viewVec); 
    179171        const float projectedEyeSpaceDepth = length(dummyPt) * invlen; 
    180172         
    181173        const float depthDif = abs(oldEyeSpaceDepth - projectedEyeSpaceDepth); 
    182         //const float depthDif = length(oldEyePos); 
    183  
     174         
    184175        float notValid = 0.5f; 
    185176 
Note: See TracChangeset for help on using the changeset viewer.