Jump to content

pnoise: remapping output values

Recommended Posts

I need a simple noise that loops over the course of five (or however many) seconds, moving the @P.x of the points on a line back and forth, and so I'm using pnoise. I would like to give it precise min and max values (I want things to be able to bump against each other but not intersect), which would be easy enough with a fit, but I haven't been able to find it's precise output values in any reference. Over the course of 120 frames the output appears to be 0.5-centric and it goes between 0.22398 and 0.800649, so it doesn't appear to be an even +/- any obvious value like 1 or 0.5. How can I find the actual minimum and maximum outputs for pnoise so I can make sure it hits zero (or 1) at its extremes?

I've tried periodic noise in a point VOP but that seems very unwieldy. I know Unified noise can loop and is always 0 - 1, but it has a whole lot more to it than I need to deal with. (Plus I just want to know how to do these things in VEX). The only output value reference I've been able to find is that aanoise is -0.5 to 0.5 and unified noise is 0 - 1.

If it makes any difference, here's what's tucked in my point wrangle (reference parameters on an outer master null):

   int offset = prim(0,"id",0);
   float roughness = ch("../MASTER/roughness",0);
   float frequency = ch("../MASTER/frequency",0);
   int period =  ch("../MASTER/period",0);
   float noisemult = ch("../MASTER/outerNoiseMult");

   float noiseval = pnoise((@Time*frequency)+offset, @P.z*roughness, frequency*period, 0);
   @P.x += (noiseval * noisemult)-(noisemult/2);  //the noisemult/2 is to get them back to 0-centric




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now