3d texture rendering

Started by
4 comments, last by Brisco 18 years, 3 months ago
is there any good sample codes for 3d texture based volume rendering? (direct3d) Also, is this possible to do in ps2?
Advertisement
Also, is there a game out there which uses 3d-texture based volume rendering to create fog effect? (or smoke)

thanks
With shader 3 support it is easy to implement a simple raycasting approach as described in the Levoy paper. The approach is easy - create a cube and assign RGB values to it's axes in a way that the left-lower-front position is black and the right-upper-back position is white, so the x-axis represnets R, y represents G and z represents B.

Then, render first the front faces of the cube into a texture. After this is done, render the back faces of the cube into a texture and subtract the colours from the previous pass - this will give you direction vectors which can be used to perform raycasting through the volume.

In a next step - render the front faces of the cube again and use a shader to iterate through the volume - that's it.

Without shader 3 you could use multipass rendering to trace through the volume, maybe you can find some useful information on http://www.vrvis.at/home_de.html, I had to implement this myself a few weeks ago - it is really simple.
Hope this will help.

Brisco
"Also, is there a game out there which uses 3d-texture based volume rendering to create fog effect?"

I don't think so - because of performance reasons. There are better methods to fake volumetric fog/smoke using simple billboards.
currently, i have to implement atmospheric fog effect, which has to swirl around a player. For such an effect in realtime, are you suggesting that 3d-texture based rendering is inefficient in the current generation of hardware? i was hoping that i could use 3d-texture based volume rendering for this effect since i'll have to use a lot of particles otherwise.
It is not easy to implement such an effect with the classical volume remdering approach - main reason for this is that the player (or to be more exact the camera) may be within the volume, which leads to the problem that you have to alter the geometry that is used to render the volume at runtime. Another problem is that interactions of the volume and geometry has to be considered - there are ways to do this, at least one of them is described in the "Advanced GPU Raycasting" paper written by Henning Scharsach - others may be available on the vrvis website, I didn't read them all. :) Of course another problem will be to perform updates to the volume (which is necessary for the fog effect you want to implement) - so, I think a particle approach is really better to fake volumetric fog.

Nevertheless - volume rendering will become an important effect in next generation games, but I think it will first be limited to "local effects" - fog affects usually a large area and this can't be rendered using simple volume rendering because of fillrate limitations.

Brisco

This topic is closed to new replies.

Advertisement