Changeset 3285 for GTP


Ignore:
Timestamp:
01/18/09 19:45:20 (15 years ago)
Author:
mattausch
Message:

working on viz for submission

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

Legend:

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

    r3284 r3285  
    2121shadowSize=4096 
    2222# the filenames given to recorded frames (+ number.bmp) 
    23 recordedFramesSuffix=image 
     23recordedFramesSuffix=frames/vienna_frame 
    2424# the filename for the statistics 
    2525statsFilename=mystats 
     
    8080 
    8181#lightDirection=-0.8f 1.0f -0.7f 
    82 lightDirection=-0.3f 0.2f -0.7f 
    83  
     82#lightDirection=-0.3f 0.2f -0.7f 
     83lightDirection=-0.14002 0.812842 -0.565404 
    8484 
    8585##################### 
    8686## window options 
    8787 
    88 #winWidth=800 
    89 #winHeight=600 
     88winWidth=800 
     89winHeight=600 
    9090 
    91 winWidth=1024 
    92 winHeight=768 
     91#winWidth=1024 
     92#winHeight=768 
    9393 
    9494useFullScreen=0 
     
    121121 
    122122# use full resolution ssao (vs. half resoltion) 
    123 ssaoUseFullResolution=0 
     123ssaoUseFullResolution=1 
    124124# ssao kernel radius 
    125125#ssaoKernelRadius=8e-1f 
     
    141141#bvhname=PowerPlantM 
    142142#keyForwardMotion=500.0f 
     143#mouseMotion=10.0f 
    143144#visibilitySolution=power-plant-2c-xx-1000b-pgv2 
    144145#visibilitySolution=power-plant-2c-xx-1000d-pgv 
     146#visibilitySolution=power-plant-2c-xx-1000b-spgvu 
    145147#camPosition=-1320.57 -6306.34 3603 
    146148#camDirection=0.292156 0.9556 0.0383878 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Pvs.cpp

    r3284 r3285  
    1010bool operator<(const PvsEntry &a, const PvsEntry &b)  
    1111{ 
    12    //return a.mTimeStamp < b.mTimeStamp; 
     12#ifdef USE_TIMESTAMPS 
     13        return a.mTimeStamp < b.mTimeStamp; 
     14#else 
    1315        return true; 
     16#endif 
    1417} 
    1518 
     
    2932void Pvs::Sort() 
    3033{ 
     34        // TODO 
    3135} 
    3236 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Pvs.h

    r3284 r3285  
    1111class Bvh; 
    1212 
     13#define USE_TIMESTAMPS 
     14 
    1315struct PvsEntry 
    1416{ 
    1517        PvsEntry(SceneEntity *ent, float t):  
    1618        mEntity(ent) 
    17         //, mTimeStamp(t)  
     19#ifdef USE_TIMESTAMPS 
     20        , mTimeStamp(t) 
     21#endif 
    1822        {} 
    1923 
     
    2428 
    2529        SceneEntity *mEntity; 
    26         //float mTimeStamp; 
     30#ifdef USE_TIMESTAMPS 
     31        float mTimeStamp; 
     32#endif 
    2733}; 
    2834 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp

    r3284 r3285  
    1818ViewCellsTree *VisibilitySolutionLoader::Load(const std::string &filename, 
    1919                                                                                          Bvh *bvh, 
    20                                                                                           float viewCellsScaleFactor) 
     20                                                                                          float &totalSamples, 
     21                                                                                          float &totalTime, 
     22                                                                                          float viewCellsScaleFactor 
     23                                                                                          ) 
    2124{ 
    2225        FILE *fr = fopen(filename.c_str(), "rb"); 
     
    3033        } 
    3134 
    32         float totalSamples; 
    33         float totalTime; 
    34  
    3535        fread(&totalSamples, sizeof(float), 1, fr); 
    3636        fread(&totalTime, sizeof(float), 1, fr); 
     
    157157        CreateIdSortedList2(bvh->GetStaticRoot(), nodes); 
    158158        //CreateIdSortedList(bvh, nodes); 
    159         ofstream outstream("test.log"); 
     159/*      ofstream outstream("test.log"); 
    160160 
    161161        BvhNode *f = ((BvhInterior *)bvh->GetStaticRoot())->GetFront(); 
     
    179179                } 
    180180        } 
    181                  
     181*/               
    182182        for (int i = 0; i < number; ++ i)  
    183183        { 
     184                if ((i % number / 10) ==  (number / 10 - 1)) 
     185                        cout << 100 * (i + 1) / 100 << "percent loaded" << endl; 
     186 
    184187                fread(&entries, sizeof(int), 1, fw); 
    185188 
     
    193196         
    194197                        BvhNode *node = nodes[objectId]; 
    195                         if (i == 100) 
    196                                 outstream << "t " << time << " "; 
     198                        //if (i == 100) outstream << "t " << time << " "; 
    197199                        mViewCells[i]->mPvs.AddEntry(bvh, node, time); 
    198200                } 
    199201        } 
    200202 
    201         outstream.close(); 
     203        //outstream.close(); 
    202204 
    203205        return true; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.h

    r3279 r3285  
    2424        VisibilitySolutionLoader(): mNumNodes(0) {}; 
    2525 
    26         ViewCellsTree *Load(const std::string &filename, Bvh *bvh, float viewCellsScaleFactor = 1.0f); 
     26        ViewCellsTree *Load(const std::string &filename,  
     27                                Bvh *bvh, 
     28                                                float &totalSamples, 
     29                                                float &totalTime, 
     30                                                float viewCellsScaleFactor = 1.0f); 
    2731 
    2832 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3284 r3285  
    384384void LoadPompeiiFloor(); 
    385385 
     386float pvsTotalSamples = .0f; 
     387float pvsTotalTime = .0f; 
     388 
    386389 
    387390// new view projection matrix of the camera 
     
    11311134#endif 
    11321135 
    1133 /* 
     1136                /* 
    11341137                ///////////////////////// 
    11351138                //-- update animations 
     
    12301233        glEnableClientState(GL_VERTEX_ARRAY); 
    12311234 
    1232         if (1 && usePvs) 
     1235        if (usePvs) 
    12331236        { 
    12341237                if (!viewCellsTree)      
    12351238                { 
     1239                        LoadVisibilitySolution(); 
    12361240                        applicationTimer.Start(); 
    1237                         LoadVisibilitySolution(); 
    12381241                } 
    12391242 
     
    14711474                Debug << "camPosition=" << camera->GetPosition().x << " " << camera->GetPosition().y << " " << camera->GetPosition().z << endl; 
    14721475                Debug << "camDirection=" << camera->GetDirection().x << " " << camera->GetDirection().y << " " << camera->GetDirection().z << endl; 
     1476                Debug << "lightDirection=" << light->GetDirection().x << " " << light->GetDirection().y << " " << light->GetDirection().z << endl; 
    14731477 
    14741478                CleanUp(); 
     
    17871791                { 
    17881792                        cout << "replaying path" << endl; 
     1793 
    17891794                        currentReplayFrame = -1; 
     1795 
     1796                        // hack: load pvs on replay (remove later!) 
     1797                        usePvs = true; 
    17901798                } 
    17911799                else 
     
    22112219        static float rTime = 1000.0f; 
    22122220 
    2213         // the render time used up purely for the traversal algorithm using glfinish 
    2214         if (showAlgorithmTime) 
    2215         { 
    2216                 if (algTime < 500) renderTime = algTime * expFactor + (1.0f - expFactor) * renderTime; 
    2217         } 
     2221        // the render time is used only for the traversal algorithm using glfinish 
     2222        if (algTime < 500) renderTime = algTime * expFactor + (1.0f - expFactor) * renderTime; 
     2223         
    22182224 
    22192225        accumulatedTime += elapsedTime; 
     
    22242230 
    22252231                if (frameTime) fps = 1e3f / (float)frameTime; 
    2226  
    22272232                rTime = renderTime; 
    22282233 
     
    23762381                        , "CHC" 
    23772382                        , "CHC ++" 
    2378 //                      , "Collector" 
     2383            //, "Collector" 
    23792384                }; 
    23802385         
     
    23962401                int mrays = (int)shotRays / 1000000; 
    23972402                sprintf(msg[7], "%s:  %04d M rays", alg_str[renderMode], mrays);         
    2398                 myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color); 
     2403                //myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color); 
     2404                myfont.DrawString(msg[7], 1.3f, winWidth - 350, winHeight - 30.0f);//, top_color, bottom_color); 
    23992405#endif 
    24002406        } 
     
    26582664        viewCell = viewCellsTree->GetViewCell(camera->GetPosition()); 
    26592665 
    2660         // assume 60 FPS and 1M rays per second 
    2661         const float scale = 1e6f / 60.0f; 
     2666        // assume 60 FPS 
     2667        const float raysPerMs = pvsTotalSamples / pvsTotalTime; 
     2668        const float scale = renderTime * raysPerMs; 
     2669 
     2670        cout << "rays per sec: " << raysPerMs << endl; 
    26622671 
    26632672        //const float elapsedAlgorithmTime = applicationTimer.Elapsedms(false); 
     
    26692678        { 
    26702679                PvsEntry entry = viewCell->mPvs.GetEntry(i); 
    2671  
    2672                 if (1)//(entry.mTimeStamp < 0.0f) || (entry.mTimeStamp <= shotRays)) 
     2680#ifdef USE_TIMESTAMPS 
     2681                if ((entry.mTimeStamp < 0.0f) || (entry.mTimeStamp <= shotRays)) 
     2682#else 
     2683                if (1) 
     2684#endif 
    26732685                { 
    26742686                        entry.mEntity->SetVisibleId(globalVisibleId); 
     
    26922704        VisibilitySolutionLoader visLoader; 
    26932705 
    2694         viewCellsTree = visLoader.Load(vis_filename, bvh, viewCellsScaleFactor); 
     2706        viewCellsTree = visLoader.Load(vis_filename,  
     2707                                           bvh, 
     2708                                                                   pvsTotalSamples, 
     2709                                                                   pvsTotalTime, 
     2710                                                                   viewCellsScaleFactor); 
    26952711 
    26962712        if (!viewCellsTree) 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3275 r3285  
    77 
    88//#define NUM_SAMPLES 8 
    9 #define NUM_SAMPLES 16 
    10 //#define NUM_SAMPLES 24 
     9//#define NUM_SAMPLES 16 
     10#define NUM_SAMPLES 24 
    1111//#define NUM_SAMPLES 48 
    1212 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3271 r3285  
    115115        float4 ao =  tex2Dlod(ssaoTex, float4(IN.texCoord, 0, 0)); 
    116116 
    117 #if 1 // use half resolution 
     117#if 0 // for half resolution 
    118118 
    119119        // the following has to be done for half resolution ssao: 
Note: See TracChangeset for help on using the changeset viewer.