Jump to content
CinnamonMetal

Shade volume attribute based on Volume Size

Recommended Posts

Posted (edited)

I'm using a basic smoke shader to shade volumes. I want to shade the scattering of the volumes perimeter depending on it's size; if the size of the volume is less then a specific size, then don't apply the scattering to the volume and only shade the volume using another type of basic smoke shader ?

Edited by CinnamonMetal

Share this post


Link to post
Share on other sites
Posted (edited)

not sure if i understood correctly, but I'd try a switch SOP with an expression like sizeOfVolume < threshold to switch between 2 material SOPs

edit: or store the size of the volume in attribute that you read (bind) inside of the material followed by two-way switch, etc to drive whatever material parameters you want to drive based on that

Edited by 3dome

Share this post


Link to post
Share on other sites

It doesn't have polygons so no, you can't calculate the perimeter of a volume. You can store the perimeter of the volume bounds, but it doesn't make much sense.

 

Share this post


Link to post
Share on other sites
Posted (edited)

@Andrea Sbabo What do you mean it doesn't make much sense ? 

The volume bounds is what I'm after, but it doesn't create an attribute which I can use in materials. I need to iterate over only volumes clusters which are within a specific size, and get only the perimeters or size of those volumes; that is what I'm not sure how ? 

If some volume pieces are small, I want to ignore those, if the volume size is large; those are of which I want the size.

Edited by CinnamonMetal

Share this post


Link to post
Share on other sites

It doesn't create the attribute by default, but what stops you from doing it yourself?

Also you might leverage the intrinsic attributes measuredvolume and measuredarea

Share this post


Link to post
Share on other sites

@3dome Yes, those intrinsic attributes are what I need; but, how do I access them if they are not available, since I created my volume with the volumeRasterizeAttribute SOP ? 

Share this post


Link to post
Share on other sites
Posted (edited)

don't have H17 at hand but since volumeRasterizeAttribute uses volumeRasterizeParticles internally and at least in H16.5 volumeRasterizeParticles has those intrinsics I don't know why they shouldn't be available to you. I don't think SideFX removed them in 17, need to check later though

 

edit: in any case, this is Houdini so there's a million way to do things. How about convert your volume (to SDF) to polygons, measure area, sum up area -> get some value that way

Edited by 3dome
  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, 3dome said:

edit: in any case, this is Houdini so there's a million way to do things. How about convert your volume (to SDF) to polygons, measure area, sum up area -> get some value that way

VolumeSDF SOP is what you mean by converting your volume to SDF, you can convert an SDF to polygons, I thought only if it's a VDB ? 

I don't have a previous version of Houdini installed, if you can verify if they removed the intrinsic attributes ?

Share this post


Link to post
Share on other sites
Posted (edited)

can't upload files and i usually work straight with VDBs but let's assume

1) you have a sphere -> isooffset

    Do you see the measured* intrinsics? (in H16.5 they are available)

2) convertvdb (to VDB, class Fog to SDF)

3) convertvdb (to Polygons)

4) from there all the measure and sum stuff (measure + attribpromote SOP)

 

will check this evening if I can see intrinsics after 1) in H17

 

Edited by 3dome

Share this post


Link to post
Share on other sites
6 minutes ago, 3dome said:

1) you have a sphere -> isooffset

    Do you see the measured* intrinsics? (in H16.5 they are available)

Yes.  Although converting it to polygons from an SDF removes all the intrinsic measure* attributes. 

Share this post


Link to post
Share on other sites
1 minute ago, CinnamonMetal said:

Yes.  Although converting it to polygons from an SDF removes all the intrinsic measure* attributes. 

of course it removes them, because they are volume related intrinsic attributes. But if you see them, there's no need to convert to polys anyway. Just use them in your shader

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

×