Previous Blog Next Blog
Prev/Next Blog
by date

Air Ace Clouds!

Air Ace Clouds!
Name:Thomas \"Man of Ice\" Lund
Date Posted:Mar 26, 2006
Rating:3.5 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Thomas \"Man of Ice\" Lund

Blog post
Ahhhh

Yesterday I was playing Heroes of the Pacific for inspiration, and noticed how much clouds mean in an air combat game.

So what better than to sit down and code a cloud renderer object for Air Ace?

(The observant reader would already now guess that I succeded - why else post a new blog) :-)

So without much further talk here are some screenies!!


One of the first attempts where "something" appeared on screen



Now it can scale the cloud puff billboards



And finally a nicer texture and something that actually looks like a cloud!!



But screenshots dont make this any justice.

Check out a little movie I made. 2 large clouds with approx 40 billboards in each of them.

Movie link (~7 MB)

Single cloud movie - fluffy fluffy
Movie link (~2 MB)


The clouds are very network efficient (single position for the entire cloud combined with a random seed + info on sizes of cloud+puffs).

I'm still fighting with getting texture lighting modified, so that the puffs on the underside are darker than the ones towards the sun. The code is in, but changing color has no effect for some reason.

Still room for improvement, but it looks damn cool!

Recent Blog Posts
List:01/22/07 - Super simple script based name generator + Air Ace bomber
09/28/06 - Air Ace ready for alpha testing
09/05/06 - Adventures under a blood red sky (clouds)
06/17/06 - Air Ace Update Server + Launcher
03/26/06 - Air Ace Clouds!
03/05/06 - "I'll be back" and here I am - Air Ace update too!
12/17/05 - Going down....
07/23/05 - Been offline - status

Submit ResourceSubmit your own resources!

Brian \\\"Cybore\\\" Smith   (Mar 26, 2006 at 11:02 GMT)
Awesome stuff!

James   (Mar 26, 2006 at 12:46 GMT)
That's pretty sweet - nice job :)
My only comment would be to drop the brightness down a bit as it's a tad on the blinding side now.
Well done!

Allyn "Mr_Bloodworth" Mcelrath   (Mar 26, 2006 at 14:52 GMT)
oooooooooooo


Resorce please =)

Thomas \"Man of Ice\" Lund   (Mar 26, 2006 at 15:00 GMT)
Updated with a new movie. Looks really fluffy

FRAPS took the Queens of the Stone Age music from my mp3 player without me noticing it - ignore ;-)

Allyn "Mr_Bloodworth" Mcelrath   (Mar 26, 2006 at 15:19 GMT)
Just watech the video...

It seems like the plane is ingored by the clouds, and allways renders "on top" or "in frunt" of the clouds...

Thats my only comment... mabye its the dredded Transpersency issue with torque and transparent objects...

Im not sure.

Looks great thoe, and i would love to see this a resorce!

"FxCloudsreplactor" =)

Brandon Maness   (Mar 26, 2006 at 16:13 GMT)
Very nice. How large have you been able to make the clouds before the system slows down?

Thomas \"Man of Ice\" Lund   (Mar 26, 2006 at 16:25 GMT)
Hmmm - I could really use someone to help with getting the blendign down right.

The overbright cloud is due to the alpha blending settings used


GFX->setSrcBlend( GFXBlendSrcAlpha );
GFX->setDestBlend( GFXBlendOne );


I've played around with these, and I got it to render the colors correctly, but it still looks wrong. I guess its time to pull out the books / Google and learn about all these to understand the blending mechanism.


@Brandon

Havent tried stressing it yet. I dont have a machine thats useful for it (too powerful - dual core 4800+ and 2 SLI enabled 7800 GTX cards). Will do soon though. I did some tests using 5 very large "puffs" rather than 50 smaller spread out. It still looks like clouds, so I guess you can always compromise speed for beauty.
Edited on Mar 26, 2006 16:28 GMT

Adam deGrandis   (Mar 26, 2006 at 17:59 GMT)
Looks great! :)

Todd Pickens   (Mar 26, 2006 at 18:13 GMT)
Very cool, I have actually been working on some cloud ..."tech" from an artist stand point, ie non coding.

It looks like you are using additive blending, try turning that off, you will eliminate the over brightness, and can then tune the look directly in the art. At that point, you should also be able to produce a nice effect with fewer boards rendered.

I am sure there are more elegant way to do this via code, but that would be my artist simple approach.

Cholly   (Mar 26, 2006 at 19:39 GMT)
@Todd - RE: Additive blending. If I recall correctly we set "useInvAlpha = true" in the particleData datablock to get rid of overbright smoke and such correct?

Tom Spilman   (Mar 26, 2006 at 20:00 GMT)
@Thomas - You may want to take a look Wang's work for MS Flight Simulator.

Todd Pickens   (Mar 26, 2006 at 20:57 GMT)
...errr, not sure, sounds right. But do the opposite of what you are doing now.

Josh Moore   (Mar 27, 2006 at 01:56 GMT)
I've been fooling around with volumetric clouds in TSE myself:



IIRC, there's 25,000 billboards being rendered in that shot(was stress testing it). I think it performs really well, but as you can tell, I can't the the alpha blending to work right. I would be glad to share this with you if you're willing to help me get this working properly. Drop me an email if you're interested or have any questions.
Edited on Mar 27, 2006 01:58 GMT

Todd Pickens   (Mar 27, 2006 at 04:58 GMT)
Josh, I haven't played around in TSE yet, so no direct experience to speak from on it. However, I can suggest a few things from looking at the screen.

First, I think you have WAY too many boards there, try larger and fewer, it will cut down on the over draw in theory.

Second, as Cholly mentioned, I used "useInvAlpha = true;" in my smoke script for the volcanos in my content pact.



I am experimenting with some clouds for "Surrender Yer Booty" and my next content pack, but don't have any screens to show yet, However, I am working with the same setting. it looks like you are using the same setting.

Second, there is a setting in the fxFoliage Replicators called "alpha cutoff" under the culling tab, which will effect the interpretation of the gray scale value range in the alpha channel of the image. I don't know how you have the clouds set up in the TSE demo, but it looks from the screen shot like you need to tune alpha cutoff because I can see some "halos" around the images as they overlap. To a certain extent that is just gonna happen, but it can be mostly tuned out by tweaking your setting and tuning the art.

Hope this helps, if not ignore my babbling.

Todd Pickens   (Mar 27, 2006 at 05:11 GMT)
Thomas, by the way, sweet movies, makes me think of the original arcade game "Red Baron", my all time favorite flight game.

Phil Carlisle   (Mar 27, 2006 at 08:43 GMT)
Ahh Todd, you at least made me very happy with that last statement :)

Phil.

Todd Pickens   (Mar 27, 2006 at 16:27 GMT)
Phil, ....so was it the part about ignoring my babbling, or the Red Baron Game?

Joseph Euan   (Mar 27, 2006 at 17:33 GMT)
wow.. looks pretty sweet... great job!

Josh Moore   (Mar 27, 2006 at 18:18 GMT)
Thanks for the suggestions, Todd, but as you can see in this screenshot, I had it working right in the past:



What changed? That code was using brute-force billboarding and GFX rendering, while the newer stuff uses a shader(much like the FxFoliageReplicator). The coulds in the first shot are actualy very dense(25,000 particles, at 130 FPS!!!!), and you shouldn't beable to see through them at all.

@Thomas/Phil: If you guys are hesitent about contacting me, I'm not looking to help with AirAce or get royalties or anything like that. Simply collaborating with me to get the the dang thing working right is enough for me.
Edited on Mar 27, 2006 18:54 GMT

Todd Pickens   (Mar 27, 2006 at 19:44 GMT)
Josh, looking at the two images in comparison, I see that you definitely had something going well.

So yup, the question is what changed?

The clear difference in the two images is the alpha cut off. In the first image (your current version of the cloud) , it is causing a big halos around each board which is preventing the effect you want. If the code is "much like the FxFoliageReplicator", take a look and see if you are reproducing the effect.

I can replicate the problem very easily with the fxFoliageReplicator, in fact I did before posting the suggestion in order to make sure I remembered correctly. The only difference was that I was using boards of grass, rather than clouds

Josh Moore   (Mar 27, 2006 at 20:04 GMT)
I actualy removed the alpha cutoff stuff, IIRC. I think the problem is either the alpha blend mode or the alpha blending in the shader is messed up(probably this one, as I know nothing of shaders).

Todd Pickens   (Mar 27, 2006 at 20:34 GMT)
Welp, I am not a coder, as if that wasn't obvious, but my guess would be that if you removed the "alpha cutoff stuff", then it is probably rendering based on a default parameter in the engine code, which may not be the setting you need to get what you want.

Just a stab in the dark

bryce   (Jun 26, 2007 at 12:21 GMT)
Nice Clouds, Thomas!

But one thing; That terrain/airbase flickering thing is kind of annoying.
Edited on Oct 27, 2007 12:37 GMT

You must be a member and be logged in to either append comments or rate this resource.