@babylonjs/core 7.27.0 → 7.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animationGroup.d.ts +2 -2
- package/Animations/animationGroup.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +5 -9
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Bones/skeleton.d.ts +2 -2
- package/Bones/skeleton.js.map +1 -1
- package/Cameras/camera.d.ts +2 -0
- package/Cameras/camera.js +2 -0
- package/Cameras/camera.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.js +3 -0
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/{abstractScene.d.ts → IAssetContainer.d.ts} +33 -6
- package/IAssetContainer.js +2 -0
- package/IAssetContainer.js.map +1 -0
- package/Layers/effectLayerSceneComponent.d.ts +6 -6
- package/Layers/effectLayerSceneComponent.js +3 -3
- package/Layers/effectLayerSceneComponent.js.map +1 -1
- package/Layers/glowLayer.d.ts +3 -3
- package/Layers/glowLayer.js +2 -2
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +3 -3
- package/Layers/highlightLayer.js +2 -2
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/layerSceneComponent.d.ts +5 -5
- package/Layers/layerSceneComponent.js.map +1 -1
- package/LensFlares/lensFlareSystemSceneComponent.d.ts +6 -6
- package/LensFlares/lensFlareSystemSceneComponent.js +6 -6
- package/LensFlares/lensFlareSystemSceneComponent.js.map +1 -1
- package/Lights/Shadows/shadowGeneratorSceneComponent.d.ts +3 -3
- package/Lights/Shadows/shadowGeneratorSceneComponent.js.map +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js +1 -1
- package/Materials/GreasedLine/greasedLineSimpleMaterial.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.d.ts +2 -2
- package/Materials/Textures/Procedurals/proceduralTextureSceneComponent.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +2 -2
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/effectRenderer.d.ts +1 -0
- package/Materials/effectRenderer.js +2 -0
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/material.d.ts +2 -2
- package/Materials/material.decalMapConfiguration.d.ts +1 -1
- package/Materials/material.decalMapConfiguration.js +1 -1
- package/Materials/material.decalMapConfiguration.js.map +1 -1
- package/Materials/material.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +5 -0
- package/Materials/shaderMaterial.js +7 -0
- package/Materials/shaderMaterial.js.map +1 -1
- package/Maths/math.color.d.ts +20 -0
- package/Maths/math.color.js +41 -12
- package/Maths/math.color.js.map +1 -1
- package/Meshes/Builders/greasedLineBuilder.d.ts +16 -0
- package/Meshes/Builders/greasedLineBuilder.js +1 -1
- package/Meshes/Builders/greasedLineBuilder.js.map +1 -1
- package/Meshes/Builders/groundBuilder.d.ts +1 -0
- package/Meshes/Builders/groundBuilder.js +2 -2
- package/Meshes/Builders/groundBuilder.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineBaseMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineMesh.js.map +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js +1 -1
- package/Meshes/GreasedLine/greasedLineRibbonMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Set/setPositionsBlock.d.ts +3 -0
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js +86 -1
- package/Meshes/Node/Blocks/Set/setPositionsBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/nullBlock.d.ts +4 -0
- package/Meshes/Node/Blocks/Sources/nullBlock.js +8 -0
- package/Meshes/Node/Blocks/Sources/nullBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Sources/planeBlock.d.ts +13 -0
- package/Meshes/Node/Blocks/Sources/planeBlock.js +41 -3
- package/Meshes/Node/Blocks/Sources/planeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/debugBlock.js +1 -1
- package/Meshes/Node/Blocks/debugBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryElbowBlock.js +1 -1
- package/Meshes/Node/Blocks/geometryElbowBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.d.ts +4 -0
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +47 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Meshes/geometry.d.ts +2 -2
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/mesh.d.ts +7 -0
- package/Meshes/mesh.js +15 -0
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/meshUVSpaceRenderer.d.ts +3 -2
- package/Meshes/meshUVSpaceRenderer.js +15 -3
- package/Meshes/meshUVSpaceRenderer.js.map +1 -1
- package/Misc/greasedLineTools.d.ts +3 -1
- package/Misc/greasedLineTools.js +17 -2
- package/Misc/greasedLineTools.js.map +1 -1
- package/Misc/index.d.ts +2 -0
- package/Misc/index.js +2 -0
- package/Misc/index.js.map +1 -1
- package/Misc/screenshotTools.js +3 -2
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/textureTools.js +20 -4
- package/Misc/textureTools.js.map +1 -1
- package/Morph/morphTargetManager.d.ts +2 -2
- package/Morph/morphTargetManager.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +2 -2
- package/PostProcesses/postProcess.js.map +1 -1
- package/Probes/reflectionProbe.d.ts +5 -5
- package/Probes/reflectionProbe.js +3 -3
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderer.d.ts +2 -2
- package/Rendering/fluidRenderer/fluidRenderer.js.map +1 -1
- package/Rendering/prePassRendererSceneComponent.d.ts +2 -2
- package/Rendering/prePassRendererSceneComponent.js.map +1 -1
- package/Rendering/subSurfaceSceneComponent.d.ts +2 -2
- package/Rendering/subSurfaceSceneComponent.js.map +1 -1
- package/Shaders/lod.fragment.js +2 -2
- package/Shaders/lod.fragment.js.map +1 -1
- package/Shaders/lodCube.fragment.js +2 -2
- package/Shaders/lodCube.fragment.js.map +1 -1
- package/Shaders/spriteMap.fragment.js +18 -6
- package/Shaders/spriteMap.fragment.js.map +1 -1
- package/Shaders/spriteMap.vertex.js +1 -1
- package/Shaders/spriteMap.vertex.js.map +1 -1
- package/ShadersWGSL/lod.fragment.d.ts +5 -0
- package/ShadersWGSL/lod.fragment.js +11 -0
- package/ShadersWGSL/lod.fragment.js.map +1 -0
- package/ShadersWGSL/lodCube.fragment.d.ts +5 -0
- package/ShadersWGSL/lodCube.fragment.js +30 -0
- package/ShadersWGSL/lodCube.fragment.js.map +1 -0
- package/Sprites/spriteMap.d.ts +16 -0
- package/Sprites/spriteMap.js +17 -0
- package/Sprites/spriteMap.js.map +1 -1
- package/assetContainer.d.ts +143 -3
- package/assetContainer.js +129 -8
- package/assetContainer.js.map +1 -1
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/node.d.ts +2 -2
- package/node.js.map +1 -1
- package/package.json +1 -1
- package/scene.d.ts +103 -14
- package/scene.js +170 -71
- package/scene.js.map +1 -1
- package/sceneComponent.d.ts +3 -3
- package/sceneComponent.js.map +1 -1
- package/abstractScene.js +0 -117
- package/abstractScene.js.map +0 -1
package/scene.js
CHANGED
|
@@ -5,7 +5,6 @@ import { SmartArrayNoDuplicate, SmartArray } from "./Misc/smartArray.js";
|
|
|
5
5
|
import { StringDictionary } from "./Misc/stringDictionary.js";
|
|
6
6
|
import { Tags } from "./Misc/tags.js";
|
|
7
7
|
import { Vector3, Matrix, TmpVectors } from "./Maths/math.vector.js";
|
|
8
|
-
import { AbstractScene } from "./abstractScene.js";
|
|
9
8
|
import { ImageProcessingConfiguration } from "./Materials/imageProcessingConfiguration.js";
|
|
10
9
|
import { UniformBuffer } from "./Materials/uniformBuffer.js";
|
|
11
10
|
import { PickingInfo } from "./Collisions/pickingInfo.js";
|
|
@@ -44,7 +43,7 @@ export var ScenePerformancePriority;
|
|
|
44
43
|
* Represents a scene to be rendered by the engine.
|
|
45
44
|
* @see https://doc.babylonjs.com/features/featuresDeepDive/scene
|
|
46
45
|
*/
|
|
47
|
-
export class Scene
|
|
46
|
+
export class Scene {
|
|
48
47
|
// eslint-disable-next-line jsdoc/require-returns-check
|
|
49
48
|
/**
|
|
50
49
|
* Factory used to create the default material.
|
|
@@ -62,26 +61,6 @@ export class Scene extends AbstractScene {
|
|
|
62
61
|
static CollisionCoordinatorFactory() {
|
|
63
62
|
throw _WarnImport("DefaultCollisionCoordinator");
|
|
64
63
|
}
|
|
65
|
-
/**
|
|
66
|
-
* Texture used in all pbr material as the reflection texture.
|
|
67
|
-
* As in the majority of the scene they are the same (exception for multi room and so on),
|
|
68
|
-
* this is easier to reference from here than from all the materials.
|
|
69
|
-
*/
|
|
70
|
-
get environmentTexture() {
|
|
71
|
-
return this._environmentTexture;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Texture used in all pbr material as the reflection texture.
|
|
75
|
-
* As in the majority of the scene they are the same (exception for multi room and so on),
|
|
76
|
-
* this is easier to set here than in all the materials.
|
|
77
|
-
*/
|
|
78
|
-
set environmentTexture(value) {
|
|
79
|
-
if (this._environmentTexture === value) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
this._environmentTexture = value;
|
|
83
|
-
this.markAllMaterialsAsDirty(1);
|
|
84
|
-
}
|
|
85
64
|
/**
|
|
86
65
|
* Default image processing configuration used either in the rendering
|
|
87
66
|
* Forward main pass or through the imageProcessingPostProcess if present.
|
|
@@ -164,6 +143,38 @@ export class Scene extends AbstractScene {
|
|
|
164
143
|
get forcePointsCloud() {
|
|
165
144
|
return this._forcePointsCloud;
|
|
166
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Texture used in all pbr material as the reflection texture.
|
|
148
|
+
* As in the majority of the scene they are the same (exception for multi room and so on),
|
|
149
|
+
* this is easier to reference from here than from all the materials.
|
|
150
|
+
*/
|
|
151
|
+
get environmentTexture() {
|
|
152
|
+
return this._environmentTexture;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Texture used in all pbr material as the reflection texture.
|
|
156
|
+
* As in the majority of the scene they are the same (exception for multi room and so on),
|
|
157
|
+
* this is easier to set here than in all the materials.
|
|
158
|
+
*/
|
|
159
|
+
set environmentTexture(value) {
|
|
160
|
+
if (this._environmentTexture === value) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this._environmentTexture = value;
|
|
164
|
+
this.markAllMaterialsAsDirty(1);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* @returns all meshes, lights, cameras, transformNodes and bones
|
|
168
|
+
*/
|
|
169
|
+
getNodes() {
|
|
170
|
+
let nodes = [];
|
|
171
|
+
nodes = nodes.concat(this.meshes);
|
|
172
|
+
nodes = nodes.concat(this.lights);
|
|
173
|
+
nodes = nodes.concat(this.cameras);
|
|
174
|
+
nodes = nodes.concat(this.transformNodes); // dummies
|
|
175
|
+
this.skeletons.forEach((skeleton) => (nodes = nodes.concat(skeleton.bones)));
|
|
176
|
+
return nodes;
|
|
177
|
+
}
|
|
167
178
|
/**
|
|
168
179
|
* Gets or sets the animation properties override
|
|
169
180
|
*/
|
|
@@ -600,7 +611,6 @@ export class Scene extends AbstractScene {
|
|
|
600
611
|
* @param options defines the scene options
|
|
601
612
|
*/
|
|
602
613
|
constructor(engine, options) {
|
|
603
|
-
super();
|
|
604
614
|
// Members
|
|
605
615
|
/** @internal */
|
|
606
616
|
this._inputManager = new InputManager(this);
|
|
@@ -641,6 +651,87 @@ export class Scene extends AbstractScene {
|
|
|
641
651
|
this._forceWireframe = false;
|
|
642
652
|
this._skipFrustumClipping = false;
|
|
643
653
|
this._forcePointsCloud = false;
|
|
654
|
+
/**
|
|
655
|
+
* Gets the list of root nodes (ie. nodes with no parent)
|
|
656
|
+
*/
|
|
657
|
+
this.rootNodes = [];
|
|
658
|
+
/** All of the cameras added to this scene
|
|
659
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/cameras
|
|
660
|
+
*/
|
|
661
|
+
this.cameras = [];
|
|
662
|
+
/**
|
|
663
|
+
* All of the lights added to this scene
|
|
664
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction
|
|
665
|
+
*/
|
|
666
|
+
this.lights = [];
|
|
667
|
+
/**
|
|
668
|
+
* All of the (abstract) meshes added to this scene
|
|
669
|
+
*/
|
|
670
|
+
this.meshes = [];
|
|
671
|
+
/**
|
|
672
|
+
* The list of skeletons added to the scene
|
|
673
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/bonesSkeletons
|
|
674
|
+
*/
|
|
675
|
+
this.skeletons = [];
|
|
676
|
+
/**
|
|
677
|
+
* All of the particle systems added to this scene
|
|
678
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/particles/particle_system/particle_system_intro
|
|
679
|
+
*/
|
|
680
|
+
this.particleSystems = [];
|
|
681
|
+
/**
|
|
682
|
+
* Gets a list of Animations associated with the scene
|
|
683
|
+
*/
|
|
684
|
+
this.animations = [];
|
|
685
|
+
/**
|
|
686
|
+
* All of the animation groups added to this scene
|
|
687
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/animation/groupAnimations
|
|
688
|
+
*/
|
|
689
|
+
this.animationGroups = [];
|
|
690
|
+
/**
|
|
691
|
+
* All of the multi-materials added to this scene
|
|
692
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/multiMaterials
|
|
693
|
+
*/
|
|
694
|
+
this.multiMaterials = [];
|
|
695
|
+
/**
|
|
696
|
+
* All of the materials added to this scene
|
|
697
|
+
* In the context of a Scene, it is not supposed to be modified manually.
|
|
698
|
+
* Any addition or removal should be done using the addMaterial and removeMaterial Scene methods.
|
|
699
|
+
* Note also that the order of the Material within the array is not significant and might change.
|
|
700
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
|
|
701
|
+
*/
|
|
702
|
+
this.materials = [];
|
|
703
|
+
/**
|
|
704
|
+
* The list of morph target managers added to the scene
|
|
705
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/dynamicMeshMorph
|
|
706
|
+
*/
|
|
707
|
+
this.morphTargetManagers = [];
|
|
708
|
+
/**
|
|
709
|
+
* The list of geometries used in the scene.
|
|
710
|
+
*/
|
|
711
|
+
this.geometries = [];
|
|
712
|
+
/**
|
|
713
|
+
* All of the transform nodes added to this scene
|
|
714
|
+
* In the context of a Scene, it is not supposed to be modified manually.
|
|
715
|
+
* Any addition or removal should be done using the addTransformNode and removeTransformNode Scene methods.
|
|
716
|
+
* Note also that the order of the TransformNode within the array is not significant and might change.
|
|
717
|
+
* @see https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms/parent_pivot/transform_node
|
|
718
|
+
*/
|
|
719
|
+
this.transformNodes = [];
|
|
720
|
+
/**
|
|
721
|
+
* ActionManagers available on the scene.
|
|
722
|
+
* @deprecated
|
|
723
|
+
*/
|
|
724
|
+
this.actionManagers = [];
|
|
725
|
+
/**
|
|
726
|
+
* Textures to keep.
|
|
727
|
+
*/
|
|
728
|
+
this.textures = [];
|
|
729
|
+
/** @internal */
|
|
730
|
+
this._environmentTexture = null;
|
|
731
|
+
/**
|
|
732
|
+
* The list of postprocesses added to the scene
|
|
733
|
+
*/
|
|
734
|
+
this.postProcesses = [];
|
|
644
735
|
/**
|
|
645
736
|
* Gets or sets a boolean indicating if animations are enabled
|
|
646
737
|
*/
|
|
@@ -3734,59 +3825,67 @@ export class Scene extends AbstractScene {
|
|
|
3734
3825
|
}
|
|
3735
3826
|
// Before render
|
|
3736
3827
|
this.onBeforeRenderObservable.notifyObservers(this);
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3828
|
+
// Custom render function?
|
|
3829
|
+
if (this.customRenderFunction) {
|
|
3830
|
+
this._renderId++;
|
|
3831
|
+
this._engine.currentRenderPassId = 0;
|
|
3832
|
+
this.customRenderFunction();
|
|
3833
|
+
}
|
|
3834
|
+
else {
|
|
3835
|
+
const engine = this.getEngine();
|
|
3836
|
+
// Customs render targets
|
|
3837
|
+
this.onBeforeRenderTargetsRenderObservable.notifyObservers(this);
|
|
3838
|
+
const currentActiveCamera = this.activeCameras?.length ? this.activeCameras[0] : this.activeCamera;
|
|
3839
|
+
if (this.renderTargetsEnabled) {
|
|
3840
|
+
Tools.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0);
|
|
3841
|
+
this._intermediateRendering = true;
|
|
3842
|
+
for (let customIndex = 0; customIndex < this.customRenderTargets.length; customIndex++) {
|
|
3843
|
+
const renderTarget = this.customRenderTargets[customIndex];
|
|
3844
|
+
if (renderTarget._shouldRender()) {
|
|
3845
|
+
this._renderId++;
|
|
3846
|
+
this.activeCamera = renderTarget.activeCamera || this.activeCamera;
|
|
3847
|
+
if (!this.activeCamera) {
|
|
3848
|
+
throw new Error("Active camera not set");
|
|
3849
|
+
}
|
|
3850
|
+
// Viewport
|
|
3851
|
+
engine.setViewport(this.activeCamera.viewport);
|
|
3852
|
+
// Camera
|
|
3853
|
+
this.updateTransformMatrix();
|
|
3854
|
+
renderTarget.render(currentActiveCamera !== this.activeCamera, this.dumpNextRenderTargets);
|
|
3751
3855
|
}
|
|
3752
|
-
// Viewport
|
|
3753
|
-
engine.setViewport(this.activeCamera.viewport);
|
|
3754
|
-
// Camera
|
|
3755
|
-
this.updateTransformMatrix();
|
|
3756
|
-
renderTarget.render(currentActiveCamera !== this.activeCamera, this.dumpNextRenderTargets);
|
|
3757
3856
|
}
|
|
3857
|
+
Tools.EndPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0);
|
|
3858
|
+
this._intermediateRendering = false;
|
|
3859
|
+
this._renderId++;
|
|
3758
3860
|
}
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
this.
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
// Restore back buffer
|
|
3765
|
-
this.activeCamera = currentActiveCamera;
|
|
3766
|
-
if (this._activeCamera && this._activeCamera.cameraRigMode !== 22 && !this.prePass) {
|
|
3767
|
-
this._bindFrameBuffer(this._activeCamera, false);
|
|
3768
|
-
}
|
|
3769
|
-
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
3770
|
-
for (const step of this._beforeClearStage) {
|
|
3771
|
-
step.action();
|
|
3772
|
-
}
|
|
3773
|
-
// Clear
|
|
3774
|
-
this._clearFrameBuffer(this.activeCamera);
|
|
3775
|
-
// Collects render targets from external components.
|
|
3776
|
-
for (const step of this._gatherRenderTargetsStage) {
|
|
3777
|
-
step.action(this._renderTargets);
|
|
3778
|
-
}
|
|
3779
|
-
// Multi-cameras?
|
|
3780
|
-
if (this.activeCameras && this.activeCameras.length > 0) {
|
|
3781
|
-
for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
|
|
3782
|
-
this._processSubCameras(this.activeCameras[cameraIndex], cameraIndex > 0);
|
|
3861
|
+
this._engine.currentRenderPassId = currentActiveCamera?.renderPassId ?? 0;
|
|
3862
|
+
// Restore back buffer
|
|
3863
|
+
this.activeCamera = currentActiveCamera;
|
|
3864
|
+
if (this._activeCamera && this._activeCamera.cameraRigMode !== 22 && !this.prePass) {
|
|
3865
|
+
this._bindFrameBuffer(this._activeCamera, false);
|
|
3783
3866
|
}
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3867
|
+
this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
|
|
3868
|
+
for (const step of this._beforeClearStage) {
|
|
3869
|
+
step.action();
|
|
3870
|
+
}
|
|
3871
|
+
// Clear
|
|
3872
|
+
this._clearFrameBuffer(this.activeCamera);
|
|
3873
|
+
// Collects render targets from external components.
|
|
3874
|
+
for (const step of this._gatherRenderTargetsStage) {
|
|
3875
|
+
step.action(this._renderTargets);
|
|
3876
|
+
}
|
|
3877
|
+
// Multi-cameras?
|
|
3878
|
+
if (this.activeCameras && this.activeCameras.length > 0) {
|
|
3879
|
+
for (let cameraIndex = 0; cameraIndex < this.activeCameras.length; cameraIndex++) {
|
|
3880
|
+
this._processSubCameras(this.activeCameras[cameraIndex], cameraIndex > 0);
|
|
3881
|
+
}
|
|
3882
|
+
}
|
|
3883
|
+
else {
|
|
3884
|
+
if (!this.activeCamera) {
|
|
3885
|
+
throw new Error("No camera defined");
|
|
3886
|
+
}
|
|
3887
|
+
this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);
|
|
3788
3888
|
}
|
|
3789
|
-
this._processSubCameras(this.activeCamera, !!this.activeCamera.outputRenderTarget);
|
|
3790
3889
|
}
|
|
3791
3890
|
// Intersection checks
|
|
3792
3891
|
this._checkIntersections();
|