Recommended Posts

I've read a couple of presentations on volume rendering. (Frostbite volume rendering, AC4 volume fog), They are using 3D texture as intermediate storage that is later used for ray marching (so that you can raymarch once for multiple volume entities). However, you need to 'voxelize' the volume entities into this intermediate 3D storage ... can anyone explain how to achieve this?

i think since the target rt is 3D texture, we need to render the volume entities into each depth slice of 3D texture with adjusted near/far plane ... but not sure.

Share this post

Link to post

Share on other sites

There are multiple ways how to 'voxelize' your data into a 3D texture.

Everything is based upon what your data are. In general, most common cases are:

Point cloud

The point cloud is quite a bit tricky - everything goes down to a question, what your points represent? If they represent fully opaque point in space, then you might consider the naive algorithm - divide part of space into voxels, if there is one or more points in this voxel, set it to opaque, otherwise it is clear (empty voxel). Color can be 'average' color for all the points in given voxel volume.

Of course more complex algorithm can be used when you are treating for example fox, or semi-transparent surfaces in general - which is where the fun begins (using some crazy functions to describe the opacity of your voxel, etc.).

Triangular geometry

Now, one of the common approaches is to render slice-by-slice using conservative rasterization (this way a triangle generates voxels in such way that there is no hole in the result). You can rasterize with color of course.

Another approach is casting rays from left side of voxel cube (from the center of each voxel on that side), and writing those voxels that are inside a geometry object as opaque (of course this way you can also assign color).

Also an approach where you generate point cloud from your geometry and perform point-cloud based voxelization might be viable (triangular data is far too complex - this can be one of the cases).