Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

Perlin noise help...

This topic is 5409 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

I am trying to do just R or G values of 255 only. Here is what I am using....
red = (unsigned int)(255 * noise.GenerateNoiseTexture(z, x, 1.0f, .1f, .85f, 5));
green = (unsigned int)(255 * noise.GenerateNoiseTexture(z * 3, x * 3, 1.0f, .1f, .85f, 5));


Thanks

Share this post


Link to post
Share on other sites
Advertisement
1. And the problem is...?
2. What are all those parameters that you pass in your calls?
3. How is your function implemented?
Etc.

You are welcome.
/def

Share this post


Link to post
Share on other sites
My bad, up late....


float GenerateNoiseTexture(int x, int y, float amplitude, float frequency, float persistance, int octaves);



I only want 255 red or 255 green, but not for both. 1st pass might be red 255 next time green 255 and the next green 255 ect... So I want either one to be 255 and the other zero... Not sure if perlin noise will do this or not....

Share this post


Link to post
Share on other sites
Correct me if I'm wrong:
You want to have 0 or 1 for each pixel of your texture, then you would assign, say, red for 0 and green for 1.

I was generating forest areas some time ago, and I ended up with the same problem/solution. And the answer is: for each pixel, generate it's perlin value, and if it's positive, mark it as red, otherwise - green.

Is that actually your problem about?
/def

PS:If you have control over implementation of your perlin function, watch for it's two-dimensional random function, 'cause I've seen that one of the mostly used(at least in net articles) has random, that is making the perlin function symetric...

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!