Lightest renderable scene nodes? (resource-wise)

Lightest renderable scene nodes? (resource-wise)

Anonymous
Not applicable
341 Views
6 Replies
Message 1 of 7

Lightest renderable scene nodes? (resource-wise)

Anonymous
Not applicable
I am making a maxscript to visualize some MRI data that I have.

Right now I turn every slice into colored boxes, but this is very heavy and memory intensive. (ignoring pixels under a threshold)

It's interesting though because i can voxelize it with a blob object (metaballs)

Anyway, it really chokes on 128x128 images, much less 512x512.
0 Likes
342 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
I am making a maxscript to visualize some MRI data that I have.

Right now I turn every slice into colored boxes, but this is very heavy and memory intensive. (ignoring pixels under a threshold)

It's interesting though because i can voxelize it with a blob object (metaballs)

Anyway, it really chokes on 128x128 images, much less 512x512.


The trouble here is the amount of single nodes, not their complexity. Creating 128x128 = 16384 objects means that you create that many base objects with their scene nodes. If these objects were ONE object with the same number of polygons, it wouldn't be a big deal.

The obvious solution is to use something that gives you separate boxes, but as a single mesh. It is called Particle Flow 😉 Basically, instead of writing a MAXScript to create boxes, write a Particle Flow Birth Script operator to place particles with the desired properties at the locations from the scan. Assign a Shape operator set to Box. If you want to color each particle, simply set a Mapping channel via the Birth Script or a separate Script Operator to the desired value (in the 0.0-1.0 range, so you might have to divide by 255) and enable Vertex Color shading for that channel in the PF Source inside the Particle View. To render, add a Vertex Color map to the material of the system via a Material Dynamic operator.
Instead of using a Birth Script, you could use a regular Birth set to the desired number of particles, then use a Script Operator to modify their positions and colors based on the MRI data. Might be simpler...
0 Likes
Message 3 of 7

Anonymous
Not applicable
Btw, the simplest representation of MRI data would be a point.
Anatomical Travelogue are using our Krakatoa renderer to render up to a billion sample points for medical visualization:
http://features.cgsociety.org/story_custom.php?story_id=4599

Because Krakatoa can read CSV text files as particle sources, you could just format your MRI data to our CSV specs (for example X,Y,Z,R,G,B) and load into Krakatoa and render or use the Krakatoa File Birth and File Update to load the CSV into Particle Flow without the need for scripted Operators.

The Krakatoa PFlow operators work in evaluation mode, so in a way it is free. Just the point rendering would have a watermark and it would not render in network mode, but all the other tools would be available. So if you intend to put boxes on your particles and render in Scanline, it would work for free.
0 Likes
Message 4 of 7

Anonymous
Not applicable
Thanks so much for the quick reply!

I was actually doing this to generate voxelized geometry from an MRI dataset I have.

I will look into the things you posted above though!
0 Likes
Message 5 of 7

Anonymous
Not applicable
This is a purely off-the-cuff idea, but what about checking for adjacent voxels of the same color and building only one box for them? For example, 2x3x4 region would be one box instead of 24.

Overall, the PFlow idea is a better approach, however.
0 Likes
Message 6 of 7

Anonymous
Not applicable
I am looking into the pflow idea (never worked with pflow), but I got it working in one version last night by coloring the vertex colors of a cube then attaching it to the mass of them.

This script is really getting me to wrap my head around memory management and garbage collection 🙂

I will post the diff incarnations here when I finish.

CE
0 Likes
Message 7 of 7

Anonymous
Not applicable
I wrote a a post about it with maxscript and examples.

http://www.chrisevans3d.com/pub_blog/?p=105

Unfortunately I didn't get around to scripting pflow, maybe next time.

CE
0 Likes