# Perlin Noise Corona

This topic is 3612 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've been playing with Perlin noise for the last few weeks, and my latest experiment is the corona effect described in Perlin's "Making Noise" presentation. Generating the static image was pretty easy. Unfortunately, converting this static image to a looping animation seems a bit more difficult. There are two things I need to do: 1) Use seamless looping 3D noise for an infinite random fluctuation. 2) Scale x and y away from center of image as z increases. Seamless looping shouldn't be hard, once I figure out the basics. However, how will seamless looping work when scaling x and y? Do I somehow need to have the values "wrap" back to the center after they "exit" the circle? - Mike

##### Share on other sites
In case it helps, here is what I did to generate the static image:

Quote:
 1. Create a smooth gradient function that drops off radially from bright yellow to dark red.

# dist is the distance from the center of the image (between 0.0 to 1.0)
red = 1.0 - 1.0 * math.pow(dist, 5)
green = 1.0 - 2.0 * math.pow(dist, 3)
blue = 0

Quote:
 2. Phase shift this function by adding a turbulence texture to its domain.3. Place a black cutout disk over the image.

I assumed that step 2 basically means blending 2D noise and the gradient circle from step 1, and that seemed to give me a nice result.

##### Share on other sites
I solved my looping problem, and implemented X/Y scaling. Unfortunately, the scaling doesn't really do what I expected. Here's the animation (speed reduced):

Basically, I'm scaling the noise map by adjusting the x/y value that is passed to the noise function.

pseudo code:
iterate through all pixels in the 256x256 image:	get distance from center of image to the current pixel	calculate "movement" of current frame (frame 10 of 20 would have a movement of 0.5)	move x & y closer to the center of the image by subtracting the movement factor from the pixel's distance to the center (wrap around to outer edge if this value is < 0)	call the noise function for the new x & y values, but set the pixel color at the original x & y coordinates

As you can see, the image does wrap around from the outside of the image back to the center. Unfortunately, the noise that wraps around from the outer edge is far more detailed than the noise that starts in the middle of the image. I think that is what is causing the very sharp seam in the animation.

So, any thoughts on how to eliminate the seam?

[Edited by - doctorsixstring on March 29, 2008 5:29:14 PM]

##### Share on other sites
Is the Graphics Programming and Theory forum the right place to be posting about Perlin Noise? I've started similar threads over in General Programming and Game Programming, and both had quite a few useful responses. I decided to post in this forum because of a slightly older thread that got plenty of responses, and because the topic is covered in the Forum FAQ.

I am in no way belittling this forum, but is it really the best place for these questions? Or, is Perlin Noise not a popular topic anymore? Or am I just asking really hard or obscure questions?

- Mike