Jump to content

Shade volume attribute based on Volume Size


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

@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
Link to comment
Share on other sites

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
Link to comment
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 ?

Link to comment
Share on other sites

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
Link to comment
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

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