|
@@ -3090,9 +3090,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
class WebGLArrayRenderTarget extends WebGLRenderTarget {
|
|
|
|
|
|
- constructor( width = 1, height = 1, depth = 1 ) {
|
|
|
+ constructor( width = 1, height = 1, depth = 1, options = {} ) {
|
|
|
|
|
|
- super( width, height );
|
|
|
+ super( width, height, options );
|
|
|
|
|
|
this.isWebGLArrayRenderTarget = true;
|
|
|
|
|
@@ -3139,9 +3139,9 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
class WebGL3DRenderTarget extends WebGLRenderTarget {
|
|
|
|
|
|
- constructor( width = 1, height = 1, depth = 1 ) {
|
|
|
+ constructor( width = 1, height = 1, depth = 1, options = {} ) {
|
|
|
|
|
|
- super( width, height );
|
|
|
+ super( width, height, options );
|
|
|
|
|
|
this.isWebGL3DRenderTarget = true;
|
|
|
|
|
@@ -7284,6 +7284,10 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ onBeforeShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}
|
|
|
+
|
|
|
+ onAfterShadow( /* renderer, object, camera, shadowCamera, geometry, depthMaterial, group */ ) {}
|
|
|
+
|
|
|
onBeforeRender( /* renderer, scene, camera, geometry, material, group */ ) {}
|
|
|
|
|
|
onAfterRender( /* renderer, scene, camera, geometry, material, group */ ) {}
|
|
@@ -22516,8 +22520,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
const depthMaterial = getDepthMaterial( object, groupMaterial, light, type );
|
|
|
|
|
|
+ object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
|
|
|
+
|
|
|
_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
|
|
|
|
|
|
+ object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, group );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -22526,8 +22534,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
const depthMaterial = getDepthMaterial( object, material, light, type );
|
|
|
|
|
|
+ object.onBeforeShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
|
|
|
+
|
|
|
_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
|
|
|
|
|
|
+ object.onAfterShadow( _renderer, object, camera, shadowCamera, geometry, depthMaterial, null );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -32865,15 +32877,16 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
}
|
|
|
|
|
|
const ID_ATTR_NAME = 'batchId';
|
|
|
- const _matrix = new Matrix4();
|
|
|
- const _identityMatrix = new Matrix4();
|
|
|
- const _projScreenMatrix$2 = new Matrix4();
|
|
|
- const _frustum = new Frustum();
|
|
|
- const _box$1 = new Box3();
|
|
|
- const _sphere$2 = new Sphere();
|
|
|
- const _vector$5 = new Vector3();
|
|
|
- const _renderList = new MultiDrawRenderList();
|
|
|
- const _mesh = new Mesh();
|
|
|
+ const _matrix = /*@__PURE__*/ new Matrix4();
|
|
|
+ const _invMatrixWorld = /*@__PURE__*/ new Matrix4();
|
|
|
+ const _identityMatrix = /*@__PURE__*/ new Matrix4();
|
|
|
+ const _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();
|
|
|
+ const _frustum = /*@__PURE__*/ new Frustum();
|
|
|
+ const _box$1 = /*@__PURE__*/ new Box3();
|
|
|
+ const _sphere$2 = /*@__PURE__*/ new Sphere();
|
|
|
+ const _vector$5 = /*@__PURE__*/ new Vector3();
|
|
|
+ const _renderList = /*@__PURE__*/ new MultiDrawRenderList();
|
|
|
+ const _mesh = /*@__PURE__*/ new Mesh();
|
|
|
const _batchIntersects = [];
|
|
|
|
|
|
// @TODO: SkinnedMesh support?
|
|
@@ -33673,7 +33686,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
- onBeforeRender( _renderer, _scene, camera, geometry, material/*, _group*/ ) {
|
|
|
+ onBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {
|
|
|
|
|
|
// if visibility has not changed and frustum culling and object sorting is not required
|
|
|
// then skip iterating over all items
|
|
@@ -33694,7 +33707,7 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
const drawRanges = this._drawRanges;
|
|
|
const perObjectFrustumCulled = this.perObjectFrustumCulled;
|
|
|
|
|
|
- // prepare the frustum
|
|
|
+ // prepare the frustum in the local frame
|
|
|
if ( perObjectFrustumCulled ) {
|
|
|
|
|
|
_projScreenMatrix$2
|
|
@@ -33702,17 +33715,17 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
.multiply( this.matrixWorld );
|
|
|
_frustum.setFromProjectionMatrix(
|
|
|
_projScreenMatrix$2,
|
|
|
- _renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
|
|
|
+ renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
let count = 0;
|
|
|
-
|
|
|
if ( this.sortObjects ) {
|
|
|
|
|
|
- // get the camera position
|
|
|
- _vector$5.setFromMatrixPosition( camera.matrixWorld );
|
|
|
+ // get the camera position in the local frame
|
|
|
+ _invMatrixWorld.copy( this.matrixWorld ).invert();
|
|
|
+ _vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _invMatrixWorld );
|
|
|
|
|
|
for ( let i = 0, l = visibility.length; i < l; i ++ ) {
|
|
|
|
|
@@ -33803,6 +33816,12 @@ console.warn( 'Scripts "build/three.js" and "build/three.min.js" are deprecated
|
|
|
|
|
|
}
|
|
|
|
|
|
+ onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {
|
|
|
+
|
|
|
+ this.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
class LineBasicMaterial extends Material {
|