Flexible LOD system

From GameStudio Wiki

Jump to: navigation, search

Unless you have the Professional edition, you have to create and save several versions of your models in order to use the LOD system.
The following is the same system as described in the manual

1. Make a model, save and name it "model_0.mdl" you can replace the word 'model' with anything you like, but the '_0' has to be there for this to work.
2. Save your model as "model_1.mdl", using the same name as the original, only changing the '_0' to a '_1'.
3. Now hack away at your model, reducing the polygon count a bit, but try to maintain the overall appearance.
4. Save the model, keeping the '_1' name.
5. Save the model again as "model_2.mdl", and repeat step 3, save again.
6. Again as "model_3.mdl" repeat step 3, save.
7. make sure all these models are in your game folder, or a folder which your script has included.
8. When building your level, use the "model_0.mdl" original model, the engine will automatically load the low poly versions when they are in the correct range from the camera.
9. You can change the range at which levels of detail change with the following script added to your camera function

Camera.clip_near = 5; // allows to go very close to objects
Camera.clip_far = 10000; // reduce clip_far for preventing sorting errors
vec_set(d3d_lodfactor,vector(2,10,30));//these values change the distance at which different LOD files will be used,
// the numbers represent a percentage of the clip_far distance...

Personal tools