- Timestamp:
- 10/03/08 02:46:30 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r2994 r2995 350 350 351 351 sOldModelViewProjMatrixParam = cgGetNamedParameter(sCgSsaoProgram, "oldModelViewProj"); 352 sModelViewProjMatrixParam = cgGetNamedParameter(sCgSsaoProgram, " mymodelViewProj");352 sModelViewProjMatrixParam = cgGetNamedParameter(sCgSsaoProgram, "oldModelView"); 353 353 sMaxDepthParam = cgGetNamedParameter(sCgSsaoProgram, "maxDepth"); 354 354 sTemporalCoherenceParam = cgGetNamedParameter(sCgSsaoProgram, "temporalCoherence"); … … 657 657 cgGLSetMatrixParameterfc(sOldModelViewProjMatrixParam, (const float *)oldProjViewMatrix.x); 658 658 659 cgGLSetMatrixParameterfc(sModelViewProjMatrixParam, (const float *)projViewMatrix.x); 660 659 661 GLuint colorsTex = fbo->GetColorBuffer(colorBufferIdx)->GetTexture(); 660 662 GLuint positionsTex = fbo->GetColorBuffer(1)->GetTexture(); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2994 r2995 278 278 279 279 static Matrix4x4 oldViewProjMatrix; 280 static Matrix4x4 oldMatViewing; 281 280 282 281 283 … … 881 883 // store matrix of last frame 882 884 oldViewProjMatrix = matProjectionView; 885 camera->GetModelViewMatrix(oldMatViewing); 883 886 884 887 glMatrixMode(GL_PROJECTION); … … 1191 1194 1192 1195 ShadowMap *sm = showShadowMap ? shadowMap : NULL; 1193 ssaoShader->Render(fbo, oldViewProjMatrix, matProjectionView, ssaoTempCohFactor, light, useHDR, sm); 1196 //ssaoShader->Render(fbo, oldViewProjMatrix, matProjectionView, ssaoTempCohFactor, light, useHDR, sm); 1197 ssaoShader->Render(fbo, oldViewProjMatrix, oldMatViewing, ssaoTempCohFactor, light, useHDR, sm); 1194 1198 } 1195 1199 … … 1724 1728 AxisAlignedBox3 box = bvh->GetBox(); 1725 1729 1726 // hack: set far plane for viz1727 //camera->SetFar(0.35f * Magnitude(box.Diagonal()));1728 1729 1730 const float offs = box.Size().x * 0.3f; 1730 //const float offs = box.Size().x * 0.6f;1731 1731 1732 1732 Vector3 vizpos = Vector3(box.Min().x, box.Min().y - box.Size().y * 0.35f, box.Min().z + box.Size().z * 50); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg
r2993 r2995 149 149 uniform float3 br, 150 150 uniform float3 tl, 151 uniform float3 tr 151 uniform float3 tr, 152 const uniform float4x4 oldModelView 152 153 ) 153 154 { … … 197 198 float4 oldPos = mul(oldModelViewProj, realPos); 198 199 200 // the depth projected into the old frame 199 201 const float newDepth = oldPos.z / oldPos.w; 200 202 203 // fit from unit cube into 0 .. 1 201 204 float2 tex = (oldPos.xy / oldPos.w) * 0.5f + 0.5f; 205 206 // optain the sample frpm last frame 202 207 float4 oldCol = tex2D(oldTex, tex); 203 208 … … 212 217 // the number of valid samples in this frame 213 218 const float newNumSamples = ao.y; 219 214 220 215 221 if (//(temporalCoherence > 0) && … … 219 225 // if visibility changed in the surrounding area we have to recompute 220 226 && (oldNumSamples > 0.8f * newNumSamples) 221 //&& (oldAvgDepth / newAvgDepth > 0.99)222 227 ) 223 228 { … … 225 230 newWeight = oldWeight + 1.0f; 226 231 OUT.illum_col.xy = (ao.xy + oldCol.xy * oldWeight) / newWeight; 227 228 232 //if (!(oldNumSamples > ao.y - 1.5f)) newWeight = 0; 229 233 }
Note: See TracChangeset
for help on using the changeset viewer.