Jump to content
  • entries
    943
  • comments
    5,899
  • views
    924,389

Sunrise, sunset


Josh

5,552 views

 Share

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.

 Share

18 Comments


Recommended Comments

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.

Link to comment

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)

Link to comment

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:

Link to comment

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:

Link to comment

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.

Link to comment
Guest Red Ocktober

Posted

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

 

:unsure:

 

seriously, good looking stuff...

 

--Mike

Link to comment

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.

Link to comment

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.

Link to comment
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...