Fit to range in VOPPOP

   9204   6   3
User Avatar
Member
696 posts
Joined: March 2009
Offline
Hi,

I have a turbulent noise VOP generating a range of values that goes from 0.06 to 0.7. How can I make this fit a 0 to 1 range instead? what would be the best way to find the lowest and the highest values from the noise to use in a fit to range VOP?

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
51 posts
Joined: Oct. 2006
Offline
Maybe you can split your VOP into two?
That is:
1) Generate the noise values in the first VOP;
2) Find the range for all the generated values;
3) Fit to a new range in the second VOP;

Here is a simple _SOP_ example to illustrate the idea.

Attachments:
SOP_attr_range.hipnc (72.3 KB)

User Avatar
Member
696 posts
Joined: March 2009
Offline
Thanks for the help! I was hoping to be able to do it all in one node, but I guess it won't be possible just yet…

Thanks again
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
691 posts
Joined: June 2006
Offline
It's not possible in just one node because inside the for loop's that calculate the min and max values you can't import an attribute created inside the same vopsop; I don't know if there are another way of do that.

Attachments:
vopsop_fitrange.hipnc (97.6 KB)

Feel The Knowledge, Kiss The Goat!!!
http://www.linkedin.com/in/alejandroecheverry [linkedin.com]
http://vimeo.com/lordpazuzu/videos [vimeo.com]
User Avatar
Member
696 posts
Joined: March 2009
Offline
alejandro
It's not possible in just one node because inside the for loop's that calculate the min and max values you can't import an attribute created inside the same vopsop

Yeah, I was kinda getting to this realization!
Thanks for your example, I'll study it further later, I need to get into loops in VEX. Just one idea here: I saw a video from Peter Quint in which he said that the order of evaluation for code generated by a VOP network is kind of not as explicit as if one actually wrote the code by hand (understandably). He then went on to place a a switch node that acted as pass through but was able to alter the order of evaluation for some operations inside the VOP network like that. Maybe that's what happen here with the min/max, right?

Cheers
Toronto - ON
My Houdini playground [renderfarm.tumblr.com]
“As technology advances, the rendering time remains constant.”
User Avatar
Member
299 posts
Joined: Jan. 2010
Offline
If you keep the amplitude at 1 and read up on the range for the noise type you are using from the help file. Then you should be able to fit it into 0 to 1 without much trouble as you would know the min and max and can just do some subtraction and multiplication to get into whatever range you wan't.
Drive, monkey, drive!
User Avatar
Member
51 posts
Joined: Oct. 2006
Offline
I think the problem here is that while the expected bounds are documented and it's known roughly what range to expect, the actual generated noise may be biased one way or another. That is, as I understand it, what's needed here is to remap the range of actually generated values not the expected range.

You can try an altogether different approach.
See the attached example, here the noise values are first scaled and filtered with Logistic function [en.wikipedia.org], that brings them roughly to range, then snapped to grid with 0.001 resolution to fill the range exactly (min at 0, max at 1). The snapping step can be skipped if you don't need the exact min/max values.

The setup in this scene is best suitable for “Original Perlin Noise” (onoise expected range -1 to 1), it will work for “Sparse Convolution Noise” as well but more values will tend to 0 or 1 (snoise expected range -1.7 to 1.7). For other noise types an additional remapping is needed before the sigmoid transformation.

Still, the two VOP approach is probably better and more general.

Attachments:
SOP_attr_range_sigmoid.hipnc (84.9 KB)

  • Quick Links