Jump to content
  • Advertisement
MasterReDWinD

Setting the ground level in procedural terrain generation using a gradient function

Recommended Posts

Hi,

I am trying to create a set of functions (similar to Libnoise, Fastnoise and the Accidental Noise Library) to manipulate noise with the goal of producing terrain.  As recommended by this article (http://accidentalnoise.sourceforge.net/minecraftworlds.html) I am starting out with a 'gradient' function.  The purpose of this function is to establish a ground level.  I've read the articles many times, along with the previous versions and I can't get my head around this function at a conceptual level.

I believe that the gradient function maps input coordinates (in my case x, y, z) to a range that I specify (0 to 1 in the linked article), on a per axis basis and assigns them a value based on where they fall within the range?  Assuming y is my gradient axis, the gradient is from 0 to 1 and the value range is -1 to 1 then any y value above 1 or below 0 is clamped to either 1 or -1.  For a y value between the 0 and 1 the result is lerp(-1, 1, y)?

I did find this question but it didn't clear things up for me (https://gamedev.stackexchange.com/questions/57790/accidental-noise-gradient-function).

Any clarification would be greatly appreciated.  Thanks.

 

Share this post


Link to post
Share on other sites
Advertisement

It is not obvious what your question or problem with the gradient distribution is really? You shoudld state the issue more clear to get help. I myself cannot see any questioning. Do you want to get oponing to your distribution system explanation?

Share this post


Link to post
Share on other sites
12 hours ago, JohnnyCode said:

It is not obvious what your question or problem with the gradient distribution is really? You shoudld state the issue more clear to get help. I myself cannot see any questioning. Do you want to get oponing to your distribution system explanation?

Thanks for your feedback, I was struggling to word the issue. 

My problem is that I can't write my own implementation of a gradient function because I don't understand what the function is trying to do.

My question would be: what is the gradient function trying to achieve?

I hope this clarifies things.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • 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!