Sign in to follow this  
Norman Barrows

drawing clouds in a flight sim

Recommended Posts

anyone out there done a flight sim where you drew clouds you could fly through?

 

i'm working on a flight sim right now, and a simple skybox doesn't seem to be the way to go. maybe if its REALLY big, and used just as a "horizon" type background....

 

or do I just need to move it vertically with the camera as well as horizontally, make it really tall, and have it extend below the horizon ?

 

I've heard things about MS flightsim 2004. often mentioned in threads. custom models and textures. and alpha bending most likely.

 

 

 

 

Share this post


Link to post
Share on other sites

I'm still a newbie, but I would probably suggest using some sort of particle system.

 

I did think of using a 3D model of a cloud, but when you go through it, it wouldn't display anything inside it. So a particle system would work well.

 

 

The way you would implement it would depend on what API or engine you are using.

Share this post


Link to post
Share on other sites

I'm still a newbie, but I would probably suggest using some sort of particle system

 

correct. unless they're hard coded to some location and don't move. but i haven't seen any clouds nailed to the sky in real life, so they probably ought to move <g>.

 

its the drawing of the particles thats the tricky part.

 

 

I did think of using a 3D model of a cloud, but when you go through it, it wouldn't display anything inside it

 

just turn off backface cull.     

 

but a box mesh wouldn't look right. i suspect MS fight sim 2004 used meshes like the cardboard dividers in a case of wine. IE stacks of quads in all 3 directions, with alpha blended cloud images on each quad.

 

in another title i'm working on, there are 20 particles, a particle mesh is an almost flat octahedron, and each mesh has 4 clouds on it, yielding 80 clouds total. but it only does alpha test. the result is somewhat akin to clouds in roadrunner cartoons.

Edited by Norman Barrows

Share this post


Link to post
Share on other sites

but a box mesh wouldn't look right. i suspect MS fight sim 2004 used meshes like the cardboard dividers in a case of wine. IE stacks of quads in all 3 directions, with alpha blended cloud images on each quad.

If your are curious about Microsoft Flight Simulator 2004's clouds, HERE'S the paper.

Share this post


Link to post
Share on other sites

I once worked on a flight sim and also had to do the clouds you can fly through. I started with Wang's (MFS 2004) approach and added some shader tricks later.

Results were not super realistic, but, well, they worked. We were able to set different density from clear to totally overcast and fly through.

http://oi50.tinypic.com/fc7f5y.jpg

http://oi48.tinypic.com/2njzuis.jpg

http://oi50.tinypic.com/5clisk.jpg

http://oi45.tinypic.com/2v8onl2.jpg

http://oi45.tinypic.com/2yu0pxh.jpg

 

Each cloud is made of 5-20 billboards and there are around 0-200 clouds on the sky. Billboard positions inside a cloud are randomly generated when the game starts. On runtime they were "tiled" - I just moved them according to the wind and when a cloud moved beyond certain limit from camera, it then would respawn far away on the other side of the sky and will start moving again.

All billboards of all clouds are drawn in 1 DIP, thanks to instancing. However, due to alpha sorting, instancing buffer has to be updated each frame (there must be a better way).

Shader tricks include making the bottom of cumulus clouds look kinda flat, direct lighting, simple fake SSS and alpha/billboard rotation changes when inside a cloud.

Edited by Mr_F_

Share this post


Link to post
Share on other sites

There are many ways to render clouds, and many more yet to discover. The era of computing power that starts will open on much awesomeness in that area.

Mark Harris and Wang are two pioneer, with Dobashi et al, (http://nis-ei.eng.hokudai.ac.jp/~doba/pub_doba.html), Antoine Bouthors, and also the guys from Lumion3d.

Flavien Brebion experimented on Dobashi's method:

http://www.gamedev.net/blog/73/entry-125220-volumetric-clouds/

I also implemented that method, it also exists in commercial products (silverlining..), and a demo of the GDC 2008.

 

For the "color" it always boils down to the problem of scattering. I recommend the reference in the papers of Antoine Bouthors about that, they are the most precise and scientifically correct. People generally struggle with higher order scatterings, therefore technics limits themselves to order 0 and 1 most of the time (Mark Harris). And the higher orders are just artistically decided as an ambience color. Or some empirical tricks using sky irradiance and desaturation modulated by an empirical albedo.

 

For the shape, either fractal, either state machine (Dobashi), either mesh (last Bouthors) + hypertexture for borders enrichment. but the enrichment would be much faster with a fin-based method. I personally intend to develop a procedural mesh construction + fractal enrichment method some day. I forsee to store the distance towards exit in each vertex (in any direction) stored in spherical harmonics, this would allow immediate shading for 0 and 1-scattering.

 

The rendering of the inside should be made with a separate method, a screen space method since the cloud appear everywhere when inside of it, and objects penetrating cloud volumes can be shaded using the concept of spherical billboards.

Share this post


Link to post
Share on other sites

Each cloud is made of 5-20 billboards and there are around 0-200 clouds on the sky. Billboard positions inside a cloud are randomly generated when the game starts. On runtime they were "tiled" - I just moved them according to the wind and when a cloud moved beyond certain limit from camera, it then would respawn far away on the other side of the sky and will start moving again.

 

very similar to the technique i used in the previous version of the "other title" mentioned above. but it had just one billboard per cloud, and i think it was 400 clouds, "tiled" or "wraparound particle system" as i call it.

Share this post


Link to post
Share on other sites

The rendering of the inside should be made with a separate method, a screen space method since the cloud appear everywhere when inside of it

 

thanks for the tip!

 

BTW, did you see my last question to you in the related thread on methods for drawing the sky?

I was hoping for a confirmation of my summary of your method discussed there.

Share this post


Link to post
Share on other sites

The rendering of the inside should be made with a separate method, a screen space method since the cloud appear everywhere when inside of it

 

thanks for the tip!

 

BTW, did you see my last question to you in the related thread on methods for drawing the sky?

I was hoping for a confirmation of my summary of your method discussed there.

oops sorry i hadn't seen. fixed :)

Share this post


Link to post
Share on other sites

The technique I've been thinking of implementing is based on particles.  Basically, you sample a 4D noise function that creates animated clouds and create particles for each sample, varying size based on the density of the function.

Share this post


Link to post
Share on other sites

The technique I've been thinking of implementing is based on particles.  Basically, you sample a 4D noise function that creates animated clouds and create particles for each sample, varying size based on the density of the function.

Yes that is a nice idea, it can definitely create a cool effect. a bit heavy on the sides perhaps, also will need serious thinking about lighting. Scattering is not solved with this solution. There are some people who did that already, I can't finf the video again, but this one looks about like that:

https://www.youtube.com/watch?v=bNYjFMplByc

other interesting struff from the guy developing the Unity Nuaj plugin:

https://www.youtube.com/watch?v=I1_f0z3Ht-k

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this