Changeset 3005 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
- Timestamp:
- 10/05/08 23:13:58 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3002 r3005 203 203 DeferredRenderer::SAMPLING_METHOD samplingMethod = DeferredRenderer::SAMPLING_QUADRATIC; 204 204 205 206 static Matrix4x4 matProjectionView = IdentityMatrix();207 208 209 205 ShadowMap *shadowMap = NULL; 210 206 DirectionalLight *light = NULL; … … 287 283 static CGparameter sBLParamTex; 288 284 289 static Matrix4x4 oldViewProjMatrix;290 static Matrix4x4 old MatViewing;285 static Matrix4x4 viewProjMat = IdentityMatrix(); 286 static Matrix4x4 oldViewProjMat = IdentityMatrix(); 291 287 292 288 … … 668 664 fbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST); 669 665 // the positions buffer 670 fbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST);671 //fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST);666 //fbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 667 fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, ColorBufferObject::FILTER_NEAREST); 672 668 // the normals buffer 673 669 fbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); … … 905 901 { 906 902 // store matrix of last frame 907 oldViewProjMatrix = matProjectionView; 908 camera->GetModelViewMatrix(oldMatViewing); 903 oldViewProjMat = viewProjMat; 909 904 910 905 glMatrixMode(GL_PROJECTION); … … 926 921 927 922 // store matrix for later use 928 matProjectionView= matViewing * matProjection;923 viewProjMat = matViewing * matProjection; 929 924 930 925 if ((renderMethod == RENDER_DEFERRED) || (renderMethod == RENDER_DEPTH_PASS_DEFERRED)) … … 1170 1165 // otherwise the temporal coherency is broken 1171 1166 BvhNode::SetCurrentState(1); 1172 shadowMap->RenderShadowView(shadowTraverser, matProjectionView);1167 shadowMap->RenderShadowView(shadowTraverser, viewProjMat); 1173 1168 BvhNode::SetCurrentState(0); 1174 1169 } … … 1177 1172 // actually render the scene geometry using the specified algorithm 1178 1173 traverser->RenderScene(); 1179 /* 1180 #if 0 1181 SceneEntityContainer::const_iterator sit, sit_end = sceneEntities.end(); 1182 1183 for (sit = sceneEntities.begin(); sit != sit_end; ++ sit) 1184 renderQueue->Enqueue(*sit); 1185 #else 1186 1187 SceneEntityContainer::const_iterator sit, sit_end = sceneEntities2.end(); 1188 1189 for (sit = sceneEntities2.begin(); sit != sit_end; ++ sit) 1190 renderQueue->Enqueue(*sit); 1191 #endif 1192 */ 1193 renderQueue->Apply(); 1174 //renderQueue->Apply(); 1194 1175 } 1195 1176 … … 1244 1225 1245 1226 ShadowMap *sm = showShadowMap ? shadowMap : NULL; 1246 ssaoShader->Render(fbo, oldViewProjMat rix, matProjectionView, ssaoTempCohFactor, light, useHDR, sm);1227 ssaoShader->Render(fbo, oldViewProjMat, viewProjMat, ssaoTempCohFactor, light, useHDR, sm); 1247 1228 } 1248 1229 … … 2173 2154 2174 2155 // the scene is rendered withouth any shading 2175 shadowMap->ComputeShadowMap(shadowTraverser, matProjectionView);2156 shadowMap->ComputeShadowMap(shadowTraverser, viewProjMat); 2176 2157 2177 2158 glEnable(GL_CULL_FACE);
Note: See TracChangeset
for help on using the changeset viewer.