- Timestamp:
- 03/16/07 17:20:26 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/OnlineCullingCHC/OGRE/src/OgreOcclusionQueriesQueryManager.cpp
r2254 r2255 28 28 GtpVisibility::MeshInfoContainer *visibleGeometry, 29 29 GtpVisibility::PatchInfoContainer *visiblePatches, 30 bool relativeVisibility) 30 const bool relativeVisibility, 31 const bool approximateVisibility) 31 32 { 32 33 // we need access to the scene manager and the rendersystem … … 37 38 bool overlayEnabled = mViewport->getOverlaysEnabled(); 38 39 39 ///////////40 //-- render scene with item buffer (i.e., objects with their id as color codes)41 42 40 //mItemBufferMode = 0; 43 if (0 && 44 (mItemBufferMode && mQueryModes) != 0) 45 { 41 if (0 && (mItemBufferMode && mQueryModes) != 0) 42 { 43 /////////// 44 //-- render scene with item buffer (ids are used as color codes) 45 46 46 int savedQueryModes = mQueryModes; 47 47 mQueryModes = mItemBufferMode; … … 51 51 visibleGeometry, 52 52 visiblePatches, 53 relativeVisibility); 53 relativeVisibility, 54 approximateVisibility); 54 55 55 56 // overlays cause false visibility … … 175 176 pfHierarchyInterface->CheckFrustumVisible(*nodeIt, intersects); 176 177 177 // always push back if intersects178 if ( 1 &&intersects)178 // always push back if only checking approximate visibility or intersects 179 if (approximateVisibility || intersects) 179 180 { 180 181 // no more information available … … 185 186 queryList[i].push_back(NULL); 186 187 } 187 else 188 else // issue occlusion query 188 189 { 189 190 queryList[i].push_back(mHierarchyInterface->IssueNodeOcclusionQuery(*nodeIt, false)); … … 200 201 for (geometryIt = geometryList.begin(); geometryIt != geometryIt_end; ++ geometryIt) 201 202 { 202 queryList[i].push_back(pfHierarchyInterface->IssueMeshOcclusionQuery(*geometryIt)); 203 if (approximateVisibility) 204 { 205 // no more information available 206 const int visPixels = 1; 207 const int projPixels = 1; 208 209 visibleGeometry->push_back(GtpVisibility::MeshInfo(*geometryIt, visPixels, projPixels)); 210 } 211 else 212 { 213 queryList[i].push_back(pfHierarchyInterface->IssueMeshOcclusionQuery(*geometryIt)); 214 } 203 215 } 204 216 } … … 211 223 for (patchIt = patchList.begin(); patchIt != patchIt_end; ++patchIt) 212 224 { 213 queryList[i].push_back(pfHierarchyInterface->IssuePatchOcclusionQuery(*patchIt)); 225 if (approximateVisibility) 226 { 227 // no more information available 228 const int visPixels = 1; 229 const int projPixels = 1; 230 231 visiblePatches->push_back(GtpVisibility::PatchInfo(*patchIt, visPixels, projPixels)); 232 } 233 else 234 { 235 queryList[i].push_back(pfHierarchyInterface->IssuePatchOcclusionQuery(*patchIt)); 236 } 214 237 } 215 238 } … … 284 307 GtpVisibility::MeshInfoContainer *visibleGeometry, 285 308 GtpVisibility::PatchInfoContainer *visiblePatches, 286 bool relativeVisibility) 309 const bool relativeVisibility, 310 const bool approximateVisibility) 287 311 { 288 312 PlatformQueryManager::ComputeFromPointVisibility(point, … … 290 314 visibleGeometry, 291 315 visiblePatches, 292 relativeVisibility); 316 relativeVisibility, 317 approximateVisibility); 293 318 294 319 // adds up their visibility and removes duplicates
Note: See TracChangeset
for help on using the changeset viewer.