User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
modelling:lodmodels [2009-07-04 13:40]
127.0.0.1 external edit
— (current)
Line 1: Line 1:
-======= Creating LoD Models ======== 
  
-//LoD// stands for **Level of Distance** and is the name of a technique that spawns **different models** at the **same place in dependance of the distance to the player**. ​ 
- 
-The technique is mainly used to //reduce the polycount// on the screen to //increase the performance//​. The theory is simple: if there are less polygons to render, the framerate is higher. 
- 
-Practically this means that a modeller creates multiple versions of his model, for example: 
- 
-  * a //highly detailed model// (many polygons) that is displayed when the player is very close to the model 
-  * a //medium detailed model// for mid distances 
-  * a //very low model// (few polygons) for long distances 
- 
- 
-All those versions should share the **same size**, **roughly the same shape** and the **same texture** and only should have **different polycounts**. Here is an example for 3 LoD versions of a model (a barrel): 
- 
-[[http://​www.cafu.de/​wiki/​lib/​exe/​fetch.php?​w=&​h=&​cache=cache&​media=modelling%3Alod-tut1.gif|{{modelling:​lod-tut1s.gif}}]] 
-(Click on the picture to enlarge it) 
- 
-You can cleary notice the difference. On the left side, you can find the high detail model, ​ in the mid a medium version and on the right the low polygon counterpart. You might notice the shape of the right model: it isn't round anymore. Don't worry, the player won't notice the difference because it is only displayed in large distances. 
- 
-===== How to create LoD models for Cafu ===== 
- 
-How you create your LoD models for Cafu is up to you. You can do it by hand, some modelling programs also have functions to do it automatically. Although there is no limitation for the number of LoD versions of your model, it is a good idea to stick to **3 to 5** versions. 
- 
-Ok let's assume that you created a model with 3 LoD versions called //​MyModel_lod1.ase//,​ //​MyModel_lod2.ase//​ and //​MyModel_lod3.ase//​ and have placed them in the //​Models/​Static//​ directory (just as an example, you can of course place it in other directories too). The only thing you now need to do is to write a **.dlold file**. A dlod is a plain text file containing model paths and numbers to tell Cafu when it should show which model. 
- 
-Just create a text file, change it to //​MyModel.dlod//​ and open it. Copy this into your dlod file, we'll discuss later what it is good for: 
- 
-  MyModel_lod1.ase ​      ​0 ​   10000 
-  MyModel_lod2.ase ​  ​10000 ​   20000 
-  MyModel_lod3.ase ​  ​20000 ​   40000 
- 
- 
-Basically we can say that the file can be divided into **3** parts. On the left side, we can see the name of the **model + file ending**, in the mid a number value that tells the engine **from which distance** the model is shown and another number on the right telling the engine **to which distance** the model should be rendered. 
- 
-As you might remember, we named our first model MyModel_lod1.ase. You can find it as the first model there so obviously, it is the LoD version that is shown when the player is very close to the model. When listing your LoD versions, begin with those which will be close to the player and end with those for the far distance. 
- 
-You might wonder what the number values mean: In Cafu, each unit is **1 millimeter**. 1000 units are one meter or 3.2808 feet.  
- 
-We can now fully understand our LoD file. //​MyModel_lod1.ase//​ gets displayed from 0 to 10 metres, //​MyModel_lod2.ase//​ from 10 to 20 metres and //​MyModels_lod3.ase//​ from 20 to 40 metres. Don't let the different number values overlap each other! 
- 
-Save your file and you are done :)  
- 
-You can find example files in the Models/​Static directory under the name //​TonneTest//​ (//​TonneTest.dlod//,​ //​TonneTest_LoD1.ase//​ etc...) Note for mappers: load the dlod file instead of a LoD version in order to let the Level of Dinstance system work!  
- 
-===== Further notes ===== 
- 
-  * If for certain distances no model is found, nothing get's rendered (in the tutorial this would be the case for distances greater than 40 metres) 
-  * In many ways, the first model in the list is "​responsible"​ for the collective. ​ The engine gets the bounding boxes, number of animation sequences etc. all from the first model. ​ Ideally though, all models should have the same BB, same (logical) animation sequences, etc. 
-  * The file names are relative to the path of the parent (dlod) file. Valid examples include a/x.mdl and ..\y.ase, whereas c:\z.mdl is invalid. 
- 
-__**Relevant links:**__ 
-  * [[mapping:​cawe:​tutorials:​placing_models|Placing Models in CaWE]] 
-  * [[mapping:​cawe:​optimisemaps| Optimising maps]] 
modelling/lodmodels.1246707618.txt.gz ยท Last modified: 2013-01-07 12:07 (external edit)