Atmosphere / Cloud Renderer
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.
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.
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/
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
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.
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.
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.
![[Image: atmos1.png]](http://dog4.dyndns.org:8080/wwwalt/atmos1.png)

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.
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.
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
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Using textures OpenGL switches to software renderer | bruno | 2 | 3,111 |
Oct 12, 2008 03:06 AM Last Post: bruno |
|
| Checking renderer capabilities | akb825 | 5 | 2,637 |
Apr 11, 2006 09:04 AM Last Post: akb825 |
|
| Renderer/Scene Graph | Nick | 2 | 2,364 |
Mar 31, 2006 08:54 AM Last Post: Nick |
|
| Can't acquire fullscreen renderer | Feanor | 10 | 3,777 |
Jul 21, 2003 10:01 PM Last Post: skyhawk |
|

![[Image: atmos2.png]](http://dog4.dyndns.org:8080/wwwalt/atmos2.png)
![[Image: atmos3.png]](http://dog4.dyndns.org:8080/wwwalt/atmos3.png)
