Changeset 3279 for GTP


Ignore:
Timestamp:
01/15/09 16:32:50 (15 years ago)
Author:
mattausch
Message:

problems with reimporting of my exported scenes

Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/default.env

    r3277 r3279  
    99#filename=vienna_full_hp 
    1010#bvhname=vienna_full_hp 
    11 filename=tryvienna 
    12 bvhname=tryvienna 
    13 filename=mypompeii 
    14 bvhname=mypompeii 
    15 #filename=pompeii/pompeii_full 
     11#filename=tryvienna 
     12#bvhname=tryvienna 
     13#filename=mypompeii 
     14#bvhname=mypompeii 
     15filename=pompeii/pompeii_full 
    1616#filename=pompeii/pompeii_part 
    1717#filename=city 
     
    2323recordedFramesSuffix=image 
    2424# the filename for the statistics 
    25 statsFilename=mystats.log 
     25statsFilename=mystats 
    2626walkThroughSuffix=walkthrough_pp_1 
    2727#walkThroughSuffix=path_pp 
     
    3232# if using pvs, this specifies the name of the visibility solutin 
    3333#visibilitySolution=vienna_full-8x3-pgv 
    34 visibilitySolution=mypompeii-1x1-pgv 
     34#visibilitySolution=mypompeii-1x1-pgv 
     35visibilitySolution=mypompeii-2x1-obvh-pgv 
     36#visibilitySolution=myvienna-3x1-obvh-pgv 
    3537 
    3638viewCellsScaleFactor=1.0f 
    3739useSkylightForIllum=1 
     40 
     41skyDomeScaleFactor=80.0f 
    3842 
    3943 
     
    6266camPosition=483.398f 242.364f 186.078f 
    6367# pompeii view point 
    64 camPosition=1300.0f -2500.0f 10.0f 
     68#camPosition=1300.0f -2500.0f 10.0f 
    6569# pompeii problematic 
    6670#camPosition=627.003 -1725.33 25.2 
     
    108112# skylight turbitity 
    109113turbitity=3.0f 
     114#sky dome scale factor 
    110115 
    111116 
     
    143148#camDirection=-0.0975121 0.994494 0.0383878 
    144149#useSkylightForIllum=1 
     150#skyDomeScaleFactor=1000.0f 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/BvhExporter.cpp

    r3274 r3279  
    2121         
    2222        int buffer[4]; 
     23        buffer[3] = currentIdx ++; 
    2324 
    2425        if (node->IsVirtualLeaf())  
     
    2930                buffer[1] = mTriangleRangeMap[leaf].second; 
    3031                buffer[2] = -1;//leaf->GetAxis(); 
    31                 buffer[3] = currentIdx ++; 
    32  
     32                 
    3333                fwrite(buffer, sizeof(int), 4, fw); 
    3434        } 
     
    4040                buffer[1] = interior->mLast; 
    4141                buffer[2] = 0;//interior->mAxis; 
    42                 buffer[3] = currentIdx ++; 
    4342 
    4443                fwrite(buffer, sizeof(int), 4, fw); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Matrix4x4.cpp

    r3103 r3279  
    401401 
    402402 
     403// uniform scale 
     404Matrix4x4 ScaleMatrix(float x) 
     405{ 
     406        Matrix4x4 M = IdentityMatrix(); 
     407 
     408        M.x[0][0] = x; 
     409        M.x[1][1] = x; 
     410        M.x[2][2] = x; 
     411 
     412        return M; 
     413} 
     414 
    403415// Construct a rotation matrix that makes the x, y, z axes 
    404416// correspond to the vectors given. 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Matrix4x4.h

    r3102 r3279  
    145145                                                                const Vector3 &vecTo); 
    146146Matrix4x4 ScaleMatrix(float X, float Y, float Z); 
     147Matrix4x4 ScaleMatrix(float x); 
    147148Matrix4x4 GenRotation(const Vector3 &x, const Vector3 &y, 
    148149                                          const Vector3 &z); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp

    r3276 r3279  
    9797                                                                Camera *camera,  
    9898                                                                RenderState *state,  
    99                                                                 bool scaleToRange) 
     99                                                                bool scaleToRange, 
     100                                                                float skyDomeScaleFactor) 
    100101{ 
    101102        pair<float, float> sun_theta; 
     
    109110 
    110111        // scale the sky dome so no intersection with the scene is visible 
    111         //const float scaleFactor = 80.0f; 
    112         const float scaleFactor = 1000.0f; 
    113  
    114         position.z -= 3.0f * scaleFactor; 
     112        position.z -= 3.0f * skyDomeScaleFactor; 
    115113        Matrix4x4 m = TranslationMatrix(position); 
    116114 
    117         Matrix4x4 s = ScaleMatrix(scaleFactor, scaleFactor, scaleFactor); 
     115        Matrix4x4 s = ScaleMatrix(skyDomeScaleFactor); 
    118116        mSkyDome->GetTransform()->SetMatrix(s * m); 
    119117         
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.h

    r3085 r3279  
    2626                               CHCDemoEngine::Camera *camera,  
    2727                                           CHCDemoEngine::RenderState *state,  
    28                                            bool scaleToRange); 
     28                                           bool scaleToRange, 
     29                                           float skyDomeScaleFactor); 
    2930 
    3031        void ComputeFactors(const CHCDemoEngine::Vector3 &sunDir,  
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp

    r3271 r3279  
    3838 
    3939        ViewCellsTree *viewCellsTree = new ViewCellsTree(); 
    40  
    4140        bool ok = viewCellsTree->_LoadFromFile(fr, viewCellsScaleFactor); 
    4241 
     
    10099                nodes.push_back(node); 
    101100 
    102                 if (!node->IsLeaf()) 
     101                if (!node->IsVirtualLeaf()) 
    103102                { 
    104103                        BvhInterior *interior = static_cast<BvhInterior *>(node); 
     
    116115 
    117116 
     117bool VisibilitySolutionLoader::CreateIdSortedList2(BvhNode *n, 
     118                                                                                                   BvhNodeContainer &nodes) 
     119{ 
     120        nodes.push_back(n); 
     121 
     122        if (!n->IsVirtualLeaf()) 
     123        { 
     124                BvhInterior *interior = static_cast<BvhInterior *>(n); 
     125 
     126                BvhNode *front = interior->GetFront(); 
     127                BvhNode *back = interior->GetBack(); 
     128 
     129                CreateIdSortedList2(front, nodes); 
     130                CreateIdSortedList2(back, nodes); 
     131        } 
     132 
     133        return true; 
     134} 
     135 
     136 
    118137bool VisibilitySolutionLoader::LoadPvs(FILE *fw, Bvh *bvh) 
    119138{ 
    120139        int number, entries; 
    121  
    122140        fread(&number, sizeof(int), 1, fw); 
    123141 
     
    135153 
    136154        BvhNodeContainer nodes; 
    137         CreateIdSortedList(bvh, nodes); 
    138          
     155        CreateIdSortedList2(bvh->GetStaticRoot(), nodes); 
     156        //CreateIdSortedList(bvh, nodes); 
     157        ofstream outstream("test.log"); 
     158 
     159        for (size_t i = 0; i < nodes.size(); ++ i) 
     160                outstream << "id " << nodes[i]->GetId() << endl; 
     161 
     162        outstream.close(); 
     163         
     164 
    139165        for (int i = 0; i < number; ++ i)  
    140166        { 
     
    194220                        AxisAlignedBox3 newBox1 = box; 
    195221                        AxisAlignedBox3 newBox2 = box; 
    196                         /*if (node->mPosition < newBox.Min(node->mAxis)) 
    197                                 cout << "e: " << node->mPosition << " " << newBox.Min(node->mAxis) << endl; 
    198                         else if (node->mPosition > newBox.Min(node->mAxis)) 
    199                                 cout << "o: " << node->mPosition << " " << newBox.Min(node->mAxis) << endl; 
    200 */ 
     222                 
    201223                        newBox1.SetMin(node->mAxis, node->mPosition); 
    202224                        newBox2.SetMax(node->mAxis, node->mPosition); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.h

    r3257 r3279  
    1111struct ViewCell; 
    1212class Bvh; 
     13class BvhNode; 
    1314 
    1415typedef std::vector<ViewCell *> ViewCellsContainer; 
     
    3233        bool CreateIdSortedList(Bvh *bvh, BvhNodeContainer &nodes); 
    3334 
     35        bool CreateIdSortedList2(BvhNode *n, BvhNodeContainer &nodes); 
     36 
     37 
    3438        bool LoadPvs(FILE *fw, Bvh *bvh); 
    3539 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3277 r3279  
    106106const float fov = 50.0f; 
    107107 
     108float skyDomeScaleFactor = 80.0f; 
     109 
    108110SceneQuery *sceneQuery = NULL; 
    109111RenderQueue *renderQueue = NULL; 
     
    377379void RenderViewCell(); 
    378380 
    379 void LoadPompeiiScene(); 
     381void LoadPompeiiFloor(); 
    380382 
    381383 
     
    471473                env.GetBoolParam(string("useSkylightForIllum"), useSkylightForIllum); 
    472474                env.GetFloatParam(string("viewCellsScaleFactor"), viewCellsScaleFactor); 
    473  
     475                env.GetFloatParam(string("skyDomeScaleFactor"), skyDomeScaleFactor); 
     476                 
    474477                //env.GetStringParam(string("modelPath"), model_path); 
    475478                //env.GetIntParam(string("numSssaoSamples"), numSsaoSamples); 
     
    509512                cout << "view cells scale factor: " << viewCellsScaleFactor << endl; 
    510513                cout << "use skylight for illumination: " << useSkylightForIllum << endl; 
     514                cout << "sky dome scale factor: " << skyDomeScaleFactor << endl; 
    511515 
    512516                //cout << "model path: " << model_path << endl; 
     
    599603        //LoadModel("sibenik.dem", dynamicObjects); 
    600604 
    601         if (0) LoadPompeiiScene(); 
     605        if (1) LoadPompeiiFloor(); 
    602606 
    603607#if 0 
     
    22592263 
    22602264                if (!statsWriter) 
    2261                         statsWriter = new StatsWriter(statsFilename); 
     2265                        statsWriter = new StatsWriter(statsFilename + ".log"); 
    22622266                         
    22632267                FrameStats frameStats; 
     
    24062410                 (renderMethod == RENDER_DEFERRED)) && useHDR; 
    24072411         
    2408         preetham->RenderSkyDome(-light->GetDirection(), camera, &renderState, !useToneMapping); 
     2412        preetham->RenderSkyDome(-light->GetDirection(), camera, &renderState, !useToneMapping, skyDomeScaleFactor); 
    24092413 
    24102414        /// once again reset the renderState just to make sure 
     
    26952699 
    26962700 
    2697 void LoadPompeiiScene() 
     2701void LoadPompeiiFloor() 
    26982702{ 
    26992703        AxisAlignedBox3 pompeiiBox = SceneEntity::ComputeBoundingBox(staticObjects); 
Note: See TracChangeset for help on using the changeset viewer.