- Timestamp:
- 01/12/06 18:31:26 (19 years ago)
- Location:
- trunk/VUT/GtpVisibilityPreprocessor
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/scripts/default.env
r526 r530 9 9 # filename vienna.x3d 10 10 # filename ../data/vienna/vienna-simple.x3d 11 #filename ../data/vienna/vienna-buildings.x3d11 filename ../data/vienna/vienna-buildings.x3d 12 12 #filename ../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d 13 13 #;../data/vienna/vienna-plane.x3d … … 15 15 # filename ../data/atlanta/atlanta2.x3d 16 16 # filename ../data/soda/soda.dat 17 filename ../data/soda/soda5.dat17 # filename ../data/soda/soda5.dat 18 18 } 19 19 … … 21 21 # stored sample rays 22 22 samplesFilename rays.out 23 useGlRenderer true23 useGlRenderer false 24 24 # type sampling 25 25 type vss … … 181 181 maxViewCells 100000 182 182 #percentage of total visible objects where pvs is considered invalid 183 maxPvsRatio 0. 05183 maxPvsRatio 0.1 184 184 185 185 delayedConstruction true … … 199 199 colorCode Random 200 200 exportRays false 201 exportGeometry false201 exportGeometry true 202 202 } 203 203 … … 287 287 Termination { 288 288 # parameters used for autopartition 289 minRays 500289 minRays 400 290 290 minPolygons -1 291 291 maxDepth 30 292 292 minPvs 10 293 minArea 0.000 1293 minArea 0.00008 294 294 #minArea 0.000 295 295 maxRayContribution 0.3 -
trunk/VUT/GtpVisibilityPreprocessor/src/Beam.cpp
r526 r530 89 89 Vector3 directions[4]; 90 90 91 /*directions[0] = VssRay::GetDirection(dBox.Min().x, dBox.Min().y);91 directions[0] = VssRay::GetDirection(dBox.Min().x, dBox.Min().y); 92 92 directions[1] = VssRay::GetDirection(dBox.Max().x, dBox.Min().y); 93 93 directions[2] = VssRay::GetDirection(dBox.Max().x, dBox.Max().y); 94 94 directions[3] = VssRay::GetDirection(dBox.Min().x, dBox.Max().y); 95 */ 95 96 96 const Vector3 mainDir = directions[0] + directions[1] + directions[2] + directions[3]; 97 97 return Normalize(mainDir); -
trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp
r529 r530 8 8 9 9 #include <GL/glext.h> 10 11 12 10 #include <Cg/cg.h> 13 11 #include <Cg/cgGL.h> … … 15 13 static CGcontext sCgContext = NULL; 16 14 static CGprogram sCgFragmentProgram = NULL; 17 //static CGprofile sCgFragmentProfile;// = CG_PROFILE_FP30; 18 19 //static CGparameter sCgKdParam = NULL; 20 //static CGparameter sCgModelViewProjParam = NULL; 21 static CGprofile sCgFragmentProfile = CG_PROFILE_FP30; 15 static CGprofile sCgFragmentProfile; 22 16 23 17 GLuint depthMap; … … 163 157 CG_SOURCE, "../src/dual_depth.cg", 164 158 sCgFragmentProfile, 165 NULL,159 "dual_depth", 166 160 NULL); 167 161 } … … 588 582 glShadeModel(GL_FLAT); 589 583 glDisable(GL_LIGHTING); 590 // needed to kill fragments584 // needed to kill the fragments for the front buffer 591 585 glEnable(GL_ALPHA_TEST); 592 586 glAlphaFunc(GL_GREATER, 0); … … 812 806 viewPoint.x, viewPoint.y, viewPoint.z, 813 807 up.x, up.y, up.z); 814 } 808 } -
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.cpp
r527 r530 347 347 348 348 349 void VssPreprocess::VerifyBeamCasting() 350 { 351 352 vector<VssLeaf *> leaves; 353 mVssTree->CollectLeaves(leaves); 354 355 for (int i = 0; i < 10; ++i) 356 { 357 const int index = (int)RandomValue(0, (Real)((int)leaf.size() - 1)); 358 VssLeaf *leaf = leaves[index]; 359 360 Beam beam; 361 AxisAlignedBox3 dirBox = mVssTree->GetDirBBox(leaf); 362 AxisAlignedBox3 box = mVssTree->GetBBox(leaf); 363 beam.Construct(dirBox, box); 364 Intersectable *sourceObj = mObjects[5]; 365 BeamSampleStatistics stats; 366 mGlRenderer->SampleBeamContributions(sourceObj, 367 beam, 368 10000, 369 stats); 370 371 Debug << "beam statistics: " << stats << endl; 372 373 374 } 375 376 } 377 349 378 float 350 379 VssPreprocessor::GetAvgPvsSize(VssTree *tree, -
trunk/VUT/GtpVisibilityPreprocessor/src/VssPreprocessor.h
r517 r530 104 104 105 105 void CastRay(const BspTree &tree, const VssRay & vssRay); 106 107 float VerifyBeamCasting(Beam &beam); 106 108 }; 107 109 -
trunk/VUT/GtpVisibilityPreprocessor/src/dual_depth.cg
r528 r530 3 3 float4 position : POSITION; //screen position 4 4 float4 color0 : COLOR0; 5 float4 color1 : COLOR1; //lighting 6 float2 texcoord0 : TEXCOORD0; 7 float4 depthTexCoord: TEXCOORD1; 8 float3 normal : TEXCOORD2; 5 float4 depthTexCoord: TEXCOORD0; 9 6 }; 10 7 … … 15 12 }; 16 13 17 18 pixel main(fragment IN, 19 uniform sampler2D shadowMap: TEXUNIT1, 20 uniform float doTexturing) 14 pixel dual_depth(fragment IN, 15 const uniform sampler2D depthMap) 21 16 { 22 17 pixel OUT; 18 19 // the depth buffer has to be compared to the current depth 20 float4 depth = tex2D(depthMap, IN.depthTexCoord.xy); 21 float test = IN.depthTexCoord.z / IN.depthTexCoord.w; 23 22 24 float4 col = IN.color0;25 26 // the depth buffer27 float4 depth = tex2Dproj(shadowMap, IN.depthTexCoord);28 float test = IN.depthTexCoord.z / IN.depthTexCoord.w;29 23 // reject by alpha test 30 //if (test < depth.x) 31 // OUT.color[4] = 0; 32 33 //OUT.color = localcolor * shadow * IN.color1; 24 if (test < depth.x) 25 OUT.color.w = 0; 34 26 35 27 return OUT;
Note: See TracChangeset
for help on using the changeset viewer.