Would anyone care for some noise?

43 views
Skip to first unread message

Casey Ransberger

unread,
Feb 13, 2013, 11:19:56 PM2/13/13
to The general-purpose Squeak developers list, open...@googlegroups.com, openc...@googlegroups.com
Hey folks,

Quick backstory about Perlin noise: it's used in computer graphics to create textures, animations, landscapes, clouds, lots of stuff. Adds a bit of predictably random "messiness" to otherwise "smooth" models, which makes things look "natural." My use of quotes here is to draw attention to the fact that these are all aesthetic statements. Somehow this function worked out really well for fooling the eye into seeing natural things. It's typically used as a basis function for multifractal terrain. Check out Texturing and Modeling: A Procedural Approach, 3rd Edition by Ebert, Musgrave, Peachey, Perlin, and Worley.

I found myself wanting to understand Perlin noise, so I hunted around looking at various implementations (didn't find one in Smalltalk, if there is one, I'd love to know) and eventually settled on an implementation that made the math clearer than the others I found, and then rewrote it from scratch in Squeak. I've got one and two dimensional noise. One dimensional noise is rarely interesting. Two dimensional noise is good for making textures and height maps, and lots of other stuff. I haven't done three dimensional noise yet, but it shouldn't be much work to do, and that gives you some help with animating things like fire and clouds (basically the animation works by walking through adjacent 2D slices of noisy space, AFAICT.)

The bad news is, I still don't understand Perlin noise! :0

The (possibly) good news is, I think it works? Looks like Perlin noise to me... it's actually kind of a hard thing to assert the correctness of, though! And it took some playing with the variables before it started to look like the pictures of pure Perlin noise that I'd found online. Attached a photo so you can see.

Ultimately I'd like to replace it with simplex noise. It's faster and doesn't have artifacts on curved meshes. I tried to do that first, but realized that I didn't understand Perlin noise well enough to understand Simplex noise. Working on understanding the former so that I can understand the latter, basically.

Anyhow I'm not sure whether or not it's something that other people would want. Could be very niche graphics-nerdery, but who knows, the Croquet crowd might find ways to have fun with it at least. If I hear from people who'd like to play with it, I can clean up the code, add an example, and put it up under the MIT license somewhere convenient. Why not, right?


Let me know if you'd like to make some noise!

--
Casey Ransberger
Image.png
Reply all
Reply to author
Forward
0 new messages