Changeset 273
- Timestamp:
- 10/11/06 10:38:05 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Dirk_RenderTraversalWork/Source/System/Action/RenderTraversal/OSGOcclusionCullingTreeBuilder.cpp
r272 r273 130 130 return; 131 131 } 132 132 133 //SETUP 133 134 _uiActiveMatrix = 0; 134 135 Real32 screen_covered_percentage = 0.f; … … 141 142 142 143 //glGenQueriesARB(uNumNodes, queries); 143 std::cout << "Calculated Pixels" << std::endl; 144 //std::cout << "Calculated Pixels" << std::endl; 145 146 //DRAW / TEST / RE-DRAW ON BUFFER FULL 144 147 drawNode(_pRoot, denv, part, screen_covered_percentage, current_node, queries); 148 //RESULTS / RE-DRAW 149 145 150 //std::cout << "Calc Pixels" << std::endl; 146 151 … … 152 157 sc->getElem(statNOccInvisible)->set(0); // Just create it 153 158 154 std::cout << std::endl;155 std::cout << "Real pixels " << std::endl;159 //std::cout << std::endl; 160 //std::cout << "Real pixels " << std::endl; 156 161 for(UInt32 i = 1; i<uNumNodes; i++) 157 162 { … … 180 185 getquiv(queries[i], GL_QUERY_RESULT_ARB, &sampleCount); 181 186 //glGetQueryObjectuivARB(queries[i], GL_QUERY_RESULT_ARB, &sampleCount); 182 std::cout << i << ":" << sampleCount << " ";187 //std::cout << i << ":" << sampleCount << " "; 183 188 184 189 if(sampleCount == 0) 185 190 sc->getElem(statNOccInvisible)->inc(); 186 191 } 187 std::cout << std::endl;192 //std::cout << std::endl; 188 193 189 194 // screen_covered_percentage = 1.0; … … 196 201 while (pNode != NULL) 197 202 { 203 //MATRIX SETUP 198 204 Viewport* vp = denv.getViewport(); 199 205 Int32 pix_width = vp->getPixelWidth(); … … 225 231 // inverted. This corrects this behavior. 226 232 233 // DRAW SPECIFIC 227 234 if(part->_bCorrectTwoSidedLighting) 228 235 { … … 293 300 pix = (max[0] - min[0]) * (max[1] - min[1]) * ((pix_width/2.0f)*(pix_height/2.0f)); 294 301 295 std::cout << cur_node << ":" << pix << " ";296 // std::cout << max - min<< std::endl;297 298 302 //std::cout << cur_node << ":" << pix << " "; 303 //std::cout << pNode->getScalar() << std::endl; 304 305 //STATE ACTIVATION 299 306 State *pNewState = pNode->getState(); 300 307 StateOverride *pNewStateOverride = pNode->getStateOverride(); … … 302 309 denv.activateState(pNewState, pNewStateOverride); 303 310 311 //DRAW DRAW DRAW 304 312 Window* win = denv.getWindow(); 305 313 … … 307 315 if(pNode->hasFunctor() == true) 308 316 { 309 std::cout << " D ";310 317 BeginQueryT beginq = (BeginQueryT) win->getFunction(_funcBeginQueryARB); 311 318 beginq(GL_SAMPLES_PASSED_ARB, queries[cur_node]); 312 if( 1)319 if(0 == 1) 313 320 { 314 321 //glPushMatrix(); … … 356 363 //glPopMatrix(); 357 364 } 358 else 365 else if ( 9 == 9 ) 359 366 { 360 367 drawVolume(volume); … … 370 377 371 378 379 //DRAW CHILDREN OR GO TO TOP AND DO IT AGAIN 372 380 if(pNode->getFirstChild() != NULL) 373 381 { … … 434 442 } 435 443 } 444 //std::cout << "Added : " << uNumNodes << std::endl; 436 445 437 446 } branches/Dirk_RenderTraversalWork/Source/System/Action/RenderTraversal/OSGRenderPartition.cpp
r271 r273 519 519 Pnt3f objPos; 520 520 521 _oDrawEnv.getRTAction()->getActNode()->getVolume().getCenter(objPos);522 523 _currMatrix.second.mult(objPos);521 //_oDrawEnv.getRTAction()->getActNode()->getVolume().getCenter(objPos); 522 523 //_currMatrix.second.mult(objPos); 524 524 525 525 DynamicVolume objVol; 526 526 objVol = _oDrawEnv.getRTAction()->getActNode()->getVolume(); 527 //objVol.transform(_currMatrix.second); 527 Pnt3r min,max; 528 objVol.getBounds(min,max); 529 _currMatrix.second.mult(min); 530 _currMatrix.second.mult(max); 531 objPos = min; 532 if(min[2] < max[2]) 533 { 534 objPos[2] = max[2]; 535 } 536 537 //std::cout << objPos[2] << std::endl; 538 528 539 pNewElem->setVol ( objVol ); 529 540
