OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Call for feedback : AC3D loader behavior w.r.t t


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Robert Osfield
Guest





PostPosted: Fri Oct 24, 2008 11:20 am    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

Hi AC3D plugin users Smile

Recently we've had a few submissions of modifications to the ac3d
plugin that try to fix texture repeat/clamping behaviour or their own
sets of models that they encounter. The problem is that we now have
multiple interpretations of what the ac3d plugin should do w.r.t
texture repeat/clamping and these conflict, apply one patch and your
fix models from source A, but break models from source B, apply
another patch and your fix the models B, but break models A.
Arggg.....

So what I'd like to properly resolve this matter. Ideally online
descriptions of the format would answer this once and for all:

http://www.inivis.com/ac3d/man/ac3dfileformat.html

But the following:

*texrep %f %f

Optional - default 1.0,1.0 . The texture repeat values for the
tiling of a texture
on an object's surfaces.

But it doesn't really say anything about the how the texture wrap
modes map to this, if at all. And here lies the problem, the ac3d
format doesn't really tell us enough about what OpenGL state to set
for textures, one has to guess at what the settings are in ac3d and
how they relate to items like texrep, or perhaps there are extra docs
hidden away that provide the definitive settings for it. On the ac3d
website's sources page it does have an example loader/viewer, perhaps
it might be definitive?

http://www.inivis.com/resources.html

I suggest that we collect together a set of .ac files that demonstrate
models where texture repeat is certainly intended and also models
where clamp wrapped modes are intended. The mailing list has a limit
of 300k per post, so if you can keep your post underneath this then
you could post them here, but it'd be better if you can post them
online for others to download and test. It'd be great if you could
also provide screenshot of how the models should looked if perfectly
rendered.

Thanks in advance,
Robert.


------------------
Post generated by Mail2Forum
Back to top
Melchior FRANZ
Guest





PostPosted: Fri Oct 24, 2008 8:36 pm    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

* Robert Osfield -- Friday 24 October 2008:
Quote:
But it doesn't really say anything about the how the texture wrap
modes map to this, if at all.

I can't say that either, but the current situation is bad. Because
'texrep 1 1' is default anyway (according to spec and reference
implementation) AC3D itself doesn't even write it to its files! AC3D
users who want the default do now have to manually(!) insert oodles
of 'texrep 1 1' with an editor, only because OSG does no longer
respect the documented default.

m.


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Mon Oct 27, 2008 11:34 am    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

Hi Melchior,


On Fri, Oct 24, 2008 at 8:36 PM, Melchior FRANZ
<> wrote:
Quote:
* Robert Osfield -- Friday 24 October 2008:
Quote:
But it doesn't really say anything about the how the texture wrap
modes map to this, if at all.

I can't say that either, but the current situation is bad. Because
'texrep 1 1' is default anyway (according to spec and reference
implementation) AC3D itself doesn't even write it to its files! AC3D
users who want the default do now have to manually(!) insert oodles
of 'texrep 1 1' with an editor, only because OSG does no longer
respect the documented default.

I have just checked in a change from Mathias Froehlich in that reverts
the ac3d plugin back to honouring the default texture repeat.

I have also asked John Cummings who instigated the texture clamping
changes to engage on this thread, hopefully he'll be able to explain
the source of his problem files and provide some examples so that
others can see if there is a possible solution for detecting when
texture clamping might be appropriate and detectable in reliable way.

Robert.


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Mon Oct 27, 2008 4:35 pm    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

Hi John,

On Mon, Oct 27, 2008 at 4:07 PM, John Cummings <> wrote:
Quote:
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.

Quote:
I am attaching a sample model.

Thanks, data illustrating problems are virtual gold dust Smile

Quote:
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.

Quote:
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.


------------------
Post generated by Mail2Forum
Back to top
John Cummings
Guest





PostPosted: Mon Oct 27, 2008 9:42 pm    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

FYI, here is the link to the discussion on the Ac3D forum:

http://www.inivis.com/forum/showthread.php?t=5090

It seems to be headed in the same direction as Robert's comments regarding
keeping track of the UV ranges.

-John

---------- Original Message ----------

Subject: Re: Call for feedback : AC3D loader behavior w.r.t
texture repeat and clamping
Date: Monday 27 October 2008
From: Robert Osfield <>
To: OpenSceneGraph Users <>

Hi John,

On Mon, Oct 27, 2008 at 4:07 PM, John Cummings <>
wrote:
Quote:
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.

Quote:
I am attaching a sample model.

Thanks, data illustrating problems are virtual gold dust Smile

Quote:
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
Quote:
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.

Quote:
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.


-------------------------------------------------------


------------------
Post generated by Mail2Forum
Back to top
Csaba Halász
Guest





PostPosted: Mon Oct 27, 2008 9:51 pm    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

On Mon, Oct 27, 2008 at 10:42 PM, John Cummings <> wrote:
Quote:
FYI, here is the link to the discussion on the Ac3D forum:

http://www.inivis.com/forum/showthread.php?t=5090

It seems to be headed in the same direction as Robert's comments regarding
keeping track of the UV ranges.

Which, unfortunately, would still break our app (flightgear), as we
have default texture coordinates within the 0,1 range, but later we
change those dynamically and assume texture repeat. Of course we could
work around that ourselves if absolutely necessary.

--
Csaba


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Tue Oct 28, 2008 9:32 am    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

On Mon, Oct 27, 2008 at 9:51 PM, Csaba Halász <> wrote:
Quote:
On Mon, Oct 27, 2008 at 10:42 PM, John Cummings <> wrote:
Quote:
FYI, here is the link to the discussion on the Ac3D forum:

http://www.inivis.com/forum/showthread.php?t=5090

It seems to be headed in the same direction as Robert's comments regarding
keeping track of the UV ranges.

Which, unfortunately, would still break our app (flightgear), as we
have default texture coordinates within the 0,1 range, but later we
change those dynamically and assume texture repeat. Of course we could
work around that ourselves if absolutely necessary.

"assume" in the above paragraph is something that could probably be
fixed quite easily with a small tweak in flight gear, and regardless
of the solution will settle for in the .ac case I'd suggest this is
something that should be done as our model sources might not follow
the current convention that AC3D follows.

On the OSG side I think the post process NodeVisitor that detects and
applies the appropriate wrap mode should be optional, or something
that is done purely as a post process entirely separate from the .ac
plugin.

Robert.


------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Tue Oct 28, 2008 9:34 am    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

On Mon, Oct 27, 2008 at 9:42 PM, John Cummings <> wrote:
Quote:
FYI, here is the link to the discussion on the Ac3D forum:

http://www.inivis.com/forum/showthread.php?t=5090

It seems to be headed in the same direction as Robert's comments regarding
keeping track of the UV ranges.

It's a bit of cop out really, what should be done in AC3D and the .ac
format is that wrap modes are something that is managed explicitly,
rather than apply post processing workarounds.

This situation is something we have to live with though. I think the
right workaround is to have the ac plugin honour the ac3d format and
leave repeat in place, then have a custom NodeVisitor that traverses
the loaded scene graph and detects the tex coord range and changes the
wrap mode accordingly. The only question I think would be whether
this NodeVisitor would be run from inside the ac plugin as an option,
or just a post process run by users.

The NodeVisitor to do the detect and wrap change is a general purpose
tool that should go in osgUtil. Do we have any volunteers for writing
it?

Robert.


------------------
Post generated by Mail2Forum
Back to top
mjingting
Guest





PostPosted: Tue Oct 28, 2008 9:48 am    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

hi Robert:
when I use osg::ImageSequence with option PAGE_AND_DISCARD_USED_IMAGES, the program will crash; I found in OSG 2.7.3 ImageSequence.cpp at line 387, if ((i>=_images.size() || !_images[i]) && _filesRequested.count(_fileNames[i])==0),
the variable _fileNames is empty, I don't know why? could you help me?

thanks!

------------------
Post generated by Mail2Forum
Back to top
Robert Osfield
Guest





PostPosted: Tue Oct 28, 2008 9:59 am    Post subject:
Call for feedback : AC3D loader behavior w.r.t t
Reply with quote

Hi ?? Could you please sign with the name you'd like to be addressed.

Also if you want to report a problem the place is not to hang it off a
complete unrelated thread. Please send the post with a relevant
subject line so it gets thread properly by mail tools and is easy to
follow. If you want me to answer your question can your report
properly.

Robert.

On Tue, Oct 28, 2008 at 9:48 AM, mjingting <> wrote:
Quote:
hi Robert:
when I use osg::ImageSequence with option PAGE_AND_DISCARD_USED_IMAGES,
the program will crash; I found in OSG 2.7.3 ImageSequence.cpp at line 387,
if ((i>=_images.size() || !_images[i]) &&
_filesRequested.count(_fileNames[i])==0),
the variable _fileNames is empty, I don't know why? could you help me?

thanks!






------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Call for assistance: Migrating and up... Chris Hanson General 10 Mon Oct 09, 2017 4:07 pm View latest post
No new posts Call for testing, preparing for 3.5.6... bouffa General 23 Thu May 11, 2017 4:25 pm View latest post
No new posts Avoid call of SetupThreads in Databas... remoe Submission 3 Sun Apr 30, 2017 2:05 pm View latest post
No new posts FBX loader convert units options robertosfield Submission 1 Tue Apr 18, 2017 4:20 pm View latest post
No new posts Matrices interpreted wrong in AC load... freqfly Plugins [osgPlugins] 7 Sun Mar 12, 2017 4:37 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP