• Register

Lost Squad - is Source Engine based game about what happened to Barney Calhoun after Half-Life 2: Episode One events and why he didn't show up in Half-Life 2: Episode Two.

Report RSS Lost Squad 2016 Update | Day Three | Procedural Sky Rendering with Source Engine Pt.2

Hello our dear friends! It's time to share the second part of our procedural sky article with you. In the first part we talked about more basic things of our technology and showed early screenshots of it. Now we describe what we actually got and why our techology is better than Source's default one.

Posted by on

Introduction.

Hello our dear friends! It's time to share the second part of our procedural sky article with you. In the first part we talked about more basic things of our technology and showed early screenshots of it. Now we describe what we actually got and why our techology is better than Source's default one.


New way to create sky.

In previous part we already pointed out that we are not using skyboxes anymore and working with skysphreres instead, but some people continued to think that all we showed in previous part it's all about skyboxes.

In reality, we completely refused to use skyboxes and switched to skyspheres. Now, to create static sky artist need to make spherical sky texture and choose it in hammer in map properties. Everything else is done automatically in shader.

Static sky.

Static sky with spherical texture


Static nightsky


For static sky we have two render modes:

  1. Render as static
  2. Render as static rotating

The first mode just renders sky texture while the second one also rotates it around player with adjustable speed. So it's possible to create dynamic sky with minimum perfomance cost.

In settings menu in game there will be an option to choose sky type between static rotating and procedural. This allows players even with low-end systems still obtain dynamic clouds.

Currently, our artists are working on remaking hl2's skybox textures to fit our new system.

Procedural sky.

To add procedural sky on a map, you just need to create 3D-skybox (or empty box with sky_camera inside if your map is not supposed to have any 3D background), then add entity env_sky and adjust it's parameters via in-game sky editor.

Procedural clouds example


In previous part we described how difficult it is to create such sky, quality of which would allow us to use it on real maps in game. And it really is, but as it usually happens, at the moment when we were about to stop trying we got what you can see on image above. We got almost perfect "perfomance/quality" ratio, allowing players enjoy procedural sky without having any FPS drops.

Of course, people with low-end systems probably have to choose static rotating sky as an alternative, because procedural sky is still pretty much expensive thing.

The whole priciple behind this clouds is pretty common in game dev industry. A good example of utilizing it is Horizon Zero Dawn game, clouds of which inspired us during the creation of our own.

This method is pretty simple, but requires some optimization tricks. You just need to:

  • Generate 3D noise texture, for example Perlin to form cloud shape
  • Add lighting
  • Add some options to control cloudiness, position, type and so on.

And don't forget about optimization. On image above you can see a little blur on clouds - optimization consequences, but by tweaking lots of settings you can hide this thing.

A cloudy day


After we got through all that difficulties, we had to add some minor things like potision modes for clouds:

  • Clouds only at distance near horizon and clear sky above player
  • Clouds above player but clear horizon
  • Random position

After that, we had to combine sky lighting we described in prevoius part with clouds to lit them properly.

Nightsky with clouds and stars


As a result, we got beautiful reaslistic and fast clouds with lots of settings like:

  • Cloudiness
  • Height
  • Quality
  • Thickness
  • Poistion mode
  • Speed and move direction

... and much more.

Let's take a look at short video demonstrating our clouds in motion:

An attempt to replicate static skybox, early test:


Attempt to replicate static skybox.

On which image sky is static and on which it's procedural - find out by yourself =)


Ok, the sky is super cool, awesome and amazing but we forgot one important thing: how our clouds woud interact with Citadel clouds? You know in HL2:Ep1 and Ep2 there are huge rotating clouds above the Citadel.

We did some testing and the result was pretty good:


To get better effect we improved our clouds so they can rotate with Citadel's. Here is short video of what we got:

Conclusion.

We are still polishing effects and lighting but the hardest job is over. Our sky already can be used as a replacement for static version on every map at almost any scenes and conditions so we will be actively using it while creating levels.


Luckily (or unluckily), this update is getting too big, so our next update related to such thing called "Interval Mapping" (in other words: fast parallax shader) will be started with in-game sky editor demonstation and couple of other things.

The last thing we are showing today is a video demonstating full day/night cycle with dynamic shadows:

That's all for today! Hope you enjoyed and have a nice day!

Comments
ubilambda
ubilambda

Looks amazing!

Reply Good karma Bad karma+5 votes
CW3D
CW3D

Great work guys! Lost Squad just keeps getting better and better and looking more beautiful then it ever was in the past! :D

Reply Good karma Bad karma+4 votes
Hobo_Gus
Hobo_Gus

As usually *** all over my keyboard... But how much time we should wait?

Reply Good karma Bad karma+2 votes
Blue199
Blue199

This is great

Reply Good karma Bad karma+2 votes
Kazemeka
Kazemeka

Nice. I'm hoping you would make this open-Source (Get it? Source? No? Ok..).

But the real question is: "How will you implement a full day-night cycle into a game with loads of level changes and where the story takes up only ~12 hours?"

Reply Good karma Bad karma+1 vote
DmitRex Author
DmitRex

We won't be using day/night cycle in Lost Squad. I'am just showing all possible features of this shader. When you create procedural sky it's already gives you ability to have day/night cycle and I decided to not kill this feature. Maybe modders will use it.

Reply Good karma+2 votes
Kazemeka
Kazemeka

Nice. Can't wait to check out the game when its out.

Reply Good karma Bad karma+1 vote
bm_killer10
bm_killer10

I'd use it, I wanted to make lava looking crazy sky, only not too bad on the eye, in some wierd *** dm like map

Reply Good karma Bad karma+1 vote
DeltalianDude
DeltalianDude

Some people never stop surprising with what they can do to source engine.

Reply Good karma Bad karma+1 vote
Guest
Guest

This comment is currently awaiting admin approval, join now to view.

Guest
Guest

This comment is currently awaiting admin approval, join now to view.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Follow Report Profile
Icon
Lost Squad
Platforms
Windows
Developer & Publisher
Oak Gear
Engine
Source
Contact
Send Message
Release date
Game watch
Follow
Purchase
News
Tags
Media, Update
Browse
News
Report
Report
Share
Related Games
Lost Squad
Lost Squad First Person Shooter
Related Engines
Source
Source Commercial
Related Groups
Oak Gear
Oak Gear Developer & Publisher