Render the scene in a single pass
| 311 | |
| 312 | // Render the scene in a single pass |
| 313 | void SceneDemo::renderSinglePass(openglframework::Shader& shader, const openglframework::Matrix4& worldToCameraMatrix) { |
| 314 | |
| 315 | if (mIsWireframeEnabled) { |
| 316 | glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); |
| 317 | } |
| 318 | |
| 319 | // Bind the shader |
| 320 | shader.bind(); |
| 321 | |
| 322 | // Render all the physics objects of the scene |
| 323 | for (std::vector<PhysicsObject*>::iterator it = mPhysicsObjects.begin(); it != mPhysicsObjects.end(); ++it) { |
| 324 | (*it)->render(mIsWireframeEnabled ? mColorShader : shader, worldToCameraMatrix); |
| 325 | } |
| 326 | |
| 327 | // Unbind the shader |
| 328 | shader.unbind(); |
| 329 | |
| 330 | if (mIsWireframeEnabled) { |
| 331 | glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | // Create the Shadow map FBO and texture |
| 336 | void SceneDemo::createShadowMapFBOAndTexture() { |