Skip to content

Commit 0f20668

Browse files
committed
initialize new color array to 1.0
1 parent 44e6f2d commit 0f20668

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/GeometryPreparationUtils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ export function setCommonAttributes( geometry, options ) {
115115
if ( ! geometry.attributes.color && ( attributes && attributes.includes( 'color' ) ) ) {
116116

117117
const vertCount = geometry.attributes.position.count;
118-
geometry.setAttribute( 'color', new BufferAttribute( new Float32Array( vertCount * 4 ), 4 ) );
118+
const array = new Float32Array( vertCount * 4 );
119+
array.fill( 1.0 );
120+
geometry.setAttribute( 'color', new BufferAttribute( array, 4 ) );
119121

120122
}
121123

0 commit comments

Comments
 (0)