Atmosphere / Cloud Renderer

DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #1
I just found a cool atmosphere rendering demo...for PC, but there was a BSD port, which i could get running halfway on the mac now, from this website:
http://sponeil.org/index.htm

Xcode Project available at:
http://dog4.dyndns.org:8080/wwwalt/SPO_S...-xcode.zip

The project file is in the "spo" folder, it has 7 targets, of which all but ScatterGPU and Planet_Quad worked for me. It needs libpng, glew and SDL. If anybody can get those two running, please let me know, I can host it if required, but I don't have the time to try and fix those two.
Quote this message in a reply
Member
Posts: 320
Joined: 2003.06
Post: #2
I have had the need to implement a similar thing at work. Unfortunately because it is a work thing I can't post code here, but it's probably fairly similar.

It's a very enjoyable thing to work on. I think getting it to produce a 'Green Flash' would be the ultimate. My current implementation cheats far too much for that to happen. Maybe one day I'll get a chance to refine it further.

On a related note, a fantastic source for terrain images like those in the screen shots is Blue Marble. You can download fairly high resolution (500m) images from that site if you look around a bit.

Also for atmosphere rendering take a look at: http://nis-lab.is.s.u-tokyo.ac.jp/~nis/a...html#sig93 and a follow up article: http://www.gamedev.net/columns/hardcore/atmscattering/

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #3
reubert Wrote:Also for atmosphere rendering take a look at: http://nis-lab.is.s.u-tokyo.ac.jp/~nis/a...html#sig93 and a follow up article: http://www.gamedev.net/columns/hardcore/atmscattering/

The site I linked is actually the site of the guy who wrote the latter article, so the code should match with the gamedev article.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #4
Alright, so I kept working on this thing, I managed to get something working based on
http://nis-lab.is.s.u-tokyo.ac.jp/~nis/a...html#sig93

Unfortunately, rendering is still a bit wonky, see the following images:
http://dog4.dyndns.org:8080/wwwalt/atmosphere3.png
http://dog4.dyndns.org:8080/wwwalt/atmosphere1.png
http://dog4.dyndns.org:8080/wwwalt/atmosphere2.png
http://dog4.dyndns.org:8080/wwwalt/spots.png
http://dog4.dyndns.org:8080/wwwalt/spots2.png

If anybody has a possible explanation, any hints are welcome. Source is available from
http://dog4.dyndns.org:8080/trac

I also wrote up an article about the process while coding it, mainly to make it clearer to myself, it's available here:
http://dog4.dyndns.org:8080/svn/ephlib/t...tering.pdf

The article is a WIP, but can hopefully shed some light on the subject for the uninitiated.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #5
[Image: atmos1.png]

Grin Grin Grin

I figured it out, at last. It was the wavelengths. When given in meters, the wavelengths of visible light are around the value 5*10^-7. That to the 4th power, as required by some of the calculations, gives roughly 10^-30. Now, this value comes close to the borders of the single-precision floating point values range, and presumably, I have not investigated further, the exp()/expf() functions do not like this range, as they are tuned to work in the vicinity of 1.0 better than with extremely high/low values. The fix was to simply scale the wavelengths to be closer to 1, and adjust the exposure parameter accordingly.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #6
More eye candy:
[Image: atmos2.png]
[Image: atmos3.png]
[Image: atmos4.png]
Quote this message in a reply
Member
Posts: 320
Joined: 2003.06
Post: #7
Good stuff!

Your black spot screenshots reminded me that I had exactly the same problem when trying to work on that code. Glad to see you found the answer, I gave up at that stage. Looks great.

Chopper, iSight Screensavers, DuckDuckDuck: http://majicjungle.com
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Using textures OpenGL switches to software renderer bruno 2 3,503 Oct 12, 2008 03:06 AM
Last Post: bruno
  Checking renderer capabilities akb825 5 2,934 Apr 11, 2006 09:04 AM
Last Post: akb825
  Renderer/Scene Graph Nick 2 2,608 Mar 31, 2006 08:54 AM
Last Post: Nick
  Can't acquire fullscreen renderer Feanor 10 4,000 Jul 21, 2003 10:01 PM
Last Post: skyhawk