PDA

View Full Version : Speed up cloud rendering



RCMaster
12-07-2002, 11:37 AM
Hello,

Has anyone ever tried "in clouds" rendering, e.g. for a flight sim ? I mean, rendering clouds seen from the ground is *not* so difficult... But when it comes to render them when you're in the middle of them, it's no longer a child's game. To create a realistic effect, i use several quads, textured mapped with basic cloud textures, that I make run towards the camera. The point is that I face a major slowdown, as several quads (full screen size when just in front of the camera !!) are being drawn at the same time, thus reaching the max fill rate of my poor GeForce 256 DDR.

Is there any particular trick to avoid this slowdown ???

Thanks a lot for your answers ! http://www.opengl.org/discussion_boards/ubb/smile.gif

RCMaster

richardve
12-07-2002, 02:22 PM
Have you already read this (http://www.cs.unc.edu/~harrism/SkyWorks) article?

zed
12-07-2002, 05:59 PM
if thats the paper i read before (about imposters) its not gonna help.

im dying to know of an answer to this as well, some things that will help

*try enabling alphatesting as well (choose the highest (nicest) value + use GLGREATER ), of course the cloud texture will require an alpha channel.
*use texture compression
*use lower quality internal textureformat
*luminance alpha texture

henryj
12-08-2002, 11:03 AM
It's a fill rate issue. It's got nothing to do with the texture format or whatever. Basically you have to reduce the number of pixels you draw.

Alpha test will help, but you always enable that when you enable alpha blend, right http://www.opengl.org/discussion_boards/ubb/smile.gif

Some sort of depth complexity algorithm might help, but the time for this to execute will probably kill you anyway.

I've got it running pretty fast, but then the gFarce4 has fillrate to burn. Fill rate is still the bottle neck though.

If you can't render one full screen textured quad at acceptable frame rates then there is nothing you can do.

Zeno
12-08-2002, 02:40 PM
I have quite a bit of experience with cloud rendering (see web site in my profile). It's tough to get it both fast and nice looking, but it is possible, so don't give up. Keep these things in mind:

1) Imposters are your friend. You can get by with a huge size reduction in clouds, since people don't mind if they're fuzzy.

2) If you don't go with a voxel-splatting approach, you should really upgrade to a Geforce3/Geforce4 so that you can use 3D textures. It'll cut your texture memory requirements in 1/3 and help with artifacts. A Geforce4 will really help you on fill rate.

3) I wouldn't recommend compressed textures. I've found the artifacts unacceptable. You can get away with using GL_ALPHA only, though http://www.opengl.org/discussion_boards/ubb/smile.gif

-- Zeno

zed
12-08-2002, 07:14 PM
>>It's a fill rate issue. It's got nothing to do with the texture format or whatever<<

yes it does try this
A/draw a 512x512 sized texture over the whole window check the fps.
B/draw the same 512x512 texture (but this time compressed) check the fps.

B should be about 20% quicker than A even though the same number of pixels are basically being filled

ps i dont know if drawing order will help cause depthwrites are most likely turned off

JustHanging
12-09-2002, 11:44 PM
My first post..

Actually, you can make very nice clouds just by rendering the slices into a low resolution texture and scaling it to fullscreen. Even 128*128 looks ok, and runs fine on my TNT with terrain and all

Also, distant clouds could be rendered to a higher-resolution texture, since these are the ones that suffer from the low res. Luckily those also require much less fillrate, so the speed shouldn't drop that much.

If 3d textures are not available, they can be simulated by two crossed textures. Texture 1 is the cloud thickness map (in alpha) and texture 2 is an alpha ramp ranging from 0 in the bottom, to 1 a little above, and back to 0 in the top.

Lighting can be encoded in the color channel of the thickenss map. Also, by making the ramp texture dark in the bottom makes the clouds darker in the bottom as well. I use a 2d-texture as a ramp texture, with some noise to create small-scale detail.