An opposite issue here - we don't see faces where they are defined. So maybe this is because Geometry is shared between the Line and Mesh.
I've debugged this issue today. Geometry
is internally converted to BufferGeometry
. The outcome of this conversion depends on the type of object (Mesh, Line, etc.). So in @makc's example, the geometry is converted as the geometry of a Line
object. This will create a position and color attribute. When the instance of Mesh
is rendered with the same Geometry
object, the renderer returns the same cached instance of BufferGeometry
.
This is the reason why you see these green triangles in the demo. Mesh
and Line
share the same internal BufferGeometry
and interpret it differently. I think we can solve this problem if we try to respect the type of object when caching the BufferGeometry
.
Or we just recommend to use BufferGeometry
in the first place :sweat_smile:
@mrdoob I suggest to introduce a new label Wont't fix
, assign it to the issue and close it. I don't think it makes sense to add a fix to the renderer if the project is going to stop rendering Geometry
anyway. The solution for this issue is the usage of BufferGeometry
.
Most helpful comment
I've debugged this issue today.
Geometry
is internally converted toBufferGeometry
. The outcome of this conversion depends on the type of object (Mesh, Line, etc.). So in @makc's example, the geometry is converted as the geometry of aLine
object. This will create a position and color attribute. When the instance ofMesh
is rendered with the sameGeometry
object, the renderer returns the same cached instance ofBufferGeometry
.https://github.com/mrdoob/three.js/blob/ec67749b0767e2727deebd52da2dbd3a4e7ab6a2/src/renderers/webgl/WebGLGeometries.js#L63-L65
This is the reason why you see these green triangles in the demo.
Mesh
andLine
share the same internalBufferGeometry
and interpret it differently. I think we can solve this problem if we try to respect the type of object when caching theBufferGeometry
.Or we just recommend to use
BufferGeometry
in the first place :sweat_smile: