Alejandro Saez (cano++at++krusty.engr.sgi.com)
Mon, 2 Mar 1998 13:06:15 -0500
Andreas,
What you seem to describing, is part of the reason of what you are
experiencing (if I got the problem right) but not all of it. What's really
happening is that the textures are being clamped. When textures are repeated,
then at the edge of the texture, the same texture is aligned "side by side",
and thus repeated, then there really isn't any edges. The problem is when you
have a clamped (no tiling) textures. There, when the texture reaches it's final
coordinate space (either 0 or 1 on u,v) and if there still is "polygon left"
the texels that get mapped into the polygon past the texture's edge are the
"edge texels" extended to the rest of the polygon. To see this in a more
evident way map a clamped texture to a small center area of a polygon and you
will see the edge texels repeated. At the edge, the interpolation kernel is
probably using this "extended" edges to do the interpolation. I can think of
the following solutions, some of them, I don't know how to implement :
a) Don't map the corner and edges of the texture to the corners and
edges of the geometry, give yourself 1 to 3 texels (this will depend on the
kernel). For example, map texel 3,3 to coordinate 0,0 of your geomtery and so
on. Not very elegant but should eliminate the annoying line, but probably gives
you a matching problem among the tiles. Then again each tile could have 1-3
texels in common with the next coincident tile.
b) Select a repeat (tiling) mapping. At the edges the opposite edge of
the texture will be repeated, depending on the texture you might get away with
it.
c) I've seen some texture mapping techniques that mirror the texture to
do the kernel convolution at the edges. This is like putting a mirror at the
edge of the geometry, so the last edge of the texture gets mapped as the first
edge past the end of the geometry. The second before last edge maps to the
second past the end and so on. This is known as the "images" method for solving
boundary conditions in finite differences computations. This solves a potential
problem with solution b) which is: What happens if the first edge of the
texture(the one that is aligned with the last edge when tiling) is quite
different from the last edge? Well at the edge you will able to tell the
texture is being tiled because both edges are so different that a boundary can
be seen (it isn't a seamless tile). When doing mirroring, you avoid this
problem, because the same texels are used to do the convolution. The problem
is, I don't know if OpenGL can do this or gives you the means to implement it.
d) Tell OpenGL/Performer to use the next tile to interpolate at the
edges. The problem is... ditto. I don't know if you can do this or a way to
trick it.
Hope this helps,
--
------------------------------------------------------------------------
Alejandro Saez
Software Engineer
Silicon Chile S.A.
Avda. Santa Maria 2560
E-mail: asaez++at++silicon.cl Providencia
Phone: +56 (2) 203 3371 Santiago
Fax: +56 (2) 203 3370 Chile
------------------------------------------------------------------------
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:40 PDT