Special-purpose noise function

Started by
4 comments, last by WarAmp 19 years, 8 months ago
Aight. So what I need to implement is a discrete 2D noise function. It can have a normal distribution, a flat distribution, whatever. But what I really need is for the mean value within all circles of a particular size (say, a 5-pixel radius or so) to get as close to the mean for the entire function as possible. That is, there can't be any clumps of white pixels. I've thought about ways to accomplish this, and I have some ideas I think are workable, but I'm sure that much smarter people than I have trodden this ground before. So far, googling has not borne fruit; I just don't know what keywords to describe this with. Anyone come across this before?
Advertisement
Doesn't random static fill that requirement? Or have I misunderstood what you're after?
It does, given a large enough radius (central limit theorem), but I need this property for relatively small radii.
I'm not an expert, here is my suggestion: run it through a high-pass filter. That should remove all the clumps. The cutoff frequency would be 1/diameter.
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
I would suggest random differences from the pixel next to it, although I don't know whether the whole thing would have a good distribution
hmm. Something like this perhaps?

for each pixel{   do   {     n = rand();   } until (n != any of the 8 neighbors);   pixel = n;}



Too complicated? Slow?
Waramp.Before you insult a man, walk a mile in his shoes.That way, when you do insult him, you'll be a mile away, and you'll have his shoes.

This topic is closed to new replies.

Advertisement