Jump to content
  • Advertisement
Sign in to follow this  
Quat

geomorphing on gpu

This topic is 4525 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'm trying to implement geomorphing on the gpu. My heightmap is stores in a texture and I sample it in the vertex shader. To get the refined height of a vertex, I just sample the heightmap directly. However, I am trying to figure out how to get the height at the next coarser level. Obviously, for a given vertex, it lies on the edge of the coarser grid. So I could find the two edge points and compute the midpoint. In a CPU implementation this seems straightforward to me. But in a vertex shader, this is giving me problems because I do not know which edge of the coarser grid the vertex lies on. When a quad is subdivided, 5 new points are introduced which can lie on a number of edges of the original quad. GPU Gems 2, the article on clip maps, seems to suggest it can be done, but doesn't give details. It just says: "the sample location lies on an edge of the coarser grid, and z_c is obtained by averaging the two course samples on the edge endpoints."

Share this post


Link to post
Share on other sites
Advertisement
Given the lack of replies here in DX I'll move it over to GP&T - this sounds like something those guys might be able to help you out with [smile]

Cheers,
Jack

Share this post


Link to post
Share on other sites
You have to calculate the height in the next level on the CPU and put it into the vertex buffer with the height in the current level.

Texture lookups in vertex shaders are relatively slow in current hardware so this approach is quicker even if you could work out how to access the neighbouring verticies to calculate the value in your shader.

Hugues Hoppe's papers on geometry clipmapping explain it in detail. See his home page for the papers.


dave j

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!