Jump to content
  • Advertisement
Sign in to follow this  
Sneftel

Special-purpose noise function

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
It does, given a large enough radius (central limit theorem), but I need this property for relatively small radii.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
hmm. Something like this perhaps?


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

pixel = n;
}




Too complicated? Slow?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!