Jump to content
  • Advertisement
Sign in to follow this  

Welding vertices in the shader

This topic is 4839 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 eliminate cracks and seams between components that are seperately rotated and placed to build larger more complex objects. Since each smaller component is literally shared in every instance where it's rendered, I can't permanently move the vertices to suit any specific instance. I'm guessing the reason for the seams is floating point error during rotations in my editor. Does this sound like my editor is at fault, or is there nothing I can do about it? I ask because I've played countless games that all shared this flaw. Anyway, how far fetched does it sound to weld vertices as they're rendered? Would this be done by simply casting the vertex coordinates to integers and back to float again? All of my map-component vertices are aligned on integer boundries, so I'm pretty sure this would do the trick. Is there a better method? edit: Here's the vertex code that will do the trick: Position.x = int( Position.x + 0.5f ); Position.y = int( Position.y + 0.5f ); Position.z = int( Position.z + 0.5f ); It completely eliminates the problem. But does it seem too hacky? Maybe a better approach? Thanks [Edited by - Jiia on June 23, 2005 8:45:31 PM]

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!