Voxel Rendering

Started by
0 comments, last by Shadow Mint 21 years, 8 months ago
Hey ppl. Dipping my fingers into voxel rendering again after a long absence. I''d just like some general thoughts on this matter, comment on my rendering algorithm, suggestions for reading on the topic. =) Basically, I''m just flatly not interested in spacial occupancy enumeration; that is, brute 1-bit maps of there/not there in a 3D grid. What I''m dealing with is a set of voxels V, such that each voxel has RGBA and XYZ coordinates, 64-bit per voxel (8-bits reserved; possibly for lighting data) (for my purposes my voxel coordinate is > 255. This is just for my trivial testing of algorithms). My basic method for rendering the set of voxels is: 0) Prepare (Xmax,Xmin,Ymax,Ymin) render buffer. 1) Determine a point O from which to observe the voxels. 2) Determine a point P which is the render of render plane. 3) Build a set of voxels 4) For each voxel: 4.1) Find the vector equation of the line from the voxel to O 4.2) Remove the voxel from the set if the line does not intersect the render plane. 4.3) Find the magnitude of the distance from the voxel to the plane. 5) Sort the voxels by magnitude, smallest first (quicksort). 6) For each voxel (smallest first): 6.1) Find the coordinate of intersection with the render plane. 6.2) Project the coordinate onto the X vector (direction we deem "x") for the render plane. 6.3) Project the coordinate onto the Y vector (direction we deem "y") for the render plane. 6.4) If the resulting coordinate is not in the boundary of the render plane defined by (Xmax,Xmin,Ymax,Ymin) discard it. Otherwise, add the voxel value to a linked list for that coordiante of the render buffer (this is slightly complex; basically build a chain of voxels for each pixel of the render buffer for step 7; needed because the voxels have alpha). 7) Flatten each chain to a pixel value. Very trivial. Very slow. =P I''m looking for optimizations, other ideas for rendering, comments, etc. =) Also; anyone heard anything useless about lit voxels? (ie. use lights to do things) Finally: Voxels are slow and nasty, yes. BUT, maybe not as bad as you might think. If you dont record data you never see (internal) you only ever end up with a # voxels proportional to the surface area, not the surface COMPLEXITY as you tend to find with a polymesh. Ciao!
Advertisement
hm..



rgba voxelmap[256][256][256];

then rasterice your ray through that 3dvolume and check for a voxel wich is visible (alpha =! 0). then set the pixel to that color..

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

This topic is closed to new replies.

Advertisement