@galacean/engine-physics-physx 1.0.0-beta.10 → 1.0.0-beta.12

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.
@@ -835,6 +835,13 @@ __decorate$1([
835
835
  TextureFormat[TextureFormat[/** 16-bit depth + 8-bit stencil format. */ "Depth24Stencil8"] = 30] = "Depth24Stencil8";
836
836
  TextureFormat[TextureFormat[/** 32-bit depth + 8-bit stencil format. */ "Depth32Stencil8"] = 31] = "Depth32Stencil8";
837
837
  })(exports.TextureFormat || (exports.TextureFormat = {}));
838
+ /**
839
+ * Texture usage.
840
+ */ exports.TextureUsage = void 0;
841
+ (function(TextureUsage) {
842
+ TextureUsage[TextureUsage[/** The content of the texture is intended to be specified once. */ "Static"] = 0] = "Static";
843
+ TextureUsage[TextureUsage[/** The content of the texture is intended to be updated frequently, with better performance. */ "Dynamic"] = 1] = "Dynamic";
844
+ })(exports.TextureUsage || (exports.TextureUsage = {}));
838
845
  /**
839
846
  * Wrapping mode of the texture.
840
847
  */ exports.TextureWrapMode = void 0;
@@ -972,6 +979,14 @@ var Logger = {
972
979
  return this._height;
973
980
  }
974
981
  },
982
+ {
983
+ key: "usage",
984
+ get: /**
985
+ * The usage of the texture.
986
+ */ function get() {
987
+ return this._usage;
988
+ }
989
+ },
975
990
  {
976
991
  key: "wrapModeU",
977
992
  get: /**
@@ -1212,14 +1227,16 @@ var Logger = {
1212
1227
  /**
1213
1228
  * Two-dimensional texture.
1214
1229
  */ var Texture2D = /*#__PURE__*/ function(Texture) {
1215
- var Texture2D = function Texture2D(engine, width, height, format, mipmap) {
1230
+ var Texture2D = function Texture2D(engine, width, height, format, mipmap, usage) {
1216
1231
  if (format === void 0) format = exports.TextureFormat.R8G8B8A8;
1217
1232
  if (mipmap === void 0) mipmap = true;
1233
+ if (usage === void 0) usage = exports.TextureUsage.Static;
1218
1234
  var _this;
1219
1235
  _this = Texture.call(this, engine) || this;
1220
1236
  _this._mipmap = mipmap;
1221
1237
  _this._width = width;
1222
1238
  _this._height = height;
1239
+ _this._usage = usage;
1223
1240
  _this._format = format;
1224
1241
  _this._mipmapCount = _this._getMipmapCount();
1225
1242
  _this._isDepthTexture = format == exports.TextureFormat.Depth || format == exports.TextureFormat.DepthStencil || format == exports.TextureFormat.Depth16 || format == exports.TextureFormat.Depth24 || format == exports.TextureFormat.Depth32 || format == exports.TextureFormat.Depth24Stencil8 || format == exports.TextureFormat.Depth32Stencil8;
@@ -2309,6 +2326,29 @@ var /** @internal */ PromiseState;
2309
2326
  * @remarks The release principle is that it is not referenced by the components, including direct and indirect reference.
2310
2327
  */ _proto.gc = function gc() {
2311
2328
  this._gc(false);
2329
+ var engine = this.engine;
2330
+ engine._renderElementPool.garbageCollection();
2331
+ engine._meshRenderDataPool.garbageCollection();
2332
+ engine._spriteRenderDataPool.garbageCollection();
2333
+ engine._spriteMaskRenderDataPool.garbageCollection();
2334
+ engine._textRenderDataPool.garbageCollection();
2335
+ var _componentsManager = engine._componentsManager, _lightManager = engine._lightManager;
2336
+ _componentsManager._renderers.garbageCollection();
2337
+ // @ts-ignore
2338
+ _componentsManager._onStartScripts.garbageCollection();
2339
+ // @ts-ignore
2340
+ _componentsManager._onUpdateScripts.garbageCollection();
2341
+ // @ts-ignore
2342
+ _componentsManager._onLateUpdateScripts.garbageCollection();
2343
+ // @ts-ignore
2344
+ _componentsManager._onPhysicsUpdateScripts.garbageCollection();
2345
+ // @ts-ignore
2346
+ _componentsManager._onUpdateAnimations.garbageCollection();
2347
+ // @ts-ignore
2348
+ _componentsManager._onUpdateRenderers.garbageCollection();
2349
+ _lightManager._spotLights.garbageCollection();
2350
+ _lightManager._pointLights.garbageCollection();
2351
+ _lightManager._directLights.garbageCollection();
2312
2352
  };
2313
2353
  /**
2314
2354
  * Add content restorer.
@@ -4725,6 +4765,11 @@ var ComponentCloner = /*#__PURE__*/ function() {
4725
4765
  * @returns Cloned entity
4726
4766
  */ _proto.clone = function clone() {
4727
4767
  var cloneEntity = new Entity(this._engine, this.name);
4768
+ var _this = this, hookResource = _this._hookResource;
4769
+ if (hookResource) {
4770
+ cloneEntity._hookResource = hookResource;
4771
+ hookResource._addReferCount(1);
4772
+ }
4728
4773
  cloneEntity._isActive = this._isActive;
4729
4774
  cloneEntity.transform.localMatrix = this.transform.localMatrix;
4730
4775
  var children = this._children;
@@ -4749,6 +4794,10 @@ var ComponentCloner = /*#__PURE__*/ function() {
4749
4794
  return;
4750
4795
  }
4751
4796
  EngineObject.prototype.destroy.call(this);
4797
+ if (this._hookResource) {
4798
+ this._hookResource._addReferCount(-1);
4799
+ this._hookResource = null;
4800
+ }
4752
4801
  var components = this._components;
4753
4802
  for(var i = components.length - 1; i >= 0; i--){
4754
4803
  components[i].destroy();
@@ -9339,9 +9388,9 @@ __decorate$1([
9339
9388
  var Material = function Material(engine, shader) {
9340
9389
  var _this;
9341
9390
  _this = ReferResource.call(this, engine) || this;
9342
- /** Shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Material);
9343
9391
  /** @internal */ _this._renderStates = [] // todo: later will as a part of shaderData when shader effect frame is OK, that is more powerful and flexible.
9344
9392
  ;
9393
+ _this._shaderData = new ShaderData(ShaderDataGroup.Material);
9345
9394
  _this.shader = shader;
9346
9395
  return _this;
9347
9396
  };
@@ -9366,7 +9415,23 @@ __decorate$1([
9366
9415
  ReferResource.prototype._addReferCount.call(this, value);
9367
9416
  this.shaderData._addReferCount(value);
9368
9417
  };
9418
+ /**
9419
+ * @override
9420
+ */ _proto._onDestroy = function _onDestroy() {
9421
+ this._shader = null;
9422
+ this._shaderData = null;
9423
+ this._renderStates.length = 0;
9424
+ this._renderStates = null;
9425
+ };
9369
9426
  _create_class$2(Material, [
9427
+ {
9428
+ key: "shaderData",
9429
+ get: /**
9430
+ * Shader data.
9431
+ */ function get() {
9432
+ return this._shaderData;
9433
+ }
9434
+ },
9370
9435
  {
9371
9436
  key: "shader",
9372
9437
  get: /**
@@ -9438,6 +9503,12 @@ __decorate$1([
9438
9503
  */ _proto.resetPool = function resetPool() {
9439
9504
  this._elementPoolIndex = 0;
9440
9505
  };
9506
+ _proto.garbageCollection = function garbageCollection() {
9507
+ var _this = this, pool = _this._elementPool;
9508
+ for(var i = pool.length - 1; i >= 0; i--){
9509
+ pool[i].dispose && pool[i].dispose();
9510
+ }
9511
+ };
9441
9512
  return ClassPool;
9442
9513
  }();
9443
9514
  var RenderData = function RenderData() {};
@@ -9455,6 +9526,9 @@ var RenderData = function RenderData() {};
9455
9526
  this.mesh = mesh;
9456
9527
  this.subMesh = subMesh;
9457
9528
  };
9529
+ _proto.dispose = function dispose() {
9530
+ this.component = this.material = this.mesh = this.subMesh = null;
9531
+ };
9458
9532
  return MeshRenderData;
9459
9533
  }(RenderData);
9460
9534
  /**
@@ -10527,6 +10601,9 @@ var RenderElement = /*#__PURE__*/ function() {
10527
10601
  this.shaderPass = shaderPass;
10528
10602
  this.renderState = renderState;
10529
10603
  };
10604
+ _proto.dispose = function dispose() {
10605
+ this.data = this.shaderPass = this.renderState = null;
10606
+ };
10530
10607
  return RenderElement;
10531
10608
  }();
10532
10609
  /**
@@ -10543,7 +10620,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10543
10620
  var Renderer1 = function Renderer1(entity) {
10544
10621
  var _this;
10545
10622
  _this = Component.call(this, entity) || this;
10546
- /** ShaderData related to renderer. */ _this.shaderData = new ShaderData(ShaderDataGroup.Renderer);
10547
10623
  /** @internal */ _this._onUpdateIndex = -1;
10548
10624
  /** @internal */ _this._rendererIndex = -1;
10549
10625
  /** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
@@ -10551,6 +10627,7 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10551
10627
  _this._overrideUpdate = false;
10552
10628
  _this._materials = [];
10553
10629
  _this._dirtyUpdateFlag = 0;
10630
+ _this._shaderData = new ShaderData(ShaderDataGroup.Renderer);
10554
10631
  _this._mvMatrix = new miniprogram$7.Matrix();
10555
10632
  _this._mvpMatrix = new miniprogram$7.Matrix();
10556
10633
  _this._mvInvMatrix = new miniprogram$7.Matrix();
@@ -10697,6 +10774,17 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10697
10774
  var _materials_i;
10698
10775
  (_materials_i = materials[i]) == null ? void 0 : _materials_i._addReferCount(-1);
10699
10776
  }
10777
+ this._entity = null;
10778
+ this._globalShaderMacro = null;
10779
+ this._bounds = null;
10780
+ this._materials = null;
10781
+ this._shaderData = null;
10782
+ this._mvMatrix = null;
10783
+ this._mvpMatrix = null;
10784
+ this._mvInvMatrix = null;
10785
+ this._normalMatrix = null;
10786
+ this._materialsInstanced = null;
10787
+ this._rendererLayer = null;
10700
10788
  };
10701
10789
  /**
10702
10790
  * @internal
@@ -10772,6 +10860,14 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10772
10860
  this._dirtyUpdateFlag |= 0x1;
10773
10861
  };
10774
10862
  _create_class$2(Renderer1, [
10863
+ {
10864
+ key: "shaderData",
10865
+ get: /**
10866
+ * ShaderData related to renderer.
10867
+ */ function get() {
10868
+ return this._shaderData;
10869
+ }
10870
+ },
10775
10871
  {
10776
10872
  key: "isCulled",
10777
10873
  get: /**
@@ -10856,9 +10952,6 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component) {
10856
10952
  }(), function() {
10857
10953
  _Renderer._rendererLayerProperty = ShaderProperty.getByName("renderer_Layer");
10858
10954
  }(), _Renderer);
10859
- __decorate$1([
10860
- deepClone
10861
- ], exports.Renderer.prototype, "shaderData", void 0);
10862
10955
  __decorate$1([
10863
10956
  ignoreClone
10864
10957
  ], exports.Renderer.prototype, "_distanceForSort", void 0);
@@ -10886,6 +10979,9 @@ __decorate$1([
10886
10979
  __decorate$1([
10887
10980
  ignoreClone
10888
10981
  ], exports.Renderer.prototype, "_dirtyUpdateFlag", void 0);
10982
+ __decorate$1([
10983
+ deepClone
10984
+ ], exports.Renderer.prototype, "_shaderData", void 0);
10889
10985
  __decorate$1([
10890
10986
  ignoreClone
10891
10987
  ], exports.Renderer.prototype, "_mvMatrix", void 0);
@@ -11135,6 +11231,7 @@ SimpleSpriteAssembler = __decorate$1([
11135
11231
  sprite._addReferCount(-1);
11136
11232
  sprite._updateFlagManager.removeListener(this._onSpriteChange);
11137
11233
  }
11234
+ this._entity = null;
11138
11235
  this._sprite = null;
11139
11236
  this._verticesData = null;
11140
11237
  };
@@ -11678,14 +11775,19 @@ var BufferUtil = /*#__PURE__*/ function() {
11678
11775
  }();
11679
11776
  /**
11680
11777
  * Sub-mesh, mainly contains drawing information.
11681
- */ var SubMesh = function SubMesh(start, count, topology) {
11682
- if (start === void 0) start = 0;
11683
- if (count === void 0) count = 0;
11684
- if (topology === void 0) topology = exports.MeshTopology.Triangles;
11685
- this.start = start;
11686
- this.count = count;
11687
- this.topology = topology;
11688
- };
11778
+ */ var SubMesh = /*#__PURE__*/ function() {
11779
+ var SubMesh = function SubMesh(start, count, topology) {
11780
+ if (start === void 0) start = 0;
11781
+ if (count === void 0) count = 0;
11782
+ if (topology === void 0) topology = exports.MeshTopology.Triangles;
11783
+ this.start = start;
11784
+ this.count = count;
11785
+ this.topology = topology;
11786
+ };
11787
+ var _proto = SubMesh.prototype;
11788
+ _proto.dispose = function dispose() {};
11789
+ return SubMesh;
11790
+ }();
11689
11791
  /**
11690
11792
  * Mesh.
11691
11793
  */ var Mesh = /*#__PURE__*/ function(GraphicsResource) {
@@ -13434,8 +13536,8 @@ var VertexChangedFlags;
13434
13536
  */ _proto._onDestroy = function _onDestroy() {
13435
13537
  Renderer.prototype._onDestroy.call(this);
13436
13538
  var mesh = this._mesh;
13437
- if (mesh && !mesh.destroyed) {
13438
- mesh._addReferCount(-1);
13539
+ if (mesh) {
13540
+ mesh.destroyed || mesh._addReferCount(-1);
13439
13541
  mesh._updateFlagManager.removeListener(this._onMeshChanged);
13440
13542
  this._mesh = null;
13441
13543
  }
@@ -13690,10 +13792,21 @@ var /**
13690
13792
  /**
13691
13793
  * @internal
13692
13794
  */ _proto._onDestroy = function _onDestroy() {
13693
- var _this_rootBone, _this__jointTexture;
13795
+ var _this__rootBone, _this__jointTexture;
13694
13796
  MeshRenderer.prototype._onDestroy.call(this);
13695
- (_this_rootBone = this.rootBone) == null ? void 0 : _this_rootBone.transform._updateFlagManager.removeListener(this._onTransformChanged);
13797
+ (_this__rootBone = this._rootBone) == null ? void 0 : _this__rootBone.transform._updateFlagManager.removeListener(this._onTransformChanged);
13798
+ this._rootBone = null;
13799
+ this._jointDataCreateCache = null;
13800
+ this._skin = null;
13801
+ this._blendShapeWeights = null;
13802
+ this._localBounds = null;
13803
+ this._jointMatrices = null;
13696
13804
  (_this__jointTexture = this._jointTexture) == null ? void 0 : _this__jointTexture.destroy();
13805
+ this._jointTexture = null;
13806
+ if (this._jointEntities) {
13807
+ this._jointEntities.length = 0;
13808
+ this._jointEntities = null;
13809
+ }
13697
13810
  };
13698
13811
  /**
13699
13812
  * @internal
@@ -15381,6 +15494,9 @@ var SpriteMaskRenderData = /*#__PURE__*/ function(RenderData) {
15381
15494
  this.material = material;
15382
15495
  this.verticesData = verticesData;
15383
15496
  };
15497
+ _proto.dispose = function dispose() {
15498
+ this.component = this.material = this.verticesData = null;
15499
+ };
15384
15500
  return SpriteMaskRenderData;
15385
15501
  }(RenderData);
15386
15502
  var SpriteRenderData = /*#__PURE__*/ function(RenderData) {
@@ -15400,6 +15516,9 @@ var SpriteRenderData = /*#__PURE__*/ function(RenderData) {
15400
15516
  this.texture = texture;
15401
15517
  this.dataIndex = dataIndex;
15402
15518
  };
15519
+ _proto.dispose = function dispose() {
15520
+ this.component = this.material = this.verticesData = this.texture = null;
15521
+ };
15403
15522
  return SpriteRenderData;
15404
15523
  }(RenderData);
15405
15524
  var TextRenderData = /*#__PURE__*/ function(RenderData) {
@@ -15411,6 +15530,11 @@ var TextRenderData = /*#__PURE__*/ function(RenderData) {
15411
15530
  return _this;
15412
15531
  };
15413
15532
  _inherits$2(TextRenderData, RenderData);
15533
+ var _proto = TextRenderData.prototype;
15534
+ _proto.dispose = function dispose() {
15535
+ this.component = this.material = null;
15536
+ this.charsData.length = 0;
15537
+ };
15414
15538
  return TextRenderData;
15415
15539
  }(RenderData);
15416
15540
  /**
@@ -15936,8 +16060,6 @@ var TextRenderData = /*#__PURE__*/ function(RenderData) {
15936
16060
  function Scene(engine, name) {
15937
16061
  var _this;
15938
16062
  _this = EngineObject.call(this, engine) || this;
15939
- /** The background of the scene. */ _this.background = new Background(_this._engine);
15940
- /** Scene-related shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Scene);
15941
16063
  /** If cast shadows. */ _this.castShadows = true;
15942
16064
  /** The resolution of the shadow maps. */ _this.shadowResolution = exports.ShadowResolution.Medium;
15943
16065
  /** The splits of two cascade distribution. */ _this.shadowTwoCascadeSplits = 1.0 / 3.0;
@@ -15947,6 +16069,8 @@ var TextRenderData = /*#__PURE__*/ function(RenderData) {
15947
16069
  /** @internal */ _this._isActiveInEngine = false;
15948
16070
  /** @internal */ _this._globalShaderMacro = new ShaderMacroCollection();
15949
16071
  /** @internal */ _this._rootEntities = [];
16072
+ _this._background = new Background(_this._engine);
16073
+ _this._shaderData = new ShaderData(ShaderDataGroup.Scene);
15950
16074
  _this._shadowCascades = exports.ShadowCascadesMode.NoCascades;
15951
16075
  _this._fogMode = exports.FogMode.None;
15952
16076
  _this._fogColor = new miniprogram$7.Color(0.5, 0.5, 0.5, 1.0);
@@ -16113,6 +16237,8 @@ var TextRenderData = /*#__PURE__*/ function(RenderData) {
16113
16237
  shaderData.setColor(Scene._sunlightColorProperty, sunlight._getLightIntensityColor());
16114
16238
  shaderData.setVector3(Scene._sunlightDirectionProperty, sunlight.direction);
16115
16239
  this._sunLight = sunlight;
16240
+ } else {
16241
+ this._sunLight = null;
16116
16242
  }
16117
16243
  if (this.castShadows && this._sunLight && this._sunLight.shadowType !== exports.ShadowType.None) {
16118
16244
  shaderData.enableMacro("SCENE_SHADOW_TYPE", this._sunLight.shadowType.toString());
@@ -16172,6 +16298,22 @@ var TextRenderData = /*#__PURE__*/ function(RenderData) {
16172
16298
  this._fogParams.w = density / Math.sqrt(Math.LN2);
16173
16299
  };
16174
16300
  _create_class$2(Scene, [
16301
+ {
16302
+ key: "shaderData",
16303
+ get: /**
16304
+ * Scene-related shader data.
16305
+ */ function get() {
16306
+ return this._shaderData;
16307
+ }
16308
+ },
16309
+ {
16310
+ key: "background",
16311
+ get: /**
16312
+ * The background of the scene.
16313
+ */ function get() {
16314
+ return this._background;
16315
+ }
16316
+ },
16175
16317
  {
16176
16318
  key: "shadowCascades",
16177
16319
  get: /**
@@ -18603,7 +18745,6 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
18603
18745
  var Camera1 = function Camera1(entity) {
18604
18746
  var _this;
18605
18747
  _this = Component.call(this, entity) || this;
18606
- /** Shader data. */ _this.shaderData = new ShaderData(ShaderDataGroup.Camera);
18607
18748
  /** Rendering priority - A Camera with higher priority will be rendered on top of a camera with lower priority. */ _this.priority = 0;
18608
18749
  /** Whether to enable frustum culling, it is enabled by default. */ _this.enableFrustumCulling = true;
18609
18750
  /**
@@ -18619,6 +18760,7 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
18619
18760
  /** @internal */ _this._virtualCamera = new VirtualCamera();
18620
18761
  /** @internal */ _this._replacementShader = null;
18621
18762
  /** @internal */ _this._replacementSubShaderTag = null;
18763
+ _this._shaderData = new ShaderData(ShaderDataGroup.Camera);
18622
18764
  _this._isProjMatSetting = false;
18623
18765
  _this._nearClipPlane = 0.1;
18624
18766
  _this._farClipPlane = 100;
@@ -18829,6 +18971,20 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
18829
18971
  this._isInvViewProjDirty.destroy();
18830
18972
  this._isViewMatrixDirty.destroy();
18831
18973
  this.shaderData._addReferCount(-1);
18974
+ this._entity = null;
18975
+ this._globalShaderMacro = null;
18976
+ this._frustum = null;
18977
+ this._renderPipeline = null;
18978
+ this._virtualCamera = null;
18979
+ this._shaderData = null;
18980
+ this._frustumViewChangeFlag = null;
18981
+ this._transform = null;
18982
+ this._isViewMatrixDirty = null;
18983
+ this._isInvViewProjDirty = null;
18984
+ this._viewport = null;
18985
+ this._inverseProjectionMatrix = null;
18986
+ this._lastAspectSize = null;
18987
+ this._invViewProjMat = null;
18832
18988
  };
18833
18989
  _proto._projMatChange = function _projMatChange() {
18834
18990
  this._isFrustumProjectDirty = true;
@@ -18868,6 +19024,14 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component) {
18868
19024
  return this._inverseProjectionMatrix;
18869
19025
  };
18870
19026
  _create_class$2(Camera1, [
19027
+ {
19028
+ key: "shaderData",
19029
+ get: /**
19030
+ * Shader data.
19031
+ */ function get() {
19032
+ return this._shaderData;
19033
+ }
19034
+ },
18871
19035
  {
18872
19036
  key: "nearClipPlane",
18873
19037
  get: /**
@@ -21257,6 +21421,7 @@ var TiledType;
21257
21421
  sprite._addReferCount(-1);
21258
21422
  sprite._updateFlagManager.removeListener(this._onSpriteChange);
21259
21423
  }
21424
+ this._entity = null;
21260
21425
  this._color = null;
21261
21426
  this._sprite = null;
21262
21427
  this._assembler = null;
@@ -23529,9 +23694,14 @@ exports.AnimatorLayerBlendingMode = void 0;
23529
23694
  })(LayerState || (LayerState = {}));
23530
23695
  /**
23531
23696
  * @internal
23532
- */ var AnimationEventHandler = function AnimationEventHandler() {
23533
- this.handlers = [];
23534
- };
23697
+ */ var AnimationEventHandler = /*#__PURE__*/ function() {
23698
+ var AnimationEventHandler = function AnimationEventHandler() {
23699
+ this.handlers = [];
23700
+ };
23701
+ var _proto = AnimationEventHandler.prototype;
23702
+ _proto.dispose = function dispose() {};
23703
+ return AnimationEventHandler;
23704
+ }();
23535
23705
  /**
23536
23706
  * Transitions define when and how the state machine switch from on state to another. AnimatorTransition always originate from a StateMachine or a StateMachine entry.
23537
23707
  */ var AnimatorStateTransition = function AnimatorStateTransition() {
@@ -27710,6 +27880,10 @@ var GLTFEntityParser = /*#__PURE__*/ function(GLTFParser) {
27710
27880
  }
27711
27881
  glTFResource.sceneRoots = sceneRoots;
27712
27882
  glTFResource.defaultSceneRoot = sceneRoots[sceneID];
27883
+ // @ts-ignore
27884
+ glTFResource.defaultSceneRoot._hookResource = glTFResource;
27885
+ // @ts-ignore
27886
+ glTFResource._addReferCount(1);
27713
27887
  };
27714
27888
  return GLTFEntityParser;
27715
27889
  }(GLTFParser);
@@ -28441,33 +28615,16 @@ var GLTFValidator = /*#__PURE__*/ function(GLTFParser1) {
28441
28615
  })();
28442
28616
  /**
28443
28617
  * Product after glTF parser, usually, `defaultSceneRoot` is only needed to use.
28444
- */ var GLTFResource = /*#__PURE__*/ function(EngineObject) {
28618
+ */ var GLTFResource = /*#__PURE__*/ function(ReferResource) {
28445
28619
  var GLTFResource = function GLTFResource(engine, url) {
28446
28620
  var _this;
28447
- _this = EngineObject.call(this, engine) || this;
28621
+ _this = ReferResource.call(this, engine) || this;
28448
28622
  _this.url = url;
28449
28623
  return _this;
28450
28624
  };
28451
- _inherits$1(GLTFResource, EngineObject);
28452
- var _proto = GLTFResource.prototype;
28453
- /**
28454
- * @internal
28455
- */ _proto._onDestroy = function _onDestroy() {
28456
- EngineObject.prototype._onDestroy.call(this);
28457
- this.defaultSceneRoot.destroy();
28458
- this.textures = null;
28459
- this.materials = null;
28460
- this.meshes = null;
28461
- this.skins = null;
28462
- this.animations = null;
28463
- this.entities = null;
28464
- this.cameras = null;
28465
- this.lights = null;
28466
- this.sceneRoots = null;
28467
- this.extensionsData = null;
28468
- };
28625
+ _inherits$1(GLTFResource, ReferResource);
28469
28626
  return GLTFResource;
28470
- }(miniprogram$5.EngineObject);
28627
+ }(miniprogram$5.ReferResource);
28471
28628
  var GLTFLoader = /*#__PURE__*/ function(Loader) {
28472
28629
  var GLTFLoader = function GLTFLoader() {
28473
28630
  return Loader.apply(this, arguments);
@@ -36013,11 +36170,7 @@ function _inherits(subClass, superClass) {
36013
36170
  var webGLGraphicDevice = new WebGLGraphicDevice(configuration.graphicDeviceOptions);
36014
36171
  var engine = new WebGLEngine(webCanvas, webGLGraphicDevice, configuration);
36015
36172
  // @ts-ignore
36016
- var promise = engine._initialize(configuration);
36017
- return promise.then(function() {
36018
- engine.sceneManager.addScene(new miniprogram$1$1.Scene(engine, "DefaultScene"));
36019
- return engine;
36020
- });
36173
+ return engine._initialize(configuration);
36021
36174
  };
36022
36175
  _create_class(WebGLEngine, [
36023
36176
  {
@@ -36573,9 +36726,9 @@ var GLBuffer = /*#__PURE__*/ function() {
36573
36726
  var isWebGL2 = this._isWebGL2;
36574
36727
  var _this__formatDetail = this._formatDetail, internalFormat = _this__formatDetail.internalFormat, baseFormat = _this__formatDetail.baseFormat, dataType = _this__formatDetail.dataType;
36575
36728
  // @ts-ignore
36576
- var _this__texture = this._texture, mipmapCount = _this__texture.mipmapCount, width = _this__texture.width, height = _this__texture.height, _isDepthTexture = _this__texture._isDepthTexture;
36729
+ var _this__texture = this._texture, mipmapCount = _this__texture.mipmapCount, width = _this__texture.width, height = _this__texture.height, usage = _this__texture.usage, _isDepthTexture = _this__texture._isDepthTexture;
36577
36730
  this._bind();
36578
- if (isWebGL2 && !(baseFormat === gl.LUMINANCE_ALPHA || baseFormat === gl.ALPHA)) {
36731
+ if (isWebGL2 && !(baseFormat === gl.LUMINANCE_ALPHA || baseFormat === gl.ALPHA) && usage !== miniprogram$1$1.TextureUsage.Dynamic) {
36579
36732
  gl.texStorage2D(this._target, mipmapCount, internalFormat, width, height);
36580
36733
  } else {
36581
36734
  if (!isCube) {
@@ -37367,11 +37520,15 @@ var GLBuffer = /*#__PURE__*/ function() {
37367
37520
  * {@inheritDoc IPlatformTexture2D.setImageSource}
37368
37521
  */ _proto.setImageSource = function setImageSource(imageSource, mipLevel, flipY, premultiplyAlpha, x, y) {
37369
37522
  var gl = this._gl;
37370
- var _this__formatDetail = this._formatDetail, baseFormat = _this__formatDetail.baseFormat, dataType = _this__formatDetail.dataType;
37523
+ var _this__formatDetail = this._formatDetail, internalFormat = _this__formatDetail.internalFormat, baseFormat = _this__formatDetail.baseFormat, dataType = _this__formatDetail.dataType;
37371
37524
  this._bind();
37372
37525
  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, +flipY);
37373
37526
  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, +premultiplyAlpha);
37374
- gl.texSubImage2D(this._target, mipLevel, x || 0, y || 0, baseFormat, dataType, imageSource);
37527
+ if (this._texture.usage === miniprogram$1$1.TextureUsage.Dynamic) {
37528
+ gl.texImage2D(this._target, mipLevel, internalFormat, baseFormat, dataType, imageSource);
37529
+ } else {
37530
+ gl.texSubImage2D(this._target, mipLevel, x || 0, y || 0, baseFormat, dataType, imageSource);
37531
+ }
37375
37532
  };
37376
37533
  /**
37377
37534
  * {@inheritDoc IPlatformTexture2D.getPixelBuffer }
@@ -37539,7 +37696,8 @@ exports.WebGLMode = void 0;
37539
37696
  var options = _extends({
37540
37697
  webGLMode: 0,
37541
37698
  stencil: true,
37542
- _forceFlush: false
37699
+ _forceFlush: false,
37700
+ _maxAllowSkinUniformVectorCount: 256
37543
37701
  }, initializeOptions);
37544
37702
  if (miniprogram$1$1.SystemInfo.platform === miniprogram$1$1.Platform.IPhone || miniprogram$1$1.SystemInfo.platform === miniprogram$1$1.Platform.IPad) {
37545
37703
  var version = miniprogram$1$1.SystemInfo.operatingSystem.match(/(\d+).?(\d+)?.?(\d+)?/);
@@ -37875,7 +38033,7 @@ function _interopNamespace(e) {
37875
38033
  }
37876
38034
  var CoreObjects__namespace = /*#__PURE__*/ _interopNamespace(CoreObjects);
37877
38035
  //@ts-ignore
37878
- var version = "1.0.0-beta.10";
38036
+ var version = "1.0.0-beta.12";
37879
38037
  console.log("Galacean engine version: " + version);
37880
38038
  for(var key in CoreObjects__namespace){
37881
38039
  CoreObjects.Loader.registerClass(key, CoreObjects__namespace[key]);