@galacean/engine-core 1.3.0-beta.9 → 1.3.1
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/dist/main.js +24 -23
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +24 -23
- package/dist/module.js +24 -23
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Renderer.d.ts +2 -0
package/dist/miniprogram.js
CHANGED
|
@@ -5893,7 +5893,7 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
5893
5893
|
_this._overrideUpdate = _this.update !== prototype.update;
|
|
5894
5894
|
_this._addResourceReferCount(_this.shaderData, 1);
|
|
5895
5895
|
_this._onTransformChanged = _this._onTransformChanged.bind(_assert_this_initialized(_this));
|
|
5896
|
-
_this.
|
|
5896
|
+
_this._setTransform(entity.transform);
|
|
5897
5897
|
shaderData.enableMacro(exports.Renderer._receiveShadowMacro);
|
|
5898
5898
|
shaderData.setVector4(exports.Renderer._rendererLayerProperty, _this._rendererLayer);
|
|
5899
5899
|
return _this;
|
|
@@ -6019,7 +6019,7 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
6019
6019
|
* @internal
|
|
6020
6020
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
6021
6021
|
Component1.prototype._onDestroy.call(this);
|
|
6022
|
-
this.
|
|
6022
|
+
this._setTransform(null);
|
|
6023
6023
|
this._addResourceReferCount(this.shaderData, -1);
|
|
6024
6024
|
var materials = this._materials;
|
|
6025
6025
|
for(var i = 0, n = materials.length; i < n; i++){
|
|
@@ -6041,7 +6041,7 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
6041
6041
|
/**
|
|
6042
6042
|
* @internal
|
|
6043
6043
|
*/ _proto._updateTransformShaderData = function _updateTransformShaderData(context, onlyMVP, batched) {
|
|
6044
|
-
var worldMatrix = this.
|
|
6044
|
+
var worldMatrix = this._transform.worldMatrix;
|
|
6045
6045
|
if (onlyMVP) {
|
|
6046
6046
|
this._updateProjectionRelatedShaderData(context, worldMatrix, batched);
|
|
6047
6047
|
} else {
|
|
@@ -6080,7 +6080,7 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
6080
6080
|
miniprogram.Matrix.invert(mvMatrix, mvInvMatrix);
|
|
6081
6081
|
miniprogram.Matrix.invert(worldMatrix, normalMatrix);
|
|
6082
6082
|
normalMatrix.transpose();
|
|
6083
|
-
shaderData.setMatrix(exports.Renderer._localMatrixProperty, this.
|
|
6083
|
+
shaderData.setMatrix(exports.Renderer._localMatrixProperty, this._transform.localMatrix);
|
|
6084
6084
|
shaderData.setMatrix(exports.Renderer._worldMatrixProperty, worldMatrix);
|
|
6085
6085
|
shaderData.setMatrix(exports.Renderer._mvMatrixProperty, mvMatrix);
|
|
6086
6086
|
shaderData.setMatrix(exports.Renderer._mvInvMatrixProperty, mvInvMatrix);
|
|
@@ -6099,13 +6099,11 @@ exports.Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
6099
6099
|
};
|
|
6100
6100
|
/**
|
|
6101
6101
|
* @internal
|
|
6102
|
-
*/ _proto.
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
*/ _proto._unRegisterEntityTransformListener = function _unRegisterEntityTransformListener() {
|
|
6108
|
-
this.entity.transform._updateFlagManager.removeListener(this._onTransformChanged);
|
|
6102
|
+
*/ _proto._setTransform = function _setTransform(transform) {
|
|
6103
|
+
var _this__transform, _transform;
|
|
6104
|
+
(_this__transform = this._transform) == null ? void 0 : _this__transform._updateFlagManager.removeListener(this._onTransformChanged);
|
|
6105
|
+
(_transform = transform) == null ? void 0 : _transform._updateFlagManager.addListener(this._onTransformChanged);
|
|
6106
|
+
this._transform = transform;
|
|
6109
6107
|
};
|
|
6110
6108
|
/**
|
|
6111
6109
|
* @internal
|
|
@@ -6277,6 +6275,9 @@ __decorate([
|
|
|
6277
6275
|
__decorate([
|
|
6278
6276
|
ignoreClone
|
|
6279
6277
|
], exports.Renderer.prototype, "_rendererLayer", void 0);
|
|
6278
|
+
__decorate([
|
|
6279
|
+
ignoreClone
|
|
6280
|
+
], exports.Renderer.prototype, "_transform", void 0);
|
|
6280
6281
|
__decorate([
|
|
6281
6282
|
deepClone
|
|
6282
6283
|
], exports.Renderer.prototype, "_shaderData", void 0);
|
|
@@ -8484,7 +8485,8 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
8484
8485
|
* @param mipLevel - Set mip level the data want to write, only take effect in webgl2.0
|
|
8485
8486
|
*/ _proto.render = function render(cubeFace, mipLevel) {
|
|
8486
8487
|
if (mipLevel === void 0) mipLevel = 0;
|
|
8487
|
-
var
|
|
8488
|
+
var engine = this._engine;
|
|
8489
|
+
var context = engine._renderContext;
|
|
8488
8490
|
var virtualCamera = this._virtualCamera;
|
|
8489
8491
|
var transform = this.entity.transform;
|
|
8490
8492
|
miniprogram.Matrix.multiply(this.projectionMatrix, this.viewMatrix, virtualCamera.viewProjectionMatrix);
|
|
@@ -8505,16 +8507,16 @@ exports.Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
8505
8507
|
this._updateShaderData();
|
|
8506
8508
|
// union scene and camera macro.
|
|
8507
8509
|
ShaderMacroCollection.unionCollection(this.scene._globalShaderMacro, this.shaderData._macroCollection, this._globalShaderMacro);
|
|
8508
|
-
if (mipLevel > 0 && !
|
|
8510
|
+
if (mipLevel > 0 && !engine._hardwareRenderer.isWebGL2) {
|
|
8509
8511
|
mipLevel = 0;
|
|
8510
8512
|
Logger.error("mipLevel only take effect in WebGL2.0");
|
|
8511
8513
|
}
|
|
8512
|
-
var
|
|
8513
|
-
if (this._cameraType !== exports.CameraType.Normal) {
|
|
8514
|
-
|
|
8514
|
+
var ignoreClearFlags;
|
|
8515
|
+
if (this._cameraType !== exports.CameraType.Normal && !this._renderTarget && !this.independentCanvasEnabled) {
|
|
8516
|
+
ignoreClearFlags = engine.xrManager._getCameraIgnoreClearFlags(this._cameraType);
|
|
8515
8517
|
}
|
|
8516
|
-
this._renderPipeline.render(context, cubeFace, mipLevel,
|
|
8517
|
-
|
|
8518
|
+
this._renderPipeline.render(context, cubeFace, mipLevel, ignoreClearFlags);
|
|
8519
|
+
engine._renderCount++;
|
|
8518
8520
|
};
|
|
8519
8521
|
_proto.setReplacementShader = function setReplacementShader(shader, replacementTag, failureStrategy) {
|
|
8520
8522
|
if (failureStrategy === void 0) failureStrategy = exports.ReplacementFailureStrategy.KeepOriginalShader;
|
|
@@ -18276,9 +18278,7 @@ var SkinUpdateFlag;
|
|
|
18276
18278
|
/**
|
|
18277
18279
|
* @internal
|
|
18278
18280
|
*/ _proto._updateTransformShaderData = function _updateTransformShaderData(context, onlyMVP, batched) {
|
|
18279
|
-
var
|
|
18280
|
-
var _this_skin_rootBone;
|
|
18281
|
-
var worldMatrix = ((_this_skin_rootBone = (_this_skin = this.skin) == null ? void 0 : _this_skin.rootBone) != null ? _this_skin_rootBone : this.entity).transform.worldMatrix;
|
|
18281
|
+
var worldMatrix = this._transform.worldMatrix;
|
|
18282
18282
|
if (onlyMVP) {
|
|
18283
18283
|
this._updateProjectionRelatedShaderData(context, worldMatrix, batched);
|
|
18284
18284
|
} else {
|
|
@@ -18363,7 +18363,7 @@ var SkinUpdateFlag;
|
|
|
18363
18363
|
var _this_skin;
|
|
18364
18364
|
var rootBone = (_this_skin = this.skin) == null ? void 0 : _this_skin.rootBone;
|
|
18365
18365
|
if (rootBone) {
|
|
18366
|
-
miniprogram.BoundingBox.transform(this._localBounds,
|
|
18366
|
+
miniprogram.BoundingBox.transform(this._localBounds, this._transform.worldMatrix, worldBounds);
|
|
18367
18367
|
} else {
|
|
18368
18368
|
MeshRenderer1.prototype._updateBounds.call(this, worldBounds);
|
|
18369
18369
|
}
|
|
@@ -18404,6 +18404,7 @@ var SkinUpdateFlag;
|
|
|
18404
18404
|
}
|
|
18405
18405
|
break;
|
|
18406
18406
|
case SkinUpdateFlag.RootBoneChanged:
|
|
18407
|
+
this._setTransform(value.transform);
|
|
18407
18408
|
this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
|
|
18408
18409
|
break;
|
|
18409
18410
|
}
|
|
@@ -23253,7 +23254,7 @@ var unlitVs = "#define GLSLIFY 1\n#include <common>\n#include <common_vert>\n#in
|
|
|
23253
23254
|
};
|
|
23254
23255
|
/**
|
|
23255
23256
|
* @internal
|
|
23256
|
-
*/ _proto.
|
|
23257
|
+
*/ _proto._getCameraIgnoreClearFlags = function _getCameraIgnoreClearFlags(type) {
|
|
23257
23258
|
return exports.CameraClearFlags.None;
|
|
23258
23259
|
};
|
|
23259
23260
|
return XRManager;
|
package/dist/module.js
CHANGED
|
@@ -5888,7 +5888,7 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
5888
5888
|
_this._overrideUpdate = _this.update !== prototype.update;
|
|
5889
5889
|
_this._addResourceReferCount(_this.shaderData, 1);
|
|
5890
5890
|
_this._onTransformChanged = _this._onTransformChanged.bind(_assert_this_initialized(_this));
|
|
5891
|
-
_this.
|
|
5891
|
+
_this._setTransform(entity.transform);
|
|
5892
5892
|
shaderData.enableMacro(Renderer._receiveShadowMacro);
|
|
5893
5893
|
shaderData.setVector4(Renderer._rendererLayerProperty, _this._rendererLayer);
|
|
5894
5894
|
return _this;
|
|
@@ -6014,7 +6014,7 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
6014
6014
|
* @internal
|
|
6015
6015
|
*/ _proto._onDestroy = function _onDestroy() {
|
|
6016
6016
|
Component1.prototype._onDestroy.call(this);
|
|
6017
|
-
this.
|
|
6017
|
+
this._setTransform(null);
|
|
6018
6018
|
this._addResourceReferCount(this.shaderData, -1);
|
|
6019
6019
|
var materials = this._materials;
|
|
6020
6020
|
for(var i = 0, n = materials.length; i < n; i++){
|
|
@@ -6036,7 +6036,7 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
6036
6036
|
/**
|
|
6037
6037
|
* @internal
|
|
6038
6038
|
*/ _proto._updateTransformShaderData = function _updateTransformShaderData(context, onlyMVP, batched) {
|
|
6039
|
-
var worldMatrix = this.
|
|
6039
|
+
var worldMatrix = this._transform.worldMatrix;
|
|
6040
6040
|
if (onlyMVP) {
|
|
6041
6041
|
this._updateProjectionRelatedShaderData(context, worldMatrix, batched);
|
|
6042
6042
|
} else {
|
|
@@ -6075,7 +6075,7 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
6075
6075
|
Matrix.invert(mvMatrix, mvInvMatrix);
|
|
6076
6076
|
Matrix.invert(worldMatrix, normalMatrix);
|
|
6077
6077
|
normalMatrix.transpose();
|
|
6078
|
-
shaderData.setMatrix(Renderer._localMatrixProperty, this.
|
|
6078
|
+
shaderData.setMatrix(Renderer._localMatrixProperty, this._transform.localMatrix);
|
|
6079
6079
|
shaderData.setMatrix(Renderer._worldMatrixProperty, worldMatrix);
|
|
6080
6080
|
shaderData.setMatrix(Renderer._mvMatrixProperty, mvMatrix);
|
|
6081
6081
|
shaderData.setMatrix(Renderer._mvInvMatrixProperty, mvInvMatrix);
|
|
@@ -6094,13 +6094,11 @@ var Renderer = (_Renderer = /*#__PURE__*/ function(Component1) {
|
|
|
6094
6094
|
};
|
|
6095
6095
|
/**
|
|
6096
6096
|
* @internal
|
|
6097
|
-
*/ _proto.
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
*/ _proto._unRegisterEntityTransformListener = function _unRegisterEntityTransformListener() {
|
|
6103
|
-
this.entity.transform._updateFlagManager.removeListener(this._onTransformChanged);
|
|
6097
|
+
*/ _proto._setTransform = function _setTransform(transform) {
|
|
6098
|
+
var _this__transform, _transform;
|
|
6099
|
+
(_this__transform = this._transform) == null ? void 0 : _this__transform._updateFlagManager.removeListener(this._onTransformChanged);
|
|
6100
|
+
(_transform = transform) == null ? void 0 : _transform._updateFlagManager.addListener(this._onTransformChanged);
|
|
6101
|
+
this._transform = transform;
|
|
6104
6102
|
};
|
|
6105
6103
|
/**
|
|
6106
6104
|
* @internal
|
|
@@ -6272,6 +6270,9 @@ __decorate([
|
|
|
6272
6270
|
__decorate([
|
|
6273
6271
|
ignoreClone
|
|
6274
6272
|
], Renderer.prototype, "_rendererLayer", void 0);
|
|
6273
|
+
__decorate([
|
|
6274
|
+
ignoreClone
|
|
6275
|
+
], Renderer.prototype, "_transform", void 0);
|
|
6275
6276
|
__decorate([
|
|
6276
6277
|
deepClone
|
|
6277
6278
|
], Renderer.prototype, "_shaderData", void 0);
|
|
@@ -8479,7 +8480,8 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
8479
8480
|
* @param mipLevel - Set mip level the data want to write, only take effect in webgl2.0
|
|
8480
8481
|
*/ _proto.render = function render(cubeFace, mipLevel) {
|
|
8481
8482
|
if (mipLevel === void 0) mipLevel = 0;
|
|
8482
|
-
var
|
|
8483
|
+
var engine = this._engine;
|
|
8484
|
+
var context = engine._renderContext;
|
|
8483
8485
|
var virtualCamera = this._virtualCamera;
|
|
8484
8486
|
var transform = this.entity.transform;
|
|
8485
8487
|
Matrix.multiply(this.projectionMatrix, this.viewMatrix, virtualCamera.viewProjectionMatrix);
|
|
@@ -8500,16 +8502,16 @@ var Camera = (_Camera = /*#__PURE__*/ function(Component1) {
|
|
|
8500
8502
|
this._updateShaderData();
|
|
8501
8503
|
// union scene and camera macro.
|
|
8502
8504
|
ShaderMacroCollection.unionCollection(this.scene._globalShaderMacro, this.shaderData._macroCollection, this._globalShaderMacro);
|
|
8503
|
-
if (mipLevel > 0 && !
|
|
8505
|
+
if (mipLevel > 0 && !engine._hardwareRenderer.isWebGL2) {
|
|
8504
8506
|
mipLevel = 0;
|
|
8505
8507
|
Logger.error("mipLevel only take effect in WebGL2.0");
|
|
8506
8508
|
}
|
|
8507
|
-
var
|
|
8508
|
-
if (this._cameraType !== CameraType.Normal) {
|
|
8509
|
-
|
|
8509
|
+
var ignoreClearFlags;
|
|
8510
|
+
if (this._cameraType !== CameraType.Normal && !this._renderTarget && !this.independentCanvasEnabled) {
|
|
8511
|
+
ignoreClearFlags = engine.xrManager._getCameraIgnoreClearFlags(this._cameraType);
|
|
8510
8512
|
}
|
|
8511
|
-
this._renderPipeline.render(context, cubeFace, mipLevel,
|
|
8512
|
-
|
|
8513
|
+
this._renderPipeline.render(context, cubeFace, mipLevel, ignoreClearFlags);
|
|
8514
|
+
engine._renderCount++;
|
|
8513
8515
|
};
|
|
8514
8516
|
_proto.setReplacementShader = function setReplacementShader(shader, replacementTag, failureStrategy) {
|
|
8515
8517
|
if (failureStrategy === void 0) failureStrategy = ReplacementFailureStrategy.KeepOriginalShader;
|
|
@@ -18271,9 +18273,7 @@ var SkinUpdateFlag;
|
|
|
18271
18273
|
/**
|
|
18272
18274
|
* @internal
|
|
18273
18275
|
*/ _proto._updateTransformShaderData = function _updateTransformShaderData(context, onlyMVP, batched) {
|
|
18274
|
-
var
|
|
18275
|
-
var _this_skin_rootBone;
|
|
18276
|
-
var worldMatrix = ((_this_skin_rootBone = (_this_skin = this.skin) == null ? void 0 : _this_skin.rootBone) != null ? _this_skin_rootBone : this.entity).transform.worldMatrix;
|
|
18276
|
+
var worldMatrix = this._transform.worldMatrix;
|
|
18277
18277
|
if (onlyMVP) {
|
|
18278
18278
|
this._updateProjectionRelatedShaderData(context, worldMatrix, batched);
|
|
18279
18279
|
} else {
|
|
@@ -18358,7 +18358,7 @@ var SkinUpdateFlag;
|
|
|
18358
18358
|
var _this_skin;
|
|
18359
18359
|
var rootBone = (_this_skin = this.skin) == null ? void 0 : _this_skin.rootBone;
|
|
18360
18360
|
if (rootBone) {
|
|
18361
|
-
BoundingBox.transform(this._localBounds,
|
|
18361
|
+
BoundingBox.transform(this._localBounds, this._transform.worldMatrix, worldBounds);
|
|
18362
18362
|
} else {
|
|
18363
18363
|
MeshRenderer1.prototype._updateBounds.call(this, worldBounds);
|
|
18364
18364
|
}
|
|
@@ -18399,6 +18399,7 @@ var SkinUpdateFlag;
|
|
|
18399
18399
|
}
|
|
18400
18400
|
break;
|
|
18401
18401
|
case SkinUpdateFlag.RootBoneChanged:
|
|
18402
|
+
this._setTransform(value.transform);
|
|
18402
18403
|
this._dirtyUpdateFlag |= RendererUpdateFlags.WorldVolume;
|
|
18403
18404
|
break;
|
|
18404
18405
|
}
|
|
@@ -23248,7 +23249,7 @@ var unlitVs = "#define GLSLIFY 1\n#include <common>\n#include <common_vert>\n#in
|
|
|
23248
23249
|
};
|
|
23249
23250
|
/**
|
|
23250
23251
|
* @internal
|
|
23251
|
-
*/ _proto.
|
|
23252
|
+
*/ _proto._getCameraIgnoreClearFlags = function _getCameraIgnoreClearFlags(type) {
|
|
23252
23253
|
return CameraClearFlags.None;
|
|
23253
23254
|
};
|
|
23254
23255
|
return XRManager;
|