Jump to content

Volume VOP inline code


hellomrjack

Recommended Posts

Hi, Im currently trying to make a Volume VOP node that will be able to strip out all densities except in a narrow range. I was thinking of using an inline code node containing something like this:

$outDensity=0.0;
if ($density>1.1)
{
   if ($density<1.2)
   {
      $outDensity=$density;
   }
}

The name for my output is outDensity.

Am I going about this the write way? Even when I just use:

$outDensity=1.0;

It wont just set everything to 1.0.

Thanks

Jack

Link to comment
Share on other sites

I can't help you with your code at the moment (no Houdini around), but I would suggest to take a look on VolumeRampSOP or using clamp() function or recreating volumeramp with vex's ramp parameter. Conditional statements (if/then) misbehave, since they output unfiltered data.

Link to comment
Share on other sites

Here is something silly I played with.

I like the ramp but the problem I often have with it is it's range 0..1 and the lack of control you have over the curves.

So here is a version of the ramp that uses bezier curves. Woohoo!

Just for fun, don't expect wonders.

Edit: The volumevop in that network serves no purpose. I forgot to delete it.

sillyvol.hipnc

post-4013-130386152693_thumb.jpg

Edited by Macha
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...