Howard Matthews

howiem

About Me

Expertise
Generalist
Location
United Kingdom

Connect

Recent Forum Posts

How do I write to a specific voxel in a volume? Jan. 24, 2020, 3:39 p.m.

Tamte, that’s spectacular. You’ve not only answered my question but given me a whole technique to explore I hadn’t thought of. Thanks

How do I write to a specific voxel in a volume? Jan. 24, 2020, 3:11 p.m.

Yep, there's other ways to skin this particular cat. But this is only one cat. I have others, and they're not all as easily subdued.

And besides… being able to directly write to a voxel in a volume seems like something one ought to be able to do on those odd occasions where you want to tweak values directly. Seems needlessly complex to have to create and rasterize points just because I want to change the value of the voxel at index 972.

Are points the only way of storing multidimensional data in Houdini? Seems horribly inefficient, but I'm not sure there's a way to do it in VEX directly in an array without cheating: an array stored in an attrib on a 2 dimensional grid of points, maybe. Eww.

We can read voxels, get their index number, convert between that and the voxel position, etc etc - gotta be a way to write one surely?

I'd like to put it forward as an RFE, but if I've missed the obvious, please let me know and save my embarrassment

How do I write to a specific voxel in a volume? Jan. 24, 2020, 8:38 a.m.

I can't decide if this is a stupid question.

Vol Wrangles are great for doing something to every voxel as fast as possible, where you don't really care what order they're processed in.

I need to go through the voxels in a specific order, though, updating surrounding voxels as I go. I can sample any voxel I like (with volumesample), so I can iterate through in the order I need, but how do I write out new values to other voxels?

Or am I going to need to convert it to points or some other data form first?

(I'm doing a kinda flood-fill based cloud pruner. Imagine filling a volume with some nice fluffy clouds with space between them - a bit of tweaked turb noise. Some of the clouds will be cut off hard by the volume's bounds: I want to go round each side of the volume and remove any clouds that are cut off, without affecting any clouds that are fully contained in the volume.

Which means I need to do a kinda of “voxel connectivity” thing: start at one edge, anywhere in that first slice that there's a voxel > 0.0, set it to 0, but then mark the neighbouring voxels on the next slice as needing inspection. Then carry on through the slices of volume, but only checking the marked voxels each time. Do this process from each side of the volume in turn and you should be left with only 100% unchopped clouds.

There are other ways of approaching this particular problem but this'd be the simplest way to create the tool I want. Not least: I could do it in reverse - mark a position within a nice cloudy volume, and fill outward to select just that single cloud and ditch anything not connected by “active” voxels)