Changeset 3101 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders
- Timestamp:
- 11/05/08 15:14:22 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3100 r3101 88 88 89 89 const float sampleEyeSpaceDepth = tex2Dlod(colors, float4(texCoord, 0, 0)).w; 90 //float3 viewVec = normalize(Interpol(texcoord, bl, br, tl, tr));90 91 91 const float3 viewVec = Interpol(texCoord, bl, br, tl, tr); 92 92 const float3 samplePos = -viewVec * sampleEyeSpaceDepth; … … 158 158 // fit from unit cube into 0 .. 1 159 159 const float2 oldTexCoords = backProjPos.xy * 0.5f + 0.5f; 160 //const float2 oldTexCoords = texcoord0;160 161 161 162 162 // retrieve the sample from the last frame … … 166 166 167 167 // vector from eye pos to old sample 168 //const float3 viewVec = normalize(Interpol(oldTexCoords, oldbl, oldbr, oldtl, oldtr));169 168 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 178 170 const float invlen = 1.0f / length(viewVec); 179 171 const float projectedEyeSpaceDepth = length(dummyPt) * invlen; 180 172 181 173 const float depthDif = abs(oldEyeSpaceDepth - projectedEyeSpaceDepth); 182 //const float depthDif = length(oldEyePos); 183 174 184 175 float notValid = 0.5f; 185 176
Note: See TracChangeset
for help on using the changeset viewer.