Changeset 459


Ignore:
Timestamp:
12/09/05 21:04:33 (19 years ago)
Author:
bittner
Message:

merge

Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/AxisAlignedBox3.h

    r448 r459  
    5555  } 
    5656 
    57         float Size(const int axis) const { 
     57  float Size(const int axis) const { 
    5858    return  Max(axis) - Min(axis); 
    5959  } 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Exporter.h

    r448 r459  
    135135  GetExporter(const string filename); 
    136136 
     137  virtual void ExportViewpoint(const Vector3 &point, const Vector3 &direction) = 0; 
     138 
    137139}; 
    138140  
  • trunk/VUT/GtpVisibilityPreprocessor/src/Makefile

    r450 r459  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (1.07a) (Qt 3.3.2) on: Mon Dec 05 09:51:45 2005 
     3# Generated by qmake (1.07a) (Qt 3.3.2) on: Mon Dec 05 10:27:34 2005 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    1313LEX             = flex 
    1414YACC            = byacc 
    15 CFLAGS  =       -nologo -Zm200 -W0 -MDd -Zi -Gm -GX  -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT 
    16 CXXFLAGS        =       -nologo -Zm200 -W0 -MDd -Zi -Gm -GX  -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT 
     15CFLAGS  =       -nologo -Zm200 -W0 -MD -O2 -G7 -GX  -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 
     16CXXFLAGS        =       -nologo -Zm200 -W0 -MD -O2 -G7 -GX  -DUNICODE -DWIN32 -DQT_DLL -DQT_THREAD_SUPPORT -DQT_NO_DEBUG 
    1717LEXFLAGS        = 
    1818YACCFLAGS       =-d 
    1919INCPATH =        -I"..\src" -I"..\support\xerces\include" -I"..\support\zlib\include" -I"..\support\boost" -I"..\support\devil\include" -I"$(QTDIR)\include" -I"d:\gametools\svn\trunk\VUT\GtpVisibilityPreprocessor\src" -I"C:\Qt\3.3.2\mkspecs\win32-msvc.net" 
    2020LINK    =       "c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\link.exe" 
    21 LFLAGS  =       /NOLOGO /DEBUG /SUBSYSTEM:CONSOLE /LIBPATH:"../support/xerces/lib" /LIBPATH:"../support/devil/lib" /LIBPATH:"$(QTDIR)\lib" 
     21LFLAGS  =       /NOLOGO /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll /SUBSYSTEM:CONSOLE /LIBPATH:"../support/xerces/lib" /LIBPATH:"../support/devil/lib" /LIBPATH:"$(QTDIR)\lib" 
    2222LIBS    =        "qt-mt332.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "delayimp.lib" "xerces-c_2.lib" "devil.lib" "ilu.lib" "ilut.lib" "opengl32.lib" "glu32.lib" 
    2323MOC             =       $(QTDIR)\bin\moc.exe 
     
    224224        -$(DEL_FILE) ViewCellsManager.obj 
    225225        -$(DEL_FILE) VspBspTree.obj 
    226         -$(DEL_FILE) preprocessor.pdb 
    227         -$(DEL_FILE) preprocessor.ilk 
    228         -$(DEL_FILE) vc*.pdb 
    229         -$(DEL_FILE) vc*.idb 
    230  
    231226 
    232227 
     
    380375                VspKdTree.h \ 
    381376                VssTree.h \ 
     377                VspBspTree.h \ 
    382378                RssTree.h \ 
    383379                Containers.h \ 
     
    636632                common.h \ 
    637633                Statistics.h \ 
     634                VssRay.h \ 
    638635                 
    639636 
     
    670667                Containers.h \ 
    671668                Statistics.h \ 
    672                 Intersectable.h \ 
    673                 Matrix4x4.h \ 
    674                 Material.h \ 
    675                 Pvs.h \ 
    676                 Rectangle3.h \ 
    677                 VssRay.h \ 
     669                VssRay.h \ 
     670                Intersectable.h \ 
     671                Matrix4x4.h \ 
     672                Material.h \ 
     673                Pvs.h \ 
     674                Rectangle3.h \ 
    678675                 
    679676 
     
    743740                ViewCellBsp.h \ 
    744741                ViewCell.h \ 
    745                 common.h \ 
    746                 Statistics.h \ 
    747                 Containers.h \ 
    748                 AxisAlignedBox3.h \ 
    749                 Ray.h \ 
    750                 Pvs.h \ 
    751                 Rectangle3.h \ 
    752                 Matrix4x4.h \ 
    753                 Vector3.h \ 
    754                 Plane3.h \ 
    755                 Mesh.h \ 
    756                 Polygon3.h \ 
    757                 Intersectable.h \ 
    758                 Material.h \ 
     742                VspBspTree.h \ 
     743                VspKdTree.h \ 
     744                common.h \ 
     745                Statistics.h \ 
     746                Containers.h \ 
     747                AxisAlignedBox3.h \ 
     748                Ray.h \ 
     749                Pvs.h \ 
     750                Rectangle3.h \ 
     751                Matrix4x4.h \ 
     752                Vector3.h \ 
     753                Plane3.h \ 
     754                Mesh.h \ 
     755                Polygon3.h \ 
     756                VssRay.h \ 
     757                Intersectable.h \ 
     758                Material.h \ 
     759                RayInfo.h \ 
    759760                 
    760761 
     
    815816                VssRay.h \ 
    816817                RssTree.h \ 
     818                ViewCellBsp.h \ 
    817819                Containers.h \ 
    818820                AxisAlignedBox3.h \ 
     
    874876                AxisAlignedBox3.h \ 
    875877                Exporter.h \ 
     878                ViewCellBsp.h \ 
    876879                Vector3.h \ 
    877880                Containers.h \ 
  • trunk/VUT/GtpVisibilityPreprocessor/src/RssPreprocessor.cpp

    r452 r459  
    1717 
    1818static bool exportPvs = false; 
     19static int numExportRays = 10000; 
     20// static int numExportRays = 0; 
    1921 
    2022RssPreprocessor::RssPreprocessor(): 
     
    215217        num = rssTree->GenerateRays(p, rays); 
    216218  } else { 
    217         int leaves = rssTree->stat.Leaves()/2; 
     219        int leaves = rssTree->stat.Leaves()/1; 
    218220        num = rssTree->GenerateRays(desiredSamples, leaves, rays); 
    219221  } 
     
    365367        exporter->SetFilled(); 
    366368        exporter->ExportGeometry(pvs); 
     369        exporter->SetWireframe(); 
     370        exporter->ExportBox(rssTree->bbox); 
     371        exporter->ExportViewpoint(rssTree->bbox.Center(), Vector3(1,0,0)); 
    367372        delete exporter; 
    368373  } 
     
    385390 
    386391  if (fromBoxVisibility) { 
    387         float size = 0.05f; 
     392        float m = box->Min(1); 
     393        float bsize = box->Size(1); 
     394 
     395        float size = 0.02f; 
    388396        float s = 0.5f - size; 
    389397        float olds = Magnitude(box->Size()); 
    390398        box->Enlarge(box->Size()*Vector3(-s)); 
    391         Vector3 translation = Vector3(-olds*0.1f, 0, 0); 
     399        //      Vector3 translation = Vector3(-olds*0.2f, 0, 0); 
     400        Vector3 translation = Vector3(-0.05*olds, 0, 0); 
    392401        box->SetMin(box->Min() + translation); 
    393402        box->SetMax(box->Max() + translation); 
     403 
     404        box->SetMin(1,  m + bsize*0.1); 
     405        box->SetMax(1,  m + bsize*0.6); 
     406 
     407         
    394408  } else { 
    395409                 
    396410        // sample city like heights 
    397         box->SetMin(1, box->Min(1) + box->Size(1)*0.2); 
    398         box->SetMax(1, box->Min(1) + box->Size(1)*0.3); 
     411        float m = box->Min(1); 
     412        float bsize = box->Size(1); 
     413        box->SetMin(1,  m + bsize*0.2); 
     414        box->SetMax(1,  m + bsize*0.3); 
    399415  } 
    400416 
     
    462478  cout << "#totalRayStackSize=" << mVssRays.size() << endl <<flush; 
    463479   
    464   int numExportRays = 10000; 
    465   //  int numExportRays = 0; 
    466480 
    467481  if (numExportRays) { 
     
    471485  } 
    472486   
    473   if (exportPvs) { 
    474         ExportPvs("rss-pvs-initial.x3d", rssTree); 
    475   } 
    476487 
    477488  // construct view cells 
     
    494505 
    495506  ExportRssTreeLeaves(rssTree, 10); 
     507 
     508  if (exportPvs) { 
     509        ExportPvs("rss-pvs-initial.x3d", rssTree); 
     510  } 
    496511 
    497512  // viewcells->UpdatePVS(newVssRays); 
     
    539554          int subdivided = rssTree->UpdateSubdivision(); 
    540555          cout<<"subdivided leafs = "<<subdivided<<endl; 
     556          cout<<"#total leaves = "<<rssTree->stat.Leaves()<<endl; 
     557 
    541558        } 
    542559 
  • trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.cpp

    r447 r459  
    17791779        Vector3 o3 = leaf->rays[r3].GetOrigin(); 
    17801780 
    1781         const float overlap = 0.1; 
     1781        const float overlap = 0.0; 
    17821782                 
    17831783        Vector3 origin, direction; 
    17841784        // generate half of convex combination and half of random rays 
    1785         bool useExtendedConvexCombination = (i > numberOfRays/2); 
     1785        bool useExtendedConvexCombination = 0 &&  (i > numberOfRays/2); 
    17861786        if (useExtendedConvexCombination) { 
    17871787          float w1, w2, w3; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VssRay.cpp

    r446 r459  
    166166  w1 = RandomValue(-overlap, 1.0f + overlap); 
    167167  w2 = RandomValue(-overlap, 1.0f + overlap); 
    168   w3 = RandomValue(-overlap, 1.0f + overlap); 
    169    
    170   float c = 1.0f/(w1 + w2 + w3); 
    171   w1 *= c; 
    172   w2 *= c; 
    173   w3 *= c; 
     168  w3 = 1.0f - w1 - w2; 
    174169} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.cpp

    r450 r459  
    13081308  return true; 
    13091309} 
     1310 
     1311 
     1312void 
     1313X3dExporter::ExportViewpoint(const Vector3 &point, 
     1314                                                         const Vector3 &direction) 
     1315{ 
     1316  stream<<"<Viewpoint "<<endl; 
     1317   
     1318  stream<<"position=\""<<point.x<<" "<<point.y<<" "<<point.z<<"\""<<endl; 
     1319  //  stream<<"orientation "<<direction.x<<direction.y<<direction.z<<endl; 
     1320   
     1321  stream<<">"<<endl; 
     1322  stream<<"</Viewpoint>"<<endl; 
     1323   
     1324} 
  • trunk/VUT/GtpVisibilityPreprocessor/src/X3dExporter.h

    r448 r459  
    143143                                                   const AxisAlignedBox3 &box,  
    144144                                                   const bool exportDepth, 
     145 
     146 
    145147                                                   const bool epsilon); 
     148 
     149  void ExportViewpoint(const Vector3 &point, const Vector3 &direction); 
     150 
    146151}; 
    147152  
  • trunk/VUT/GtpVisibilityPreprocessor/src/default.env

    r451 r459  
    1313#;../data/vienna/vienna-plane.x3d 
    1414# filename ../data/vienna/viewcells-25-sel.x3d 
    15 # filename ../data/atlanta/atlanta2.x3d 
     15 filename ../data/atlanta/atlanta2.x3d 
    1616# filename ../data/soda/soda.dat 
    17  filename ../data/soda/soda5.dat 
     17# filename ../data/soda/soda5.dat 
    1818} 
    1919 
     
    6464RssPreprocessor { 
    6565        samplesPerPass  100000 
    66         initialSamples 500000 
    67         vssSamples 5000000 
    68         vssSamplesPerPass 100000 
     66        initialSamples 1000000 
     67        vssSamples 1000000 
     68        vssSamplesPerPass 50000 
    6969        useImportanceSampling true 
    7070} 
     
    7575 
    7676        maxDepth        40 
    77         minPvs          5 
     77        minPvs          3 
    7878        minRays         30 
    7979        minSize         0.001 
     
    9090 
    9191        interleaveDirSplits     true 
    92     dirSplitDepth 9 
     92    dirSplitDepth 0 
    9393 
    9494        numberOfEndPointDomains 10000 
     
    179179                epsilon 0.005 
    180180        } 
    181  
    182181 
    183182        # random polygon       = 1 
  • trunk/VUT/GtpVisibilityPreprocessor/src/preprocessor.pro

    r450 r459  
    1717 
    1818# debuc config 
    19 CONFIG          += console warn_off thread debug 
     19CONFIG          += console warn_off thread release 
    2020 
    2121# RELEASE CONFIG 
Note: See TracChangeset for help on using the changeset viewer.