Changeset 3027
- Timestamp:
- 10/12/08 16:44:53 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.cpp
r3026 r3027 291 291 const string fullName = "src/shaders/" + filename + ".cg"; 292 292 293 cout << "fullname: " << fullName << endl;294 295 293 *program = new ShaderProgram(context, fullName, RenderState::sCgFragmentProfile, functionName); 296 294 … … 299 297 if (!(*program)->IsValid()) 300 298 { 301 cerr << "Program " << functionName << " in " << fullName << " failed to load" << endl;299 cerr << "Program " << functionName << " in " << fullName << " failed to load" << endl; 302 300 return false; 303 301 } 302 303 cout << "Program " << functionName << " in " << fullName << " loaded" << endl; 304 304 305 305 return true; … … 388 388 DownSample(fbo, 1, mDownSampleFbo, 1); 389 389 390 ComputeSsao(fbo, tempCohFactor, oldProjViewMatrix, projViewMatrix);390 ComputeSsao(fbo, tempCohFactor, projViewMatrix, oldProjViewMatrix); 391 391 CombineSsao(fbo); 392 392 break; … … 432 432 void DeferredRenderer::ComputeSsao(FrameBufferObject *fbo, 433 433 float tempCohFactor, 434 const Matrix4x4 & oldProjViewMatrix,435 const Matrix4x4 & projViewMatrix434 const Matrix4x4 &projViewMatrix, 435 const Matrix4x4 &oldProjViewMatrix 436 436 ) 437 437 { 438 sCgSsaoProgram->SetMatrix("modelViewProj", projViewMatrix);439 sCgSsaoProgram->SetMatrix("oldModelViewProj", oldProjViewMatrix);440 441 438 #if 0 442 439 GLuint colorsTex = fbo->GetColorBuffer(colorBufferIdx)->GetTexture(); … … 456 453 glDrawBuffers(1, mrt + mIllumFboIndex); 457 454 458 Vector3 pos = mCamera->GetPosition(); 459 455 const Vector3 pos = mCamera->GetPosition(); 460 456 sCgSsaoProgram->SetValue3f("eyePos", pos.x, pos.y, pos.z); 457 461 458 sCgSsaoProgram->SetTexture("colors", colorsTex); 462 459 sCgSsaoProgram->SetTexture("normals", normalsTex); 463 sCgSsaoProgram->SetTexture("oldTex", colorsTex);460 sCgSsaoProgram->SetTexture("oldTex", oldTex); 464 461 sCgSsaoProgram->SetTexture("noise", noiseTex); 465 462 466 463 sCgSsaoProgram->SetValue1f("temporalCoherence", (mUseTemporalCoherence && !mRegenerateSamples) ? tempCohFactor : 0); 467 464 465 sCgSsaoProgram->SetMatrix("modelViewProj", projViewMatrix); 466 sCgSsaoProgram->SetMatrix("oldModelViewProj", oldProjViewMatrix); 468 467 469 468 if (mUseTemporalCoherence || mRegenerateSamples) … … 743 742 sCgDeferredShadowProgram->SetTexture("shadowMap", shadowTex); 744 743 sCgDeferredShadowProgram->SetTexture("noise", noiseTex); 744 745 745 sCgDeferredShadowProgram->SetMatrix("shadowMatrix", shadowMatrix); 746 746 747 sCgDeferredShadowProgram->SetValue1f("sampleWidth", 2.0f / shadowMap->GetSize()); 747 748 … … 846 847 847 848 stopil(); 848 849 // cout << "exported buffer" << endl;850 849 } 851 850 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/DeferredRenderer.h
r3026 r3027 79 79 void ComputeSsao(FrameBufferObject *fbo, 80 80 float tempCohFactor, 81 const Matrix4x4 &oldProjViewMatrix, 82 const Matrix4x4 &projViewMatrix); 81 const Matrix4x4 &projViewMatrix, 82 const Matrix4x4 &oldProjViewMatrix 83 ); 83 84 84 void ComputeGlobIllum(FrameBufferObject *fbo, float tempCohFactor, const Matrix4x4 &projViewMatrix, const Matrix4x4 &oldProjViewMatrix); 85 void ComputeGlobIllum(FrameBufferObject *fbo, 86 float tempCohFactor, 87 const Matrix4x4 &projViewMatrix, 88 const Matrix4x4 &oldProjViewMatrix); 85 89 86 90 void FirstPass(FrameBufferObject *fbo, DirectionalLight *light);
Note: See TracChangeset
for help on using the changeset viewer.