Trying to understand VEX noise functions on the most basic level

   6003   4   2
User Avatar
Member
22 posts
Joined: Jan. 2011
Offline
I have no coding background whatsoever so bare with me. I'm trying to get a grasp on the most basic stuff in VEX. I watched several videos on the subject (Jeff Wagner's Illume webinar on VEX and Rohan Dalvi's VEX videos).

After watching those I started doing some R and D concerning animated noise in VEX. I created a polygonal sphere and hooked up an attribute wrangle right after that containing the following:

@Cd = set (0,0,0); // Initialize the color
@Cd.r = anoise ((@P*16); // add some anoise to the red channel


Now I'm trying to animate the noise from the center of the sphere moving outward, as if it was animated along the normals but I cannot seem to get it working the way I want it to work. When I add @Time to the noise function like this: @Cd.r = anoise ((@P*16)+@Time);

the noise animates but it moves along a 45 degree angle over the surface of the sphere. I am trying to get a bubbling look. All hints and tips on the subject are appreciated!
User Avatar
Member
11 posts
Joined: July 2012
Offline
I tested your VEX code, and it works the way you intended with the bubbling look. Perhaps your sphere doesn't have enough points for you to see this. If you're using the polygon sphere, try raising the frequency higher than 32. If you're using the polygon mesh sphere, try using more than 32 rows and 32 columns.
User Avatar
Member
7755 posts
Joined: Sept. 2011
Offline
You can't animate a noise space like that. Moving along the normal direction of a sphere in Cartesian space is simply scaling. You want noise(P*freq*Time), if you really want to animate the scale of a noise, but you probably don't, because it will look like it is simply getting higher and higher frequency. To allow the noise to stay a constant frequency, and not simply scale, you will need to apply a noise in spherical coordinates, and animate the ‘r’ coordinate to translate the space in the radial fashion. Spherical coordinates will compress the space at the poles, however.

https://en.wikipedia.org/wiki/Spherical_coordinate_system [en.wikipedia.org]
User Avatar
Member
1737 posts
Joined: May 2006
Offline
(edit: doh, didn't see jsmack's reply before posting…)

The diagonal movement thing is sort of expected; imagine your noise as cube of noisy fog, by adding to @P you're just offseting its position. Because @Time is just moving in one direction, it gets added to the x, y and z values of P, so it moves diagonally up and away.

To move noise out from the center you'd need to multiply by @Time, however in doing so you're going to also change the scale of the noise; the longer @Time runs, the smaller your noise will be.

Solving this isn't easy (not for my feeble brain anyway). One way would be to setup noises that just scale from, say, 1 to 4, and offset them in time so one starts halfway through the other, and then crossfade between them. Fiddly.

A better way is to use a different noise function that can setup movement without an offset. The flow noise vops do this, where from reading the help cards they essentially do a rotation of the noise, giving the appearance of motion.

All that said, I looked at your phrase ‘bubbling surface’, and went a different approach. Here I've randomly spawned particles over a surface that have a lifespan of 1 second, and set their scale to match their age.

I then transfer the scale attribute to the surface of the pig with a blended falloff, then use that value to drive a bubble, as well as a colour mix to make it look like the pig needs to see a doctor.

-matt
Edited by mestela - Sept. 12, 2017 00:33:18

Attachments:
pig_boil.gif (625.6 KB)
pig_boil.hip (353.3 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
22 posts
Joined: Jan. 2011
Offline
Thanks for the all replies and the hip file! That pig hip file sparked an idea :-). Thnx again!
  • Quick Links