Jump to content
  • entries
    948
  • comments
    5,905
  • views
    945,070

Sunrise, sunset


Day/night cycles are something I have thought about for a long time. There's several possible approaches to simulating these, but it wasn't until today that I decided which is best. Here are some options I considered:

 

1. Shader-based skies with particle clouds.

This is the method Crysis employs. A subsurface scattering shader creates the sky background. The mathematics are pretty complex, but the results for an empty blue sky look great. Particle clouds are used to place sparse clouds in the sky.

 

Pros: Clear skies look great.

Cons: Not very good for overcast skies, clouds look worse than a skybox, expensive to render.

 

2. Animated skyboxes.

The idea is to animate a looping sequence of skybox animations for a 24-hour cycle, and interpolate between the nearest two frames at all times.

 

Pros: Potentially very high quality results, with a low cost of rendering.

Cons: Long rendering times to generate skybox textures, no ability to tweak and adjust skies.

 

The solution I finally arrived at is similar to the day/night cycles in STALKER: Call of Pripyat. A skybox with uniform lighting is used, so that it is not apparent from which direction the sunlight should be coming. The ambient light level, directional light color, fog, and skybox color are adjusted according to a set of colors for a 24-hour cycle. A large sun corona can be used to simulate the sun moving across the sky, and the directional light angle can be synced with the sun.

 

Pros: Adjustable and dynamic, easy to add new skyboxes, low cost to render. Skyboxes can be changed to alter weather.

Cons: Skyboxes with a distinct direction of lighting won't look good.

 

Here are some of my results using this method:

blogentry-1-12716221326193_thumb.jpg

blogentry-1-12716221382177_thumb.jpg

blogentry-1-12716221438249_thumb.jpg

Of course, you are still free to implement any method you choose, but I am pretty satisfied with this approach for my own work, and I will make a scripted entity available to control these settings.

18 Comments


Recommended Comments

franck22000

Posted

Very nice Josh this will help some users :unsure:

Is it going to be available in 2.32 update ?

Canardia

Posted

HDR is an essential effect with daytime rendering. It makes the sun appear yellow in tree leaves instead of plain white (the sun must be yellow in color though, even if it is in fullbright mode).

HDR also doesn't lower FPS.

Pancakes

Posted

awww was hoping for shader skies because the clouds could roll across the sky

 

but this is okay too

Rekindled Phoenix

Posted

This is going to be an essential asset to some games. An out of the box sky environment will be wonderful Josh

omid3098

Posted

I digg animated cloud. the only engine I saw this feature was UDK. (with really bad implementation)

can you use animated movies from real clouds? just as animated water?

Real clouds

you need someone to simulate some loop able animated clouds with alpha channel.(maybe a Vue artist)

Michael Betke

Posted

Will we be able to tweak the light settings or are they fixed with your sky method?

 

A bit of ftopic maybe but I also would like to have this extended renderstats you have on the shots. Especially the "batches" display. :unsure:

Quan

Posted

I can't wait to see this, your clouds are much better than what I have come up with so far which is just a sphere with a cloud map applied.

 

I have put my skybox on hold now until this one is ready as I can see myself dumping my project to use something that works in the editor :unsure:

Pancakes

Posted

Josh have you taken a look at Visual3d.Net skies and water?

 

They have one of the BEST skies I've ever seen. Please take a look at it. There are a lot more options to the sky than what you can see on the surface. I can take screenshots if you want to see what I mean.

Guest Red Ocktober

Posted

yes... yesss.... this is a must have...

 

:unsure:

 

seriously, good looking stuff...

 

--Mike

Josh

Posted

The Simul demo just produces a black screen.

Pancakes

Posted

I just tried it out and it worked at first, but then an error occured and it went black screen. Perhaps its a bug. But while it was working it looked extremely impressive.

VicToMeyeZR

Posted

I actually never tried the demo, just watched the video...

 

More just like the idea, but not the $4500/year license. :unsure:

Pixel Perfect

Posted

The simul software has been embedded into a package for Dark Basic users DarkClouds. This is available at low cost but unfortunately not usable by Leadwerks due to its DirectX rendering requirement. However, their product is integratable with OpenGL too and their SDK gives an example. If they did a deal with The Game Creators perhaps they might be prepared to do the same with Leadwerks too. Might be worth an initial enquiry Josh! Their founder and MD Roderick Kennedy is very approachable.

 

The demo runs fine for me and is very impressive.

Josh

Posted

I'd like to see a working demo.

  • Upvote 1
Pixel Perfect

Posted

I have the SDK but I haven't had time to get round to trying it yet. I'll see what I can do.

  • Upvote 1
Shard

Posted

I would very much like to see the scripted entities that you speak off.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...