Changeset 179 for trunk/VUT/GtpVisibilityPreprocessor
- Timestamp:
- 07/18/05 17:59:54 (20 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/Preprocessor.vcproj
r136 r179 62 62 <Tool 63 63 Name="VCCLCompilerTool" 64 AdditionalIncludeDirectories=" ..\include"64 AdditionalIncludeDirectories=""$(ZLIB_PATH)\include";"$(QTDIR)\include";"$(QTDIR)\include\Qt";"$(XERCES_PATH)\include";..\include" 65 65 PreprocessorDefinitions="WIN32;NDEBUG;_LIB" 66 66 RuntimeLibrary="2" … … 102 102 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"> 103 103 <File 104 RelativePath="..\src\AxisAlignedBox3.cpp"> 105 </File> 106 <File 107 RelativePath="..\src\AxisAlignedBox3.h"> 108 </File> 109 <File 110 RelativePath="..\src\Camera.cpp"> 111 </File> 112 <File 113 RelativePath="..\src\Camera.h"> 114 </File> 115 <File 116 RelativePath="..\src\common.cpp"> 117 </File> 118 <File 119 RelativePath="..\src\common.h"> 120 </File> 121 <File 122 RelativePath="..\src\Containers.h"> 123 </File> 124 <File 125 RelativePath="..\src\Environment.cpp"> 126 </File> 127 <File 128 RelativePath="..\src\Environment.h"> 129 </File> 130 <File 104 131 RelativePath="..\src\ExactPreprocessor.cpp"> 105 132 </File> 106 133 <File 134 RelativePath="..\src\ExactPreprocessor.h"> 135 </File> 136 <File 137 RelativePath="..\src\Exporter.cpp"> 138 </File> 139 <File 140 RelativePath="..\src\Exporter.h"> 141 </File> 142 <File 143 RelativePath="..\src\gzstream.cpp"> 144 </File> 145 <File 146 RelativePath="..\src\gzstream.h"> 147 </File> 148 <File 149 RelativePath="..\src\Intersectable.h"> 150 </File> 151 <File 107 152 RelativePath="..\src\KdTree.cpp"> 108 153 </File> 109 154 <File 155 RelativePath="..\src\KdTree.h"> 156 </File> 157 <File 158 RelativePath="..\src\main.cpp"> 159 </File> 160 <File 161 RelativePath="..\src\Material.cpp"> 162 </File> 163 <File 164 RelativePath="..\src\Material.h"> 165 </File> 166 <File 167 RelativePath="..\src\Matrix4x4.cpp"> 168 </File> 169 <File 170 RelativePath="..\src\Matrix4x4.h"> 171 </File> 172 <File 173 RelativePath="..\src\Mesh.cpp"> 174 </File> 175 <File 176 RelativePath="..\src\Mesh.h"> 177 </File> 178 <File 179 RelativePath="..\src\Parser.h"> 180 </File> 181 <File 182 RelativePath="..\src\Plane3.h"> 183 </File> 184 <File 110 185 RelativePath="..\src\Preprocessor.cpp"> 111 186 </File> 112 187 <File 188 RelativePath="..\src\Preprocessor.h"> 189 </File> 190 <File 191 RelativePath="..\src\Ray.cpp"> 192 </File> 193 <File 194 RelativePath="..\src\Ray.h"> 195 </File> 196 <File 113 197 RelativePath="..\src\SamplingPreprocessor.cpp"> 198 </File> 199 <File 200 RelativePath="..\src\SamplingPreprocessor.h"> 201 </File> 202 <File 203 RelativePath="..\src\SceneGraph.cpp"> 204 </File> 205 <File 206 RelativePath="..\src\SceneGraph.h"> 207 </File> 208 <File 209 RelativePath="..\src\UnigraphicsParser.cpp"> 210 </File> 211 <File 212 RelativePath="..\src\UnigraphicsParser.h"> 213 </File> 214 <File 215 RelativePath="..\src\Vector3.cpp"> 216 </File> 217 <File 218 RelativePath="..\src\Vector3.h"> 219 </File> 220 <File 221 RelativePath="..\src\ViewCellBsp.h"> 222 </File> 223 <File 224 RelativePath="..\src\VisibilityVector3.h"> 225 </File> 226 <File 227 RelativePath="..\src\X3dExporter.cpp"> 228 </File> 229 <File 230 RelativePath="..\src\X3dExporter.h"> 231 </File> 232 <File 233 RelativePath="..\src\X3dParser.cpp"> 234 </File> 235 <File 236 RelativePath="..\src\X3dParser.h"> 114 237 </File> 115 238 </Filter> -
trunk/VUT/GtpVisibilityPreprocessor/src/Camera.cpp
r176 r179 20 20 21 21 22 QImage image(mWidth, mHeight, 32); 22 // QImage image(mWidth, mHeight, 32); changed by matt 23 QImage image(mWidth, mHeight, QImage::Format_RGB32); 24 23 25 vector<Ray> rays; 24 26 -
trunk/VUT/GtpVisibilityPreprocessor/src/SamplingPreprocessor.cpp
r177 r179 73 73 int passSampleContributions = 0; 74 74 int passSamples = 0; 75 75 int index = 0; 76 KdNode *visibleNode = NULL; 77 76 78 for (i =0; i < objects.size(); i++) { 77 79 KdNode *nodeToSample = NULL; … … 80 82 int pvsSize = object->mKdPvs.GetSize(); 81 83 82 if (0 && pvsSize) { 83 // mail all nodes from the pvs 84 Intersectable::NewMail(); 85 KdPvsMap::iterator i = object->mKdPvs.mEntries.begin(); 86 for (; i != object->mKdPvs.mEntries.end(); i++) { 87 KdNode *node = (*i).first; 88 node->Mail(); 84 if (0 && pvsSize) { 85 // mail all nodes from the pvs 86 Intersectable::NewMail(); 87 KdPvsMap::iterator i = object->mKdPvs.mEntries.begin(); 88 for (; i != object->mKdPvs.mEntries.end(); i++) { 89 KdNode *node = (*i).first; 90 node->Mail(); 91 } 92 int maxTries = 2*pvsSize; 93 94 for (int tries = 0; tries < 10; tries++) { 95 index = RandomValue(0, pvsSize - 1); 96 KdPvsData data; 97 object->mKdPvs.GetData(index, visibleNode, data); 98 nodeToSample = mKdTree->FindRandomNeighbor(visibleNode, true); 99 if (nodeToSample) 100 break; 101 } 89 102 } 90 int maxTries = 2*pvsSize; 91 for (int tries = 0; tries < 10; tries++) { 92 int index = RandomValue(0, pvsSize - 1); 93 KdPvsData data; 94 KdNode *visibleNode; 95 object->mKdPvs.GetData(index, visibleNode, data); 96 nodeToSample = mKdTree->FindRandomNeighbor(visibleNode, true); 97 if (nodeToSample) 98 break; 99 } 103 104 if (pvsSize) { 105 // mail all nodes from the pvs 106 Intersectable::NewMail(); 107 KdPvsMap::iterator i = object->mKdPvs.mEntries.begin(); 108 for (; i != object->mKdPvs.mEntries.end(); i++) { 109 KdNode *node = (*i).first; 110 node->Mail(); 111 } 112 113 vector<KdNode *> invisibleNeighbors; 114 // get all neighbors of all PVS nodes 115 i = object->mKdPvs.mEntries.begin(); 116 for (; i != object->mKdPvs.mEntries.end(); i++) { 117 KdNode *node = (*i).first; 118 mKdTree->FindNeighbors(visibleNode, invisibleNeighbors, true); 119 } 120 121 KdPvsData data; 122 KdNode *visibleNode; 123 object->mKdPvs.GetData(index, visibleNode, data); 124 nodeToSample = mKdTree->FindRandomNeighbor(visibleNode, true); 125 if (nodeToSample) 126 break; 100 127 } 101 102 if (pvsSize) {103 // mail all nodes from the pvs104 Intersectable::NewMail();105 KdPvsMap::iterator i = object->mKdPvs.mEntries.begin();106 for (; i != object->mKdPvs.mEntries.end(); i++) {107 KdNode *node = (*i).first;108 node->Mail();109 }110 vector<KdNode *> invisibleNeighbors;111 // get all neighbors of all PVS nodes112 KdPvsMap::iterator i = object->mKdPvs.mEntries.begin();113 for (; i != object->mKdPvs.mEntries.end(); i++) {114 KdNode *node = (*i).first;115 mKdTree->FindNeighbors(visibleNode, invisibleNeighbors, true);116 }117 118 KdPvsData data;119 KdNode *visibleNode;120 object->mKdPvs.GetData(index, visibleNode, data);121 nodeToSample = mKdTree->FindRandomNeighbor(visibleNode, true);122 if (nodeToSample)123 break;124 }125 128 126 129 127 130 for (int k=0; k < mSamplesPerPass; k++) { 128 object->GetRandomSurfacePoint(point, normal); 129 if (nodeToSample) { 130 int maxTries = 5; 131 for (int tries = 0; tries < maxTries; tries++) { 132 direction = mKdTree->GetBox(nodeToSample).GetRandomPoint() - point; 133 if (DotProd(direction, normal) > Limits::Small) 134 break; 135 } 136 if (tries == maxTries) 137 direction = UniformRandomVector(normal); 138 } else 139 direction = UniformRandomVector(normal); 140 141 // construct a ray 142 SetupRay(ray, point, direction); 143 mKdTree->CastRay(ray); 144 145 if (i < pvsOut) 146 rays[i].push_back(ray); 147 148 int sampleContributions = 0; 149 150 if (ray.leaves.size()) { 151 sampleContributions += AddNodeSamples(object, ray); 131 object->GetRandomSurfacePoint(point, normal); 132 if (nodeToSample) { 133 int maxTries = 5; 134 for (int tries = 0; tries < maxTries; tries++) { 135 direction = mKdTree->GetBox(nodeToSample).GetRandomPoint() - point; 136 if (DotProd(direction, normal) > Limits::Small) 137 break; 138 } 139 140 if (tries == maxTries) 141 direction = UniformRandomVector(normal); 142 } else 143 direction = UniformRandomVector(normal); 144 145 // construct a ray 146 SetupRay(ray, point, direction); 147 mKdTree->CastRay(ray); 148 149 if (i < pvsOut) 150 rays[i].push_back(ray); 151 152 int sampleContributions = 0; 153 154 155 if (ray.leaves.size()) { 156 sampleContributions += AddNodeSamples(object, ray); 152 157 153 if (ray.intersections.size()) { 154 sampleContributions += AddNodeSamples(ray.intersections[0].mObject, ray); 155 // check whether we can add this to the rays 156 for (int j = 0; j < pvsOut; j++) { 157 if (objects[j] == ray.intersections[0].mObject) { 158 rays[j].push_back(ray); 159 } 160 } 161 } 162 passSamples++; 163 if (sampleContributions) { 164 passContributingSamples++; 165 passSampleContributions += sampleContributions; 158 if (ray.intersections.size()) { 159 sampleContributions += AddNodeSamples(ray.intersections[0].mObject, ray); 160 // check whether we can add this to the rays 161 for (int j = 0; j < pvsOut; j++) { 162 if (objects[j] == ray.intersections[0].mObject) { 163 rays[j].push_back(ray); 164 } 165 } 166 } 167 168 passSamples++; 169 170 if (sampleContributions) { 171 passContributingSamples++; 172 passSampleContributions += sampleContributions; 173 } 174 } 166 175 } 167 176 } 168 }169 }170 177 totalSamples += passSamples; 171 178 pass++; -
trunk/VUT/GtpVisibilityPreprocessor/src/UnigraphicsParser.cpp
r167 r179 35 35 char str[80]; 36 36 Face *face; 37 Vector3 *vptr;37 //Vector3 *vptr; 38 38 39 39 float x,y,z; -
trunk/VUT/GtpVisibilityPreprocessor/src/X3dParser.cpp
r176 r179 24 24 #include "X3dParser.h" 25 25 26 #include "X3dParserXerces.h"26 //#include "X3dParserXerces.h" 27 27 #include "Mesh.h" 28 28 #include "SceneGraph.h"
Note: See TracChangeset
for help on using the changeset viewer.