- Timestamp:
- 11/03/05 16:14:24 (19 years ago)
- Location:
- trunk/VUT
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibility/scripts/GtpVisibility.vcproj
r371 r373 103 103 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 104 104 <File 105 RelativePath="..\src\BatchedQueriesCullingManager.cpp"> 106 </File> 107 <File 105 108 RelativePath="..\src\CoherentHierarchicalCullingManager.cpp"> 106 109 </File> … … 137 140 Filter="h;hpp;hxx;hm;inl;inc;xsd" 138 141 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"> 142 <File 143 RelativePath="..\include\BatchedQueriesCullingManager.h"> 144 </File> 139 145 <File 140 146 RelativePath="..\include\CoherentHierarchicalCullingManager.h"> … … 183 189 </File> 184 190 </Filter> 191 <File 192 RelativePath=".\VTune\GtpVisibility.vpj"> 193 </File> 185 194 </Files> 186 195 <Globals> -
trunk/VUT/GtpVisibilityPreprocessor/scripts/Preprocessor.vcproj
r370 r373 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories="..\ include"22 AdditionalIncludeDirectories="..\support;..\support\devil\include;..\support\zlib\include;"$(QTDIR)\include";"$(QTDIR)\include\Qt";..\include" 23 23 PreprocessorDefinitions="WIN32;_DEBUG;_LIB" 24 24 MinimalRebuild="TRUE" -
trunk/VUT/GtpVisibilityPreprocessor/src/Exporter.h
r362 r373 78 78 ExportPolygons(const PolygonContainer &polys) = 0; 79 79 80 virtual void 81 ExportBspViewCellPartition(const BspTree &tree) = 0; 82 83 virtual void 84 ExportBspLeaves(const BspTree &tree) = 0; 85 80 86 void SetExportRayDensity(const bool d) { mExportRayDensity = d; } 81 87 -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r372 r373 550 550 551 551 cout << "evaluating render time heuristics ... "; 552 Real rt = EvaluateRenderHeuristics();552 Real rt = SimulateRendering(); 553 553 cout << "finished" << endl; 554 554 … … 877 877 if (!objects[j]->Mailed()) 878 878 { 879 //if (j == 2198)m.mDiffuseColor = RgbColor(1, 0, 1);880 //else m.mDiffuseColor = RgbColor(1, 1, 0);881 879 exporter->SetForcedMaterial(m); 882 880 exporter->ExportIntersectable(objects[j]); … … 886 884 DEL_PTR(exporter); 887 885 } 888 } 889 890 Real SamplingPreprocessor::EvaluateRenderHeuristics() 886 887 if (1) // export view cells and leaves 888 { 889 Exporter *exporter = Exporter::GetExporter("viewCells.x3d"); 890 if (exporter) 891 { 892 exporter->ExportBspViewCellPartition(*mBspTree); 893 delete exporter; 894 } 895 896 exporter = Exporter::GetExporter("bspLeaves.x3d"); 897 898 if (exporter) 899 { 900 exporter->ExportBspLeaves(*mBspTree); 901 delete exporter; 902 } 903 } 904 905 } 906 907 908 909 Real SamplingPreprocessor::RenderPvs(ViewCell &viewCell, 910 const float objRenderTime) const 911 { 912 return viewCell.GetPvs().GetSize() * objRenderTime; 913 } 914 915 Real SamplingPreprocessor::SimulateRendering() 891 916 { 892 917 Real renderTime = 0; 893 918 894 const float objRt = 1.0f; // render time for 1 object of PVS 895 const float vcOverhead = 1.0f; // const overhead for crossing a view cell border 919 // render time for 1 object of PVS 920 const float objRt = 1.0f; 921 // const overhead for crossing a view cell border 922 const float vcOverhead = 0.01f; 896 923 897 924 float totalArea = 0; … … 915 942 area += (*pit)->GetArea(); 916 943 917 renderTime += area * (*it)->GetPvs().GetSize() * objRt;944 renderTime += area * RenderPvs(*(*it), objRt); 918 945 totalArea += area; 919 946 } -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.h
r372 r373 12 12 class SamplingPreprocessor : public Preprocessor { 13 13 public: 14 15 SamplingPreprocessor(); 16 17 ~SamplingPreprocessor(); 18 19 virtual bool ComputeVisibility(); 20 21 protected: 14 22 int mPass; 15 23 … … 22 30 int mBspConstructionSamples; 23 31 int mPostProcessSamples; 24 25 SamplingPreprocessor();26 32 27 ~SamplingPreprocessor();28 29 virtual bool ComputeVisibility();30 33 31 34 void … … 93 96 /** Post processes view cells (i.e., merges or subdivides view cells based 94 97 on the PVS and the ray sets. 98 @param rays a set of rays which carries the visibility information 99 the merging / subdivision is based on. 95 100 @returns number of merged view cells. 96 101 */ … … 100 105 quality of the view cell partition. 101 106 */ 102 Real EvaluateRenderHeuristics(); 107 Real SimulateRendering(); 108 /** Simulates rendering of the pvs of one view cell, with given rendering time for an object. 109 @param viewCell the view cell holding the Pvs 110 @param objRenderTime estimated render time for one object of the Pvs 111 */ 112 Real RenderPvs(ViewCell &viewCell, const float objRenderTime) const; 113 103 114 }; 104 115 -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.cpp
r372 r373 1486 1486 } 1487 1487 1488 void BspTree::CollectLeaves(vector<BspLeaf *> &leaves) 1488 void BspTree::CollectLeaves(vector<BspLeaf *> &leaves) const 1489 1489 { 1490 1490 stack<BspNode *> nodeStack; … … 1499 1499 if (node->IsLeaf()) 1500 1500 { 1501 BspLeaf *leaf = (BspLeaf *)node; 1502 1501 BspLeaf *leaf = (BspLeaf *)node; 1503 1502 leaves.push_back(leaf); 1504 } else 1503 } 1504 else 1505 1505 { 1506 1506 BspInterior *interior = dynamic_cast<BspInterior *>(node); -
trunk/VUT/GtpVisibilityPreprocessor/src/ViewCellBsp.h
r372 r373 341 341 /** Returns list of BSP leaves. 342 342 */ 343 void CollectLeaves(vector<BspLeaf *> &leaves) ;343 void CollectLeaves(vector<BspLeaf *> &leaves) const; 344 344 345 345 /** Returns box which bounds the whole tree. -
trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp
r372 r373 8 8 #include "ViewCell.h" 9 9 #include "Polygon3.h" 10 ViewCellContainer X3dExporter::foundViewCells; // TODO: delete later11 10 12 11 X3dExporter::X3dExporter(const string filename):Exporter(filename) … … 177 176 for (it = viewCells.begin(); it != it_end; ++ it) 178 177 ExportViewCell(*it); 178 } 179 180 void 181 X3dExporter::ExportBspViewCellPartition(const BspTree &tree) 182 { 183 ViewCellContainer viewCells; 184 tree.CollectViewCells(viewCells); 185 186 ViewCellContainer::const_iterator it, it_end = viewCells.end(); 187 188 for (it = viewCells.begin(); it != it_end; ++ it) 189 { 190 if ((*it)->GetMesh()) 191 ExportViewCell(*it); 192 else 193 { 194 PolygonContainer cell; 195 tree.ConstructGeometry(dynamic_cast<BspViewCell *>(*it), cell); 196 ExportPolygons(cell); 197 } 198 } 199 } 200 201 void 202 X3dExporter::ExportBspLeaves(const BspTree &tree) 203 { 204 vector<BspLeaf *> leaves; 205 tree.CollectLeaves(leaves); 206 207 vector<BspLeaf *>::const_iterator it, it_end = leaves.end(); 208 209 for (it = leaves.begin(); it != it_end; ++ it) 210 { 211 PolygonContainer cell; 212 tree.ConstructGeometry(*it, cell); 213 ExportPolygons(cell); 214 } 179 215 } 180 216 … … 477 513 } 478 514 } 479 else // export view cells 480 { 481 while (!tStack.empty()) 482 { 483 BspNode *node = tStack.top(); 484 485 tStack.pop(); 486 487 if (node->IsLeaf()) 488 { 489 ViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 490 if (viewCell) 491 foundViewCells.push_back(viewCell); 492 } 493 else 494 { 495 BspInterior *interior = dynamic_cast<BspInterior *>(node); 496 497 tStack.push(interior->GetFront()); 498 tStack.push(interior->GetBack()); 499 } 500 } 501 502 Debug << "Number of view cells with dublicates: " << (int)foundViewCells.size() << endl; 503 504 //-- erase dublicates 505 sort(foundViewCells.begin(), foundViewCells.end()); 506 ViewCellContainer::iterator new_end = unique(foundViewCells.begin(), foundViewCells.end()); 507 foundViewCells.erase(new_end, foundViewCells.end()); 508 ExportViewCells(foundViewCells); 509 510 Debug << "Number of view cells after erasing dublicates: " << (int)foundViewCells.size() << endl; 511 } 515 // export view cells 516 ExportBspViewCellPartition(tree); 512 517 513 518 return true; -
trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.h
r362 r373 85 85 const RgbColor &color = RgbColor(1,1,1)); 86 86 87 static ViewCellContainer foundViewCells; // todo: remove this 87 virtual void 88 ExportBspViewCellPartition(const BspTree &tree); 89 90 virtual void 91 ExportBspLeaves(const BspTree &tree); 92 88 93 protected: 89 94
Note: See TracChangeset
for help on using the changeset viewer.