@babylonjs-toolkit/next 9.22.2 → 9.28.0
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/lib/index.d.ts +35 -23
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +35 -23
- package/lib/ipostprocessparameter.d.ts +6 -0
- package/lib/ipostprocessparameter.d.ts.map +1 -0
- package/lib/particleconstantcurve.d.ts +3 -0
- package/lib/particleconstantcurve.d.ts.map +1 -0
- package/lib/particleconstantcurve.js +3 -0
- package/lib/particleconstantgradient.d.ts +3 -0
- package/lib/particleconstantgradient.d.ts.map +1 -0
- package/lib/particleconstantgradient.js +4 -0
- package/lib/particleemptytexture.d.ts +3 -0
- package/lib/particleemptytexture.d.ts.map +1 -0
- package/lib/particleemptytexture.js +1 -0
- package/lib/particlev2.d.ts +3 -0
- package/lib/particlev2.d.ts.map +1 -0
- package/lib/particlev2.js +1 -0
- package/lib/particlev3.d.ts +3 -0
- package/lib/particlev3.d.ts.map +1 -0
- package/lib/particlev3.js +1 -0
- package/lib/particlewhite.d.ts +3 -0
- package/lib/particlewhite.d.ts.map +1 -0
- package/lib/particlewhite.js +1 -0
- package/lib/project.d.ts +4 -117
- package/lib/project.d.ts.map +1 -1
- package/lib/project.js +65 -182
- package/lib/scenemanager.d.ts +7576 -860
- package/lib/scenemanager.d.ts.map +1 -1
- package/lib/scenemanager.js +58595 -20811
- package/lib/sgshadowdepth.d.ts +19 -0
- package/lib/sgshadowdepth.d.ts.map +1 -0
- package/lib/sgshadowdepth.js +214 -0
- package/lib/shadergraphfullscreen.d.ts +18 -0
- package/lib/shadergraphfullscreen.d.ts.map +1 -0
- package/lib/shadergraphfullscreen.js +22 -0
- package/lib/shadergraphlighttable.d.ts +7 -0
- package/lib/shadergraphlighttable.d.ts.map +1 -0
- package/lib/shadergraphlighttable.js +74 -0
- package/lib/unityscrollbar.d.ts.map +1 -1
- package/package.json +14 -14
- package/lib/channelmixerplugin.d.ts +0 -11
- package/lib/channelmixerplugin.d.ts.map +0 -1
- package/lib/channelmixerplugin.js +0 -34
- package/lib/iparticlesystemtransform.d.ts +0 -9
- package/lib/iparticlesystemtransform.d.ts.map +0 -1
- package/lib/lutblendplugin.d.ts +0 -13
- package/lib/lutblendplugin.d.ts.map +0 -1
- package/lib/lutblendplugin.js +0 -153
- package/lib/perlin2d.d.ts +0 -9
- package/lib/perlin2d.d.ts.map +0 -1
- package/lib/perlin2d.js +0 -45
- /package/lib/{iparticlesystemtransform.js → ipostprocessparameter.js} +0 -0
package/lib/project.js
CHANGED
|
@@ -5,7 +5,7 @@ const TOOLKIT = (typeof window !== "undefined" && window.TOOLKIT) || _ToolkitRef
|
|
|
5
5
|
if (typeof window !== "undefined" && !window.PROJECT)
|
|
6
6
|
window.PROJECT = {};
|
|
7
7
|
const PROJECT = (typeof window !== "undefined" && window.PROJECT) || {};
|
|
8
|
-
import { ScriptComponent, SceneManager, AudioSource, Utilities, RigidbodyPhysics, InputController, ShurikenParticles, SearchType, UserInterface, RaycastVehicle, System, PlayerNumber, UserInputKey, WindowManager, UserInputAxis, UserInputOptions, CustomShaderMaterial, CustomShaderMaterialPlugin
|
|
8
|
+
import { ScriptComponent, SceneManager, AudioSource, Utilities, RigidbodyPhysics, InputController, ShurikenParticles, SearchType, UserInterface, RaycastVehicle, System, PlayerNumber, UserInputKey, WindowManager, UserInputAxis, UserInputOptions, CustomShaderMaterial, CustomShaderMaterialPlugin } from './scenemanager';
|
|
9
9
|
import { LocalMessageBus } from './localmessagebus';
|
|
10
10
|
import { EntityController } from './entitycontroller';
|
|
11
11
|
import { LinesMeshRenderer } from './linesmeshrenderer';
|
|
@@ -4052,7 +4052,6 @@ export class StandardKartEffects extends ScriptComponent {
|
|
|
4052
4052
|
}
|
|
4053
4053
|
if (this.kart == null)
|
|
4054
4054
|
return;
|
|
4055
|
-
this.ensureSimulationSpace();
|
|
4056
4055
|
const dt = this.getDeltaTime();
|
|
4057
4056
|
this.tickDriftEffects();
|
|
4058
4057
|
this.tickBoostEffects();
|
|
@@ -4238,54 +4237,13 @@ export class StandardKartEffects extends ScriptComponent {
|
|
|
4238
4237
|
const model = this.findChildNode(this.modelNodeName);
|
|
4239
4238
|
return (model != null) ? model : this.transform;
|
|
4240
4239
|
}
|
|
4241
|
-
applySimulationSpace(group) {
|
|
4242
|
-
if (group.systems.length === 0)
|
|
4243
|
-
return true;
|
|
4244
|
-
const local = (group.simulationSpace === 0);
|
|
4245
|
-
let applied = 0;
|
|
4246
|
-
for (let i = 0; i < group.systems.length; i++) {
|
|
4247
|
-
const system = group.systems[i];
|
|
4248
|
-
if (system == null || typeof system.getParticleSystem !== "function")
|
|
4249
|
-
continue;
|
|
4250
|
-
const particles = system.getParticleSystem();
|
|
4251
|
-
if (particles == null || typeof particles.isLocal !== "boolean")
|
|
4252
|
-
continue;
|
|
4253
|
-
particles.isLocal = local;
|
|
4254
|
-
applied++;
|
|
4255
|
-
}
|
|
4256
|
-
return applied === group.systems.length;
|
|
4257
|
-
}
|
|
4258
|
-
ensureSimulationSpace() {
|
|
4259
|
-
this.groups.forEach((group) => {
|
|
4260
|
-
if (group.simulationSpaceApplied === true)
|
|
4261
|
-
return;
|
|
4262
|
-
if (this.applySimulationSpace(group) !== true)
|
|
4263
|
-
return;
|
|
4264
|
-
this.repairInvertedSizeRange(group);
|
|
4265
|
-
group.simulationSpaceApplied = true;
|
|
4266
|
-
});
|
|
4267
|
-
}
|
|
4268
|
-
repairInvertedSizeRange(group) {
|
|
4269
|
-
for (let i = 0; i < group.systems.length; i++) {
|
|
4270
|
-
const system = group.systems[i];
|
|
4271
|
-
if (system == null || typeof system.getParticleSystem !== "function")
|
|
4272
|
-
continue;
|
|
4273
|
-
const particles = system.getParticleSystem();
|
|
4274
|
-
if (particles == null)
|
|
4275
|
-
continue;
|
|
4276
|
-
if (typeof particles.minSize !== "number" || typeof particles.maxSize !== "number")
|
|
4277
|
-
continue;
|
|
4278
|
-
if (particles.minSize > particles.maxSize)
|
|
4279
|
-
particles.maxSize = particles.minSize;
|
|
4280
|
-
}
|
|
4281
|
-
}
|
|
4282
4240
|
resolveSimulationSpace(group, kind) {
|
|
4283
4241
|
if (group.placeholder === true) {
|
|
4284
4242
|
const properties = StandardKartEffects.PlaceholderProperties(kind, 0);
|
|
4285
4243
|
return properties?.main?.simulationSpace ?? 0;
|
|
4286
4244
|
}
|
|
4287
4245
|
for (let i = 0; i < group.systems.length; i++) {
|
|
4288
|
-
const authored = group.systems[i]?.
|
|
4246
|
+
const authored = group.systems[i]?.getProperties?.()?.main?.simulationSpace;
|
|
4289
4247
|
if (typeof authored === "number")
|
|
4290
4248
|
return authored;
|
|
4291
4249
|
}
|
|
@@ -4315,7 +4273,7 @@ export class StandardKartEffects extends ScriptComponent {
|
|
|
4315
4273
|
}
|
|
4316
4274
|
registerGroup(key, nodeName, parent, count, offset, kind) {
|
|
4317
4275
|
const found = (parent != null) ? this.findNamedChildOf(parent, nodeName) : this.findChildNode(nodeName);
|
|
4318
|
-
const group = { name: key, mount: found, systems: [], playing: false, placeholder: false, simulationSpace: 0
|
|
4276
|
+
const group = { name: key, mount: found, systems: [], playing: false, placeholder: false, simulationSpace: 0 };
|
|
4319
4277
|
if (found != null) {
|
|
4320
4278
|
group.systems = this.collectParticleComponents(found);
|
|
4321
4279
|
}
|
|
@@ -4675,6 +4633,7 @@ export class RaceTrackManager extends ScriptComponent {
|
|
|
4675
4633
|
this.p3n = 0;
|
|
4676
4634
|
this.i = 0;
|
|
4677
4635
|
this.drawDebugLines = false;
|
|
4636
|
+
RaceTrackManager.LiveManagers++;
|
|
4678
4637
|
}
|
|
4679
4638
|
awake() {
|
|
4680
4639
|
this.trackNodes = this.getProperty("TrackNodes", this.trackNodes);
|
|
@@ -4860,6 +4819,19 @@ export class RaceTrackManager extends ScriptComponent {
|
|
|
4860
4819
|
}
|
|
4861
4820
|
}
|
|
4862
4821
|
destroy() {
|
|
4822
|
+
const owner = this.scene;
|
|
4823
|
+
const owned = (node) => (node != null && node.getScene() === owner);
|
|
4824
|
+
if (owned(RaceTrackManager.WinnerTransform))
|
|
4825
|
+
RaceTrackManager.WinnerTransform = null;
|
|
4826
|
+
if (RaceTrackManager.CheckPointList != null && RaceTrackManager.CheckPointList.some(owned))
|
|
4827
|
+
RaceTrackManager.CheckPointList = null;
|
|
4828
|
+
if (RaceTrackManager.PlayerVehicleList != null) {
|
|
4829
|
+
const vehicles = RaceTrackManager.PlayerVehicleList.filter((node) => !owned(node));
|
|
4830
|
+
RaceTrackManager.PlayerVehicleList = (vehicles.length > 0) ? vehicles : null;
|
|
4831
|
+
}
|
|
4832
|
+
RaceTrackManager.LiveManagers = Math.max(0, RaceTrackManager.LiveManagers - 1);
|
|
4833
|
+
if (RaceTrackManager.LiveManagers === 0)
|
|
4834
|
+
RaceTrackManager._EventBus = null;
|
|
4863
4835
|
}
|
|
4864
4836
|
getRoutePoint(distance) {
|
|
4865
4837
|
const result = new RoutePoint();
|
|
@@ -4981,6 +4953,7 @@ RaceTrackManager.CheckPointList = null;
|
|
|
4981
4953
|
RaceTrackManager.LeaderBoardList = null;
|
|
4982
4954
|
RaceTrackManager.PlayerVehicleList = null;
|
|
4983
4955
|
RaceTrackManager._EventBus = null;
|
|
4956
|
+
RaceTrackManager.LiveManagers = 0;
|
|
4984
4957
|
export class RemoteCarController extends ScriptComponent {
|
|
4985
4958
|
constructor() {
|
|
4986
4959
|
super(...arguments);
|
|
@@ -5497,6 +5470,20 @@ export class SkidMarkManager extends ScriptComponent {
|
|
|
5497
5470
|
}
|
|
5498
5471
|
start() { SkidMarkManager.CreateSkidMarkManager(this.scene); }
|
|
5499
5472
|
update() { SkidMarkManager.UpdateSkidMarkManager(); }
|
|
5473
|
+
destroy() {
|
|
5474
|
+
if (SkidMarkManager.SkidMarkMesh == null || SkidMarkManager.SkidMarkMesh.getScene() !== this.scene)
|
|
5475
|
+
return;
|
|
5476
|
+
SkidMarkManager.SkidMarkMesh = null;
|
|
5477
|
+
SkidMarkManager.SkidMarkSections = null;
|
|
5478
|
+
SkidMarkManager.SkidBufferPositions = null;
|
|
5479
|
+
SkidMarkManager.SkidBufferNormals = null;
|
|
5480
|
+
SkidMarkManager.SkidBufferTangents = null;
|
|
5481
|
+
SkidMarkManager.SkidBufferColors = null;
|
|
5482
|
+
SkidMarkManager.SkidBufferUvs = null;
|
|
5483
|
+
SkidMarkManager.SkidBufferIndices = null;
|
|
5484
|
+
SkidMarkManager.SkidMarkIndex = 0;
|
|
5485
|
+
SkidMarkManager.SkidMarkUpdated = false;
|
|
5486
|
+
}
|
|
5500
5487
|
static AddSkidMarkSegment(pos, normal, intensity, lastIndex) {
|
|
5501
5488
|
if (SkidMarkManager.SkidMarkMesh == null)
|
|
5502
5489
|
return null;
|
|
@@ -9981,7 +9968,11 @@ export class VehicleNetworkLabel extends ScriptComponent {
|
|
|
9981
9968
|
}
|
|
9982
9969
|
static GetFullscreenUI(scene, sampling = BABYLON.Texture.BILINEAR_SAMPLINGMODE) {
|
|
9983
9970
|
if (VehicleNetworkLabel.AdvDynamicTexture == null) {
|
|
9984
|
-
|
|
9971
|
+
const ui = BABYLON.GUI.AdvancedDynamicTexture.CreateFullscreenUI("Default-Screen-UI", true, scene, sampling);
|
|
9972
|
+
VehicleNetworkLabel.AdvDynamicTexture = ui;
|
|
9973
|
+
if (scene != null)
|
|
9974
|
+
scene.onDisposeObservable.addOnce(() => { if (VehicleNetworkLabel.AdvDynamicTexture === ui)
|
|
9975
|
+
VehicleNetworkLabel.AdvDynamicTexture = null; });
|
|
9985
9976
|
}
|
|
9986
9977
|
return VehicleNetworkLabel.AdvDynamicTexture;
|
|
9987
9978
|
}
|
|
@@ -10147,10 +10138,6 @@ export class VertexSplatPlugin extends CustomShaderMaterialPlugin {
|
|
|
10147
10138
|
}
|
|
10148
10139
|
}
|
|
10149
10140
|
export class DefaultCameraSystem extends ScriptComponent {
|
|
10150
|
-
static GetRenderingPipeline() { return DefaultCameraSystem.renderingPipeline; }
|
|
10151
|
-
;
|
|
10152
|
-
static GetScreenSpacePipeline() { return DefaultCameraSystem.screenSpacePipeline; }
|
|
10153
|
-
;
|
|
10154
10141
|
static IsCameraSystemReady() { return DefaultCameraSystem.cameraReady; }
|
|
10155
10142
|
isMainCamera() { return this.mainCamera; }
|
|
10156
10143
|
getCameraType() { return this.cameraType; }
|
|
@@ -10170,7 +10157,6 @@ export class DefaultCameraSystem extends ScriptComponent {
|
|
|
10170
10157
|
this.setPointerLock = false;
|
|
10171
10158
|
this.setCameraTarget = null;
|
|
10172
10159
|
this.setSpatialAudio = true;
|
|
10173
|
-
this.editorPostProcessing = null;
|
|
10174
10160
|
this.m_cameraRig = null;
|
|
10175
10161
|
this.targetCameraOffset = new BABYLON.Vector3(0, 0, 0);
|
|
10176
10162
|
this.cameraNode = null;
|
|
@@ -10205,7 +10191,6 @@ export class DefaultCameraSystem extends ScriptComponent {
|
|
|
10205
10191
|
this.arcRotateConfig = this.getProperty("arcRotateConfig", this.arcRotateConfig);
|
|
10206
10192
|
this.multiPlayerSetup = this.getProperty("multiPlayerSetup", this.multiPlayerSetup);
|
|
10207
10193
|
this.cameraController = this.getProperty("cameraController", this.cameraController);
|
|
10208
|
-
this.editorPostProcessing = this.getProperty("renderingPipeline", this.editorPostProcessing);
|
|
10209
10194
|
this.cleanCameraSystemState();
|
|
10210
10195
|
if (this.fullScreenToggle === 0) {
|
|
10211
10196
|
InputController.OnKeyboardPress(UserInputKey.F, () => {
|
|
@@ -10473,134 +10458,6 @@ export class DefaultCameraSystem extends ScriptComponent {
|
|
|
10473
10458
|
}
|
|
10474
10459
|
}
|
|
10475
10460
|
}
|
|
10476
|
-
const quality = RenderQuality.High;
|
|
10477
|
-
const allowProcessing = (quality === RenderQuality.High);
|
|
10478
|
-
if (allowProcessing === true && this.editorPostProcessing != null && this.editorPostProcessing.usePostProcessing === true) {
|
|
10479
|
-
DefaultCameraSystem.renderingPipeline = new BABYLON.DefaultRenderingPipeline("DefaultCameraSystem", this.editorPostProcessing.highDynamicRange, this.scene, this.scene.cameras, true);
|
|
10480
|
-
if (DefaultCameraSystem.renderingPipeline.isSupported === true) {
|
|
10481
|
-
const defaultPipeline = DefaultCameraSystem.renderingPipeline;
|
|
10482
|
-
defaultPipeline.samples = this.editorPostProcessing.screenAntiAliasing.msaaSamples;
|
|
10483
|
-
defaultPipeline.imageProcessingEnabled = this.editorPostProcessing.imageProcessingConfig.imageProcessing;
|
|
10484
|
-
if (defaultPipeline.imageProcessingEnabled) {
|
|
10485
|
-
defaultPipeline.imageProcessing.contrast = this.editorPostProcessing.imageProcessingConfig.imageContrast;
|
|
10486
|
-
defaultPipeline.imageProcessing.exposure = this.editorPostProcessing.imageProcessingConfig.imageExposure;
|
|
10487
|
-
defaultPipeline.imageProcessing.toneMappingEnabled = this.editorPostProcessing.imageProcessingConfig.toneMapping;
|
|
10488
|
-
defaultPipeline.imageProcessing.toneMappingType = this.editorPostProcessing.imageProcessingConfig.toneMapType;
|
|
10489
|
-
defaultPipeline.imageProcessing.vignetteEnabled = this.editorPostProcessing.imageProcessingConfig.vignetteEnabled;
|
|
10490
|
-
if (defaultPipeline.imageProcessing.vignetteEnabled) {
|
|
10491
|
-
defaultPipeline.imageProcessing.vignetteBlendMode = this.editorPostProcessing.imageProcessingConfig.vignetteBlendMode;
|
|
10492
|
-
defaultPipeline.imageProcessing.vignetteCameraFov = this.editorPostProcessing.imageProcessingConfig.vignetteCameraFov;
|
|
10493
|
-
defaultPipeline.imageProcessing.vignetteCentreX = this.editorPostProcessing.imageProcessingConfig.vignetteCentreX;
|
|
10494
|
-
defaultPipeline.imageProcessing.vignetteCentreY = this.editorPostProcessing.imageProcessingConfig.vignetteCentreY;
|
|
10495
|
-
defaultPipeline.imageProcessing.vignetteStretch = this.editorPostProcessing.imageProcessingConfig.vignetteStretch;
|
|
10496
|
-
defaultPipeline.imageProcessing.vignetteWeight = this.editorPostProcessing.imageProcessingConfig.vignetteWeight;
|
|
10497
|
-
if (this.editorPostProcessing.imageProcessingConfig.vignetteColor != null) {
|
|
10498
|
-
const vcolor = Utilities.ParseColor4(this.editorPostProcessing.imageProcessingConfig.vignetteColor);
|
|
10499
|
-
if (vcolor != null)
|
|
10500
|
-
defaultPipeline.imageProcessing.vignetteColor = vcolor;
|
|
10501
|
-
}
|
|
10502
|
-
}
|
|
10503
|
-
defaultPipeline.imageProcessing.colorGradingEnabled = this.editorPostProcessing.imageProcessingConfig.useColorGrading;
|
|
10504
|
-
if (defaultPipeline.imageProcessing.colorGradingEnabled) {
|
|
10505
|
-
if (this.editorPostProcessing.imageProcessingConfig.setGradingTexture != null) {
|
|
10506
|
-
const colorGradingTexture = Utilities.ParseTexture(this.editorPostProcessing.imageProcessingConfig.setGradingTexture, this.scene, true, false);
|
|
10507
|
-
colorGradingTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
|
|
10508
|
-
colorGradingTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
|
|
10509
|
-
defaultPipeline.imageProcessing.colorGradingTexture = colorGradingTexture;
|
|
10510
|
-
defaultPipeline.imageProcessing.colorGradingWithGreenDepth = false;
|
|
10511
|
-
}
|
|
10512
|
-
}
|
|
10513
|
-
defaultPipeline.imageProcessing.colorCurvesEnabled = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.curvesEnabled;
|
|
10514
|
-
if (defaultPipeline.imageProcessing.colorCurvesEnabled) {
|
|
10515
|
-
var curve = new BABYLON.ColorCurves();
|
|
10516
|
-
curve.globalDensity = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.globalDen;
|
|
10517
|
-
curve.globalExposure = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.globalExp;
|
|
10518
|
-
curve.globalHue = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.globalHue;
|
|
10519
|
-
curve.globalSaturation = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.globalSat;
|
|
10520
|
-
curve.highlightsDensity = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.highlightsDen;
|
|
10521
|
-
curve.highlightsExposure = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.highlightsExp;
|
|
10522
|
-
curve.highlightsHue = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.highlightsHue;
|
|
10523
|
-
curve.highlightsSaturation = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.highlightsSat;
|
|
10524
|
-
curve.midtonesDensity = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.midtonesDen;
|
|
10525
|
-
curve.midtonesExposure = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.midtonesExp;
|
|
10526
|
-
curve.midtonesHue = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.midtonesHue;
|
|
10527
|
-
curve.midtonesSaturation = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.midtonesSat;
|
|
10528
|
-
curve.shadowsDensity = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.shadowsDen;
|
|
10529
|
-
curve.shadowsExposure = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.shadowsExp;
|
|
10530
|
-
curve.shadowsHue = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.shadowsHue;
|
|
10531
|
-
curve.shadowsSaturation = this.editorPostProcessing.imageProcessingConfig.imagingColorCurves.shadowsSat;
|
|
10532
|
-
defaultPipeline.imageProcessing.colorCurves = curve;
|
|
10533
|
-
}
|
|
10534
|
-
}
|
|
10535
|
-
defaultPipeline.bloomEnabled = this.editorPostProcessing.bloomEffectProperties.bloomEnabled;
|
|
10536
|
-
if (defaultPipeline.bloomEnabled) {
|
|
10537
|
-
defaultPipeline.bloomKernel = this.editorPostProcessing.bloomEffectProperties.bloomKernel;
|
|
10538
|
-
defaultPipeline.bloomScale = this.editorPostProcessing.bloomEffectProperties.bloomScale;
|
|
10539
|
-
defaultPipeline.bloomWeight = this.editorPostProcessing.bloomEffectProperties.bloomWeight;
|
|
10540
|
-
defaultPipeline.bloomThreshold = this.editorPostProcessing.bloomEffectProperties.bloomThreshold;
|
|
10541
|
-
}
|
|
10542
|
-
defaultPipeline.chromaticAberrationEnabled = this.editorPostProcessing.chromaticAberration.aberrationEnabled;
|
|
10543
|
-
if (defaultPipeline.chromaticAberrationEnabled) {
|
|
10544
|
-
defaultPipeline.chromaticAberration.aberrationAmount = this.editorPostProcessing.chromaticAberration.aberrationAmount;
|
|
10545
|
-
defaultPipeline.chromaticAberration.adaptScaleToCurrentViewport = this.editorPostProcessing.chromaticAberration.adaptScaleViewport;
|
|
10546
|
-
defaultPipeline.chromaticAberration.alphaMode = this.editorPostProcessing.chromaticAberration.alphaMode;
|
|
10547
|
-
defaultPipeline.chromaticAberration.alwaysForcePOT = this.editorPostProcessing.chromaticAberration.alwaysForcePOT;
|
|
10548
|
-
defaultPipeline.chromaticAberration.enablePixelPerfectMode = this.editorPostProcessing.chromaticAberration.pixelPerfectMode;
|
|
10549
|
-
defaultPipeline.chromaticAberration.forceFullscreenViewport = this.editorPostProcessing.chromaticAberration.fullscreenViewport;
|
|
10550
|
-
}
|
|
10551
|
-
defaultPipeline.depthOfFieldEnabled = this.editorPostProcessing.focalDepthOfField.depthOfField;
|
|
10552
|
-
if (defaultPipeline.depthOfFieldEnabled && defaultPipeline.depthOfField.isSupported) {
|
|
10553
|
-
defaultPipeline.depthOfFieldBlurLevel = this.editorPostProcessing.focalDepthOfField.blurLevel;
|
|
10554
|
-
defaultPipeline.depthOfField.fStop = this.editorPostProcessing.focalDepthOfField.focalStop;
|
|
10555
|
-
defaultPipeline.depthOfField.focalLength = this.editorPostProcessing.focalDepthOfField.focalLength;
|
|
10556
|
-
defaultPipeline.depthOfField.focusDistance = this.editorPostProcessing.focalDepthOfField.focusDistance;
|
|
10557
|
-
defaultPipeline.depthOfField.lensSize = this.editorPostProcessing.focalDepthOfField.maxLensSize;
|
|
10558
|
-
}
|
|
10559
|
-
defaultPipeline.fxaaEnabled = this.editorPostProcessing.screenAntiAliasing.fxaaEnabled;
|
|
10560
|
-
if (defaultPipeline.fxaaEnabled) {
|
|
10561
|
-
defaultPipeline.fxaa.samples = this.editorPostProcessing.screenAntiAliasing.fxaaSamples;
|
|
10562
|
-
defaultPipeline.fxaa.adaptScaleToCurrentViewport = this.editorPostProcessing.screenAntiAliasing.fxaaScaling;
|
|
10563
|
-
}
|
|
10564
|
-
defaultPipeline.glowLayerEnabled = this.editorPostProcessing.glowLayerProperties.glowEnabled;
|
|
10565
|
-
if (defaultPipeline.glowLayerEnabled) {
|
|
10566
|
-
defaultPipeline.glowLayer.intensity = this.editorPostProcessing.glowLayerProperties.glowIntensity;
|
|
10567
|
-
defaultPipeline.glowLayer.blurKernelSize = this.editorPostProcessing.glowLayerProperties.blurKernelSize;
|
|
10568
|
-
}
|
|
10569
|
-
defaultPipeline.grainEnabled = this.editorPostProcessing.grainEffectProperties.grainEnabled;
|
|
10570
|
-
if (defaultPipeline.grainEnabled) {
|
|
10571
|
-
defaultPipeline.grain.animated = this.editorPostProcessing.grainEffectProperties.grainAnimated;
|
|
10572
|
-
defaultPipeline.grain.intensity = this.editorPostProcessing.grainEffectProperties.grainIntensity;
|
|
10573
|
-
defaultPipeline.grain.adaptScaleToCurrentViewport = this.editorPostProcessing.grainEffectProperties.adaptScaleViewport;
|
|
10574
|
-
}
|
|
10575
|
-
defaultPipeline.sharpenEnabled = this.editorPostProcessing.sharpEffectProperties.sharpenEnabled;
|
|
10576
|
-
if (defaultPipeline.sharpenEnabled) {
|
|
10577
|
-
defaultPipeline.sharpen.edgeAmount = this.editorPostProcessing.sharpEffectProperties.sharpEdgeAmount;
|
|
10578
|
-
defaultPipeline.sharpen.colorAmount = this.editorPostProcessing.sharpEffectProperties.sharpColorAmount;
|
|
10579
|
-
defaultPipeline.sharpen.adaptScaleToCurrentViewport = this.editorPostProcessing.sharpEffectProperties.adaptScaleViewport;
|
|
10580
|
-
}
|
|
10581
|
-
}
|
|
10582
|
-
else {
|
|
10583
|
-
SceneManager.LogWarning("Babylon.js default rendering pipeline not supported");
|
|
10584
|
-
}
|
|
10585
|
-
if (this.editorPostProcessing.screenSpaceRendering != null && this.editorPostProcessing.screenSpaceRendering.SSAO === true) {
|
|
10586
|
-
const ssaoRatio = {
|
|
10587
|
-
ssaoRatio: this.editorPostProcessing.screenSpaceRendering.SSAORatio,
|
|
10588
|
-
combineRatio: this.editorPostProcessing.screenSpaceRendering.combineRatio
|
|
10589
|
-
};
|
|
10590
|
-
DefaultCameraSystem.screenSpacePipeline = new BABYLON.SSAORenderingPipeline("DefaultCameraSystem-SSAO", this.scene, ssaoRatio, this.scene.cameras);
|
|
10591
|
-
if (DefaultCameraSystem.screenSpacePipeline.isSupported === true) {
|
|
10592
|
-
const ssaoPipeline = DefaultCameraSystem.screenSpacePipeline;
|
|
10593
|
-
ssaoPipeline.fallOff = this.editorPostProcessing.screenSpaceRendering.fallOff;
|
|
10594
|
-
ssaoPipeline.area = this.editorPostProcessing.screenSpaceRendering.area;
|
|
10595
|
-
ssaoPipeline.radius = this.editorPostProcessing.screenSpaceRendering.radius;
|
|
10596
|
-
ssaoPipeline.totalStrength = this.editorPostProcessing.screenSpaceRendering.totalStrength;
|
|
10597
|
-
ssaoPipeline.base = this.editorPostProcessing.screenSpaceRendering.baseValue;
|
|
10598
|
-
}
|
|
10599
|
-
else {
|
|
10600
|
-
SceneManager.LogWarning("Babylon.js SSAO rendering pipeline not supported");
|
|
10601
|
-
}
|
|
10602
|
-
}
|
|
10603
|
-
}
|
|
10604
10461
|
DefaultCameraSystem.cameraReady = true;
|
|
10605
10462
|
}
|
|
10606
10463
|
updateCameraSystemState() {
|
|
@@ -10644,6 +10501,23 @@ export class DefaultCameraSystem extends ScriptComponent {
|
|
|
10644
10501
|
this.immersiveOptions = null;
|
|
10645
10502
|
this.cameraPivot = null;
|
|
10646
10503
|
this.cameraNode = null;
|
|
10504
|
+
const owner = this.scene;
|
|
10505
|
+
const owned = (camera) => (camera != null && owner != null && camera.getScene() === owner);
|
|
10506
|
+
if (owned(DefaultCameraSystem.PlayerOneCamera))
|
|
10507
|
+
DefaultCameraSystem.PlayerOneCamera = null;
|
|
10508
|
+
if (owned(DefaultCameraSystem.PlayerTwoCamera))
|
|
10509
|
+
DefaultCameraSystem.PlayerTwoCamera = null;
|
|
10510
|
+
if (owned(DefaultCameraSystem.PlayerThreeCamera))
|
|
10511
|
+
DefaultCameraSystem.PlayerThreeCamera = null;
|
|
10512
|
+
if (owned(DefaultCameraSystem.PlayerFourCamera))
|
|
10513
|
+
DefaultCameraSystem.PlayerFourCamera = null;
|
|
10514
|
+
if (DefaultCameraSystem.multiPlayerCameras != null && DefaultCameraSystem.multiPlayerCameras.some(owned))
|
|
10515
|
+
DefaultCameraSystem.multiPlayerCameras = null;
|
|
10516
|
+
const xr = DefaultCameraSystem.XRExperienceHelper;
|
|
10517
|
+
if (xr != null && xr.baseExperience != null && xr.baseExperience.sessionManager != null && xr.baseExperience.sessionManager.scene === owner)
|
|
10518
|
+
DefaultCameraSystem.XRExperienceHelper = null;
|
|
10519
|
+
if (DefaultCameraSystem.cameraInstance === this)
|
|
10520
|
+
DefaultCameraSystem.cameraInstance = null;
|
|
10647
10521
|
}
|
|
10648
10522
|
getCameraPivotPosition() { return (this.cameraPivot != null) ? this.cameraPivot.position : null; }
|
|
10649
10523
|
getCameraPivotRotation() { return (this.cameraPivot != null) ? this.cameraPivot.rotationQuaternion : null; }
|
|
@@ -11034,8 +10908,6 @@ DefaultCameraSystem.stereoCameras = true;
|
|
|
11034
10908
|
DefaultCameraSystem.startupMode = 1;
|
|
11035
10909
|
DefaultCameraSystem.cameraReady = false;
|
|
11036
10910
|
DefaultCameraSystem.cameraInstance = null;
|
|
11037
|
-
DefaultCameraSystem.renderingPipeline = null;
|
|
11038
|
-
DefaultCameraSystem.screenSpacePipeline = null;
|
|
11039
10911
|
DefaultCameraSystem.OnXRExperienceHelperObservable = new BABYLON.Observable();
|
|
11040
10912
|
DefaultCameraSystem.FOLLOW_SPEED = 1.0;
|
|
11041
10913
|
export class DebugInformation extends ScriptComponent {
|
|
@@ -11453,6 +11325,8 @@ export class MobileInputController extends ScriptComponent {
|
|
|
11453
11325
|
}
|
|
11454
11326
|
}
|
|
11455
11327
|
destroy() {
|
|
11328
|
+
if (MobileInputController.StaticInstance === this)
|
|
11329
|
+
MobileInputController.StaticInstance = null;
|
|
11456
11330
|
if (this.m_leftStick != null) {
|
|
11457
11331
|
this.m_leftStick.dispose();
|
|
11458
11332
|
this.m_leftStick = null;
|
|
@@ -14839,6 +14713,15 @@ export class SceneSoundSystem extends ScriptComponent {
|
|
|
14839
14713
|
if (soundNode != null)
|
|
14840
14714
|
SceneSoundSystem._SFX = SceneManager.FindScriptComponent(soundNode, "PROJECT.SoundManager");
|
|
14841
14715
|
}
|
|
14716
|
+
destroy() {
|
|
14717
|
+
const owner = this.scene;
|
|
14718
|
+
const music = SceneSoundSystem._MUSIC;
|
|
14719
|
+
if (music != null && (music.scene == null || music.scene === owner))
|
|
14720
|
+
SceneSoundSystem._MUSIC = null;
|
|
14721
|
+
const sfx = SceneSoundSystem._SFX;
|
|
14722
|
+
if (sfx != null && (sfx.scene == null || sfx.scene === owner))
|
|
14723
|
+
SceneSoundSystem._SFX = null;
|
|
14724
|
+
}
|
|
14842
14725
|
}
|
|
14843
14726
|
SceneSoundSystem._MUSIC = null;
|
|
14844
14727
|
SceneSoundSystem._SFX = null;
|