Changeset 1292


Ignore:
Timestamp:
08/28/06 21:13:40 (18 years ago)
Author:
bittner
Message:

intel ray caster updates

Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/preprocessor.bat

    r1218 r1292  
    11@PATH=%PATH%;..\bin 
    2 @..\bin\release\preprocessor.exe %1 %2 %3 %4 
     2@..\bin\release\preprocessor.exe %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r1272 r1292  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: út 22. VIII 22:47:13 2006 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: po 28. VIII 11:32:19 2006 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    7878                C:\Qt\4.1.2\mkspecs\features\win32\stl.prf \ 
    7979                C:\Qt\4.1.2\mkspecs\features\shared.prf \ 
    80                 C:\Qt\4.1.2\mkspecs\features\qt.prf \ 
    81                 C:\Qt\4.1.2\mkspecs\features\win32\opengl.prf \ 
    82                 C:\Qt\4.1.2\mkspecs\features\moc.prf \ 
    8380                C:\Qt\4.1.2\mkspecs\features\resources.prf \ 
    8481                C:\Qt\4.1.2\mkspecs\features\uic.prf 
     
    9996C:\Qt\4.1.2\mkspecs\features\win32\stl.prf: 
    10097C:\Qt\4.1.2\mkspecs\features\shared.prf: 
    101 C:\Qt\4.1.2\mkspecs\features\qt.prf: 
    102 C:\Qt\4.1.2\mkspecs\features\win32\opengl.prf: 
    103 C:\Qt\4.1.2\mkspecs\features\moc.prf: 
    10498C:\Qt\4.1.2\mkspecs\features\resources.prf: 
    10599C:\Qt\4.1.2\mkspecs\features\uic.prf: 
     
    116110distclean: release-distclean debug-distclean FORCE 
    117111        -$(DEL_FILE) Makefile 
    118  
    119 release-mocclean: $(MAKEFILE).Release 
    120         $(MAKE) -f $(MAKEFILE).Release mocclean 
    121 debug-mocclean: $(MAKEFILE).Debug 
    122         $(MAKE) -f $(MAKEFILE).Debug mocclean 
    123 mocclean: release-mocclean debug-mocclean 
    124  
    125 release-mocables: $(MAKEFILE).Release 
    126         $(MAKE) -f $(MAKEFILE).Release mocables 
    127 debug-mocables: $(MAKEFILE).Debug 
    128         $(MAKE) -f $(MAKEFILE).Debug mocables 
    129 mocables: release-mocables debug-mocables 
    130112FORCE: 
    131113 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.cpp

    r1287 r1292  
    6969 
    7070void 
    71 Mesh::Preprocess() 
    72 { 
     71Mesh::Preprocess(bool cleanup) 
     72{ 
     73  if (cleanup) 
    7374        Cleanup(); 
    7475  
  • GTP/trunk/Lib/Vis/Preprocessing/src/Mesh.h

    r1199 r1292  
    127127        because it creates the local kd tree and the bounding box. 
    128128        */ 
    129   void Preprocess(); 
     129  void Preprocess(const bool cleanup = true); 
    130130 
    131131  /** Applies transformation to the mesh. 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ObjParser.cpp

    r1286 r1292  
    4242        }; 
    4343 
    44 const static int nMaxFaces = 6; 
     44//const static int nMaxFaces = 6; 
    4545 
    4646 
     
    109109 
    110110        mesh->mFaces = faces; 
    111         mesh->Preprocess(); 
     111 
     112        // can't do cleanup because coupling with kdf file for intel ray tracer 
     113        mesh->Preprocess(false); 
    112114 
    113115        /*for (int i = 0; i < faces.size(); ++ i) 
     
    161163        int meshGrouping; 
    162164        Environment::GetSingleton()->GetIntValue("ObjParser.meshGrouping", meshGrouping); 
     165 
     166        int nMaxFaces = meshGrouping; 
    163167 
    164168        while (fgets(str, 80, file) != NULL) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r1291 r1292  
    2424#include "ArchModeler2MLRT.hxx" 
    2525#endif 
     26 
     27#define DEBUG_RAYCAST 0 
     28 
    2629 
    2730namespace GtpVisibilityPreprocessor { 
     
    454457} 
    455458 
     459   
     460bool 
     461Preprocessor::ConstructViewCells() 
     462{ 
     463  // if not already loaded, construct view cells from file 
     464  if (!mLoadViewCells) { 
     465        mViewCellsManager->SetViewSpaceBox(mKdTree->GetBox()); 
     466         
     467        // construct view cells using it's own set of samples 
     468        mViewCellsManager->Construct(this); 
     469         
     470        //-- several visualizations and statistics 
     471        Debug << "view cells construction finished: " << endl; 
     472        mViewCellsManager->PrintStatistics(Debug); 
     473  } 
     474  return true; 
     475} 
    456476 
    457477HierarchyManager *Preprocessor::CreateHierarchyManager(const char *name) 
     
    834854 
    835855        Vector3 pointA, pointB; 
    836          
    837         Intersectable *objectA =  
    838                 CastIntelSingleRay(viewPoint, direction, pointA, box); 
    839          
    840         // cast ray into other direction 
    841         Intersectable *objectB =  
    842                 CastIntelSingleRay(viewPoint, -direction, pointB, box); 
    843  
    844         const bool validSample = (objectA != objectB); 
    845          
    846         if (validSample)  
    847         {        
    848                 if (objectA)  
    849                 { 
    850                         vssRay = new VssRay(pointB, 
    851                                                                 pointA, 
    852                                                                 objectB, 
    853                                                                 objectA, 
    854                                                                 mPass, 
    855                                                                 probability 
    856                                                                 ); 
    857  
    858                         vssRays.push_back(vssRay); 
    859                         hits ++; 
    860                 } 
    861  
    862                 if (objectB)  
    863                 { 
    864                         vssRay = new VssRay(pointA, 
    865                                                                 pointB, 
    866                                                                 objectA, 
    867                                                                 objectB, 
    868                                                                 mPass, 
    869                                                                 probability 
    870                                                                 ); 
    871  
    872                         vssRays.push_back(vssRay); 
    873                         hits ++; 
    874                 } 
    875                 //Debug << "intel ray: " << *vssRay << endl; 
    876         } 
    877  
    878         //cout << "a"; 
    879         return hits; 
     856        Vector3 normalA, normalB; 
     857        Intersectable *objectA = NULL, *objectB = NULL; 
     858        float dist; 
     859         
     860        int hittriangle; 
     861        double normal[3]; 
     862        hittriangle = mlrtaIntersectAS(&viewPoint.x, 
     863                                                                   &direction.x, 
     864                                                                   normal, 
     865                                                                   dist); 
     866        if (hittriangle !=-1 ) { 
     867          if (hittriangle >= mFaceParents.size()) 
     868                cerr<<"Warning: traingle index out of range! "<<hittriangle<<endl; 
     869          else { 
     870                objectA = mFaceParents[hittriangle].mObject; 
     871                normalA = Vector3(normal[0], normal[1], normal[2]); 
     872                // Get the normal of that face 
     873                //              Mesh *mesh = ((MeshInstance *)objectA)->GetMesh(); 
     874                //              normalA = mesh->GetFacePlane(mFaceParents[forward_hit_triangles[i]].mFaceIndex).mNormal; 
     875                //-rays[index+i].mDirection; // $$ temporary 
     876                pointA = viewPoint + direction*dist; 
     877          } 
     878        } 
     879 
     880        Vector3 dir = -direction; 
     881        hittriangle = mlrtaIntersectAS(&viewPoint.x, 
     882                                                                   &dir.x, 
     883                                                                   normal, 
     884                                                                   dist); 
     885        if (hittriangle !=-1 ) { 
     886          if (hittriangle >= mFaceParents.size()) 
     887                cerr<<"Warning: traingle index out of range! "<<hittriangle<<endl; 
     888          else { 
     889                objectB = mFaceParents[hittriangle].mObject; 
     890                normalB = Vector3(normal[0], normal[1], normal[2]); 
     891                // Get the normal of that face 
     892                //              Mesh *mesh = ((MeshInstance *)objectB)->GetMesh(); 
     893                //              normalA = mesh->GetFacePlane(mFaceParents[forward_hit_triangles[i]].mFaceIndex).mNormal; 
     894                //-rays[index+i].mDirection; // $$ temporary 
     895                pointB = viewPoint + dir*dist; 
     896        } 
     897        } 
     898 
     899        return ProcessRay(viewPoint, 
     900                                          direction, 
     901                                          objectA, pointA, normalA, 
     902                                          objectB, pointB, normalB, 
     903                                          probability, 
     904                                          vssRays, 
     905                                          box 
     906                                          ); 
    880907} 
    881908 
     
    909936 
    910937        if (hittriangle == -1) 
    911         { 
     938          { 
    912939                static Ray ray; 
    913940                SetupRay(ray, viewPoint, direction); 
    914  
     941                 
    915942                float tmin = 0, tmax; 
    916943                if (box.ComputeMinMaxT(ray, &tmin, &tmax) && tmin < tmax) 
    917                 { 
     944                  { 
    918945                        tPoint = ray.Extrap(tmax); 
    919                 } 
    920  
     946                  } 
     947                 
    921948                return NULL; 
    922         } 
    923         else 
    924         { 
     949          } 
     950        else { 
     951          if (hittriangle >= mFaceParents.size()) { 
     952                cerr<<"Warning: traingle index out of range! "<<hittriangle<<endl; 
     953                return NULL; 
     954          } 
     955          else { 
     956                 
    925957                tPoint[0] = pforg[0] + pfdir[0] * dist; 
    926958                tPoint[1] = pforg[1] + pfdir[1] * dist; 
    927959                tPoint[2] = pforg[2] + pfdir[2] * dist; 
    928  
     960                 
    929961                return mFaceParents[hittriangle].mObject; 
    930         } 
     962          } 
     963        } 
     964         
    931965} 
    932966 
     
    10501084{ 
    10511085  int hits=0; 
    1052  
     1086#if DEBUG_RAYCAST 
     1087  Debug<<"PR "; 
     1088#endif 
    10531089  if (objectA == NULL && objectB == NULL) 
    10541090        return 0; 
    1055  
     1091   
    10561092  AxisAlignedBox3 sbox = box; 
    10571093  sbox.Enlarge(Vector3(-Limits::Small)); 
     
    11231159        } 
    11241160  } 
    1125    
     1161 
     1162 
    11261163  return hits; 
    11271164} 
     
    11351172  int i; 
    11361173  int num = 16; 
    1137    
     1174 
     1175#if DEBUG_RAYCAST 
     1176  Debug<<"C16 "<<flush; 
     1177#endif 
    11381178  if (mRayCastMethod == INTEL_RAYCASTER) { 
    11391179#ifdef GTP_INTERNAL 
     
    11441184  int backward_hit_triangles[16]; 
    11451185  float backward_dist[16]; 
    1146    
     1186 
     1187 
    11471188  Vector3 min = sbox.Min(); 
    11481189  Vector3 max = sbox.Max(); 
    1149    
    11501190  for (i=0; i < num; i++) { 
    11511191        mlrtaStoreRayAS16(&rays[index + i].mOrigin.x, 
     
    11611201 
    11621202  for (i=0; i < num; i++) { 
    1163         Vector3 dir = -rays[index+i].mDirection; 
     1203        Vector3 dir = -rays[index + i].mDirection; 
    11641204        mlrtaStoreRayAS16(&rays[index+i].mOrigin.x, 
    11651205                                          &dir.x, 
     
    11741214   
    11751215 
     1216 
    11761217  for (i=0; i < num; i++) { 
    11771218        Intersectable *objectA = NULL, *objectB = NULL; 
    11781219        Vector3 pointA, pointB; 
    11791220        Vector3 normalA, normalB; 
     1221 
     1222 
     1223   
    11801224        if (forward_hit_triangles[i] !=-1 ) { 
    1181           objectA = mFaceParents[forward_hit_triangles[i]].mObject; 
    1182           // Get the normal of that face 
    1183           Mesh *mesh = ((MeshInstance *)objectA)->GetMesh(); 
    1184           normalA = mesh->GetFacePlane(mFaceParents[forward_hit_triangles[i]].mFaceIndex).mNormal; 
    1185           //-rays[index+i].mDirection; // $$ temporary 
    1186           pointA = rays[index+i].Extrap(forward_dist[i]); 
     1225          if (forward_hit_triangles[i] >= mFaceParents.size()) 
     1226                cerr<<"Warning: traingle index out of range! "<<forward_hit_triangles[i]<<endl; 
     1227          else { 
     1228                objectA = mFaceParents[forward_hit_triangles[i]].mObject; 
     1229                // Get the normal of that face 
     1230                Mesh *mesh = ((MeshInstance *)objectA)->GetMesh(); 
     1231                normalA = mesh->GetFacePlane(mFaceParents[forward_hit_triangles[i]].mFaceIndex).mNormal; 
     1232                //-rays[index+i].mDirection; // $$ temporary 
     1233                pointA = rays[index+i].Extrap(forward_dist[i]); 
     1234          } 
    11871235        } 
    11881236         
    11891237        if (backward_hit_triangles[i]!=-1) { 
    1190           objectB = mFaceParents[backward_hit_triangles[i]].mObject; 
    1191           Mesh *mesh = ((MeshInstance *)objectB)->GetMesh(); 
    1192  
    1193           normalB = mesh->GetFacePlane(mFaceParents[backward_hit_triangles[i]].mFaceIndex).mNormal; 
    1194            
    1195           //      normalB = rays[index+i].mDirection; // $$ temporary 
    1196           pointB = rays[index+i].Extrap(-backward_dist[i]); 
    1197         } 
    1198          
     1238          if (backward_hit_triangles[i] >= mFaceParents.size()) 
     1239                cerr<<"Warning: traingle index out of range! "<<backward_hit_triangles[i]<<endl; 
     1240          else { 
     1241                objectB = mFaceParents[backward_hit_triangles[i]].mObject; 
     1242                Mesh *mesh = ((MeshInstance *)objectB)->GetMesh(); 
     1243                 
     1244                normalB = mesh->GetFacePlane(mFaceParents[backward_hit_triangles[i]].mFaceIndex).mNormal; 
     1245                 
     1246                //        normalB = rays[index+i].mDirection; // $$ temporary 
     1247                pointB = rays[index+i].Extrap(-backward_dist[i]); 
     1248          } 
     1249        } 
     1250 
    11991251        ProcessRay(rays[index+i].mOrigin, 
    12001252                           rays[index+i].mDirection, 
     
    12071259  } 
    12081260#endif 
     1261   
    12091262  } else { 
    12101263 
     
    12171270        } 
    12181271  } 
    1219    
     1272#if DEBUG_RAYCAST 
     1273  Debug<<"C16F\n"<<flush; 
     1274#endif 
    12201275} 
    12211276 
     
    12361291          i += 16; 
    12371292        } else { 
     1293 
    12381294          CastRay(rays[i].mOrigin, 
    12391295                          rays[i].mDirection, 
     
    12411297                          vssRays, 
    12421298                          mViewCellsManager->GetViewSpaceBox()); 
     1299 
    12431300          i++; 
    12441301        } 
     
    12521309} 
    12531310 
    1254  
    1255 int Preprocessor::CastRay( 
    1256                                                   const Vector3 &viewPoint, 
    1257                                                   const Vector3 &direction, 
    1258                                                   const float probability, 
    1259                                                   VssRayContainer &vssRays, 
    1260                                                   const AxisAlignedBox3 &box 
    1261                                                   ) 
    1262 { 
    1263         switch (mRayCastMethod) 
     1311Intersectable * 
     1312Preprocessor::CastSimpleRay( 
     1313                                                        const Vector3 &viewPoint, 
     1314                                                        const Vector3 &direction, 
     1315                                                        const AxisAlignedBox3 &box, 
     1316                                                        Vector3 &point, 
     1317                                                        Vector3 &normal 
     1318                                                        ) 
     1319{ 
     1320  Intersectable *result = NULL; 
     1321  switch (mRayCastMethod) 
     1322        { 
     1323        case INTEL_RAYCASTER: { 
     1324          float dist; 
     1325          int hittriangle; 
     1326          double n[3]; 
     1327          hittriangle = mlrtaIntersectAS(&viewPoint.x, 
     1328                                                                         &direction.x, 
     1329                                                                         n, 
     1330                                                                         dist); 
     1331          if (hittriangle !=-1 ) { 
     1332                if (hittriangle >= mFaceParents.size()) 
     1333                  cerr<<"Warning: traingle index out of range! "<<hittriangle<<endl; 
     1334                else { 
     1335                  result = mFaceParents[hittriangle].mObject; 
     1336                  normal = Vector3(n[0], n[1], n[2]); 
     1337                  point = viewPoint + direction*dist; 
     1338                } 
     1339          } 
     1340          break; 
     1341        } 
     1342        case INTERNAL_RAYCASTER: 
     1343        default: { 
     1344          static Ray ray; 
     1345           
     1346          ray.intersections.clear(); 
     1347          // do not store anything else then intersections at the ray 
     1348          ray.Init(viewPoint, direction, Ray::LOCAL_RAY); 
     1349           
     1350          ray.mFlags &= ~Ray::CULL_BACKFACES; 
     1351           
     1352          if (mKdTree->CastRay(ray)) { 
     1353                result = ray.intersections[0].mObject; 
     1354                point = ray.Extrap(ray.intersections[0].mT); 
     1355                normal = ray.intersections[0].mNormal; 
     1356          } 
     1357          break; 
     1358        } 
     1359        } 
     1360  return result; 
     1361} 
     1362 
     1363int 
     1364Preprocessor::CastRay( 
     1365                                          const Vector3 &viewPoint, 
     1366                                          const Vector3 &direction, 
     1367                                          const float probability, 
     1368                                          VssRayContainer &vssRays, 
     1369                                          const AxisAlignedBox3 &box 
     1370                                          ) 
     1371{ 
     1372#if DEBUG_RAYCAST 
     1373  Debug<<"CR "<<flush; 
     1374#endif 
     1375  switch (mRayCastMethod) 
    12641376        { 
    12651377        case INTEL_RAYCASTER: 
     
    12691381                return CastInternalRay(viewPoint, direction, probability, vssRays, box); 
    12701382        } 
     1383#if DEBUG_RAYCAST 
     1384  Debug<<"CRF "<<flush; 
     1385#endif   
    12711386} 
    12721387 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r1288 r1292  
    8787  */ 
    8888  bool PrepareViewCells(); 
    89    
     89 
     90  /** Construct viewcells (if not already loaded) */ 
     91  bool 
     92  ConstructViewCells(); 
     93 
    9094  /** Returns the specified sample strategy, NULL if no valid strategy. 
    9195  */ 
     
    168172          ); 
    169173 
     174  Intersectable * 
     175  CastSimpleRay( 
     176                                const Vector3 &viewPoint, 
     177                                const Vector3 &direction, 
     178                                const AxisAlignedBox3 &box, 
     179                                Vector3 &point, 
     180                                Vector3 &normal 
     181                                ); 
     182   
    170183  //////////////////////////////////////////////// 
    171184 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.icproj

    r1283 r1292  
    115115                        <Tool  
    116116                                Name="CppCmplrTool" 
    117                                 Optimization="1000" 
    118                                 GlobalOptimizations="1" 
     117                                Optimization="2" 
     118                                GlobalOptimizations="0" 
    119119                                InlineFunctionExpansion="0" 
    120                                 EnableIntrinsicFunctions="1" 
     120                                EnableIntrinsicFunctions="0" 
    121121                                FavorSizeOrSpeed="1" 
    122                                 OmitFramePointers="1" 
    123                                 EnableFiberSafeOptimizations="1" 
     122                                OmitFramePointers="0" 
     123                                EnableFiberSafeOptimizations="0" 
    124124                                OptimizeForProcessor="3" 
    125125                                OptimizeForWindowsApplication="1" 
     
    135135                                WarningLevel="2" 
    136136                                Detect64BitPortabilityProblems="1" 
    137                                 DebugInformationFormat="3" 
    138                                 UseProcExt="4" 
    139                                 Parallelization="1"/> 
     137                                DebugInformationFormat="3"/> 
    140138                        <Tool  
    141139                                Name="LinkerTool" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj

    r1287 r1292  
    115115                                Name="VCCLCompilerTool" 
    116116                                Optimization="2" 
    117                                 GlobalOptimizations="TRUE" 
     117                                GlobalOptimizations="FALSE" 
    118118                                InlineFunctionExpansion="0" 
    119                                 EnableIntrinsicFunctions="TRUE" 
     119                                EnableIntrinsicFunctions="FALSE" 
    120120                                FavorSizeOrSpeed="1" 
    121                                 OmitFramePointers="TRUE" 
    122                                 EnableFiberSafeOptimizations="TRUE" 
     121                                OmitFramePointers="FALSE" 
     122                                EnableFiberSafeOptimizations="FALSE" 
    123123                                OptimizeForProcessor="3" 
    124124                                OptimizeForWindowsApplication="TRUE" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/RssPreprocessor.cpp

    r1283 r1292  
    503503   
    504504  long startTime = GetTime(); 
     505  long lastTime; 
     506  float totalTime; 
    505507   
    506508  int totalSamples = 0; 
     
    602604        mViewCellsManager->ComputeSampleContributions(mVssRays, true, false); 
    603605        cout<<"done.\n"<<flush; 
     606 
     607        long time = GetTime(); 
     608        totalTime = TimeDiff(startTime, time)*1e-3; 
     609        lastTime = time; 
    604610         
    605611        mStats << 
    606612          "#Pass\n" <<mPass<<endl<< 
    607613          "#RssPass\n" <<rssPass<<endl<< 
    608           "#Time\n" << TimeDiff(startTime, GetTime())*1e-3<<endl<< 
     614          "#Time\n" << totalTime <<endl<< 
    609615          "#TotalSamples\n" <<totalSamples<<endl<< 
    610616          "#RssSamples\n" <<rssSamples<<endl; 
     
    748754           
    749755          // now evaluate the ratios for the next pass 
    750 #define TIMES 0 
     756#define TIMES 1 
    751757 
    752758#if TIMES 
     
    800806                                                                                                                                                   mInitialSamples)<<"%\n"; 
    801807         
     808 
     809        long time = GetTime(); 
     810        totalTime += TimeDiff(lastTime, time); 
     811        lastTime = time; 
    802812         
    803813        mStats << 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SamplingPreprocessor.cpp

    r1251 r1292  
    1515 
    1616 
    17 SamplingPreprocessor::SamplingPreprocessor(): mPass(0) 
     17SamplingPreprocessor::SamplingPreprocessor(): Preprocessor(), mPass(0) 
    1818{ 
    1919  // this should increase coherence of the samples 
     
    3636                                                          ) 
    3737{ 
    38   static Ray ray; 
    3938  AxisAlignedBox3 box = mViewCellsManager->GetViewSpaceBox(); 
    4039   
     
    4342  if (!sbox.IsInside(origin)) 
    4443        return 0; 
    45          
    46   ray.intersections.clear(); 
    47   // do not store anything else then intersections at the ray 
    48   ray.Init(origin, direction, Ray::LOCAL_RAY); 
    49  
    50   ray.mFlags &= ~Ray::CULL_BACKFACES; 
    51  
    52  
     44   
     45  Vector3 point, normal; 
     46  Intersectable *object; 
    5347 
    5448  // cast ray to KD tree to find intersection with other objects 
    55   Intersectable *objectA = NULL; 
    56   Vector3 pointA; 
    57   float bsize = Magnitude(box.Size()); 
    58    
    59   if (mKdTree->CastRay(ray)) { 
    60         if (!mDetectEmptyViewSpace || DotProd(ray.intersections[0].mNormal, direction) < 0) { 
    61           objectA = ray.intersections[0].mObject; 
    62           pointA = ray.Extrap(ray.intersections[0].mT); 
    63         } 
    64   } 
    65   return objectA; 
     49  object = CastSimpleRay(origin, 
     50                                                 direction, 
     51                                                 mKdTree->GetBox(), 
     52                                                 point, 
     53                                                 normal 
     54                                                 ); 
     55   
     56  if (mDetectEmptyViewSpace && DotProd(normal, direction) >= 0) { 
     57        object = NULL; 
     58  } 
     59   
     60  return object; 
    6661} 
    6762 
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.icproj

    r1283 r1292  
    126126                        <Tool  
    127127                                Name="CppCmplrTool" 
    128                                 Optimization="3" 
     128                                Optimization="2" 
    129129                                GlobalOptimizations="0" 
    130130                                FavorSizeOrSpeed="1" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj

    r1287 r1292  
    130130                        <Tool 
    131131                                Name="VCCLCompilerTool" 
    132                                 Optimization="3" 
     132                                Optimization="2" 
    133133                                GlobalOptimizations="FALSE" 
    134134                                FavorSizeOrSpeed="1" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.h

    r1291 r1292  
    190190        bool Mailed() const { return mMailbox == sMailId; } 
    191191 
     192 
    192193        static int sMailId; 
    193194        int mMailbox; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/default.env

    r1283 r1292  
    5656} 
    5757 
     58ObjParser { 
     59        meshGrouping 500 
     60} 
    5861 
    5962RenderSampler { 
     
    104107 
    105108SamplingPreprocessor { 
    106         totalSamples 30000000 
     109        totalSamples 10000000 
    107110        samplesPerPass 1000000 
    108111} 
     
    112115        initialSamples 1000000 
    113116        vssSamples 10000000 
    114         vssSamplesPerPass 500000 
     117        vssSamplesPerPass 1000000 
    115118        useImportanceSampling true 
    116119 
     
    192195} 
    193196 
     197 
    194198MeshKdTree { 
    195199        Termination { 
    196                 minCost 32 
     200                minCost 150 
    197201                maxDepth 18 
    198202                maxCostRatio 0.9 
     
    221225 
    222226        #number of active view cells 
    223         active 5000 
     227        active 1000 
    224228        maxStaticMemory 200 
    225229 
     
    234238         
    235239        height 5.0 
    236         maxViewCells 5000 
     240        maxViewCells 1000 
    237241 
    238242        #percentage of total visible objects where pvs is considered invalid 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r1284 r1292  
    143143        MeshKdTree::ParseEnvironment(); 
    144144 
     145         
    145146        char buff[128]; 
    146147        Environment::GetSingleton()->GetStringValue("Preprocessor.type", buff); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro

    r1272 r1292  
    1 #CONFIG -= qt  
    2 CONFIG  += console warn_off thread release 
     1CONFIG -= qt debug 
     2CONFIG  += console warn_off thread release mlrt 
    33 
    44TEMPLATE = app 
     
    2929win32:LIBPATH += GL $$NONGTP/Xerces/xerces/lib $$NONGTP/Devil/lib \ 
    3030  $$NONGTP/glut $$NONGTP/Boost/lib $$NONGTP/Zlib/lib  
     31 
    3132 
    3233CONFIG(qt) { 
     
    6465} 
    6566 
     67 
     68CONFIG(mlrt) { 
     69 
     70CONFIG(release) { 
     71LIBPATH += ../MultiLevelRayTracing/RTScene/Release \ 
     72../MultiLevelRayTracing/RTWorld/Release 
     73} 
     74 
     75CONFIG(debug) { 
     76LIBPATH += ../MultiLevelRayTracing/RTScene/Debug \ 
     77../MultiLevelRayTracing/RTWorld/Debug 
     78} 
     79 
     80LIBS += RTScene.lib RTWorld.lib 
     81DEFINES += GTP_INTERNAL 
     82INCLUDEPATH += ../MultiLevelRayTracing 
     83} 
     84 
     85 
    6686QMAKE_LFLAGS_CONSOLE=/NODEFAULTLIB:LIBCMT 
    6787 
     
    91111VrmlExporter.cpp PlyParser.cpp plyfile.c RenderSampler.cpp \ 
    92112GzBinFileInputStream.cpp  GzFileInputSource.cpp \ 
    93 LogManager.cpp \ 
     113LogManager.cpp VspTree.cpp \ 
    94114SamplingStrategy.cpp KdIntersectable.cpp \ 
    95 OspTree.cpp HierarchyManager.cpp ObjParser.cpp VspTree.cpp \ 
     115OspTree.cpp HierarchyManager.cpp ObjParser.cpp \ 
    96116BvHierarchy.cpp  \ 
    97117BoostPreprocessorThread.cpp  
     118 
    98119 
    99120 
Note: See TracChangeset for help on using the changeset viewer.