• Advertisement
Sign in to follow this  

Best technique to generate procedural terrain

Recommended Posts

Hi guys, looking around I saw that the most common technique to generate procedural terrain is by using height maps stored in PNG files. Is it the best technique though? Wouldn't it better to just generate a grid and then transform the y coordinates according to a chosen function? Could the perlin noise algorith be used to modify the y axis only?

Thank you for your help.

Share this post


Link to post
Share on other sites
Advertisement

Perlin noise is fine for this kind of thing. It generates a scalar value which you can use to modify the y coordinate.

So I do not need to create a height map? and how can this method work if the perlin noise would return only a scalar value?

Thanks

Share this post


Link to post
Share on other sites

Well, if you can just iterate the vertices of your height geometry and set each one directly, then you don't need a heightmap. Just iterate the vertices and set Y based on the value returned by the noise function. Many engines facilitate setting from a heightmap, though, so in that case it might just be easier to generate a heightmap from the noise function first, then set heights from that.

Share this post


Link to post
Share on other sites

a heightmap function can be handy.   given a set of world coordinates (x,z), it returns the y value (ground height) at that point in the game world. internally it can use heightmaps or procedural functions or both to determine y.  this can be used to generate ground meshes, set the drawing height of characters and objects, check falling collisions with the ground, steep_rise_ahead() and steep fall_ahead() functions, etc, etc.

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

Sign in to follow this  

  • Advertisement