Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 


Submitted by Jean-François Dubé, posted on January 15, 2005




Image Description, by Jean-François Dubé



Here are some shots of my sky system. The clouds are 100% generated and lighted on the GPU. I use 8 octaves Perlin noise, and the lighting is integrated on the GPU using a ray-tracing technique that I described in details in the upcoming Game Programming Gems 5 book available in March 2005. The clouds are fully dynamic, I can control the speed of deformation, the speed and direction of the wind, the density over the entire sky, etc.

Here’s some other shots and videos, all rendered on a GeForce6800:
  • http://www3.sympatico.ca/deks/CloudsShot01.jpg
  • http://www3.sympatico.ca/deks/CloudsShot02.jpg
  • http://www3.sympatico.ca/deks/TestSky01.avi
  • http://www3.sympatico.ca/deks/TestSky02.avi
  • http://www3.sympatico.ca/deks/TestSky03.avi
  • Thanks!
    Jean-François Dubé


    [prev]
    Image of the Day Gallery
    www.flipcode.com

    [next]

     
    Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
     
    Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
     
    John Schultz

    January 15, 2005, 01:01 AM

    Excellent work. Fly through clouds too?

     
    Dan Royer

    January 15, 2005, 01:38 AM

    Great work, very nice animations. Those are some very nice Stratus clouds. Have you given any thought to generating Cumulus/Cumulonimbus and Cirrus clouds? I'd be very interested in a discussion on that subject.

     
    theAntiELVIS

    January 15, 2005, 01:46 AM

    Impressive. I guess the obvious question is: is there any time left per-frame to do anything else?

     
    Victor Widell

    January 15, 2005, 03:55 AM

    Cool, but not realistic.

    Clouds tend to form and dissolve with the change of temperature etc. This mainly happens when the air is forced to rise or sink, by convection or when blown over a mountain.

    I guess this can be pretty difficult to simulate/emulate.

     
    Rui Martins

    January 15, 2005, 06:12 AM

    Very nice indeed.

    However, in some shots, especially the videos (due to movement) provide a flat fealing relative to the clouds positioning/movement. the Clouds fake volume well, but they seem to be all in the same plane.
    Can this be changed or is this a limitation of the algo ?

    Well one can always make N planes to hide that, but a real solution would be better.

    Also the Sun occlusion by clouds looks very good, although the Sun highlight (white light) seems vary imensilly, and sometimes, seemed unsynchronized with the actual cloud that should be occluding it. i.e. occluded when it shouldn't, or too small cloud makes big occlusion.

    Also, the videos would be a lot better, if you included shadows on the terrain, from the terrain itself (this is a must to not break the reality fealing) and from the clouds.

    Finally, can you set the density (perlin noise) of the clouds, by regions ?

    This is fundamental to break the continuity of the clouds, that somehow always seem "connected" to each other.
    There is something like this on one of the videos, but it seemed to be a variation of the overall density while moving the camera, giving the impression of what I just said.

    Nice work anyway, very believable, expecially, if the clouds don't move so fast 8).


     
    mikie

    January 15, 2005, 06:13 AM

    The clouds look like the form and disolve , but they do look quite uniform and
    also, although lit, look very flat - no curvature (sort of ruins the effect). Colours are also a bit off.

    6800 - does this require PS 3.0 ??

    Some static shots of Yanns and others look better, but I am glad we
    see videos here.





     
    Dube Jean-Francois

    January 15, 2005, 08:18 AM

    Thanks for the comments!

    John Schultz: No, I can't fly through clouds. The effect is 2D.

    theAntiELVIS: After lots of optimizations, yes. Its going to be part of an upcoming commercial game.

    Rui Martin: Yes. The density and other settings can be customized per pixel by the artists, allowing storms formations at the horizon, etc.

    mikie: Yep, pixel shader 3.0 is minimum. Every pixel run through a 64 ray-marching sun to cloud ray integration, so loops are used. I had a pixel-shader 2.0 version working, doing the integration using 64 passes into a render target, but if was really slower that what it is now.

    Jean-Francois Dube
    =[dEkS]=

     
    mikie

    January 15, 2005, 02:52 PM

    You say commercial game, I wonder what fall back you would do for non- PS 3.0?
    With top ATI cards still being 2.0b and plenty of people running 2.0 and 1.1?

     
    =[dEkS]=

    January 15, 2005, 03:06 PM

    mikie wrote: You say commercial game, I wonder what fall back you would do for non- PS 3.0? With top ATI cards still being 2.0b and plenty of people running 2.0 and 1.1?


    Fallbacks are possible, but without tracing ray through the clouds. Looks like http://www3.sympatico.ca/deks/skyshot.jpg this and it runs on low-end hardware.

    =[dEkS]=

     
    knackered

    January 15, 2005, 06:02 PM

    Interesting pixel shader experiment, but used in a commercial game?! I don't think so. They just don't offer a dramatic enough improvement on static texture maps, yet use sh*t loads more resources. They also don't look anywhere near as good as the cloud systems used in things like sturmovik and skyworks - so if the game is cloud orientated, then your system is going to look silly and amateurish to the casual observer.

     
    =[dEkS]=

    January 15, 2005, 06:59 PM

    knackered wrote: Interesting pixel shader experiment, but used in a commercial game?! I don't think so. They just don't offer a dramatic enough improvement on static texture maps, yet use sh*t loads more resources. They also don't look anywhere near as good as the cloud systems used in things like sturmovik and skyworks - so if the game is cloud orientated, then your system is going to look silly and amateurish to the casual observer.


    Looking at the history of your posts, its not even worth an answer. We'll just all sit here and wait for your image of the day submission.

    Thanks for sharing your anyway!
    =[dEkS]=

     
    mikie

    January 15, 2005, 08:09 PM

    Deks didn't i see your screenshots on gamedev.net?
    I recognise your nick anyway. Are you doing 2 different versions
    of your sky?

    Im interested in the performance


    I think MS flight sim got a really pretty result
    the lighting/colour works really nice - the other "harris style"
    of clouds though rather than this method.

    http://www.ofb.net/~eggplant/clouds/

     
    mikie

    January 15, 2005, 08:28 PM

    Knackered, IOTD is where people post WIP, the sky has potential for use
    in a game and resources costs + type of game are unknown to you - thats your speculation.

    The method you suggest of billboards and imposters + lighting also requires lots of resources and has performace penalties of overdraw.

    After all this method deks is using is not much different from the
    original terragen method which holds up pretty well I think (although about
    to be superseeded by the amazing new clouds :) )

    I think there is still some way to making this IOTD as good
    as it could be, it requires constructive replies though to make it
    happen.












     
    =[dEkS]=

    January 15, 2005, 08:33 PM

    Mikie:
    Yep! I posted some shots before on gamedev, these were the first iteration of my sky system. Performance wise, the ray-tracing shader is really intensive, and it highly depends on the resolution and z-rejection situations. For a full sky rendering in 1024x768, I get it to render at 60fps, and in real-game situations, with at most half the screen rendered, its acceptable on high-end hardware.

    MS flight sim got pretty good results, but their main goal is to be able to go through clouds: in my case, the player is always on the ground, but I think it could still be relevant to try.

    =[dEkS]=

     
    Gavin John Costello

    January 16, 2005, 04:23 AM

    Very cool stuff indeed. I've been trying to implement something like this (on and off between university work and working on other sections of the engine) into my own program.

    So far my results, although "good for a first try", are considerably less impressive than the ones in your videos (or indeed, in Yanns screenshots!)

    I was wondering something (before I rush out and pre-order the book)... on the book's site it says:

    "Ready-to-use source code is included for each algorithm and can be used immediately"

    I was wondering just how "ready to use" the example you have provided for the book is (I would very much like to pull it apart (in a good way) and fiddle with parts to see where I was going wrong).


    If I'm going to be able to get the book, compile the source for this project as-is, and have a look at it running realtime with no problems (then pulling it apart and fiddling with it of course) then I'll be happy.

    If, on the other hand, it's more of a "discussed but not demonstrated with source" feature (as in many of the ShaderX books), then I'll have to think more carefully over whether the book has anything I need.

    Thanks for your time.... once again, nice IOTD, very cool stuff.

    ~GavinC~

     
    Sébastien Lussier

    January 16, 2005, 06:52 AM

    Hey, good job JF ! ;)

    It will be nice to see that in your next game !

     
    shahar eldar

    January 16, 2005, 07:08 AM

    neat method, I created an implementation similar to this, but in 3D studio Max I did not use a dynamic noise texture, I merely generated my clouds in photoshop, and then layered them, using the upper layer as the lit layer and lower one as darkened,
    by using creative UV mapping and the exact same texture, you can also create atmospheric cloud shadows using the exact same method, you can also create varying times of day and so on, again all by varying the UV coordinates on your cloud planes.

    http://home.earthlink.net/~shahar/Gallery/3D/Movies/cloud_layers.jpg
    http://home.earthlink.net/~shahar/Gallery/3D/Movies/cloud_layers2.jpg

    disclaimer: IANAPBIAA3A - I am not a programmer but I am a 3D artist :) though I do know enough about programming to read code.

     
    shahar eldar

    January 16, 2005, 07:17 AM

    oh nevermind I took another look at it, looks like you're using that paralaxing stuff on the GPU as well, so you can probably accomplish what I did using a single texture layer... (my method though could run back in the day on a Geforce 2, but didnt look quite as good...

    still I think you can still do a good atmospheric shadow addition... you'd need to render the cloud plane to a buffer and found a way to do a motion blur coming outward from the sun, (basically a 2D "scaling" effect centered around the sun) ) you could get a real nice sun beam/cloud shadow approximation that would really add volume to your scene

     
    knackered

    January 16, 2005, 09:15 AM

    I am in no way disrespecting his achievement, I just don't see a use for it at this moment in realtime graphics. Any ground based game is not going to be willing to spare the kind of per-pixel resources required by this technique just for something to fill in the gaps above the horizon between buildings, when a rolling texture map would give 95% the same impact. Unless of course that game had lots of fillrate to spare, which so far is a luxury I've never had!
    Fillrate is like gold dust, so I ain't gonna pump it through a complicated pixel shader for 35% of the screen space.
    And for an air-based game, the quality of the technique isn't good enough. That's not an opinion, it's just obvious from the videos and screenshots that this is a planar technique, which is obsolete in air-based games. We're used to volumetric effects now!

    QUOTE: "The clouds are 100% generated and lighted on the GPU. I use 8 octaves Perlin noise, and the lighting is integrated on the GPU using a ray-tracing technique"
    You seriously think that's a good use of resources?

    This isn't criticism for critisisms sake, I'm impressed by what can be done in a pixel shader these days, but I don't see the use in a real world application.
    How am I supposed to be constructive when the fundamental point of this IOTD is that it's done through a pixel shader and I think that's not a good use of cycles?
    I've justified my comments, which is more than the "hey, cool" brigade have.

     
    =[dEkS]=

    January 16, 2005, 10:22 AM

    knackered wrote: "You seriously think that's a good use of resources?"
    I understand your fears, but you don't even know what's going to be the target platform. Maybe that game is supposed to release in 5 years? You don't know. But I admit it, it is a fillrate eater, and games could/should spend fillrate in a tons of other places, when required, depending on the target hardware.

    =[dEkS]=

     
    Victor Widell

    January 16, 2005, 05:43 PM

    " http://home.earthlink.net/~shahar/Gallery/3D/Movies/cloud_layers2.jpg "

    It would look a lot better if you instead _added_ light _between_ the clouds. That way, you would have sun beams like the ones you se on a day with some mist.

     
    shahar eldar

    January 17, 2005, 01:23 AM

    I tried that one too, thing is, light shafts/volumetric shadows are mutually exclusive, and occure depending on the condition of the cloud cover. if you have a high cloud cover with only a few holes in it than you will notice the light shafts, but on the other hand if you have only a few clouds hanging in a mostly clear sky then you will notice the shadows more than the light.. one way to emphasize this would be to write the code so that the "eye" of the camera adjusts for available light, (basically fake HDRI), that way the lighter areas will be emphasized with a high cloud density and the darker areas with a low density.

     
    hexmax

    January 18, 2005, 03:14 PM

    Looks nice, but to be honest imho this looks like smoke or the like
    and not like clouds.

    Some time ago I saw some very impressive screenshots which show
    really nice looking clouds - as far as I know using pretty much the
    same technique used here, but not in the GPU.

    http://www.gamedev.net/community/forums/topic.asp?topic_id=86024

    btw: this thread tries to explain how to do such clouds too.

     
    This thread contains 23 messages.
     
     
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.