Changeset 2879 for GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
- Timestamp:
- 08/28/08 21:17:15 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r2878 r2879 47 47 //-- fbos 48 48 49 FrameBufferObject *fbo ;49 FrameBufferObject *fbo = NULL; 50 50 51 51 bool isFirstTexture = true; … … 376 376 glHint(GL_MULTISAMPLE_FILTER_HINT_NV, GL_NICEST); 377 377 378 InitFBO();379 380 378 LeftMotion(0, 0); 381 379 MiddleMotion(0, 0); … … 432 430 SsaoShader::Init(sCgContext); 433 431 434 deferredShader = new DeferredShader(texWidth, texHeight);435 ssaoShader = new SsaoShader(texWidth, texHeight, camera, myfar / 10.0f);432 //deferredShader = new DeferredShader(texWidth, texHeight); 433 //ssaoShader = new SsaoShader(texWidth, texHeight, camera, myfar / 10.0f); 436 434 437 435 // initialize the render traverser … … 539 537 // this fbo basicly stores the scene information we get from standard rendering of a frame 540 538 // we store colors, normals, positions (for the ssao) 541 fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_ 24);539 fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_32); 542 540 543 541 // the diffuse color buffer … … 551 549 // the normals buffer 552 550 //fbo->AddColorBuffer(ColorBufferObject::BUFFER_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false); 551 fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false); 552 553 // another color buffer 553 554 fbo->AddColorBuffer(ColorBufferObject::BUFFER_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST, false); 554 555 … … 574 575 void InitGLstate() 575 576 { 576 glClearColor(0. 5f, 0.5f, 0.8f, 0.0f);577 glClearColor(0.0f, 0.0, 0.2f, 0.0f); 577 578 578 579 glPixelStorei(GL_UNPACK_ALIGNMENT, 1); … … 871 872 872 873 glEnable(GL_MULTISAMPLE_ARB); 873 fbo->Release(); 874 874 875 875 state.SetRenderType(RenderState::FIXED); 876 876 glEnable(GL_LIGHTING); … … 888 888 889 889 glEnable(GL_MULTISAMPLE_ARB); 890 fbo->Release(); 891 890 892 891 cgGLDisableProfile(RenderState::sCgFragmentProfile); 893 892 cgGLDisableProfile(RenderState::sCgVertexProfile); … … 907 906 908 907 case RenderState::DEFERRED: 908 909 if (!fbo) InitFBO(); 909 910 910 911 // multisampling does not work with deferred shading … … 987 988 988 989 if (useSsao) 990 { 991 if (!ssaoShader) ssaoShader = new SsaoShader(texWidth, texHeight, camera, myfar / 10.0f); 992 //DEL_PTR(deferredShader); 993 989 994 ssaoShader->Render(fbo, oldViewProjMatrix, ssaoExpFactor); 995 996 } 990 997 else 998 { 999 if (!deferredShader) deferredShader = new DeferredShader(texWidth, texHeight); 1000 //DEL_PTR(ssaoShader); 1001 991 1002 deferredShader->Render(fbo); 1003 } 1004 } 1005 else 1006 { 1007 /*DEL_PTR(fbo); 1008 DEL_PTR(ssaoShader); 1009 DEL_PTR(deferredShader); 1010 */ 992 1011 } 993 1012 … … 1174 1193 switch (c) 1175 1194 { 1195 1176 1196 case 'A': 1177 1197 case 'a': … … 1531 1551 DEL_PTR(renderQueue); 1532 1552 DEL_PTR(perfGraph); 1553 1554 DEL_PTR(fbo); 1555 DEL_PTR(ssaoShader); 1556 DEL_PTR(deferredShader); 1533 1557 1534 1558 if (sCgMrtVertexProgram)
Note: See TracChangeset
for help on using the changeset viewer.