Jump to content
  • Advertisement
Sign in to follow this  
crazybach

Generate decal on grid terrain

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

To improve terrain visual quality. i want to support a mesh decal system on my grid based terrain. but i find diffcult to generate a well fitted decal polygon on grid terrain. is there any one know a alogrithm about generating a scalable decal polygon on a grid mesh terrain. i just want the decal polygon always be will fitted even when the polygon edge do not cover a complete grid or grids of terrain. For simplicity, the decal could just be treated as a squard polygon project on the terrain.

Share this post


Link to post
Share on other sites
Advertisement
Project the four corners of the decal quad onto the terrain and determine which terrain quads intersect the decal quad (in 2D). Then assign those terrain quads appropriate texture coordinates, and render them again with the decal texture using those new texture coordinates. Your decal will always be flush with the terrain, and there won't be any Z-fighting either, since you're rendering the exact same geometry with only a different texture.

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!