File tree 1 file changed +5
-0
lines changed
src/rendering/renderers/webGpu
1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import {WebGpuChunkedBuffer} from "./bufferHelper/WebGpuChunkedBuffer.js";
5
5
import { CachedCameraData } from "./CachedCameraData.js" ;
6
6
import { CachedMeshData } from "./CachedMeshData.js" ;
7
7
import { Mat4 } from "../../../math/Mat4.js" ;
8
+ import { Vec2 } from "../../../math/Vec2.js" ;
9
+ import { Vec3 } from "../../../math/Vec3.js" ;
8
10
import { Vec4 } from "../../../math/Vec4.js" ;
9
11
import { LightComponent } from "../../../components/builtIn/LightComponent.js" ;
10
12
import { MeshComponent } from "../../../components/builtIn/MeshComponent.js" ;
@@ -399,9 +401,12 @@ export class WebGpuRenderer extends Renderer {
399
401
if ( view ) textureView = view ;
400
402
}
401
403
if ( ! textureView ) {
404
+ /** @type {number[] } */
402
405
let color ;
403
406
if ( Array . isArray ( value ) ) {
404
407
color = value ;
408
+ } else if ( value instanceof Vec2 || value instanceof Vec3 || value instanceof Vec4 ) {
409
+ color = value . toArray ( ) ;
405
410
} else {
406
411
color = [ 0 , 0 , 0 ] ;
407
412
}
You can’t perform that action at this time.
0 commit comments