View Single Post
Old 27th October 2008, 05:37 PM   #5
lisa
Senior Member
Professional user
 
lisa's Avatar
 
Join Date: Mar 2005
Location: Phoenix, AZ
Posts: 917
Default Re: Texture clamping and repeating

I think I understand where jcummings is going with this.

jcummings - from purely a graphics programmer perspective, "clamp" would be the correct answer for non-repeating\non-tiling textures. This assumes, however, that you have a rule for your art team that uvs cannot go outside the [0-1], which isn't always the case.

However, I think AC3D has the correct behavior with "wrap" because of the specific use-case. AC3D allows uvs outside [0-1], which it needs to as many formats it imports also allows uvs outside [0-1]. When most artists create texture coordinates outside the [0-1] range, they are assuming it will tile. This is really the only reason an artist would do this, and many people use this "trick" especially with editors that don't support explicit repeat modes.

If you wanted to be really sexy about it on your importer, I would take the min and max of the uv coordinates. If the uvs are within the 0-1 range and repeat mode is disabled, set your addressing mode to "clamp" to minimize seams. If any uvs are outside the 0-1 range, then set your addressing mode to "wrap" and assume it was intentional. This should give you the best of both worlds.
lisa is offline   Reply With Quote