osgexport
osgexport copied to clipboard
Convert the normals for rotated and (unevenly) scaled objects
Flat normals does not appear correctly if there where unevenly transformed.
Thanks @fulezi for this PR.
My only concern with this fix is that, in my opinion, mesh data should never be modified according to any transform data, it's more the role of the rendering part to handle such case.
In the case your mesh is used by two object having different matrices (let's say one with an uneven scale and another one at identity), as processed meshes are cached in unique_objects
and could be retrieved here, one of the two mentionned objects will appear with wrong normals.
It can be a workaround but I don't think it's the best way to fix.
I might have missed something, though
Thanks for your answer @AurL,
The issue symptoms are unlighted or totally lighted (white) models with OpenSceneGraph (version 3.2.3 and 3.5.7): http://forum.openscenegraph.org/viewtopic.php?t=16991 While the same model is working when exported as .3sd or .obj.
I was not aware of cached objects, and I need to dig more on this. I will come back in my next spare time. :)