Skip to content

Conversation

@sciecode
Copy link
Contributor

Flat / smooth shading is baked into normals. You need to reset normals buffer (see above).

This information makes it seems like every material needs to reset normals buffer when updating flatShading parameter, this isn't true.

This would only apply MeshLambertMaterial, but even with geometry.normalsNeedUpdate = true flatShading isn't working correctly on this material.

@WestLangley
Copy link
Collaborator

WestLangley commented May 27, 2019

but even with geometry.normalsNeedUpdate = true flatShading isn't working correctly on this material.

MeshLambertMaterial does not support the flatShading flag.

Instead, you need to bake flat vertex normals into your geometry:

geometry = new THREE.Geometry().fromBufferGeometry( geometry );

geometry.computeFlatVertexNormals();

geometry = new THREE.BufferGeometry().fromGeometry( geometry );

@sciecode
Copy link
Contributor Author

@WestLangley thanks for clarifying.

Still, it makes sense to remove that information from the docs. Correct?

@WestLangley
Copy link
Collaborator

Probably. That document is ancient.

@mrdoob mrdoob added this to the r105 milestone May 28, 2019
@mrdoob mrdoob merged commit 4a31d82 into mrdoob:dev May 28, 2019
@mrdoob
Copy link
Owner

mrdoob commented May 28, 2019

Thanks!

@sciecode sciecode deleted the dev17 branch May 28, 2019 17:37
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.

3 participants