stripes Posted October 15, 2016 Share Posted October 15, 2016 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 Quote Link to comment Share on other sites More sharing options...
mestela Posted October 16, 2016 Share Posted October 16, 2016 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.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. 5 1 Quote Link to comment Share on other sites More sharing options...
stripes Posted October 16, 2016 Author Share Posted October 16, 2016 (edited) This is a perfectly working solution. Thank you so very much @mestela have a great weekend!! Edited October 16, 2016 by stripes Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.