For WaveEngine 2.0 we decided to change our render to allow users to have more control on lighting. The big challenge here was how to offer a better lighting system and still support old mobile devices with OpenGL 2.0.
The render system in WaveEngine 1.4.2 is known in computer graphics as Forward Rendering. It is fast, simple but limited since you cannot use for example more than 4 to 8 lights per object (there are some techniques that try to simulate more lights but do not give good quality), and you need to write a large amount of shaders to support some combinations efficiently.
So we spent a period studying others options like:
- Forward Rendering Multipass
- Deferred Rendering
- Light-Pre Pass Deferred Rendering
- Light Indexed Deferred Rendering
Multipass is too heavy and Deferred Techniques seem really the future because they separate the simple pass of Forward Rendering into two passes, one for lighting and another one for shading and the results using this technique are awesome, but the original implementation uses MRT which is not supported on the most common mobile devices currently.
After this research we decided that Light-Pre Pass Deferred Rendering was the best option for mobiles right now, but the original implementation is not supported on a lot the old mobile devices. We wanted our render to run on:
- Windows, Linux, MacOS (DepthBuffer supported, MRT supported)
- Windows Store DirectX 9.1 (DepthBuffer unsupported and MRT unsupported)
- Windows Phone DirectX 9.3 (DepthBuffer supported)
- iOS OpenGL ES 2.0 (DepthTexture extension)
- Android OpenGL ES 2.0 (DepthTexture extension)
- Android Tegra GPU (No DepthTexture extension, MRT supported)
So we needed to develop a custom Light-Pre pass Deferred Rendering technique to support all these old mobile versions, because a great amount of the current worldwide mobile base has theses specs.
Here you can see screenshots of how this technique works through these images:
We have this temple demo with more than 30 dynamic lights running on old devices.
This new system also allows us to introduce more types of light source SpotLights, PointLights, Directional Lights and more types are coming: area lights, 2D light sources, occluders and projectors.
We will continue revealing more WaveEngine 2.0 features in the upcomming days.