Performance Optimizations
From Esenthel
Following suggestions may be used to increase application performance:
- Use images in GFX format (loads faster)
- Use images in DXT5 format (smaller file size, loads faster, slightly worse quality)
- Keep Viewport range as low as possible (reduces number of rendered objects and increases quality of directional light shadows)
- Prefer Cone Lights first (LightCone, fastest), then Point Lights with low range (LightSqr, fast), and finally Point Lights (LightPoint)
- Set light's range as low as possible
- Enable shadowing only for key lights
- Let only key objects cast shadows (render only selected objects in RM_SHD_MAP / RM_SHD_STENCIL mode)
- Use Shadow Mapping instead of Stencil Shadows (especially Hardware Shadow Mapping)
- Use Levels of Detail (Lod) for Meshes - have at least 2 LOD's for meshes (the first Lod always uses more complex shaders - tesselation, bump mapping, details.., other lods have this disabled, this means that with only 1 Lod you can't benefit from simpler shaders)
- Avoid dynamic memory allocation during application update (use static memory, stack memory where possible)
- Design application to be multi-threaded (for advanced only)
- After setting up materials and optionally names to each mesh part, join together those parts that share the same material and name by using menu command "Mesh\Join\With the same Material & Name" in Mesh Editor (faster rendering)
- For the final product version use Meshes (if possible) with no software versions (MeshBase) using Converter tool, or Mesh::delBase() method in custom tool, keeping only GPU version's (Mshr) - (smaller file size, loads faster)
- When building final product version, use "Release" project settings
- Archive your Game Data files to "data.pak" Pak file and load them using Paks.add("data.pak",&secure) instead of IOPath("...\Data") (much faster loading times, automatic data encryption)
- Enable APP_AUTO_FREE_PHYS_BODY_HELPER_DATA application flag to use less memory for Physical Body objects
- Playing .ogg sound files is slower than .wav, as ogg requires real-time decompression, because of that, sounds which are played very repetitively and many of them at the same time (for example bullet shots) should be stored as .wav
How to achieve satisfying performance on low end systems:
- Completely disable bump mapping - D.bumpMode(BUMP_FLAT)
- Completely disable shadows D.shdMode(SHD_NONE)
- Set low texture filtering D.texFilter(..)
- Reduce texture level of details D.texLod(..)
- Disable macro texture usage D.texMacro(false)
- Disable detail texture usage D.texDetail(TEX_USE_DISABLE)
- Disable reflection texture usage D.texReflection(TEX_USE_DISABLE)
- Build Worlds with Heightmaps in Low Quality Mode in World Editor
- Reduce number of triangles in meshes
- If you're not using palette based rendering (RM_PALETTE), set Renderer.color_palette=NULL inside Init() function
- Try using different Renderers
