Changeset 2996
- Timestamp:
- 10/03/08 02:53:02 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2995 r2996 196 196 // by storing the position from last frame and the old model view matrix 197 197 198 //float4 oldPos = mul(oldModelViewProj, realPos); 198 199 float4 oldPos = mul(oldModelViewProj, realPos); 199 200 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; 202 204 203 205 // fit from unit cube into 0 .. 1 204 206 float2 tex = (oldPos.xy / oldPos.w) * 0.5f + 0.5f; 205 207 206 // optain the sample fr pmlast frame208 // optain the sample from the last frame 207 209 float4 oldCol = tex2D(oldTex, tex); 208 210 209 211 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 214 217 215 218 float newWeight;
Note: See TracChangeset
for help on using the changeset viewer.