Quick Reference: Render Order
Explanation of Rendering
Rendering is the process of converting the 3D world into a 2D image that can be displayed on your monitor. This is done by drawing each polygon in the world to this image one after the other as defined by the render order. For the pixels where the polygon is closer to the camera than what has already been drawn, the pixels are overwritten; where the polygon is behind what has already been written, nothing is drawn.
The OMSI Render Order
Each polygon is rendered in the order that it is defined within a mesh. Each mesh is rendered in the order that it is defined within an o3d file. Each o3d file is rendered in the order that it is defined within a model config file (either a dedicated model.cfg file or as part of an object.sco file). Each item within a particular group (e.g. cars) is rendered based on the order it was defined (e.g. the first car to be spawned is rendered first, and so on).
The groups are:
- Skybox, sun, moon, stars, etc.
- Objects with rendertype presurface
- Objects with rendertype surface
- Objects with rendertype on_surface
- Wet road effects (both puddles and moisture)
- Objects with rendertype 1
- Objects with rendertype 2 (i.e. those with no rendertype defined)
- Objects with rendertype 3
- AI vehicles, and the user vehicle when it is viewed from outside
- Objects with rendertype 4
- User vehicle from the driver or passenger view
When to use which rendertype
- Objects that have some part that is underground, e.g. the subway entrances in the default Berlin-Spandau map, can benefit from the presurface rendertype - by having a plane above ground level with a mostly-transparent texture you can prevent the terrain from rendering. The terrain is still there and can be collided with, but it won't be visible.
- The surface rendertype should be used for all road surface objects like junctions.
- The on_surface rendertype should be used for all objects that sit on the road surface, like road markings.
- I guess maybe rendertype 1 could be used for backdrops? It's not used by any default object.
- As rendertype 2 is the default value, there's no point setting this manually.
- rendertype 3 is useful for objects that you'll see through vehicle windows and/or see other objects through.
- rendertype 4 is useful for objects that you'll see vehicles through, like glass bus shelters. The inverse is not possible however, with vehicle windows cutting through the object.
Quirks of the Rendering System
There's no way for polygons to be rendered behind others that have been already rendered. This causes problems for translucent polygons, as you have to ensure everything you'll see through them is rendered before they are, otherwise the translucent polygons appear to cut through what's behind them. This isn't always possible.
This can be a very useful feature though, as it does allow you to visually cut through things like the terrain.