|
|
@@ -1133,7 +1133,23 @@ class BatchedMesh extends Mesh {
|
|
|
getColorAt( instanceId, color ) {
|
|
|
|
|
|
this.validateInstanceId( instanceId );
|
|
|
- return color.fromArray( this._colorsTexture.image.data, instanceId * 4 );
|
|
|
+ if ( this._colorsTexture === null ) {
|
|
|
+
|
|
|
+ if ( color.isVector4 ) {
|
|
|
+
|
|
|
+ return color.set( 1, 1, 1, 1 );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ return color.setRGB( 1, 1, 1 );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ return color.fromArray( this._colorsTexture.image.data, instanceId * 4 );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|