LIGHTING FOR MOBILE
Written by Peter Stolmeier
Working on a video game can be challenging in the best of times, but it gets significantly harder in virtual reality (VR) or when using the mobile platform’s limited power. So, when we decided to make a video game in VR on a mobile platform, we had many challenges to overcome.
It’s important to mention that these are only temporary textures and effects as a proof of concept, but already we see promise.
An important part of our game’s immersion is the passing of time while outdoors enjoying cultivated nature. That means we would have to find a way to do a broader lighting effect for sunlight than the limited real-time lighting the mobile chipset would allow.
It is difficult for the Oculus Quest to render this many real-time lights.
In 3D engine terms, lighting is only relevant to the changing of an object’s color. With that in mind, at least in the beta process, our solution is to change the color of textures ourselves outside of the game engine by prebaking and then inside the engine programmatically.
Prebaking a texture allows us to have some shadow information that is not needed to be calculated by the game engine freeing up resources for other things. The only problem is that they will not react to the sun, so we still need to help it along with some color.
Shader Graph is a built-in system in Unity that lets us have detailed control of our objects’ look. In it, we can blend in different effects to get the look we want. Since this is a dynamic process, it’s possible to blend multiple textures in real-time to make it easier on system resources but effective across the entire world.
It’s important to mention that these are only temporary textures and effects as a proof of concept, but already we see promise.
We’ll try to revisit this once we have more permanent looks to see if they are as useful to our game as we suspect.