Skip to content

Commit

Permalink
VOXLoader: VOXMesh clean up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 16, 2021
1 parent c460b28 commit 9fa202c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions examples/jsm/loaders/VOXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,14 @@ class VOXMesh extends Mesh {
geometry.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );
geometry.computeVertexNormals();

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

const material = new MeshStandardMaterial( { vertexColors: hasColors } );
if ( hasColors ) {

geometry.setAttribute( 'color', new Float32BufferAttribute( colors, 3 ) );
material.vertexColors = true;

}

super( geometry, material );

Expand Down

0 comments on commit 9fa202c

Please sign in to comment.