- Timestamp:
- 10/24/08 13:17:03 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env
r3065 r3066 4 4 assumedVisibleFrames=10 5 5 maxBatchSize=50 6 #trianglesPerVirtualLeaf=3007 trianglesPerVirtualLeaf=300006 trianglesPerVirtualLeaf=300 7 #trianglesPerVirtualLeaf=30000 8 8 keyForwardMotion=20.0f 9 9 keyRotation=1.5f -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp
r3065 r3066 200 200 201 201 // nodes are tested using the subnodes from 3 levels below 202 mMaxDepthForTestingChildren = 0;//3;202 mMaxDepthForTestingChildren = 3; 203 203 //mMaxDepthForTestingChildren = 4; 204 204 … … 1109 1109 1110 1110 1111 static Technique GetVizTechnique() 1112 { 1113 Technique tech; 1114 tech.Init(); 1115 1116 //tech.SetLightingEnabled(false); 1117 //tech.SetDepthWriteEnabled(false); 1118 1119 tech.SetEmmisive(RgbaColor(1.0f, 1.0f, 1.0f, 1.0f)); 1120 tech.SetDiffuse(RgbaColor(1.0f, 1.0f, 1.0f, 1.0f)); 1121 tech.SetAmbient(RgbaColor(1.0f, 1.0f, 1.0f, 1.0f)); 1122 1123 return tech; 1124 } 1125 1126 1111 1127 void Bvh::RenderBoundsForViz(BvhNode *node, 1112 1128 RenderState *state, 1113 1129 bool useTightBounds) 1114 1130 { 1115 glColor3f(1, 1, 1); 1116 1117 // hack: for deferred shading we have to define a material 1118 static Technique boxMat; 1119 boxMat.SetLightingEnabled(false); 1120 1121 boxMat.SetEmmisive(RgbaColor(1.0f, 1.0f, 1.0f, 1.0f)); 1122 1131 Technique *oldTech = state->GetState(); 1132 // we set a simple material 1133 static Technique boxMat = GetVizTechnique(); 1123 1134 boxMat.Render(state); 1124 1135 1125 1136 if (!useTightBounds) 1126 1137 { 1127 //RenderBoxForViz(node->GetBox());1128 glPolygonMode(GL_FRONT, GL_LINE);1138 RenderBoxForViz(node->GetBox()); 1139 /*glPolygonMode(GL_FRONT, GL_LINE); 1129 1140 RenderBoundingBoxImmediate(node->GetBox()); 1130 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 1141 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);*/ 1131 1142 } 1132 1143 else … … 1137 1148 } 1138 1149 } 1150 1151 if (oldTech) oldTech->Render(state); 1139 1152 } 1140 1153 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.cpp
r3065 r3066 129 129 /// the query box material 130 130 static Technique queryTech = GetQueryTechnique(); 131 static Technique dummyTech = GetDummyTechnique(); 132 133 //if ((float)rand() / RAND_MAX < 0.2) 134 // SetState(&dummyTech); 135 //else 136 SetState(&queryTech); 131 SetState(&queryTech); 137 132 } 138 133 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderState.h
r3065 r3066 44 44 */ 45 45 void SetState(Technique *tech); 46 /** Returns the current render state. 47 */ 48 Technique *GetState() { return mCurrentTechnique; } 46 49 /** Returns either query or render mode 47 50 */ -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/RenderTraverser.cpp
r3038 r3066 83 83 else 84 84 { 85 // for non leafs this renders only the bounding volume (if the flag is set)86 85 BvhInterior *interior = static_cast<BvhInterior *>(node); 87 86 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ShadowMapping.cpp
r3063 r3066 598 598 glViewport(0, 0, mSize, mSize); 599 599 600 glDisable(GL_LIGHTING);601 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);600 //glDisable(GL_LIGHTING); 601 //glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 602 602 603 603 glShadeModel(GL_FLAT); … … 612 612 613 613 glShadeModel(GL_SMOOTH); 614 glEnable(GL_LIGHTING);615 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);614 //glEnable(GL_LIGHTING); 615 //glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 616 616 617 617 #if 0 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3065 r3066 56 56 #include "ShaderManager.h" 57 57 58 59 58 60 using namespace std; 59 61 using namespace CHCDemoEngine; … … 513 515 514 516 // this fbo basicly stores the scene information we get from standard rendering of a frame 515 // we store colors, normals, positions (for the ssao)517 // we store diffuse colors, eye space depth and normals 516 518 fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_32); 517 519 //fbo = new FrameBufferObject(texWidth, texHeight, FrameBufferObject::DEPTH_24); … … 521 523 // the normals buffer 522 524 fbo->AddColorBuffer(ColorBufferObject::RGB_FLOAT_16, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 523 // the positions buffer 524 //fbo->AddColorBuffer(ColorBufferObject::RGBA_FLOAT_32, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 525 // a rgb buffer which could hold material properties 525 526 fbo->AddColorBuffer(ColorBufferObject::RGB_UBYTE, ColorBufferObject::WRAP_CLAMP_TO_EDGE, ColorBufferObject::FILTER_NEAREST); 526 527 // another color buffer … … 669 670 RenderTraverser *tr; 670 671 671 bvh->ResetNodeClassifications();672 673 672 switch (renderMode) 674 673 { … … 703 702 tr->SetUseDepthPass((renderMethod == RENDER_DEPTH_PASS) || (renderMethod == RENDER_DEPTH_PASS_DEFERRED)); 704 703 tr->SetRenderQueue(renderQueue); 704 tr->SetShowBounds(showBoundingVolumes); 705 706 bvh->ResetNodeClassifications(); 707 705 708 706 709 return tr; … … 920 923 // the scene is rendered withouth any shading 921 924 glShadeModel(GL_FLAT); 922 glDisable(GL_LIGHTING);923 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);925 //glDisable(GL_LIGHTING); 926 //glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 924 927 925 928 … … 937 940 938 941 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 939 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);942 //glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 940 943 941 944 … … 1896 1899 // draw all objects that have exactly the same depth as the current sample 1897 1900 glDepthFunc(GL_LEQUAL); 1898 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);1901 //glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 1899 1902 1900 1903 glClear(GL_COLOR_BUFFER_BIT);
Note: See TracChangeset
for help on using the changeset viewer.