On Jun 2, 2008, at 9:48 AM, Patrick Hartling wrote:

On May 25, 2008, at 12:51 AM, Gerrit Voss wrote:


Hi,

On Thu, 2008-05-22 at 10:56 -0500, Patrick Hartling wrote:

The COLLADA loader on the fcptr_stable_jun07 SVN branch is in pretty
decent shape now as of r1235, although I am still having some problems
with texture loading. My suspicion is that the textures are somehow
malformed, but Open Scene Graph does not have the problems with them
that OpenSG does. Would anyone be able to take a look at the model in
the ZIP archive below and give me some hints about what might be
preventing the textures from applying correctly?

You dug up a really interesting case and as far as I can tell a rather
strange model.

Yes, most of the models that I was testing could be called strange. Stronger language could be used, but I digress. :)

Well, there were two bugs inside the collada
integration.

1) If any texture was set, no corresponding color was set, so when
 modulating the texture everything was black.

2) I interpreted the transparency value wrongly. There is more than
 one value. The colour carries an alpha value and there is a
 separate transparency value. Unfortunately they collide with some
 models setting it to 1 and some to 0. I guess the safest way for now
 is to take the colour value and not the separate one.

I'll fix these in the trunk, I will also apply your branch changes
to the collada loader so they are in sync again.

Fantastic! Thank you very much. I will test your fixes as soon as I can.

And now for the model weirdness. You must render it with backface
culling enabled. There seem to be duplicated faces with wrong texture
coordinates, all of which are backfacing. So with face culling enabled you will see the correct set of faces, with correct texture coordinates. Without backface culling you get the wrong result. See attached images.

This isn't terribly surprising. I have other models that exhibit similar--or worse--behavior. I don't know if the COLLADA exporter for SketchUp needs work or if the people posting the models just don't realize that these problems exist in the source SketchUp data. With free models, you certainly get what you pay for.

Your fixes made things a whole lot better. Problems that I was attributing to bad source data got fixed up, and all the texture issues I saw are gone now. I committed a change (r1276) that enables backface culling except when there is extra XML data saying not to use it. Right now, it only handles the Google Earth use of the <double_sided> element; I don't know if there are other similar cases out there.

At this point, I think that things are looking quite good with the state of the COLLADA loader. Thanks for your help.

 -Patrick


--
Patrick L. Hartling
Senior Software Engineer, Priority 5
http://www.priority5.com/

Attachment: PGP.sig
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to