I have a KCM that uses the radius of two spheres (Inner Boundary and Outer boundary) to scale particles around a center point. All the particles in the inner boundary get scaled to 0% around the point and the particles between the inner and outer boundary get a partial scale modified by the curve. The issue im having with this is that the boundarys are very spherical (by nature!) and id love to add a 3D noise to the boundarys to break up the spherical edges. How would I do this using a KCM?
There are at least 3 possible approaches to do this, but the simplest and fastest would be similar to the way the Clouds flow works.
Basically, you already have subtracted the Center of the Range from the Particle Position to calculate the magnitude. Create a Vector>Normalize operator and feed the Subtraction into it. This gives you a vector with length 1.0 pointing from the center of the range in the direction of the particle. Then create a Function>Noise operator and feed the normalized vector into its first socket. Set the second to Integer 4 and the third to Float 4.0 or something like that. This gives you a random value which will be the same for EVERY particle along the normal vector. In a way, if you imagine a sphere around the center with a noise texture on it, the above operation would produce a similar result to sampling such a spherical texture around the center…
Now you can Multiply the result of the Noise (which is not in a normalized range and can be positive or negative) by some small Float like 0.1 to be able to control the amount of noise. Setting this Float to 0.0 will disable the Noise. Then you add the output of the Noise to either the Inner or the Outer value (or to both) to vary them. As result, the particles will calculate their position scaling based on a varied Inner and/or Outer radii instead of the fixed values before.
The alternative approaches would be to actually add a texture to a mesh sphere in the scene, fire a ray through the particle to get a point on the surface and evaluate the UV coordinates, then steal the textures’s texel value to control the effect. Or you could add a Noise Modifier to a Mesh sphere and shoot a ray to calculate the distance between the center of the effect and the surface of the modified sphere - this would literarily apply noise to the radius that you could measure. But both these approaches involve geometry operations and would be much slower than the procedural Noise operator approach above.
Thanks for your fast and awesomely useful reply, as always, Bobo!
Adding the noise function to the outer boundary worked perfectly.
How would I go about changing the scale/phase of such a noise. Id like to keep geo/textures out of it because of the speed if possible.
Thanks again Bobo!
Just add a Multiply node with a Float Input between the Normalized Vector and the Noise node. Higher values will increase the Frequency.
Attached is a Max 2010 scene showing a Plane turned into a PRT Volume with a KCM that applies a Noise to the Color channel using the same principle.
I have exposed the Frequency and the Amplitude multipliers in the KCM’s UI for easier tweaking.
KCM_CentralNoiseFrequencyAndAmplitude_v001.zip (18.8 KB)
Thanks Bobo! you are my hero!