Changeset 99 for trunk/VUT/work/ogre_changes
- Timestamp:
- 05/15/05 04:08:02 (20 years ago)
- Location:
- trunk/VUT/work/ogre_changes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/work/ogre_changes/OgreMain/src/OgreSceneManager.cpp
r61 r99 4178 4178 } 4179 4179 } 4180 #ifdef OGRE_COHERENT_OCCLUSION_CULLING4180 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 4181 4181 //----------------------------------------------------------------------- 4182 4182 void SceneManager::_renderSceneNode( Camera *cam, SceneNode *node ) … … 4193 4193 RenderQueue::QueueGroupIterator queueIt = getRenderQueue()->_getQueueGroupIterator(); 4194 4194 4195 // find currently processed queue groups and delelete them from render queue 4195 4196 while (queueIt.hasMoreElements()) 4196 4197 { … … 4198 4199 RenderQueueGroup* pGroup = queueIt.getNext(); 4199 4200 4200 // delete this queue group if already processed4201 4201 if (isRenderQueueToBeProcessed(qId)) 4202 4202 pGroup->clear(); … … 4206 4206 // Pass::processPendingPassUpdates(); 4207 4207 } 4208 #endif // OGRE_COHERENT_OCCLUSION_CULLING4209 } 4208 #endif //GTP_VISIBILITY_MODIFIED_OGRE 4209 } -
trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctreeSceneManager.cpp
r61 r99 316 316 317 317 mOctree = new Octree( 0 ); 318 #ifdef OGRE_COHERENT_OCCLUSION_CULLING318 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 319 319 mNumOctreeNodes = 1; 320 #endif // OGRE_COHERENT_OCCLUSION_CULLING320 #endif // GTP_VISIBILITY_MODIFIED_OGRE 321 321 mMaxDepth = depth; 322 322 mBox = box; … … 461 461 { 462 462 octant -> mChildren[ x ][ y ][ z ] = new Octree( octant ); 463 #ifdef OGRE_COHERENT_OCCLUSION_CULLING463 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 464 464 mNumOctreeNodes ++; 465 #endif // OGRE_COHERENT_OCCLUSION_CULLING465 #endif // GTP_VISIBILITY_MODIFIED_OGRE 466 466 467 467 const Vector3 *corners = octant -> mBox.getAllCorners(); … … 1028 1028 1029 1029 mOctree = new Octree( 0 ); 1030 #ifdef OGRE_COHERENT_OCCLUSION_CULLING1030 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 1031 1031 mNumOctreeNodes = 1; 1032 #endif // OGRE_COHERENT_OCCLUSION_CULLING1032 #endif // GTP_VISIBILITY_MODIFIED_OGRE 1033 1033 mOctree->mBox = box; 1034 1034 … … 1166 1166 return q; 1167 1167 } 1168 #ifdef OGRE_COHERENT_OCCLUSION_CULLING1168 #ifdef GTP_VISIBILITY_MODIFIED_OGRE 1169 1169 //----------------------------------------------------------------------- 1170 1170 void OctreeSceneManager::_renderOctant(Camera *cam, Octree *octant) … … 1177 1177 OctreeNode *sn = *it; 1178 1178 1179 mNumObjects++;1179 ++mNumObjects; 1180 1180 1181 1181 // check bounding box visibility of scene nodes … … 1187 1187 1188 1188 if (mDisplayNodes) 1189 { 1189 1190 getRenderQueue()->addRenderable(sn); 1191 } 1190 1192 1191 1193 // check if the scene manager or this node wants the bounding box shown. 1192 1194 if (sn->getShowBoundingBox() || mShowBoundingBoxes) 1195 { 1193 1196 sn->_addBoundingBoxToQueue(getRenderQueue()); 1194 1195 if (mShowBoxes) 1196 getRenderQueue()->addRenderable(octant->getWireBoundingBox()); 1197 } 1197 1198 } 1198 1199 ++it; 1199 1200 } 1200 1201 1202 if (mShowBoxes) 1203 { 1204 getRenderQueue()->addRenderable(octant->getWireBoundingBox()); 1205 ++mNumObjects; 1206 } 1207 1201 1208 SceneManager::_renderVisibleObjects(); 1202 1209 1203 // delete all rendered objects from renderqueue1210 // delete all rendered objects from the render queue 1204 1211 _deleteRenderedQueueGroups(); 1205 1212 } 1206 #endif // OGRE_COHERENT_OCCLUSION_CULLING1207 } 1213 #endif // GTP_VISIBILITY_MODIFIED_OGRE 1214 } -
trunk/VUT/work/ogre_changes/RenderSystems/GL/src/OgreGLHardwareOcclusionQuery.cpp
r97 r99 161 161 162 162 // Check for hardware occlusion support 163 // if( glDeleteOcclusionQueriesNV_ptr != 0 ) // This is a hack to see if hw occlusion is supported. pointer is 0 if it's not supported.164 if( glDeleteQueriesARB_ptr != 0 )163 if ( glDeleteOcclusionQueriesNV_ptr != 0 ) // This is a hack to see if hw occlusion is supported. pointer is 0 if it's not supported. 164 //if ( glDeleteQueriesARB_ptr != 0 ) 165 165 { 166 166 m_bHWOcclusionSupport = true; … … 171 171 } 172 172 173 if ( m_bHWOcclusionSupport )174 { 175 //glGenOcclusionQueriesNV_ptr( 1, m_uintQuery );176 glGenQueriesARB_ptr(1, m_uintQuery);173 if ( m_bHWOcclusionSupport ) 174 { 175 glGenOcclusionQueriesNV_ptr( 1, m_uintQuery ); 176 //glGenQueriesARB_ptr(1, m_uintQuery); 177 177 } 178 178 } … … 182 182 GLHardwareOcclusionQuery::~GLHardwareOcclusionQuery() 183 183 { 184 if ( m_bHWOcclusionSupport )185 { 186 //glDeleteOcclusionQueriesNV_ptr( 1, &m_uintQuery[0] );187 glDeleteQueriesARB_ptr(1, &m_uintQuery[0]);184 if ( m_bHWOcclusionSupport ) 185 { 186 glDeleteOcclusionQueriesNV_ptr( 1, &m_uintQuery[0] ); 187 //glDeleteQueriesARB_ptr(1, &m_uintQuery[0]); 188 188 } 189 189 } … … 192 192 void GLHardwareOcclusionQuery::beginOcclusionQuery() 193 193 { 194 if ( m_bHWOcclusionSupport ) // Make it fail silently if hardware occlusion isn't supported194 if ( m_bHWOcclusionSupport ) // Make it fail silently if hardware occlusion isn't supported 195 195 { 196 196 // do the actual occlusion query for this node 197 //glBeginOcclusionQueryNV_ptr( m_uintQuery[0] );198 glBeginQueryARB_ptr(GL_SAMPLES_PASSED_ARB, m_uintQuery[0]);197 glBeginOcclusionQueryNV_ptr( m_uintQuery[0] ); 198 //glBeginQueryARB_ptr(GL_SAMPLES_PASSED_ARB, m_uintQuery[0]); 199 199 } 200 200 } … … 202 202 void GLHardwareOcclusionQuery::endOcclusionQuery() 203 203 { 204 if ( m_bHWOcclusionSupport ) // Make it fail silently if hardware occlusion isn't supported205 { 206 //glEndOcclusionQueryNV_ptr();207 glEndQueryARB_ptr(GL_SAMPLES_PASSED_ARB);204 if ( m_bHWOcclusionSupport ) // Make it fail silently if hardware occlusion isn't supported 205 { 206 glEndOcclusionQueryNV_ptr(); 207 //glEndQueryARB_ptr(GL_SAMPLES_PASSED_ARB); 208 208 } 209 209 } … … 211 211 bool GLHardwareOcclusionQuery::pullOcclusionQuery( unsigned int * NumOfFragments, const bool waitForResult) 212 212 { 213 //unsigned int isAvailable = GL_TRUE;214 int isAvailable = GL_TRUE;213 unsigned int isAvailable = GL_TRUE; 214 //int isAvailable = GL_TRUE; 215 215 216 216 if( m_bHWOcclusionSupport ) 217 217 { 218 if (!waitForResult)219 { 220 //glGetOcclusionQueryuivNV_ptr( m_uintQuery[0], GL_PIXEL_COUNT_AVAILABLE_NV, &isAvailable );221 glGetQueryivARB_ptr(m_uintQuery[0], GL_QUERY_RESULT_AVAILABLE_ARB, &isAvailable);222 } 223 224 if (isAvailable == GL_TRUE)225 { 226 glGet QueryObjectuivARB_ptr( m_uintQuery[0], GL_QUERY_RESULT_ARB, NumOfFragments);227 //glGet OcclusionQueryuivNV_ptr( m_uintQuery[0], GL_PIXEL_COUNT_NV, NumOfFragments);218 if (!waitForResult) 219 { 220 glGetOcclusionQueryuivNV_ptr( m_uintQuery[0], GL_PIXEL_COUNT_AVAILABLE_NV, &isAvailable ); 221 //glGetQueryivARB_ptr(m_uintQuery[0], GL_QUERY_RESULT_AVAILABLE_ARB, &isAvailable); 222 } 223 224 if (isAvailable == GL_TRUE) 225 { 226 glGetOcclusionQueryuivNV_ptr( m_uintQuery[0], GL_PIXEL_COUNT_NV, NumOfFragments ); 227 //glGetQueryObjectuivARB_ptr( m_uintQuery[0], GL_QUERY_RESULT_ARB, NumOfFragments); 228 228 } 229 229 }
Note: See TracChangeset
for help on using the changeset viewer.