Changeset 3271


Ignore:
Timestamp:
01/12/09 19:03:24 (15 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
15 edited

Legend:

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

    r3270 r3271  
    99#filename=vienna_full_hp 
    1010#filename=procedural_pompeii_area6_hires/pompeii_full 
    11 filename=procedural_pompeii_area6_hires/pompeii_part1 
     11filename=procedural_pompeii_area6_hires/pompeii_part 
    1212#filename=city 
    1313useLODs=1 
     
    1818# the filename for the statistics 
    1919statsFilename=mystats.log 
     20walkThroughSuffix=path_pp 
    2021 
    2122# use potentially visible sets? 
     
    2526visibilitySolution=vienna_full-8x3-pgv 
    2627viewCellsScaleFactor=1.0f 
    27 useSkylightForIllum=0 
     28useSkylightForIllum=1 
    2829 
    2930 
     
    120121## powerplant options 
    121122 
    122 #filename=PowerPlantM 
    123 #keyForwardMotion=500.0f 
    124 #mouseMotion=3.0f 
     123# static geometry 
     124filename=PowerPlantM 
     125bvhname=PowerPlantM 
     126keyForwardMotion=500.0f 
     127mouseMotion=3.0f 
    125128#visibilitySolution=power-plant-2c-xx-1000b-pgv2 
    126 #camPosition=-1320.57 -6306.34 3603 
    127 #camDirection=0.292156 0.9556 0.0383878 
    128 #viewCellsScaleFactor=0.05f 
     129visibilitySolution=power-plant-2c-xx-1000d-pgv 
     130camPosition=-1320.57 -6306.34 3603 
     131camDirection=0.292156 0.9556 0.0383878 
     132viewCellsScaleFactor=0.05f 
     133 
     134camPosition=763.554 -10254.5 2604 
     135camDirection=-0.0975121 0.994494 0.0383878 
     136useSkylightForIllum=1 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly

    r3250 r3271  
    1313#FILES="$PREFIX-vfc.log $PREFIX-vfc_pvs.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log" 
    1414#FILES="$PREFIX-chc++.log $PREFIX-chc++_b20.log" 
     15FILES="$PREFIX-chc.log $PREFIX-vfc_pvs.log $PREFIX-vfc_pvs_smaller.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log $PREFIX-chc++_pvs_smaller.log" 
    1516 
    1617echo $FILES 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2

    r3250 r3271  
    2323#echo set xrange \[100:20000\] >> $FILE 
    2424#echo set xrange \[4200:4600\] >> $FILE 
    25 echo set xrange \[100:400\] >> $FILE 
     25#echo set xrange \[100:400\] >> $FILE 
     26echo set xrange \[1:1000\] >> $FILE 
    2627#echo set xrange \[1600:2000\] >> $FILE 
    2728# echo set boxwidth 0.4 >> $FILE 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Bvh.cpp

    r3270 r3271  
    652652        CollectNodes(mStaticRoot, nodes); 
    653653        //CollectNodes(mRoot, nodes); 
     654        // also add root 
     655        nodes.push_back(mRoot); 
    654656 
    655657        cout << "creating new indices" << endl; 
     
    799801 
    800802        CollectNodes(mDynamicRoot, nodes); 
     803        // also add root 
     804        nodes.push_back(mRoot); 
    801805 
    802806        const unsigned int bufferSize = 8 * (int)nodes.size(); 
     
    813817 
    814818                for (int j = 0; j < 8; ++ j) 
     819                { 
    815820                        (static_cast<Vector3 *>(mVertices))[node->GetId() * 8 + j] = node->GetBox().GetVertex(j); 
     821                } 
    816822        } 
    817823         
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/CHCPlusPlusTraverser.cpp

    r3259 r3271  
    119119                        mDistanceQueue.pop(); 
    120120         
    121                         if (!IsNodeGeometryVisible(node, 10)) 
    122                         { 
     121                        if (0 && !IsNodeGeometryVisible(node, 10)) 
     122                        { 
     123                                // todo: find out why it is jumping 
    123124                                node->SetLastVisitedFrame(mFrameId); 
    124125                                node->SetVisible(false); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/FrustumCullingTraverser.cpp

    r3258 r3271  
    1717                mDistanceQueue.pop(); 
    1818         
    19                 if (1 && !IsNodeGeometryVisible(node, 10)) 
     19                if (0 && !IsNodeGeometryVisible(node, 10)) 
    2020                { 
    2121                        node->SetVisible(false); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp

    r3261 r3271  
    315315 
    316316        deferred->GetFragmentProgramParameters()->SetViewMatrixParam(0); 
    317          
    318317        deferred->GetVertexProgramParameters()->SetModelMatrixParam(1); 
    319318        deferred->GetVertexProgramParameters()->SetOldModelMatrixParam(2); 
     
    425424 
    426425        cout << "loaded " << numTextures << " textures" << endl; 
    427  
    428426        cout << "loading shapes (geometry + materials)" << endl; 
    429427 
     
    432430 
    433431        cout << "loaded " << (int)mGeometryTable.size() << " shapes" << endl; 
    434  
    435432        cout << "loading scene entites" << endl; 
    436433         
     
    438435         
    439436        cout << "loaded " << numEntities << " scene entities" << endl; 
    440  
    441437        cout << "bin loading finished" << endl; 
    442438 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SceneEntityConverter.cpp

    r3270 r3271  
    9393 
    9494        tex[0].first = 0; tex[0].second = 0; 
    95         tex[1].first = 1; tex[1].second = 0; 
    96         tex[2].first = 1; tex[2].second = 1; 
     95        tex[1].first = 50; tex[1].second = 0; 
     96        tex[2].first = 50; tex[2].second = 50; 
    9797 
    9898        tex[3].first = 0; tex[3].second = 0; 
    99         tex[4].first = 1; tex[4].second = 1; 
    100         tex[5].first = 0; tex[5].second = 1; 
     99        tex[4].first = 50; tex[4].second = 50; 
     100        tex[5].first = 0; tex[5].second = 50; 
    101101 
    102102        for (size_t i = 0; i < triangles.size(); ++ i) 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp

    r3268 r3271  
    109109 
    110110        // scale the sky dome so no intersection with the scene is visible 
    111         const float scaleFactor = 80.0f; 
    112         //const float scaleFactor = 500.0f; 
     111        //const float scaleFactor = 80.0f; 
     112        const float scaleFactor = 1000.0f; 
    113113 
    114114        position.z -= 3.0f * scaleFactor; 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/StopAndWaitTraverser.cpp

    r3259 r3271  
    2222                mDistanceQueue.pop(); 
    2323         
    24                 if (1 && !IsNodeGeometryVisible(node, 10)) 
     24                if (0 && !IsNodeGeometryVisible(node, 10)) 
    2525                { 
    2626                        node->SetVisible(false); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/VisibilitySolutionLoader.cpp

    r3259 r3271  
    136136        BvhNodeContainer nodes; 
    137137        CreateIdSortedList(bvh, nodes); 
    138  
     138         
    139139        for (int i = 0; i < number; ++ i)  
    140140        { 
     
    148148                        fread(&objectId, sizeof(int), 1, fw); 
    149149                        fread(&time, sizeof(float), 1, fw); 
    150  
     150         
    151151                        BvhNode *node = nodes[objectId]; 
    152  
    153152                        mViewCells[i]->mPvs.AddEntry(bvh, node); 
    154153                } 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp

    r3270 r3271  
    132132 
    133133string filename("city"); 
     134string bvhname(""); 
    134135string visibilitySolution(""); 
    135136 
     
    303304 
    304305GLuint sunQuery = 0; 
     306 
     307string walkThroughSuffix("frames"); 
    305308 
    306309 
     
    455458 
    456459                env.GetStringParam(string("recordedFramesSuffix"), recordedFramesSuffix); 
     460                env.GetStringParam(string("walkThroughSuffix"), walkThroughSuffix); 
    457461                env.GetStringParam(string("statsFilename"), statsFilename); 
    458462                env.GetStringParam(string("filename"), filename); 
     463                env.GetStringParam(string("bvhname"), bvhname); 
    459464                env.GetStringParam(string("visibilitySolution"), visibilitySolution); 
    460465 
     
    472477                cout << "max batch size: " << maxBatchSize << endl; 
    473478                cout << "triangles per virtual leaf: " << trianglesPerVirtualLeaf << endl; 
     479 
     480                cout << "static scene filename prefix: " << filename << endl; 
     481                cout << "bvh filename prefix: " << bvhname << endl; 
    474482 
    475483                cout << "key forward motion: " << keyForwardMotion << endl; 
     
    491499                cout << "use ssao full resolution: " << ssaoUseFullResolution << endl; 
    492500                cout << "recorded frames suffix: " << recordedFramesSuffix << endl; 
     501                cout << "walkthrough suffix: " << walkThroughSuffix << endl; 
    493502                cout << "stats filename: " << statsFilename << endl; 
    494                 cout << "static scene filename prefix: " << filename << endl; 
    495503                cout << "use PVSs: " << usePvs << endl; 
    496504                cout << "visibility solution: " << visibilitySolution << endl; 
     
    587595        //LoadModel("sibenik.dem", dynamicObjects); 
    588596 
     597#if 1 
     598 
     599        AxisAlignedBox3 pompeiiBox = SceneEntity::ComputeBoundingBox(staticObjects); 
     600 
    589601        // todo: dispose texture 
    590602        Texture *floorTex = new Texture(model_path + "stairs.c.01.tif"); 
     
    594606 
    595607        floorTex->Create(); 
    596  
    597  
    598608        Material *mymat = resourceManager->CreateMaterial(); 
    599609 
    600         mymat->GetTechnique(0)->SetDiffuse(RgbaColor(1, 1, 1, 1)); 
    601         mymat->GetTechnique(0)->SetTexture(floorTex); 
    602  
    603         const Vector3 offs(1300.0f, -2500.0f, .0f); 
     610        Technique *tech = mymat->GetDefaultTechnique(); 
     611        tech->SetDiffuse(RgbaColor(1, 1, 1, 1)); 
     612        tech->SetTexture(floorTex); 
     613 
     614        Technique *depthPass = new Technique(*tech); 
     615        Technique *deferred = new Technique(*tech); 
     616 
     617        depthPass->SetColorWriteEnabled(false); 
     618        depthPass->SetLightingEnabled(false); 
     619 
     620        ShaderProgram *defaultFragmentTexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultFragmentTexMrt"); 
     621        ShaderProgram *defaultVertexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultVertexMrt"); 
     622 
     623        deferred->SetFragmentProgram(defaultFragmentTexProgramMrt); 
     624        deferred->SetVertexProgram(defaultVertexProgramMrt); 
     625 
     626        deferred->GetFragmentProgramParameters()->SetViewMatrixParam(0); 
     627        deferred->GetVertexProgramParameters()->SetModelMatrixParam(1); 
     628        deferred->GetVertexProgramParameters()->SetOldModelMatrixParam(2); 
     629 
     630        deferred->SetTexture(floorTex); 
     631         
     632        mymat->AddTechnique(deferred); 
     633        mymat->AddTechnique(depthPass); 
     634 
     635 
     636        //const Vector3 offs(1300.0f, -2500.0f, .0f); 
     637        const Vector3 offs(pompeiiBox.Center(0), pompeiiBox.Center(1), 0); 
    604638        Matrix4x4 moffs = TranslationMatrix(offs); 
    605639 
     
    609643        SceneEntity *myplane =  
    610644                SceneEntityConverter().ConvertPlane(plane,  
    611                                                     500,  
    612                                                                                         500, 
     645                                                    pompeiiBox.Size(0), 
     646                                                                                        pompeiiBox.Size(1), 
    613647                                                                                        5,  
    614648                                                                                        5, 
     
    618652        resourceManager->AddSceneEntity(myplane); 
    619653        staticObjects.push_back(myplane); 
    620         /*const float side = 400.0f; 
    621         AxisAlignedBox3 mybox(Vector3(-side, -side, -side), Vector3(side, side, side)); 
    622  
    623         Transform3 *mytrafo2 = resourceManager->CreateTransform(moffs); 
    624  
    625         SceneEntity *myboxEnt =  
    626                 SceneEntityConverter().ConvertBox(mybox, mymat, mytrafo2); 
    627  
    628         staticObjects.push_back(myboxEnt); 
    629         resourceManager->AddSceneEntity(myboxEnt);*/ 
     654 
     655#endif 
    630656 
    631657#if 0 
     
    667693        //-- load the associated static bvh 
    668694 
    669         const string bvh_filename = string(model_path + filename + ".bvh"); 
    670  
    671695        BvhFactory bvhFactory; 
    672 #if 1 
    673         bvh = bvhFactory.Create(staticObjects, dynamicObjects, maxDepthForTestingChildren); 
    674 #else 
    675         bvh = bvhFactory.Create(bvh_filename, staticObjects, dynamicObjects, maxDepthForTestingChildren); 
    676 #endif 
    677  
    678         if (!bvh) 
    679         { 
    680                 cerr << "loading bvh " << bvh_filename << " failed" << endl; 
    681                 CleanUp(); 
    682                 exit(0); 
     696 
     697        if (bvhname != "") 
     698        { 
     699                cout << "loading bvh from disc" << endl; 
     700                const string bvh_fullpath = string(model_path + bvhname + ".bvh"); 
     701                bvh = bvhFactory.Create(bvh_fullpath, staticObjects, dynamicObjects, maxDepthForTestingChildren); 
     702 
     703                if (!bvh) 
     704                { 
     705                        cerr << "loading bvh " << bvh_fullpath << " failed" << endl; 
     706                        CleanUp(); 
     707                        exit(0); 
     708                } 
     709        } 
     710        else 
     711        { 
     712                cout << "creating new bvh" << endl; 
     713                bvh = bvhFactory.Create(staticObjects, dynamicObjects, maxDepthForTestingChildren); 
    683714        } 
    684715 
     
    11981229        { 
    11991230                if (!walkThroughPlayer) 
    1200                         walkThroughPlayer = new WalkThroughPlayer("frames.log"); 
     1231                        walkThroughPlayer = new WalkThroughPlayer(walkThroughSuffix + ".log"); 
    12011232                 
    12021233                ++ currentReplayFrame; 
     
    12291260        { 
    12301261                if (!walkThroughRecorder) 
    1231                         walkThroughRecorder = new WalkThroughRecorder("frames.log"); 
     1262                        walkThroughRecorder = new WalkThroughRecorder(walkThroughSuffix + ".log"); 
    12321263                 
    12331264                if ((Distance(oldPos, camera->GetPosition()) > 1e-6f) || 
     
    25602591{ 
    25612592        const string filename = string(model_path + model); 
    2562  
    25632593        int numEntities = 0; 
    25642594 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaderenv.h

    r3251 r3271  
    66//-- ssao + gi parameters 
    77 
    8 #define NUM_SAMPLES 8 
     8//#define NUM_SAMPLES 8 
    99//#define NUM_SAMPLES 16 
    1010//#define NUM_SAMPLES 24 
    11 //#define NUM_SAMPLES 48 
     11#define NUM_SAMPLES 48 
    1212 
    1313#define MIN_SAMPLES 8 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/combineSsao.cg

    r3247 r3271  
    162162 
    163163                // the filtered ssao value 
    164                 //ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, scale, bl, br, tl, tr); 
     164                ao.x = DiscontinuityFilter(IN.texCoord, ao, col, ssaoTex, normalsTex, colorsTex, filterOffs, scale, bl, br, tl, tr); 
    165165        } 
    166166 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/shaders/ssao.cg

    r3247 r3271  
    322322#endif 
    323323 
    324         return float3(total_ao, validSamples, numSamples); 
     324        //return float3(total_ao, validSamples, numSamples); 
     325        return float3(min(1.0f, total_ao), validSamples, numSamples); 
    325326} 
    326327 
Note: See TracChangeset for help on using the changeset viewer.