Closed Astrak closed 3 years ago
Is there any update here? I noticed #9222 got merged recently, is that the way to go about this?
@codeka Yes, if your geometry is THREE.Geometry
, you can call
geometry.computeFlatVertexNormals();
and achieve flat shading when using MeshLambertMaterial
.
Added a note to the docs saying that FlatShading won't work for this material.
Currently the note about flat shading not working with Lambert seems to have gone missing from the docs.
One might assume that MeshLambertMaterial
with flatShading: true
would produce the same result as MeshPhongMaterial
with flatShading: true
and shininess: 0
.
http://jsfiddle.net/__jee7__/0aj5vh9g/16/
As choosing the material class seems to be about how the shading is calculated (what reflectance model is used) instead of where is it calculated (per fragment, vertex or face).
Quick update on this topic since THREE.Geometry
is now removed.
BufferGeometry
is indexed, you can use .toNonIndexed()
to convert it to triangle soup and then (re)compute vertex normals via .computeVertexNormals()
to achieve a flat shaded effect: https://jsfiddle.net/3sg4ohLr/@mrdoob We might want to consider to move flatShading
to only those materials who actually support it (and not have it in Material
). Except for that, I would not change shader code nor introduce a new geometry class.
@mrdoob We might want to consider to move
flatShading
to only those materials who actually support it (and not have it inMaterial
).
That sounds good to me 👍
The
shading
property has been removed fromMeshLambertMaterial
, it is only rendered theSmoothShading
way.Is it the desired effect ? Phong looks heavier to get this result.