I don't think I can give you an answer, but I can share my thoughts with you and let you know how I've thought about this in the past.

First, I think you might be right about some material/lighting issues, and they might be fixable. It's been a while since I ran the flt export regression test suite, but last time I ran it, I do recall some subtle lighting anomalies along the lines you describe. (osgfltexport.googlecode.com)
I did not take the time to investigate the issues.

From my research into trying to match the OpenFlight lighting model to the OSG/OpenGL model, I found that it was not a simple matter of matching up ambient with ambient and diffuse with diffuse. The OpenFlight specification does not describe how the lighting parameters in the FLT file are to be interpreted to create a final color. MPI has left this at the discretion of those of us coding rendering systems. :-)

Also note that it was never a FLT exporter goal to support a "round trip" of loading a FLT file into OSG, and getting back the original model when you export it back out. This is simply not possible due to the differences between FLT and OSG. And I suspect you'd find this is true in any model file conversion software (Okino PolyTrans doesn't support this, either).

Similarly, this means if you try to do:
   osgconv a.ive b.flt
   osgconv b.flt c.ive
The result is that a.ive and c.ive will _not_ match. They can't; it's not possible.

However, the OSG FLT importer and exporter should work together such that you can do the following:
   osgconv a.flt b.ive
   osgconv b.ive c.flt
   osgconv c.flt d.ive
Then b.ive and d.ive should be a nearly identical match. At the very least, the material colors in b.ive and d.ive should be identical.

I hope this helps.

Paul Martz
Skew Matrix Software LLC
_http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
+1 303 859 9466



Katharina Plugge wrote:
Hi,

its me again. :)

There is still something wrong. I had not realized before that the added material leads to a darker shading. If I have an osg-file without material the colors are brighter than after exporting to flight. The default material which is created seems to be wrong. Osg's default Material has an ambient color of (0.2, 0.2, 0.2, 1.0) and a diffuse color of (0.8, 0.8, 0.8, 1.0). When computing an implicit material for OpenGL Rendering something has to be done different.

If I export a flt-file, without any materials, osg adopts the primary color 
directly as ambient and as diffuse color of the newly created material. The 
same material is created, if the flt-file has already a material attached which 
has an ambient and diffuse color of pure white.

In my opinion the OpenFlight-Plugin has to use a default material of (1.0, 1.0, 1.0, 1.0) for both ambient and diffuse to get the Shading right.
Or have I missed anything again?


Cheers,
Katharina

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17566#17566





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


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

Reply via email to