PART 2 PUBLISHED HERE - Moddb.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.
Introduction.
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.
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.
Nightsky.
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.
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.
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.
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!
A tutorial on this and the other stuff you've done would be great!
yes I am working on my own mod & would like to know how to do this
Looking beautiful! Keep it up! ;D
Wow that's a lot to soak in.
This is a whole new Half Life game, and i would pay money for it. In my Opinion.
I really like the way you've created the clouds. It could definitely still use some work but it's looking very nice so far. Have you guys considered adding Physically Based Rendering into the game and replacing the old standard shader or is that out of reach?
Adding Physically Based Rendering is very complicated task especially on Source, mostly because we don't have full engine source code. But I still have some ideas how to implement it (or something close to it) so will see. I am working hard to bring as most advanced rendering system as possible to Source.
It would be very interesting to see the results. Are you planning to go the metalness/roughness route or the specular/gloss route?
I'd prefer metalness/roughness, because as far as I know it's more realistic approach.
It's easier to work with yes. Although, it isn't perfect for everything, it works for 95% of objects quick nicely. ;D