Changeset 3276 for GTP/trunk


Ignore:
Timestamp:
01/14/09 18:48:14 (15 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/App/Demos/Vis/FriendlyCulling
Files:
7 edited

Legend:

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

    r3274 r3276  
    1111#filename=newvienna 
    1212#bvhname=newvienna 
    13 filename=procedural_pompeii_area6_hires/pompeii_full 
    14 #filename=procedural_pompeii_area6_hires/pompeii_part 
    15 #filename=city 
    16 #bvhname=city 
     13filename=pompeii/pompeii_full 
     14#filename=pompeii/pompeii_part 
     15filename=city 
     16bvhname=city 
    1717useLODs=1 
    1818# shadow map size 
     
    2222# the filename for the statistics 
    2323statsFilename=mystats.log 
    24 walkThroughSuffix=path_pp 
     24walkThroughSuffix=walkthrough_pp_1 
     25#walkThroughSuffix=path_pp 
    2526 
    2627# use potentially visible sets? 
     
    5556 
    5657# initial camera position 
    57 #camPosition=483.398f 242.364f 186.078f 
     58camPosition=483.398f 242.364f 186.078f 
    5859# pompeii view point 
    59 camPosition=1300.0f -2500.0f 10.0f 
     60#camPosition=1300.0f -2500.0f 10.0f 
     61# pompeii problematic 
     62#camPosition=627.003 -1725.33 25.2 
     63#camDirection=-0.761538 0.64812 -0 
    6064 
    6165# initial camera orientation 
     
    9296# tone mapping 
    9397useHDR=0 
    94  
    9598# use antialiasing 
    9699useAA=0 
    97  
    98100# show lense flare 
    99101useLenseFlare=1 
    100  
    101102# use ssao / color bleeding 
    102103useAdvancedShading=1 
    103  
    104104# skylight turbitity 
    105105turbitity=3.0f 
     
    130130#bvhname=PowerPlantM 
    131131#keyForwardMotion=500.0f 
    132 #mouseMotion=3.0f 
    133132#visibilitySolution=power-plant-2c-xx-1000b-pgv2 
    134133#visibilitySolution=power-plant-2c-xx-1000d-pgv 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/plot_friendly

    r3271 r3276  
    77COMMAND3=./ps_memory_plot3 
    88 
    9 PREFIX=pp 
     9PREFIX=pp_2 
    1010 
    1111#FILES="$PREFIX-vfc.log $PREFIX_chc.log $PREFIX-vfc_pvs.log $PREFIX-chc++_b20.log $PREFIX-chc++_pvs_b20.log" 
     
    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" 
    15 FILES="$PREFIX-chc.log $PREFIX-vfc_pvs.log $PREFIX-vfc_pvs_smaller.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log $PREFIX-chc++_pvs_smaller.log" 
     15#FILES="$PREFIX-chc.log $PREFIX-vfc_pvs.log $PREFIX-vfc_pvs_smaller.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log $PREFIX-chc++_pvs_smaller.log" 
     16FILES="$PREFIX-chc.log $PREFIX-vfc_pvs.log $PREFIX-chc++.log $PREFIX-chc++_pvs.log" 
    1617 
    1718echo $FILES 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/ps_memory_plot2

    r3271 r3276  
    2424#echo set xrange \[4200:4600\] >> $FILE 
    2525#echo set xrange \[100:400\] >> $FILE 
    26 echo set xrange \[1:1000\] >> $FILE 
     26echo set xrange \[1:500\] >> $FILE 
    2727#echo set xrange \[1600:2000\] >> $FILE 
    2828# echo set boxwidth 0.4 >> $FILE 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/Geometry.cpp

    r3274 r3276  
    4040        if (delData) 
    4141        { 
    42                 //DEL_ARRAY_PTR(mVertices); 
     42                DEL_ARRAY_PTR(mVertices); 
    4343                DEL_ARRAY_PTR(mNormals); 
    4444                DEL_ARRAY_PTR(mTexCoords); 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/src/SkyPreetham.cpp

    r3272 r3276  
    109109 
    110110        // scale the sky dome so no intersection with the scene is visible 
    111         const float scaleFactor = 80.0f; 
    112         //const float scaleFactor = 1000.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/chcdemo.cpp

    r3274 r3276  
    377377void RenderViewCell(); 
    378378 
     379void LoadPompeiiScene(); 
     380 
    379381 
    380382// new view projection matrix of the camera 
     
    597599        //LoadModel("sibenik.dem", dynamicObjects); 
    598600 
    599  
    600         AxisAlignedBox3 pompeiiBox = SceneEntity::ComputeBoundingBox(staticObjects); 
    601  
    602 #if 1 
    603         // todo: dispose texture 
    604         Texture *floorTex = new Texture(model_path + "stairs.c.01.tif"); 
    605  
    606         floorTex->SetBoundaryModeS(Texture::REPEAT); 
    607         floorTex->SetBoundaryModeT(Texture::REPEAT); 
    608  
    609         floorTex->Create(); 
    610         Material *mymat = resourceManager->CreateMaterial(); 
    611  
    612         Technique *tech = mymat->GetDefaultTechnique(); 
    613         tech->SetDiffuse(RgbaColor(1, 1, 1, 1)); 
    614         tech->SetTexture(floorTex); 
    615  
    616         Technique *depthPass = new Technique(*tech); 
    617         Technique *deferred = new Technique(*tech); 
    618  
    619         depthPass->SetColorWriteEnabled(false); 
    620         depthPass->SetLightingEnabled(false); 
    621  
    622         ShaderProgram *defaultFragmentTexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultFragmentTexMrt"); 
    623         ShaderProgram *defaultVertexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultVertexMrt"); 
    624  
    625         deferred->SetFragmentProgram(defaultFragmentTexProgramMrt); 
    626         deferred->SetVertexProgram(defaultVertexProgramMrt); 
    627  
    628         deferred->GetFragmentProgramParameters()->SetViewMatrixParam(0); 
    629         deferred->GetVertexProgramParameters()->SetModelMatrixParam(1); 
    630         deferred->GetVertexProgramParameters()->SetOldModelMatrixParam(2); 
    631  
    632         deferred->SetTexture(floorTex); 
    633          
    634         mymat->AddTechnique(deferred); 
    635         mymat->AddTechnique(depthPass); 
    636  
    637  
    638         //const Vector3 offs(1300.0f, -2500.0f, .0f); 
    639         const Vector3 offs(pompeiiBox.Center(0), pompeiiBox.Center(1), 0); 
    640         Matrix4x4 moffs = TranslationMatrix(offs); 
    641  
    642         Plane3 plane; 
    643         Transform3 *mytrafo = resourceManager->CreateTransform(moffs); 
    644  
    645         SceneEntity *myplane =  
    646                 SceneEntityConverter().ConvertPlane(plane,  
    647                                                     pompeiiBox.Size(0), 
    648                                                                                         pompeiiBox.Size(1), 
    649                                                                                         5,  
    650                                                                                         5, 
    651                                                                                         mymat,  
    652                                                                                         mytrafo); 
    653  
    654         resourceManager->AddSceneEntity(myplane); 
    655         staticObjects.push_back(myplane); 
    656  
    657 #endif 
     601        if (1) LoadPompeiiScene(); 
    658602 
    659603#if 0 
     
    724668 
    725669 
    726         ObjExporter().Export(model_path + "mypompeii.obj", bvh); 
    727         BvhExporter().Export(model_path + "mypompeii.bv", bvh); 
     670        //ObjExporter().Export(model_path + "mypompeii.obj", bvh); 
     671        //BvhExporter().Export(model_path + "mypompeii.bv", bvh); 
    728672 
    729673 
     
    14611405                        deferredShader->SetSaveFrame("", -1);            
    14621406                } 
    1463                 //if (makeSnapShot) makeSnapShot = false; 
     1407                 
     1408                if (makeSnapShot) makeSnapShot = false; 
    14641409 
    14651410                ShadowMap *sm = showShadowMap ? shadowMap : NULL; 
     
    23972342                        int i = 4; 
    23982343 
    2399                         if (0) 
     2344                        if (0) // q: show rendered objects or nodes (no space for both) 
    24002345                        { 
    24012346                                sprintf(msg[i ++], "rendered: %s of %s objects, %s of %s triangles",  
     
    24082353                        } 
    24092354 
    2410                         sprintf(msg[i ++], "traversed: %5d, frustum culled: %5d, query culled: %5d", 
     2355                        sprintf(msg[i ++], "traversed: %5d, frustum culled: %5d, query culled: %5d nodes", 
    24112356                                traversedNodes, frustumCulledNodes, queryCulledNodes); 
    24122357                        sprintf(msg[i ++], "issued queries: %5d, state changes: %5d, render batches: %5d",  
     
    24292374                { 
    24302375                        if (showFPS) 
    2431                                 sprintf(msg[7], "%s:  %6.1f fps", alg_str[renderMode], fps); 
     2376                        {                        
     2377                                sprintf(msg[7], "%s:  %6.1f fps", alg_str[renderMode], fps);             
     2378                                myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color); 
     2379                        } 
    24322380                } 
    24332381                else 
     2382                { 
    24342383                        sprintf(msg[7], "%s:  %6.1f ms", alg_str[renderMode], rTime); 
    2435                  
    2436                 myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color); 
     2384                        myfont.DrawString(msg[7], 1.3f, 690.0f, 760.0f);//, top_color, bottom_color); 
     2385                } 
     2386 
    24372387                 
    24382388                //sprintf(msg[8], "algorithm time: %6.1f ms", rTime); 
     
    25162466        renderState.Reset(); 
    25172467 
    2518         PrintGLerror("visibleobjects"); 
     2468        PrintGLerror("visible objects"); 
    25192469} 
    25202470 
     
    25372487 
    25382488        if (validIntersect)  
    2539                 // && ((playerPos.z - oldPos.z) < bvh->GetBox().Size(2) * 1e-1f)) 
     2489                //&& ((playerPos.z - oldPos.z) < bvh->GetBox().Size(2) * 1e-1f)) 
    25402490        { 
    25412491                camera->SetPosition(playerPos); 
     
    27432693        Visualization::RenderBoxForViz(viewCell->GetBox()); 
    27442694} 
     2695 
     2696 
     2697void LoadPompeiiScene() 
     2698{ 
     2699        AxisAlignedBox3 pompeiiBox = SceneEntity::ComputeBoundingBox(staticObjects); 
     2700 
     2701        // todo: dispose texture 
     2702        Texture *floorTex = new Texture(model_path + "stairs.c.01.tif"); 
     2703 
     2704        floorTex->SetBoundaryModeS(Texture::REPEAT); 
     2705        floorTex->SetBoundaryModeT(Texture::REPEAT); 
     2706 
     2707        floorTex->Create(); 
     2708        Material *mymat = resourceManager->CreateMaterial(); 
     2709 
     2710        Technique *tech = mymat->GetDefaultTechnique(); 
     2711        tech->SetDiffuse(RgbaColor(1, 1, 1, 1)); 
     2712        tech->SetTexture(floorTex); 
     2713 
     2714        Technique *depthPass = new Technique(*tech); 
     2715        Technique *deferred = new Technique(*tech); 
     2716 
     2717        depthPass->SetColorWriteEnabled(false); 
     2718        depthPass->SetLightingEnabled(false); 
     2719 
     2720        ShaderProgram *defaultFragmentTexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultFragmentTexMrt"); 
     2721        ShaderProgram *defaultVertexProgramMrt = ShaderManager::GetSingleton()->GetShaderProgram("defaultVertexMrt"); 
     2722 
     2723        deferred->SetFragmentProgram(defaultFragmentTexProgramMrt); 
     2724        deferred->SetVertexProgram(defaultVertexProgramMrt); 
     2725 
     2726        deferred->GetFragmentProgramParameters()->SetViewMatrixParam(0); 
     2727        deferred->GetVertexProgramParameters()->SetModelMatrixParam(1); 
     2728        deferred->GetVertexProgramParameters()->SetOldModelMatrixParam(2); 
     2729 
     2730        deferred->SetTexture(floorTex); 
     2731         
     2732        mymat->AddTechnique(deferred); 
     2733        mymat->AddTechnique(depthPass); 
     2734 
     2735 
     2736        //const Vector3 offs(1300.0f, -2500.0f, .0f); 
     2737        const Vector3 offs(pompeiiBox.Center(0), pompeiiBox.Center(1), 0); 
     2738        Matrix4x4 moffs = TranslationMatrix(offs); 
     2739 
     2740        Plane3 plane; 
     2741        Transform3 *mytrafo = resourceManager->CreateTransform(moffs); 
     2742 
     2743        SceneEntity *myplane =  
     2744                SceneEntityConverter().ConvertPlane(plane,  
     2745                                                    pompeiiBox.Size(0), 
     2746                                                                                        pompeiiBox.Size(1), 
     2747                                                                                        5,  
     2748                                                                                        5, 
     2749                                                                                        mymat,  
     2750                                                                                        mytrafo); 
     2751 
     2752        resourceManager->AddSceneEntity(myplane); 
     2753        staticObjects.push_back(myplane); 
     2754} 
  • GTP/trunk/App/Demos/Vis/FriendlyCulling/toto.txt

    r3228 r3276  
    162162 
    163163 
    164 implement dof 
     164make better DOF 
     165 
     166clouds 
     167 
     168god rays  
     169 
     170animation 
     171 
     172 
     173################################ 
     174## pompeii todo: 
     175 
     1761) improve performance: 
     177make better objects (jiri?) 
     178 
     1792) use better bvh code (also use size to handle floor plane) 
     180 
     1813) shading problems:  
     182 
     183create own normals: 
     184 
     185flat normals 
     186use crease angles 
     187 
     188find out about degenerate vertices 
     189 
     190find out about missing texcoords 
     191 
     192 
     193##################################### 
     194 
     195fix shadows 
Note: See TracChangeset for help on using the changeset viewer.