PART 2 PUBLISHED HERE - Indiedb.com
Hello, our dear friends, today we are going to show the first part of our media update dedicated to procedural sky rendering. In this part we will talk about basic things of our new techonology. The whole material is very complicated, so we decided to split it in two parts.
We have been dreaming for a long time about making more dynamic sky with moving clouds and replace the static one. We had three options: make a rotating model with cloud texture and place it inside 3D skybox; make clouds using particle system; write a custom sky shader. The first two options are easy to implement, but we still can't create something that we can control in real-time and something that physically simulates with them, so we have chosen to write a shader.
Despite the fact that in Lost Squad we don't have day/night cycle, we have flashbacks where player gets teleported to a completely different location with different weather and time of day, so option to write a shader seemed for us the most convenient.
Same 3D-Skybox, but acting as a sky sphere.
The first thing we have done to improve current sky was an ability to use on 3D-skybox textures designed to be used on skysphere. That allows level designer, even if he doesn't want to use procedural features, create better sky without artifacts usually seen when using skybox.
Usually, people create 3D model of a sphere, place it inside 3D-skybox and use spherical texture on it. We wanted to make our technology as simple for use as possible, so everything happening automatically inside our shader.
An example of static sky with spherical texture.
No artifacts that usually seen in skybox.
Physically-based skylight model.
After that, we impemented procedural skylight model.
Sunset with Physically-Based skylight model.
We have tried a lot of different skylight models and very early implementations looked like this:
As a result, we took "An Analytic Model for Full Spectral Sky-Dome Radiance by Hosek & Wilkie" as a base. Currently, this is the most realistic skylight model used in games and realtime renderers.
For nightsky we tried to generate stars procedurally, but results were far away from being good. After trying a lot of different techinques, we decided to simply use a starfield texture. We created spherical starfield texture and applied it to our "pseudo sphere".
Skylight model for night is much more simplier, but still gives good enough results.
Nightsky with static starfield texture.
So, we got seamless sky with realistic skylight model and day & night suppport. We are only lack of clouds here.
Procedural cloud generation.
Working prototype of our new sky was almost ready, but without clouds. Our task was to implement procedural, physically-based clouds for real-time.
One of early implementations of procedural clouds.
We quickly realised that this task is too complicated, almost impossible even on better next-gen engines.
Perfomance and quality were very poor, don't even think that something is "physically-based" here.
Another attempt to get realistic clouds.
But despite all the difficulties, we saw the potential in these clouds and tried to unlock it.
Not bad, but 26FPS.
The work was very slow, unproductive, but still there were some progress.
- FPS is OK and quality is good too, isn't it?
Recently, we managed to create something similar to what we wanted originally and with good perfomance.
However, there was still a lot of problems, which prevented us to finish the work and forced to think about finding more simple alternative. Although the results have been impressive we still do not dare to use procedural clouds on real maps in the game.
Clouds test on one of old maps.
That's all for today. In the next part we explain functionality of our shader in more detail, demonstrate some dev-videos and finish with clouds.
Finally, let's look at this old sky demonstation video recorded when we have just implemented Hosek & Wilkie skylight model:
Thanks for reading,
Have a nice day!