[Fluxus] voxels primitive

Dave Griffiths dave at pawfal.org
Wed Nov 4 06:21:05 PST 2009


Hi all,

I've added a new primitive for rendering volumetric forms. This can be
viewed directly by means of sprite 'splatting' where each voxel is
rendered as a camera facing polygon textured with a fuzzy blob. This is
all very experimental, so I haven't documented it yet other than this
email - and it's all very much subject to change.

The general idea is to play with rendering techniques which handle
transparency in different ways to polygons. It also has a very different
look which I'm quite keen on at the moment. More waffle and pictures
here: http://www.pawfal.org/dave/blog/2009/11/voxels-in-fluxus/

(build-voxels width height depth)

The voxels primitive uses two pdata arrays, "c" for the colour at each
voxel and "g" for the gradient, which is used for lighting.

You can of course read and write the same as any other pdata, but as
there tends to be a lot of data involved I've added some voxels specific
functions for quick generation of volumes:

(voxels-sphere-influence centre colour power) 
Additively applies a colour as a sphere influence, looks like this when
viewed directly:
http://www.pawfal.org/dave/blog/wp-content/uploads/2009/11/flxvox3.png
Can also be thresholded to get results very similar to the blobby
primitive.

(voxels-sphere-solid centre colour radius)
(voxels-box-solid topleft bottomright colour)
Sets colours for every voxel inside a sphere or box

(voxels-threshold value)
Sets voxels below this value to black/transparent, and voxels above to
white/opaque.

(voxels-calc-gradient)
Write the gradient values to the "g" pdata array.

(voxels-point-light position colour)
Uses the gradient to light each voxel from a point light.

I've also fixed a bug with the camera facing primitives I introduced a
few days ago when optimising them (rotations in the primitive state
transform messed with the camera facing direction).

cheers,

dave




More information about the Fluxus mailing list