|
@@ -1,6 +1,6 @@
|
|
/**
|
|
/**
|
|
* @license
|
|
* @license
|
|
- * Copyright 2010-2023 Three.js Authors
|
|
|
|
|
|
+ * Copyright 2010-2024 Three.js Authors
|
|
* SPDX-License-Identifier: MIT
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
*/
|
|
const REVISION = '164dev';
|
|
const REVISION = '164dev';
|
|
@@ -2921,6 +2921,7 @@ class RenderTarget extends EventDispatcher {
|
|
minFilter: LinearFilter,
|
|
minFilter: LinearFilter,
|
|
depthBuffer: true,
|
|
depthBuffer: true,
|
|
stencilBuffer: false,
|
|
stencilBuffer: false,
|
|
|
|
+ resolveDepthBuffer: true,
|
|
resolveStencilBuffer: true,
|
|
resolveStencilBuffer: true,
|
|
depthTexture: null,
|
|
depthTexture: null,
|
|
samples: 0,
|
|
samples: 0,
|
|
@@ -2946,6 +2947,7 @@ class RenderTarget extends EventDispatcher {
|
|
this.depthBuffer = options.depthBuffer;
|
|
this.depthBuffer = options.depthBuffer;
|
|
this.stencilBuffer = options.stencilBuffer;
|
|
this.stencilBuffer = options.stencilBuffer;
|
|
|
|
|
|
|
|
+ this.resolveDepthBuffer = options.resolveDepthBuffer;
|
|
this.resolveStencilBuffer = options.resolveStencilBuffer;
|
|
this.resolveStencilBuffer = options.resolveStencilBuffer;
|
|
|
|
|
|
this.depthTexture = options.depthTexture;
|
|
this.depthTexture = options.depthTexture;
|
|
@@ -3025,6 +3027,7 @@ class RenderTarget extends EventDispatcher {
|
|
this.depthBuffer = source.depthBuffer;
|
|
this.depthBuffer = source.depthBuffer;
|
|
this.stencilBuffer = source.stencilBuffer;
|
|
this.stencilBuffer = source.stencilBuffer;
|
|
|
|
|
|
|
|
+ this.resolveDepthBuffer = source.resolveDepthBuffer;
|
|
this.resolveStencilBuffer = source.resolveStencilBuffer;
|
|
this.resolveStencilBuffer = source.resolveStencilBuffer;
|
|
|
|
|
|
if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();
|
|
if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();
|
|
@@ -16253,16 +16256,16 @@ const INV_PHI = 1 / PHI;
|
|
// Vertices of a dodecahedron (except the opposites, which represent the
|
|
// Vertices of a dodecahedron (except the opposites, which represent the
|
|
// same axis), used as axis directions evenly spread on a sphere.
|
|
// same axis), used as axis directions evenly spread on a sphere.
|
|
const _axisDirections = [
|
|
const _axisDirections = [
|
|
- /*@__PURE__*/ new Vector3( 1, 1, 1 ),
|
|
|
|
- /*@__PURE__*/ new Vector3( - 1, 1, 1 ),
|
|
|
|
- /*@__PURE__*/ new Vector3( 1, 1, - 1 ),
|
|
|
|
- /*@__PURE__*/ new Vector3( - 1, 1, - 1 ),
|
|
|
|
- /*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),
|
|
|
|
- /*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),
|
|
|
|
- /*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),
|
|
|
|
- /*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),
|
|
|
|
|
|
+ /*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ),
|
|
/*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ),
|
|
/*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ),
|
|
- /*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ) ];
|
|
|
|
|
|
+ /*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),
|
|
|
|
+ /*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),
|
|
|
|
+ /*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),
|
|
|
|
+ /*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),
|
|
|
|
+ /*@__PURE__*/ new Vector3( - 1, 1, - 1 ),
|
|
|
|
+ /*@__PURE__*/ new Vector3( 1, 1, - 1 ),
|
|
|
|
+ /*@__PURE__*/ new Vector3( - 1, 1, 1 ),
|
|
|
|
+ /*@__PURE__*/ new Vector3( 1, 1, 1 ) ];
|
|
|
|
|
|
/**
|
|
/**
|
|
* This class generates a Prefiltered, Mipmapped Radiance Environment Map
|
|
* This class generates a Prefiltered, Mipmapped Radiance Environment Map
|
|
@@ -16648,12 +16651,13 @@ class PMREMGenerator {
|
|
const renderer = this._renderer;
|
|
const renderer = this._renderer;
|
|
const autoClear = renderer.autoClear;
|
|
const autoClear = renderer.autoClear;
|
|
renderer.autoClear = false;
|
|
renderer.autoClear = false;
|
|
|
|
+ const n = this._lodPlanes.length;
|
|
|
|
|
|
- for ( let i = 1; i < this._lodPlanes.length; i ++ ) {
|
|
|
|
|
|
+ for ( let i = 1; i < n; i ++ ) {
|
|
|
|
|
|
const sigma = Math.sqrt( this._sigmas[ i ] * this._sigmas[ i ] - this._sigmas[ i - 1 ] * this._sigmas[ i - 1 ] );
|
|
const sigma = Math.sqrt( this._sigmas[ i ] * this._sigmas[ i ] - this._sigmas[ i - 1 ] * this._sigmas[ i - 1 ] );
|
|
|
|
|
|
- const poleAxis = _axisDirections[ ( i - 1 ) % _axisDirections.length ];
|
|
|
|
|
|
+ const poleAxis = _axisDirections[ ( n - i - 1 ) % _axisDirections.length ];
|
|
|
|
|
|
this._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis );
|
|
this._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis );
|
|
|
|
|
|
@@ -22077,7 +22081,7 @@ const vertex = "void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";
|
|
|
|
|
|
const fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";
|
|
const fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}";
|
|
|
|
|
|
-function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
+function WebGLShadowMap( renderer, objects, capabilities ) {
|
|
|
|
|
|
let _frustum = new Frustum();
|
|
let _frustum = new Frustum();
|
|
|
|
|
|
@@ -22091,7 +22095,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
_materialCache = {},
|
|
_materialCache = {},
|
|
|
|
|
|
- _maxTextureSize = _capabilities.maxTextureSize;
|
|
|
|
|
|
+ _maxTextureSize = capabilities.maxTextureSize;
|
|
|
|
|
|
const shadowSide = { [ FrontSide ]: BackSide, [ BackSide ]: FrontSide, [ DoubleSide ]: DoubleSide };
|
|
const shadowSide = { [ FrontSide ]: BackSide, [ BackSide ]: FrontSide, [ DoubleSide ]: DoubleSide };
|
|
|
|
|
|
@@ -22141,11 +22145,11 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
if ( lights.length === 0 ) return;
|
|
if ( lights.length === 0 ) return;
|
|
|
|
|
|
- const currentRenderTarget = _renderer.getRenderTarget();
|
|
|
|
- const activeCubeFace = _renderer.getActiveCubeFace();
|
|
|
|
- const activeMipmapLevel = _renderer.getActiveMipmapLevel();
|
|
|
|
|
|
+ const currentRenderTarget = renderer.getRenderTarget();
|
|
|
|
+ const activeCubeFace = renderer.getActiveCubeFace();
|
|
|
|
+ const activeMipmapLevel = renderer.getActiveMipmapLevel();
|
|
|
|
|
|
- const _state = _renderer.state;
|
|
|
|
|
|
+ const _state = renderer.state;
|
|
|
|
|
|
// Set GL state for depth map.
|
|
// Set GL state for depth map.
|
|
_state.setBlending( NoBlending );
|
|
_state.setBlending( NoBlending );
|
|
@@ -22219,8 +22223,8 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- _renderer.setRenderTarget( shadow.map );
|
|
|
|
- _renderer.clear();
|
|
|
|
|
|
+ renderer.setRenderTarget( shadow.map );
|
|
|
|
+ renderer.clear();
|
|
|
|
|
|
const viewportCount = shadow.getViewportCount();
|
|
const viewportCount = shadow.getViewportCount();
|
|
|
|
|
|
@@ -22261,13 +22265,13 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
scope.needsUpdate = false;
|
|
scope.needsUpdate = false;
|
|
|
|
|
|
- _renderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel );
|
|
|
|
|
|
+ renderer.setRenderTarget( currentRenderTarget, activeCubeFace, activeMipmapLevel );
|
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
function VSMPass( shadow, camera ) {
|
|
function VSMPass( shadow, camera ) {
|
|
|
|
|
|
- const geometry = _objects.update( fullScreenMesh );
|
|
|
|
|
|
+ const geometry = objects.update( fullScreenMesh );
|
|
|
|
|
|
if ( shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples ) {
|
|
if ( shadowMaterialVertical.defines.VSM_SAMPLES !== shadow.blurSamples ) {
|
|
|
|
|
|
@@ -22290,18 +22294,18 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;
|
|
shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;
|
|
shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;
|
|
shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;
|
|
shadowMaterialVertical.uniforms.radius.value = shadow.radius;
|
|
shadowMaterialVertical.uniforms.radius.value = shadow.radius;
|
|
- _renderer.setRenderTarget( shadow.mapPass );
|
|
|
|
- _renderer.clear();
|
|
|
|
- _renderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null );
|
|
|
|
|
|
+ renderer.setRenderTarget( shadow.mapPass );
|
|
|
|
+ renderer.clear();
|
|
|
|
+ renderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null );
|
|
|
|
|
|
// horizontal pass
|
|
// horizontal pass
|
|
|
|
|
|
shadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;
|
|
shadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;
|
|
shadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;
|
|
shadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;
|
|
shadowMaterialHorizontal.uniforms.radius.value = shadow.radius;
|
|
shadowMaterialHorizontal.uniforms.radius.value = shadow.radius;
|
|
- _renderer.setRenderTarget( shadow.map );
|
|
|
|
- _renderer.clear();
|
|
|
|
- _renderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null );
|
|
|
|
|
|
+ renderer.setRenderTarget( shadow.map );
|
|
|
|
+ renderer.clear();
|
|
|
|
+ renderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -22319,7 +22323,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
result = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial;
|
|
result = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial;
|
|
|
|
|
|
- if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
|
|
|
|
|
|
+ if ( ( renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
|
|
( material.displacementMap && material.displacementScale !== 0 ) ||
|
|
( material.displacementMap && material.displacementScale !== 0 ) ||
|
|
( material.alphaMap && material.alphaTest > 0 ) ||
|
|
( material.alphaMap && material.alphaTest > 0 ) ||
|
|
( material.map && material.alphaTest > 0 ) ) {
|
|
( material.map && material.alphaTest > 0 ) ) {
|
|
@@ -22384,7 +22388,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
if ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) {
|
|
if ( light.isPointLight === true && result.isMeshDistanceMaterial === true ) {
|
|
|
|
|
|
- const materialProperties = _renderer.properties.get( result );
|
|
|
|
|
|
+ const materialProperties = renderer.properties.get( result );
|
|
materialProperties.light = light;
|
|
materialProperties.light = light;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -22405,7 +22409,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
object.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );
|
|
object.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );
|
|
|
|
|
|
- const geometry = _objects.update( object );
|
|
|
|
|
|
+ const geometry = objects.update( object );
|
|
const material = object.material;
|
|
const material = object.material;
|
|
|
|
|
|
if ( Array.isArray( material ) ) {
|
|
if ( Array.isArray( material ) ) {
|
|
@@ -22421,11 +22425,11 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
|
|
const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
|
|
|
|
|
|
- object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
|
|
|
|
|
|
+ object.onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
|
|
|
|
|
|
- _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
|
|
|
|
|
|
+ renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
|
|
|
|
|
|
- object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
|
|
|
|
|
|
+ object.onAfterShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -22435,11 +22439,11 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
|
|
|
|
|
|
const depthMaterial = getDepthMaterial( object, material, light, type );
|
|
const depthMaterial = getDepthMaterial( object, material, light, type );
|
|
|
|
|
|
- object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
|
|
|
|
|
|
+ object.onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
|
|
|
|
|
|
- _renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
|
|
|
|
|
|
+ renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
|
|
|
|
|
|
- object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
|
|
|
|
|
|
+ object.onAfterShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -25619,9 +25623,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
for ( let i = 0; i < textures.length; i ++ ) {
|
|
for ( let i = 0; i < textures.length; i ++ ) {
|
|
|
|
|
|
- const ignoreDepthValues = ( renderTargetProperties.__ignoreDepthValues !== undefined ) ? renderTargetProperties.__ignoreDepthValues : false;
|
|
|
|
-
|
|
|
|
- if ( ignoreDepthValues === false ) {
|
|
|
|
|
|
+ if ( renderTarget.resolveDepthBuffer ) {
|
|
|
|
|
|
if ( renderTarget.depthBuffer ) mask |= _gl.DEPTH_BUFFER_BIT;
|
|
if ( renderTarget.depthBuffer ) mask |= _gl.DEPTH_BUFFER_BIT;
|
|
|
|
|
|
@@ -25649,7 +25651,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
invalidationArrayRead.push( _gl.COLOR_ATTACHMENT0 + i );
|
|
invalidationArrayRead.push( _gl.COLOR_ATTACHMENT0 + i );
|
|
|
|
|
|
- if ( renderTarget.depthBuffer && ignoreDepthValues === true ) {
|
|
|
|
|
|
+ if ( renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false ) {
|
|
|
|
|
|
invalidationArrayRead.push( depthStyle );
|
|
invalidationArrayRead.push( depthStyle );
|
|
invalidationArrayDraw.push( depthStyle );
|
|
invalidationArrayDraw.push( depthStyle );
|
|
@@ -25688,10 +25690,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
- const renderTargetProperties = properties.get( renderTarget );
|
|
|
|
- const ignoreDepthValues = ( renderTargetProperties.__ignoreDepthValues !== undefined ) ? renderTargetProperties.__ignoreDepthValues : false;
|
|
|
|
-
|
|
|
|
- if ( renderTarget.depthBuffer && ignoreDepthValues && supportsInvalidateFramebuffer ) {
|
|
|
|
|
|
+ if ( renderTarget.depthBuffer && renderTarget.resolveDepthBuffer === false && supportsInvalidateFramebuffer ) {
|
|
|
|
|
|
const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;
|
|
const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;
|
|
|
|
|
|
@@ -26818,12 +26817,10 @@ class WebXRManager extends EventDispatcher {
|
|
depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
|
|
depthTexture: new DepthTexture( glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat ),
|
|
stencilBuffer: attributes.stencil,
|
|
stencilBuffer: attributes.stencil,
|
|
colorSpace: renderer.outputColorSpace,
|
|
colorSpace: renderer.outputColorSpace,
|
|
- samples: attributes.antialias ? 4 : 0
|
|
|
|
|
|
+ samples: attributes.antialias ? 4 : 0,
|
|
|
|
+ resolveDepthBuffer: ( glProjLayer.ignoreDepthValues === false )
|
|
} );
|
|
} );
|
|
|
|
|
|
- const renderTargetProperties = renderer.properties.get( newRenderTarget );
|
|
|
|
- renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
|
|
newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
|
|
@@ -28434,10 +28431,7 @@ class WebGLRenderer {
|
|
|
|
|
|
function getContext( contextName, contextAttributes ) {
|
|
function getContext( contextName, contextAttributes ) {
|
|
|
|
|
|
- const context = canvas.getContext( contextName, contextAttributes );
|
|
|
|
- if ( context !== null ) return context;
|
|
|
|
-
|
|
|
|
- return null;
|
|
|
|
|
|
+ return canvas.getContext( contextName, contextAttributes );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -29648,12 +29642,10 @@ class WebGLRenderer {
|
|
minFilter: LinearMipmapLinearFilter,
|
|
minFilter: LinearMipmapLinearFilter,
|
|
samples: 4,
|
|
samples: 4,
|
|
stencilBuffer: stencil,
|
|
stencilBuffer: stencil,
|
|
|
|
+ resolveDepthBuffer: false,
|
|
resolveStencilBuffer: false
|
|
resolveStencilBuffer: false
|
|
} );
|
|
} );
|
|
|
|
|
|
- const renderTargetProperties = properties.get( currentRenderState.state.transmissionRenderTarget[ camera.id ] );
|
|
|
|
- renderTargetProperties.__ignoreDepthValues = true;
|
|
|
|
-
|
|
|
|
// debug
|
|
// debug
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -29701,39 +29693,43 @@ class WebGLRenderer {
|
|
textures.updateMultisampleRenderTarget( transmissionRenderTarget );
|
|
textures.updateMultisampleRenderTarget( transmissionRenderTarget );
|
|
textures.updateRenderTargetMipmap( transmissionRenderTarget );
|
|
textures.updateRenderTargetMipmap( transmissionRenderTarget );
|
|
|
|
|
|
- let renderTargetNeedsUpdate = false;
|
|
|
|
|
|
+ if ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === false ) { // see #28131
|
|
|
|
|
|
- for ( let i = 0, l = transmissiveObjects.length; i < l; i ++ ) {
|
|
|
|
|
|
+ let renderTargetNeedsUpdate = false;
|
|
|
|
|
|
- const renderItem = transmissiveObjects[ i ];
|
|
|
|
|
|
+ for ( let i = 0, l = transmissiveObjects.length; i < l; i ++ ) {
|
|
|
|
|
|
- const object = renderItem.object;
|
|
|
|
- const geometry = renderItem.geometry;
|
|
|
|
- const material = renderItem.material;
|
|
|
|
- const group = renderItem.group;
|
|
|
|
|
|
+ const renderItem = transmissiveObjects[ i ];
|
|
|
|
|
|
- if ( material.side === DoubleSide && object.layers.test( camera.layers ) ) {
|
|
|
|
|
|
+ const object = renderItem.object;
|
|
|
|
+ const geometry = renderItem.geometry;
|
|
|
|
+ const material = renderItem.material;
|
|
|
|
+ const group = renderItem.group;
|
|
|
|
|
|
- const currentSide = material.side;
|
|
|
|
|
|
+ if ( material.side === DoubleSide && object.layers.test( camera.layers ) ) {
|
|
|
|
|
|
- material.side = BackSide;
|
|
|
|
- material.needsUpdate = true;
|
|
|
|
|
|
+ const currentSide = material.side;
|
|
|
|
|
|
- renderObject( object, scene, camera, geometry, material, group );
|
|
|
|
|
|
+ material.side = BackSide;
|
|
|
|
+ material.needsUpdate = true;
|
|
|
|
|
|
- material.side = currentSide;
|
|
|
|
- material.needsUpdate = true;
|
|
|
|
|
|
+ renderObject( object, scene, camera, geometry, material, group );
|
|
|
|
|
|
- renderTargetNeedsUpdate = true;
|
|
|
|
|
|
+ material.side = currentSide;
|
|
|
|
+ material.needsUpdate = true;
|
|
|
|
+
|
|
|
|
+ renderTargetNeedsUpdate = true;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ if ( renderTargetNeedsUpdate === true ) {
|
|
|
|
|
|
- if ( renderTargetNeedsUpdate === true ) {
|
|
|
|
|
|
+ textures.updateMultisampleRenderTarget( transmissionRenderTarget );
|
|
|
|
+ textures.updateRenderTargetMipmap( transmissionRenderTarget );
|
|
|
|
|
|
- textures.updateMultisampleRenderTarget( transmissionRenderTarget );
|
|
|
|
- textures.updateRenderTargetMipmap( transmissionRenderTarget );
|
|
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -30630,9 +30626,9 @@ class WebGLRenderer {
|
|
|
|
|
|
this.copyTextureToTexture3D = function ( sourceBox, position, srcTexture, dstTexture, level = 0 ) {
|
|
this.copyTextureToTexture3D = function ( sourceBox, position, srcTexture, dstTexture, level = 0 ) {
|
|
|
|
|
|
- const width = Math.round( sourceBox.max.x - sourceBox.min.x );
|
|
|
|
- const height = Math.round( sourceBox.max.y - sourceBox.min.y );
|
|
|
|
- const depth = sourceBox.max.z - sourceBox.min.z + 1;
|
|
|
|
|
|
+ const width = sourceBox.max.x - sourceBox.min.x;
|
|
|
|
+ const height = sourceBox.max.y - sourceBox.min.y;
|
|
|
|
+ const depth = sourceBox.max.z - sourceBox.min.z;
|
|
const glFormat = utils.convert( dstTexture.format );
|
|
const glFormat = utils.convert( dstTexture.format );
|
|
const glType = utils.convert( dstTexture.type );
|
|
const glType = utils.convert( dstTexture.type );
|
|
let glTarget;
|
|
let glTarget;
|
|
@@ -43469,7 +43465,7 @@ class FileLoader extends Loader {
|
|
|
|
|
|
// Nginx needs X-File-Size check
|
|
// Nginx needs X-File-Size check
|
|
// https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content
|
|
// https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content
|
|
- const contentLength = response.headers.get( 'Content-Length' ) || response.headers.get( 'X-File-Size' );
|
|
|
|
|
|
+ const contentLength = response.headers.get( 'X-File-Size' ) || response.headers.get( 'Content-Length' );
|
|
const total = contentLength ? parseInt( contentLength ) : 0;
|
|
const total = contentLength ? parseInt( contentLength ) : 0;
|
|
const lengthComputable = total !== 0;
|
|
const lengthComputable = total !== 0;
|
|
let loaded = 0;
|
|
let loaded = 0;
|