@@ -8,6 +8,7 @@ import WebGPURenderPipelines from './WebGPURenderPipelines.js';
88import WebGPUBindings from './WebGPUBindings.js' ;
99import WebGPURenderLists from './WebGPURenderLists.js' ;
1010import WebGPUTextures from './WebGPUTextures.js' ;
11+ import WebGPUBackground from './WebGPUBackground.js' ;
1112
1213import { Frustum , Matrix4 , Vector3 } from '../../../../build/three.module.js' ;
1314
@@ -24,6 +25,7 @@ class WebGPURenderer {
2425 this . domElement = ( parameters . canvas !== undefined ) ? parameters . canvas : document . createElementNS ( 'http://www.w3.org/1999/xhtml' , 'canvas' ) ;
2526 this . parameters = parameters ;
2627
28+ this . autoClear = true ;
2729 this . sortObjects = true ;
2830
2931 // internals
@@ -50,6 +52,7 @@ class WebGPURenderer {
5052 this . _renderPipelines = null ;
5153 this . _renderLists = null ;
5254 this . _textures = null ;
55+ this . _background = null ;
5356
5457 this . _renderPassDescriptor = null ;
5558
@@ -91,11 +94,12 @@ class WebGPURenderer {
9194
9295 const colorAttachment = this . _renderPassDescriptor . colorAttachments [ 0 ] ;
9396 colorAttachment . attachment = this . _swapChain . getCurrentTexture ( ) . createView ( ) ;
94- colorAttachment . loadValue = GPULoadOp . Load ;
9597
9698 const depthStencilAttachment = this . _renderPassDescriptor . depthStencilAttachment ;
9799 depthStencilAttachment . attachment = this . _depthBuffer . createView ( ) ;
98100
101+ this . _background . render ( scene , this . _renderPassDescriptor , this . autoClear ) ;
102+
99103 const opaqueObjects = this . _currentRenderList . opaque ;
100104 const transparentObjects = this . _currentRenderList . transparent ;
101105
@@ -575,6 +579,7 @@ async function initWebGPU( scope ) {
575579 scope . _objects = new WebGPUObjects ( scope . _geometries , scope . _info ) ;
576580 scope . _renderPipelines = new WebGPURenderPipelines ( device , compiler , scope . _bindings ) ;
577581 scope . _renderLists = new WebGPURenderLists ( ) ;
582+ scope . _background = new WebGPUBackground ( ) ;
578583
579584 //
580585
0 commit comments