Jump to content

Houdini pyro vertical gradient pass


stripes

Recommended Posts

Hello, I am new to houdini and it would be a great help if anyone could point to any resource that will help me shade the pyro fluid (wispy smoke) as in following manner shown in the attached image, ie, assigning an rgb gradient along one particular axis. 

Best regards

Capture.PNG

Link to comment
Share on other sites

Here's one way, no doubt someone else will show an easier method. :)

To fit a colour ramp to something, you need an input value that goes between 0 and 1. In this case, we want a 0-1 value within the bounding box of your volume. The relbbox() function does this, where one of the lower corners is set as {0,0,0}, the opposite top corner is {1,1,1}, and if you give it a position within the box, it tells you where it is within that 0-1 range of the box. In a volume wrangle, you can query the position of each voxel relative to the overall bounding box with

vector bb = relbbox(0, @P);

For the vertical gradient, we only want the y component of that, ie bb.y. You can directly feed that to a channel ramp, and set the colours you want, and drive @Cd that way:

@Cd = chramp('my_colour', bb.y);

vol_y_ramp.jpg

vol_y_ramp.hipnc

 

Few things to watch for:

-the default mode for a channel ramp is a float ramp, not a colour ramp. You need to edit the parameter interface to swap it from float to colour.

-you need a volume visualisation node to see it in the viewport

-I'm sure its possible to do this in a shader and not directly in the volume, but I couldn't be bothered to work that out. :)

-relbbox() might be depreciated in future in favour of the more descriptive relpointbbox(), but that seems to have a bug with volumes. Instead you need to put down a bounds sop to get an actual box shape, wire that to the second input of the wrangle, and call relpointbbox(1,@P) instead.

-the viewport renderer shows washed out colours compared to the render, you can see I used the colour correction toolbar on both the viewport and render view to make them roughly match.

 

  • Like 5
  • Thanks 1
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...