Changeset 347 for trunk/VUT


Ignore:
Timestamp:
10/24/05 16:37:50 (19 years ago)
Author:
mattausch
Message:

fixed color bug
fixed terrain tile ch culling
made better terrain

Location:
trunk/VUT
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/Ogre/include/OgreVisibilityTerrainSceneManager.h

    r254 r347  
    9292        void renderModulativeStencilShadowedQueueGroupObjects(RenderQueueGroup* pGroup); 
    9393 
     94        /** Override standard function so octree boxes are always of equal side length. 
     95                This has advantages for CHC, because terrain tiles are in different octree nodes 
     96                and can be culled. 
     97        */ 
     98        void setWorldGeometry( const String& filename ); 
     99 
    94100protected: 
    95101         
  • trunk/VUT/Ogre/resources/terrain.cfg

    r346 r347  
    2626 
    2727# How large is each tile? Must be (2^n)+1 and be smaller than PageSize 
    28 TileSize=129 
     28TileSize=65 
    2929 
    3030# The maximum error allowed when determining which LOD to use 
     
    3434PageWorldX=5000 
    3535PageWorldZ=5000 
     36 
    3637# Maximum height of the terrain  
    37 MaxHeight=500 
     38MaxHeight=400 
    3839 
    3940# Upper LOD limit 
  • trunk/VUT/Ogre/src/OgreVisibilityTerrainSceneManager.cpp

    r343 r347  
    9494        //mItemBufferPass->setAmbient(1, 1, 0); 
    9595} 
     96//------------------------------------------------------------------------- 
     97void VisibilityTerrainSceneManager::setWorldGeometry( const String& filename ) 
     98{ 
     99    // Clear out any existing world resources (if not default) 
     100    if (ResourceGroupManager::getSingleton().getWorldResourceGroupName() !=  
     101        ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME) 
     102    { 
     103        ResourceGroupManager::getSingleton().clearResourceGroup( 
     104            ResourceGroupManager::getSingleton().getWorldResourceGroupName()); 
     105    } 
     106    mTerrainPages.clear(); 
     107    // Load the configuration 
     108    loadConfig(filename); 
     109 
     110    // Resize the octree, allow for 1 page for now 
     111    float max_x = mOptions.scale.x * mOptions.pageSize; 
     112    float max_y = mOptions.scale.y; 
     113    float max_z = mOptions.scale.z * mOptions.pageSize; 
     114 
     115        float maxAxis = std::max(max_x, max_y); 
     116        maxAxis = std::max(maxAxis, max_z); 
     117        resize( AxisAlignedBox( 0, 0, 0, maxAxis, maxAxis, maxAxis ) ); 
     118     
     119    setupTerrainMaterial(); 
     120 
     121    setupTerrainPages(); 
     122 
     123 } 
     124 
    96125//----------------------------------------------------------------------- 
    97126void VisibilityTerrainSceneManager::PrepareVisualization(Camera *cam) 
  • trunk/VUT/work/TestCullingTerrain/TestCullingTerrainApplication.cpp

    r346 r347  
    309309                generateScene(200, 2); 
    310310        } 
    311  
    312         // no limitations on height => it is possible for the user to put single  
    313         // objects on peaks of the terrain (only few, not relevant for occlusion) 
    314         mTerrainContentGenerator->SetMaxPos(mTerrainMaxPos); 
    315311} 
    316312//----------------------------------------------------------------------- 
     
    319315        float val = TerrainFrameListener::msObjectScales[objectType]; 
    320316        Vector3 scale(val, val, val);  
    321         const float maxHeight = 100; 
     317        const float maxHeight = 75; 
    322318        // to provide much occlusion, 
    323         // height is restricted to 50 => no objects are created on peaks 
     319        // height is restricted to maxHeight => no objects are created on peaks 
    324320        mTerrainContentGenerator->SetMinPos(Vector3(mTerrainMinPos)); 
    325321        mTerrainContentGenerator->SetMaxPos(Vector3(mTerrainMaxPos.x, maxHeight, mTerrainMaxPos.z)); 
     
    342338        } 
    343339 
    344         // no limitations anymore => it is possible for the user to put single  
    345         // objects on peaks of the terrain (only few, not relevant for occlusion) 
     340        // release limitations on height => it is possible for the user to put single  
     341        // objects on peaks of the terrain (will be only few, not relevant for occlusion) 
    346342        mTerrainContentGenerator->SetMaxPos(mTerrainMaxPos); 
    347343} 
  • trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/include/OgreOctree.h

    r316 r347  
    188188        */ 
    189189        void setLastRendered(int frameid); 
    190         /** Returns current depth of octree  
    191         @return current depth 
    192         */ 
    193         int getDepth(); 
    194         /** Returns real extent of the octree, i.e., the merged extent of the bounding boxes. */ 
     190         
     191        /** Returns real extent of the octree, i.e., the merged extent of the bounding boxes.  
     192        */ 
    195193        AxisAlignedBox _getWorldAABB(void) const; 
    196194 
    197         /** Updates bounds of real aabb of octree. */ 
     195        /** Updates bounds of real aabb of octree.  
     196        */ 
    198197        void _updateBounds(); 
    199198 
     
    206205        int mLastVisited; 
    207206        bool mVisible; 
    208         int mDepth; 
    209207         
    210208#endif // GTP_VISIBILITY_MODIFIED_OGRE 
  • trunk/VUT/work/ogre_changes/Plugins/OctreeSceneManager/src/OgreOctree.cpp

    r316 r347  
    104104    mParent = parent; 
    105105#ifdef GTP_VISIBILITY_MODIFIED_OGRE 
    106         if (mParent)  
    107                 mDepth = parent->getDepth() + 1; 
    108         else 
    109                 mDepth = 0; 
    110106        // update bounds because we want tight octree 
    111         _updateBounds(); 
     107        if (1) _updateBounds();  
    112108         
    113109#endif //GTP_VISIBILITY_MODIFIED_OGRE 
     
    219215{ 
    220216        return mParent; 
    221 } 
    222 //-----------------------------------------------------------------------        
    223 int Octree::getDepth() 
    224 { 
    225         return mDepth; 
    226217} 
    227218//-----------------------------------------------------------------------        
  • trunk/VUT/work/ogre_changes/RenderSystems/GL/src/OgreGLRenderSystem.cpp

    r343 r347  
    23442344            glDisableVertexAttribArrayARB_ptr(1); // disable weights 
    23452345        } 
    2346  
     2346                glColor4f(1,1,1,1); 
    23472347        glSecondaryColor3fEXT_ptr(0.0f, 0.0f, 0.0f); 
    23482348 
Note: See TracChangeset for help on using the changeset viewer.