The old fog system used a 2D image post processing effect the simulate the fog. Because of this we coudln’t really add depth to our fog and everything seemed the same fog color.Picture of old fog system
The new system consist out of a particle systems instead of 2D image processing effect.
The fog itself is made out of 3 parts: near fog, mid fog and the far fog.
The near and mid fog are world particle systems and the far is a local particle system. Each layer the fog gets denser and more lightweighted. The fog is also highly adjustable in comparison with the old fog.
Fog system viewed from unity editor.
During the fog test and the new level we noticed that our game had started to lag and run at terrible fps. Optimization was needed.
- Everything that can’t move-> static. (this allow unity static batching to kick in which basically unity makes larger meshes and fewer drawcalls are needed to render the meshes)
- To reduce draw calls en polygons we reduced the terrain quality en texture sizes + adjusted the camera far plane so less objects needs to be rendered.
- To stimulate static or dynamic batching as much as possible we also intent to use one material for as many objects as possible(snowshader, yet to be implemented)
After all these changes the draw calls and polyfons count dropped significally but we kept experiencing low fps. After many testing we found that webgl was being runned with our internal intel graphics card instead of our Nvidia ones. To test for yourself : chrome-> chrome://gpu/
firefox -> about:support
and check your graphics drivers.
Level Design with Meshes from Mathias. (Ingame screenshots)