Hi John,

On Mon, Oct 27, 2008 at 4:07 PM, John Cummings <[EMAIL PROTECTED]> wrote:
> In the process of finding a small example, I've realized that indeed the
> reference document is not clear at for this feature.

The reference documents say nothing about texture wrap modes at all.
Given that this is important feature of texturing the format feels
really outdated and insufficient for the job in hand.

> I am attaching a sample model.

Thanks, data illustrating problems are virtual gold dust :-)

>  It is simple a slice of earth with tiled
> images. I have also attached some screenshots- one with the old behavior in
> the latest release of OSG, one with the current SVN version, and one with a
> screeshot of AC3D (sorry about the angle on that one). You will notice that a
> thin slice of the desert in Africa show up in the Atlantic and vice versa.
> Clearly not correct. However, AC3D renders it that way- leading me to think
> our old custom implementation simply papered over the issue.

I suspect small OpenGL drivers changing over the last 10 years has
lead slightly different intrepretions of texcoords on fragments, such
that the 0.999999 that appear in your ac file are resulting in
fragments being computed with values > 1.0 despite the tex coords on
the vertices never getting greater than 1.0 or less than 0.0.  It used
to be the case that values like these would be find with a wrap value
of CLAMP, or probably even REPEAT.   These days though you have to use
CLAMP_TO_EDGE to get the intended behaviour.

My guess AC3D was developed quite a while ago, making assumptions
about CLAMP/REPEAT working fine with the near to edge tex coordinates
that you've used, but with modern drivers things are now broken
because the cards are computing the tex coords on fragment slightly
differently.

Other parts of the OSG have migrated from use CLAMP to CLAMP_TO_EDGE
over the years just because of this issue.  Things use to work fine
with CLAMP, then drivers started popping up that broke this, and
required CLAMP_TO_EDGE.  I vaguely recall that it might of been ATI
drivers that were the first to have problems w.r.t this.  I see it now
on this dataset on my Nvidia card so it's probably an industry wide
migration.

> I am going to start a discussion on the AC3D forum as well since I think
> perhaps there is a feature in AC3D that I have not discovered as yet that
> would allow this behavior. Any other AC3D'ers on this list have some insight?

I can't provide any insight as I'm no AC3D user.

On the OSG side I think the only thing we could do is parse the tex
coord arrays on geometries and if they fit into the 0 to 1.0 range to
use CLAMP_TO_EDGE, otherwise use REPEAT.  Perhaps an new
osgUtil::Optimizer visitor would be appropriate for handling this type
of issue.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to