Jump to content

Color fluid density from particle advection


Overload

Recommended Posts

Hopefully somebody knows how to solve this one. I have added particles straight into the density field and advected them (so they exactly follow the density). I want to take the point color & or alpha from the particles and directly tint or color the density field. I've tried this a few different ways, both in the shader and through applying custom fields to the volume, but none seem to grab the color correctly. To me the best method would be to tint the volume density as to see the result in the viewport instead of waiting to render. I've attached a file to illustrate what I mean. Thanks in advance.

-A

pyro_PointColor.hip

Link to comment
Share on other sites

You pretty much had it with the VolumeFromAttrib approach. I made a few quick changes that seem to work OK for the viewport and rendering.

- Added a pscale attribute to the particles, which affects the radius used in VolumeFromAttrib

- Increased the resolution of the volume being fed into VolumeFromAttrib to get more detail and smoother mixing of the colors

- Made the volume size dependent on the pyro fields rather than the moving particles, just to avoid popping

- Switched to the BasicSmoke shader just to get a simple render going that respects Cd

P.S. if your video card can handle it, enabling HDR Rendering in H11 under "Display Options|Effects" gives you smoother Volume display for flipbooking and whatnot.

pyro_PointColor_pscale.hip

Link to comment
Share on other sites

Ah man that's awesome. I knew it was close, but I couldn't figure out what I was missing. Which volume size did you link? I didn't notice a stepsize on the vol from attr and vol visualization.

I had sidefx send me an example of this same workflow but all inside dops. It was pretty cool, but way slower to calculate, and way more confusing. At least here you can cache the sim out, and apply whatever colors you want to your particles as a post process. Thanks for taking the time to look.

Anthony

Link to comment
Share on other sites

Ah man that's awesome. I knew it was close, but I couldn't figure out what I was missing. Which volume size did you link? I didn't notice a stepsize on the vol from attr and vol visualization.

I just meant that you had the particles as the input to the Volume SOP that creates the color volume in the first place, so that volume will be the size of their (changing) bounding box. I just switched the input to be the pyro fields, so the size of the color volume is constant. Come to think of it, maybe you could still use the particles but specify the volume sampling "By Size" rather than Max Axis if you really wanted to keep the size of the volume restricted to the particles.

I had sidefx send me an example of this same workflow but all inside dops. It was pretty cool, but way slower to calculate, and way more confusing. At least here you can cache the sim out, and apply whatever colors you want to your particles as a post process. Thanks for taking the time to look.

Yup, VolumeFromAttrib is really nice, as are all the new Volume manipulation functions available in SOPs in H11.

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...