Skip to content

Conversation

fulezi
Copy link

@fulezi fulezi commented Dec 4, 2017

Flat normals does not appear correctly if there where unevenly transformed.
fix_normals

@cedricpinson cedricpinson requested a review from AurL December 4, 2017 10:58
@AurL
Copy link
Collaborator

AurL commented Dec 4, 2017

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

@fulezi
Copy link
Author

fulezi commented Dec 6, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants