@@ -47814,8 +47814,11 @@ class Background extends DataMap {
4781447814 // compute vertex position
4781547815 const modifiedPosition = isOrtho.select( positionLocal.mul( orthoScale ), positionLocal );
4781647816
47817- // By using a w component of 0, the skybox will not translate when the camera moves through the scene
47818- let viewProj = cameraProjectionMatrix.mul( modelViewMatrix.mul( vec4( modifiedPosition, 0.0 ) ) );
47817+ // by using a w component of 0, the skybox will not translate when the camera moves through the scene
47818+ const viewPosition = modelViewMatrix.mul( vec4( modifiedPosition, 0.0 ) );
47819+
47820+ // we force w=1.0 here to prevent the w_clip=0 divide-by-zero error for ortho cameras.
47821+ let viewProj = cameraProjectionMatrix.mul( vec4( viewPosition.xyz, 1.0 ) );
4781947822
4782047823 // force background to far plane so it does not occlude objects
4782147824 viewProj = viewProj.setZ( viewProj.w );
@@ -57670,8 +57673,7 @@ class Renderer {
5767057673 * and pipeline updates.
5767157674 *
5767257675 * @private
57673- * @type {?Function}
57674- * @default null
57676+ * @type {Function}
5767557677 */
5767657678 this._handleObjectFunction = this._renderObjectDirect;
5767757679
@@ -57957,6 +57959,7 @@ class Renderer {
5795757959 const previousRenderId = nodeFrame.renderId;
5795857960 const previousRenderContext = this._currentRenderContext;
5795957961 const previousRenderObjectFunction = this._currentRenderObjectFunction;
57962+ const previousHandleObjectFunction = this._handleObjectFunction;
5796057963 const previousCompilationPromises = this._compilationPromises;
5796157964
5796257965 //
@@ -58040,7 +58043,15 @@ class Renderer {
5804058043
5804158044 //
5804258045
58043- this._background.update( sceneRef, renderList, renderContext );
58046+ if ( targetScene !== scene ) {
58047+
58048+ this._background.update( targetScene, renderList, renderContext );
58049+
58050+ } else {
58051+
58052+ this._background.update( sceneRef, renderList, renderContext );
58053+
58054+ }
5804458055
5804558056 // process render lists
5804658057
@@ -58058,10 +58069,9 @@ class Renderer {
5805858069
5805958070 this._currentRenderContext = previousRenderContext;
5806058071 this._currentRenderObjectFunction = previousRenderObjectFunction;
58072+ this._handleObjectFunction = previousHandleObjectFunction;
5806158073 this._compilationPromises = previousCompilationPromises;
5806258074
58063- this._handleObjectFunction = this._renderObjectDirect;
58064-
5806558075 // wait for all promises setup by backends awaiting compilation/linking/pipeline creation to complete
5806658076
5806758077 await Promise.all( compilationPromises );
@@ -58458,6 +58468,7 @@ class Renderer {
5845858468 const previousRenderId = nodeFrame.renderId;
5845958469 const previousRenderContext = this._currentRenderContext;
5846058470 const previousRenderObjectFunction = this._currentRenderObjectFunction;
58471+ const previousHandleObjectFunction = this._handleObjectFunction;
5846158472
5846258473 //
5846358474
@@ -58490,6 +58501,7 @@ class Renderer {
5849058501
5849158502 this._currentRenderContext = renderContext;
5849258503 this._currentRenderObjectFunction = this._renderObjectFunction || this.renderObject;
58504+ this._handleObjectFunction = this._renderObjectDirect;
5849358505
5849458506 //
5849558507
@@ -58689,6 +58701,7 @@ class Renderer {
5868958701
5869058702 this._currentRenderContext = previousRenderContext;
5869158703 this._currentRenderObjectFunction = previousRenderObjectFunction;
58704+ this._handleObjectFunction = previousHandleObjectFunction;
5869258705
5869358706 //
5869458707
@@ -70604,7 +70617,7 @@ const GPUPrimitiveTopology = {
7060470617 TriangleStrip: 'triangle-strip',
7060570618};
7060670619
70607- const GPUShaderStage = ( typeof self !== 'undefined' ) ? self.GPUShaderStage : { VERTEX: 1, FRAGMENT: 2, COMPUTE: 4 };
70620+ const GPUShaderStage = ( typeof self !== 'undefined' && self.GPUShaderStage ) ? self.GPUShaderStage : { VERTEX: 1, FRAGMENT: 2, COMPUTE: 4 };
7060870621
7060970622const GPUCompareFunction = {
7061070623 Never: 'never',
0 commit comments