- Timestamp:
- 10/16/08 19:51:16 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r3028 r3034 159 159 const float eyeDepth = tex2Dlod(colors, float4(IN.texCoord, 0, 0)).w; 160 160 const float3 eyeSpacePos = -viewDir * eyeDepth; 161 const float3 centerPosition = eyePos + eyeSpacePos; 162 163 const float4 realPos = float4(centerPosition, 1.0f); 161 const float4 worldPos = float4(eyePos + eyeSpacePos, 1.0f); 164 162 165 163 … … 167 165 //-- calculcate the current projected depth for next frame 168 166 169 float4 currentPos = mul(modelViewProj, realPos);167 float4 currentPos = mul(modelViewProj, worldPos); 170 168 171 169 const float w = SAMPLE_RADIUS / currentPos.w; … … 185 183 186 184 // calculate projected depth 187 float4 projPos = mul(oldModelViewProj, realPos);185 float4 projPos = mul(oldModelViewProj, worldPos); 188 186 projPos /= projPos.w; 189 187 190 188 // the current depth projected into the old frame 191 189 const float projDepth = projPos.z * precisionScale;
Note: See TracChangeset
for help on using the changeset viewer.