Jump to content

Recommended Posts

Hi guys.

I am trying to utilize my point attribs in a volume. how can I:

- set the volume color (shade the volume) using my point color?

- when volume is created, get it to read already set density values on the points. (volume rasterize).

 

attached is an example file.

 

cheers

colortovolume.hiplc

Share this post


Link to post
Share on other sites

I solved the density problem, by simply bind the density inside the volume rasterize vop and multiplying it against incoming density.

now only thing left is to solve how to get my volume colorized according to my particles

Share this post


Link to post
Share on other sites

easiest way is to use point cloud functions in your shader to read the points and get the average Cd in a radius, then use that as your volume color. if you need the colors in SOPs, it's more or less the same thing... pcopen() and pcfilter() in a volume wrangle to get the average P within a radius, then bind that to a Cd vector volume. just have to create the volume in advance, before the wrangle.

  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks Henry. That did the trick. Exactly what I was looking for.

Appreciate you taking the time to reply.

 

Cheers

Share this post


Link to post
Share on other sites
On 2018-07-19 at 3:57 PM, toadstorm said:

easiest way is to use point cloud functions in your shader to read the points and get the average Cd in a radius, then use that as your volume color. if you need the colors in SOPs, it's more or less the same thing... pcopen() and pcfilter() in a volume wrangle to get the average P within a radius, then bind that to a Cd vector volume. just have to create the volume in advance, before the wrangle.

@toadstorm any chance you can provide a simple example file? I thought I had it working but I was to quick on that one.

 

Thanks in advance

Edited by Jesper Rahlff

Share this post


Link to post
Share on other sites
On 2018-07-24 at 2:22 AM, adrianr said:

@Jesper Rahlff Here you go. Sops and Shader versions inside.

volume_pc_colour_01.hip

thanks so much man. appreciate the help

Interestingly enough I cannot get this to work with VDBs. Volumes work fine, but VDBs not so much

Edited by Jesper Rahlff

Share this post


Link to post
Share on other sites

@Jesper Rahlff Here is the file with VDBs, nothing really different. Is there a specific issue you're having with your scene you could share? 

I've popped in an example using the bunny from http://www.openvdb.org/download/ too so just download it from there if you want to see that. bunny_cloud.vdb is the file, top right.

volume_pc_colour_02.hip

Share this post


Link to post
Share on other sites

I think the issue was that I was creating the Cd volume with the VDB node. using a volume node and converting that to VDB works fine.

anyhow, I ended up expanding on your shader approach and used that. Was perfect for what I needed to do.

Cheers for your time mate

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×