Jump to content

Color Volume by Points/Particles


kai.scorpio

Recommended Posts

My situation is that I am trying to color some smoke depending on the color of points inside the smoke.

The setup is a popnet that creates some particles, and a volume is created from these particles using the iso offset node, sampling set to point-cloud. However, my smoke is now white, and I would like to make the color of the smoke the same as the color of the particles at that location in the smoke. How do I do that?

Is there another method other than copying metaballs to the particles and creating a volume from that, as this requires a lot of tweaking to change the metaball size everytime I change the number of particles, and looks terrible in the viewport.

Many thanks,

Kai

Link to comment
Share on other sites

Hey

You could bake your points out to disk(the ones with the colour), and then read them in as a point cloud,

its quiet a simple addition to the vop network.

there might be even a simplier method,

let me know if i must bash up a file.

regards

brian

Link to comment
Share on other sites

Yes please, an example would be nice. I think I understand what you are saying, but I have no idea how to do it...

Would this method update the color of the smoke when the color of the particles changes throughout the animation?

Here's an example. You're likely going to want color information beyond that of the density because you'll run into premultiplication issues if the color fades out to black as the density fades to black. I haven't bothered to comment anything, so let me know if you are confused by anything that's going on.

And yes, if you set it up right, this should update just fine as your animation occurs.

points_to_color.tar.gz

Edited by Allegro
Link to comment
Share on other sites

Many thanks, I see how it works now.

Is there any other way to work without creating the 'grid' of points first, because it takes forever to render out with a high resolution, and if I use a too low one I get black stripes throughout my volume.

EDIT: I might actually be able to make that work, but the volume changes size throughout the animation, so I'd have to update the resolution depending on it's size, how do I query the size of a volume/bounding box?

Kai

Edited by kai.scorpio
Link to comment
Share on other sites

You can also take a shortcut that allows you to access the points without writing them out to disk by replacing the expression in the "Point Cloud Texture" parameter field of the volume_* SOPs with

op:/obj/sphere_object1/POINT_CLOUD[$F]

which references the point cloud SOP directly.

As for finding out resolution and size, they are provided inside the Volume VOP as outputs of the global parameters VOP node. In the SOP context, you can use the $SIZEX, $SIZEY and $SIZEZ variables. You can easily use those to adjust your sampling steps in the isooffset SOP.

cheers,

Abdelkareem

Link to comment
Share on other sites

Ah, thanks for that solution, works perfectly.

I wasn't clear before, but I was thinking about changing the spacing of the point grid and keeping the number of voxels/points the same as it changes size (that wouldn't cause any problems or would it?). However, I cannot use $SIZEX/Y/Z in the spacing parameter, doesn't produce any points that way (even though it doesn't show an error when I middle-click the node).

EDIT: Use bbox() function, that does it.

Kai

Edited by kai.scorpio
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...