Sign in to follow this  

Welding vertices in the shader

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

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