Render to texture/clouds

I want to render smoke/clouds and it seems like the best way without taking a big hit on frame rate is through dynamically impostering. Does anyone have a better idea?

I’ve noticed a few discussions on render-to-textures but I couldn’t find anything that discusses it in detail. How do you render to texture and is this the optimal way to generate the textures for dynamic impostering?

Please help!

I think your talking about creating billboards by rendering an object to a texture, and then replacing the far away high mesh object with a simple billboard.

This is often done when visualizing a large city. You render the far away buildings to a texture, and replace them with a billboard. As the person drives down a road and gets closer to the billboards, then they are replaced with meshs, and new far away buildings are introduced to the scene.

Clouds are normally done with a sky box. You render the sky box as a background in your scene, and it gives the impression of clouds in the sky.

If you want animated clouds, then you add a textured cloud plane that has drifting clouds (i.e. animate the UV coords). This is blended with the sky box.

What I want to do is display a cloud of smoke sitting on terrain. I want to be able to fly through the cloud and have the view obscured when I am in the cloud. This kind of rules out a particle system because when I get real close, it looks very grainy instead of hazy. The only solution I can think of is generate what the smoke might look like from the current eye position and billboard that to a screen-aligned billboard.

I need to generate the image of the cloud from the eye position and use it as a texture. I’ve seen a couple postings involving p-buffers and was hoping someone had some tutorial on that or could show me a code snippet. Is there another way to render to texture?

How thick and big is this cloud of smoke?

If it’s really thick, and big then you could just enable OpenGL fog while your close to the source of smoke.

The fog parameters could be a function of the camera’s eye from the source of smoke.

Sort of a transition into the cloud?

Fog may work best, because if the person is walking they will be able to see the ground. But just for a few feet.

I’m not too familiar with GL fog, but I am a little concerned with it’s limitations. The smoke cloud volume will actually come from real data. For now, I assume random particles in 3D space, each particle obsuring visibility up to a certain point. I voxelize these points to create the volume and now I want to render the volume. So the characteristics of the smoke cloud volume are determined by these data points. The function that describes the distribution of the particle are unbeknownst to me as it will come from another engine and it appears that I need to know that function for GL fog.