OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: PixelCountLodStrategy
View page
Source of version: 3
(current)
!Pixel Count LOD Strategy PixelCountLodStrategy works by analyzing how many pixels a model occupies on screen on any given instance of time, and selects a LOD mesh/material accordingly. !Status PixelCountLodStrategy is fully integrated into latest Ogre SDK versions !How To Use !!Some Background: How LOD models and strategies work in general? ''NOTE: To simplify things, I am using generic terms, simple explanations and approximations in this sub-section. They do not convey full details, but are easy to understand. After this sub-section, actual Ogre terms are used'' LOD stands for Level Of Details. The concept of LOD is to use high quality (complex and slow to draw) models when an object is viewed from close and low quality (simple and fast to draw) models when an object is viewed from a distance. LOD strategies are all about calculating that which version of a model (complex one or simple one) should be displayed at any diven time. They do it by generating a __LOD value__ for a 3d model and the active camera at any given time LOD models consist of a series of models starting with most detailed model with successive ones decreasing in complexity and quality (hence increasing in speed). While creating these models, we specify which LOD strategy will be applicable to a certain model. Then we specify at what __lod values__, what __lod version__ of the models will be displayed !!How PixelCountLodStrategy Works? PixelCountLodStrategy works by (approximately) counting that how many pixels does a Mesh occupy on screen at any time. The value calculated is pixel area (height*width). For example, if a model occupy 200*200 pixels on screen at any time, value calculated will be 40,000. !!How To Programatically Prepare A Mesh For PixelCountLodStrategy? ''NOTE: code needs testing'' For PixelCountLodStrategy, mesh lod values are stored in decreasing orger, starting with MAX_FLOAT value. Here is what you have to do {CODE(wrap="1", colors="c++")} // define base mesh MeshPtr mesh = MeshManager::getSingleton().load("something-100p.mesh"); // level 0, 100 percent // add LOD strategy mesh->setLodStrategy(Ogre::PixelCountLodStrategy::getSingletonPtr()); // might need to reapply after load // add level 1 mesh, for pixel area below 500*500 mesh->createManualLodLevel(250000, "something-50p.mesh"); // level 1, 50 percent // add level 2 mesh, for pixel area below 200*200 mesh->createManualLodLevel(40000, "something-25p.mesh"); // level 2, 25 percent // export LODed mesh MeshSerializer ser; ser.exportMesh(mesh1.get(), "something-with-lod.mesh"); {CODE} !!How to use LODed mesh ''NOTE: code needs testing'' {CODE(wrap="1", colors="c++")} Entity* enty = sceneManager->createEntity("MyLodMesh", "something-with-lod.mesh"); enty->setLodStrategy(Ogre::PixelCountLodStrategy::getSingletonPtr()); // optional {CODE} !Also See http://www.ogre3d.org/tikiwiki/ScreenRatioLodStrategy !References http://www.ogre3d.org/docs/api/html/classOgre_1_1PixelCountLodStrategy.html http://www.ogre3d.org/forums/viewtopic.php?f=13&t=40308 http://www.ogre3d.org/tikiwiki/SoC2008+LOD
Search by Tags
Search Wiki by Freetags
Latest Changes
IDE Eclipse
FMOD SoundManager
HDRlib
Building Ogre V2 with CMake
Ogre 2.1 FAQ
Minimal Ogre Collision
Artifex Terra
OpenMB
Advanced Mogre Framework
MogreSocks
...more
Search
Find
Advanced
Search Help
Online Users
153 online users