Skip to content

Commit 9fa202c

Browse files
committed
VOXLoader: VOXMesh clean up.
1 parent c460b28 commit 9fa202c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

examples/jsm/loaders/VOXLoader.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,14 @@ class VOXMesh extends Mesh {
251251
geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
252252
geometry.computeVertexNormals();
253253

254-
if ( hasColors ) geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
254+
const material = new MeshStandardMaterial();
255255

256-
const material = new MeshStandardMaterial( { vertexColors: hasColors } );
256+
if ( hasColors ) {
257+
258+
geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
259+
material.vertexColors = true;
260+
261+
}
257262

258263
super( geometry, material );
259264

0 commit comments

Comments
 (0)