|
From: Keith W. <kw...@cs...> - 2004-07-15 15:38:49
|
I have noticed a strange behavior in the last week or so. I have a set of trimeshes that are perfectly square in the XZ axis (terrain tiles), with Y extrusion points and subdivision triangulation, etc. Pretty basic stuff. I have a series of textures that can be mapped over the tiles. The series represents the same texture at varying resolutions. For example, I might have a series of 512,256,128,64,32,16,8,4,2,1. Clearly, since the textures are square and the tiles are square it is pretty simply to assign UV coordinates to each vertex based on their XZ location in the mesh. I make the UV coordinates fill the range 0.0 to 1.0 inclusive. The textures always wraps (or shifts) around the ends of the tile slightly. So for example, if I have a texture that is just two fat bands, each across the texture but only half the texture in height, of different colors, like this: RRRRRRRR RRRRRRRR RRRRRRRR RRRRRRRR GGGGGGGG GGGGGGGG GGGGGGGG GGGGGGGG ...just as an example, I will get a very thin green sliver on the red edge and a very thin red sliver on the green edge. I get this for all the textures, but it is more pronounced for the lower res textures (the slivers are wider). And yes, it does this on both X and Z. I have hacked my way around this problem by insetting the UV coordinates, so that they range from, say, .01 to .99, or .1 to .9, if you see what I mean. This does alleviate the problem, but since it chops off the edge of the texture a little bit, the texture doesn't really "tile" perfectly with adjacent tiles, if you see what I mean. ...and more seriously, since the sliver width varies with the resolution, a given set of UV coordinates will work "perfectly" at only one texture resolution (perfect meaning it barely chops off the sliver without cutting into the "good" part of the texture). Does anyone have any idea what's going on here? I can live with it, but I'd like to know why it's happening, and if it's a bug. I can put some screen shots on the web if anyone wants to see what I'm talking about. ________________________________________________________________________ Keith Wiley kw...@cs... http://www.unm.edu/~keithw http://www.mp3.com/KeithWiley "Yet mark his perfect self-contentment, and hence learn his lesson, that to be self-contented is to be vile and ignorant, and that to aspire is better than to be blindly and impotently happy." -- Edwin A. Abbott, Flatland ________________________________________________________________________ |