Changeset 511


Ignore:
Timestamp:
01/10/06 11:59:58 (18 years ago)
Author:
mattausch
Message:
 
Location:
trunk/VUT/GtpVisibilityPreprocessor/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/Beam.cpp

    r510 r511  
     1#include "VssRay.h" 
    12#include "Beam.h" 
    2 #include "VssRay.h" 
    3  
    43 
    54 
    65 
    76void 
    8 Beam::Construct(const  AxisAlignedBox3 &box, 
     7MyBeam::Construct(const  AxisAlignedBox3 &box, 
    98                                const  AxisAlignedBox3 &dBox) 
    109{ 
     
    5453 
    5554int 
    56 Beam::ComputeIntersection(const AxisAlignedBox3 &box) 
     55MyBeam::ComputeIntersection(const AxisAlignedBox3 &box) 
    5756{ 
    5857  int i; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Beam.h

    r507 r511  
    33 
    44#include <vector> 
     5#include "AxisAlignedBox3.h" 
     6 
    57using namespace std; 
    68 
    79class KdNode; 
    810class Intersectable; 
    9 #include "AxisAlignedBox3.h" 
    1011 
    11 class Beam { 
     12class MyBeam { 
    1213   
    1314public:                  
     
    2829  vector<Plane3> mPlanes; 
    2930 
     31     
     32  void Construct(const AxisAlignedBox3 &box, 
     33          const AxisAlignedBox3 &dBox); 
     34   
     35   
     36  int 
     37          ComputeIntersection(const AxisAlignedBox3 &box); 
     38 
    3039  bool IsValid() { return mFlags & VALID; } 
    3140  bool SetValid() { return mFlags |= VALID; } 
    3241 
    33   Beam():mFlags(STORE_KD_NODES+STORE_OBJECTS),mKdNodes(0), mObjects(0) 
     42  MyBeam():mFlags(STORE_KD_NODES+STORE_OBJECTS), mKdNodes(0), mObjects(0) 
    3443  { 
    3544  } 
    36    
    37   void Construct(const  AxisAlignedBox3 &box, 
    38                                  const  AxisAlignedBox3 &dBox); 
    39    
    40    
    41   int 
    42   ComputeIntersection(const  AxisAlignedBox3 &box); 
    43  
    4445   
    4546}; 
  • trunk/VUT/GtpVisibilityPreprocessor/src/Environment.cpp

    r508 r511  
    12291229                        "0"); 
    12301230 
    1231         RegisterOption("ViewCells.maxPvs", 
    1232                                         optInt, 
    1233                                         "view_cells_max_pvs=", 
    1234                                         "300"); 
     1231        RegisterOption("ViewCells.maxPvsRatio", 
     1232                                        optFloat, 
     1233                                        "view_cells_max_pvs_ratio=", 
     1234                                        "0.1"); 
    12351235 
    12361236        RegisterOption("ViewCells.filename", 
  • trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.cpp

    r507 r511  
    55#include "Pvs.h" 
    66#include "Viewcell.h" 
    7 #include "Beam.cpp" 
     7#include "Beam.h" 
    88 
    99#include <GL/glext.h> 
     
    118118  glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC) 
    119119        wglGetProcAddress("glGetOcclusionQueryuivNV"); 
     120 
     121  // second depth buffer texture 
     122  GLuint shadowMap; 
     123  const int shadowMapSize=512; 
     124  
     125 
     126  glGenTextures(1, &shadowMap); 
     127  glBindTexture(GL_TEXTURE_2D, shadowMap); 
     128   
     129  glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, shadowMapSize,  
     130          shadowMapSize, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); 
     131  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 
     132  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 
     133  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); 
     134  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); 
    120135} 
    121136 
     
    535550GlRendererBuffer::SampleBeamContributions( 
    536551                                                                                  Intersectable *sourceObject, 
    537                                                                                   Beam &beam, 
     552                                                                                  MyBeam &beam, 
    538553                                                                                  const int desiredSamples, 
    539554                                                                                  BeamSampleStatistics &stat 
     
    589604GlRendererBuffer::SampleViewpointContributions( 
    590605                                                                                           Intersectable *sourceObject, 
    591                                                                                            Beam &beam, 
     606                                                                                           MyBeam &beam, 
    592607                                                                                           const int desiredSamples, 
    593608                                                                                           BeamSampleStatistics &stat 
  • trunk/VUT/GtpVisibilityPreprocessor/src/GlRenderer.h

    r507 r511  
    1717class Intersectable; 
    1818class Material; 
    19 class Beam; 
     19class MyBeam; 
    2020 
    2121struct PvsRenderStatistics { 
     
    159159  void SampleBeamContributions( 
    160160                                                           Intersectable *sourceObject, 
    161                                                            Beam &beam, 
     161                                                           MyBeam &beam, 
    162162                                                           const int samples, 
    163163                                                           BeamSampleStatistics &stat 
     
    167167  SampleViewpointContributions( 
    168168                                                           Intersectable *sourceObject, 
    169                                                            Beam &beam, 
     169                                                           MyBeam &beam, 
    170170                                                           const int desiredSamples, 
    171171                                                           BeamSampleStatistics &stat 
  • trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.cpp

    r507 r511  
    968968int 
    969969KdTree::CastBeam( 
    970                                  Beam &beam 
     970                                 MyBeam &beam 
    971971                                 ) 
    972972{ 
  • trunk/VUT/GtpVisibilityPreprocessor/src/KdTree.h

    r505 r511  
    1616class Intersectable; 
    1717//class KdViewCell; 
    18 class Beam; 
     18class MyBeam; 
    1919 
    2020// -------------------------------------------------------------- 
     
    289289  int 
    290290  CastBeam( 
    291                    Beam &beam 
     291                   MyBeam &beam 
    292292                   ); 
    293293   
  • trunk/VUT/GtpVisibilityPreprocessor/src/RssTree.h

    r507 r511  
    2222#include "AxisAlignedBox3.h" 
    2323#include "Halton.h" 
    24 #include "beam.h" 
     24#include "Beam.h" 
     25#include "Statistics.h" 
     26#include "Ray.h" 
     27 
     28#include "Containers.h" 
    2529 
    2630#define USE_KDNODE_VECTORS 1 
     
    2933 
    3034 
    31 #include "Statistics.h" 
    32 #include "Ray.h" 
    33  
    34 #include "Containers.h" 
    3535// -------------------------------------------------------------- 
    3636// Static statistics for kd-tree search 
     
    420420  HaltonSequence halton; 
    421421 
    422   Beam mBeam; 
     422  MyBeam mBeam; 
    423423   
    424424  RssTreeLeaf(RssTreeInterior *p, 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.cpp

    r509 r511  
    8787        environment->GetBoolValue("VspBspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 
    8888        environment->GetBoolValue("VspBspTree.PostProcess.useRaysForMerge", mUseRaysForMerge); 
    89         environment->GetIntValue("ViewCells.maxPvs", mMaxPvs); 
     89 
     90        environment->GetIntValue("ViewCells.pvsInvalid", mMaxPvsRatio); 
    9091 
    9192        //-- termination criteria for axis aligned split 
     
    275276        Intersectable::NewMail(); 
    276277 
     278        int numObj = 0; 
    277279        //-- extract polygons intersected by the rays 
    278280        for (rit = sampleRays.begin(); rit != rit_end; ++ rit) 
     
    287289                        MeshInstance *obj = dynamic_cast<MeshInstance *>(ray->mTerminationObject); 
    288290                        AddMeshToPolygons(obj->GetMesh(), polys, obj); 
     291                        ++ numObj; 
    289292                        //-- compute bounding box 
    290293                        if (!forcedBoundingBox) 
     
    299302                        MeshInstance *obj = dynamic_cast<MeshInstance *>(ray->mOriginObject); 
    300303                        AddMeshToPolygons(obj->GetMesh(), polys, obj); 
     304                        ++ numObj; 
     305 
    301306                        //-- compute bounding box 
    302307                        if (!forcedBoundingBox) 
     
    305310        } 
    306311 
    307         //-- compute bounding box 
    308         //if (!forcedBoundingBox) Polygon3::IncludeInBox(polys, mBox); 
     312        mMaxPvs = (int)(mMaxPvsRatio * (float)numObj); 
    309313 
    310314        //-- store rays 
  • trunk/VUT/GtpVisibilityPreprocessor/src/VspBspTree.h

    r508 r511  
    692692        int mMaxPvs; 
    693693 
     694        int mMaxPvsRatio; 
     695 
    694696        /// View cell corresponding to the space outside the valid view space 
    695697        BspViewCell *mOutOfBoundsCell; 
Note: See TracChangeset for help on using the changeset viewer.