Jump to content
  • Advertisement
Sign in to follow this  

QuadTree procedurally generated heighmap

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

Sorry if this has been asked before.


I am procedurally generating (very large) terrain and have a problem with discontinuities of chunks with the same LOD.


Let's say I start with this at the coarsest level of detail.



Whenever I split the top chunk I want to render higher res height maps for each of the children. I use the GPU to do this.

So I make 4 new meshes and 4 new height maps. The maps are seamless if you place them next to each other.


The problem is that the children share vertices and when rendering these shared vertices look at different height maps.



(Just the bottom 2 children, top 2 omitted) (height maps are two separate textures).

In this diagram when rendering the red child, vertices A and B look to the 'left' texture for a height map value and

when rendering the blue child, vertices A and B look to the 'right' texture for a height map value. They get ever so slightly different

values since the images are continuous between children.


I could instead generate the height for each vertex in the vertex shader, but this seems like this would be very slow once I get down to the finest LOD. Especially if I wanted to do bi-cubic interpolation on the heights.


I could also compute the height on the CPU side for each vertex but running complex noise functions seem to take upwards of 25-30 ms even for small resolutions. That's my entire frame!


Any thoughts?

Edited by Furion117

Share this post

Link to post
Share on other sites

Overlapping your heightmaps by one pixel in each direction should solve this.

I thought of that too, but I'm not sure about how to actually do it. I render the textures using a 2x2 quad and pass in the world coordinates of the 4 corners of a chunk/node.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!