@galacean/effects-threejs 2.0.0-alpha.27 → 2.0.0-alpha.28
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/index.js +256 -192
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -2
- package/dist/index.min.js.map +1 -1
- package/dist/index.mjs +254 -192
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime threejs plugin for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.0.0-alpha.
|
|
6
|
+
* Version: v2.0.0-alpha.28
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as THREE from 'three';
|
|
@@ -442,16 +442,27 @@ function isIOS() {
|
|
|
442
442
|
// real ios device not in simulator
|
|
443
443
|
return !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
|
|
444
444
|
}
|
|
445
|
+
function isIOSByUA() {
|
|
446
|
+
var str = navigator.userAgent.toLowerCase();
|
|
447
|
+
var ver = str.match(/cpu (iphone )?os (.*?) like mac os/);
|
|
448
|
+
return ver ? parseInt(ver[2], 10) : 0;
|
|
449
|
+
}
|
|
445
450
|
function isAndroid() {
|
|
446
451
|
return /\b[Aa]ndroid\b/.test(navigator.userAgent);
|
|
447
452
|
}
|
|
448
453
|
function isSimulatorCellPhone() {
|
|
449
454
|
return isAndroid() || /\b(iPad|iPhone|iPod)\b/.test(navigator.userAgent);
|
|
450
455
|
}
|
|
456
|
+
function isMiniProgram() {
|
|
457
|
+
return isAlipayMiniApp() || isWechatMiniApp();
|
|
458
|
+
}
|
|
451
459
|
function isAlipayMiniApp() {
|
|
452
460
|
var _my;
|
|
453
461
|
return typeof my !== "undefined" && ((_my = my) == null ? void 0 : _my.renderTarget) === "web";
|
|
454
462
|
}
|
|
463
|
+
function isWechatMiniApp() {
|
|
464
|
+
return window.__wxjs_environment === "miniprogram";
|
|
465
|
+
}
|
|
455
466
|
|
|
456
467
|
function imageDataFromColor(value) {
|
|
457
468
|
if (isString(value)) {
|
|
@@ -8131,31 +8142,35 @@ function deserializeMipmapTexture(textureOptions, bins, engine) {
|
|
|
8131
8142
|
}
|
|
8132
8143
|
function _deserializeMipmapTexture() {
|
|
8133
8144
|
_deserializeMipmapTexture = _async_to_generator(function(textureOptions, bins, engine, files) {
|
|
8134
|
-
var mipmaps, target,
|
|
8145
|
+
var mipmaps, target, jobs, loadedMipmaps, mipmaps1, target1, jobs1, loadedMipmaps1, bin;
|
|
8135
8146
|
return __generator(this, function(_state) {
|
|
8136
8147
|
switch(_state.label){
|
|
8137
8148
|
case 0:
|
|
8138
8149
|
if (files === void 0) files = [];
|
|
8139
8150
|
if (!(textureOptions.target === 34067)) return [
|
|
8140
8151
|
3,
|
|
8141
|
-
|
|
8152
|
+
2
|
|
8142
8153
|
];
|
|
8143
8154
|
mipmaps = textureOptions.mipmaps, target = textureOptions.target;
|
|
8144
|
-
|
|
8145
|
-
|
|
8146
|
-
for(_iterator = _create_for_of_iterator_helper_loose(mipmaps); !(_step = _iterator()).done;){
|
|
8147
|
-
level = _step.value;
|
|
8148
|
-
newLevel = [];
|
|
8149
|
-
for(_iterator1 = _create_for_of_iterator_helper_loose(level); !(_step1 = _iterator1()).done;){
|
|
8150
|
-
face = _step1.value;
|
|
8151
|
-
// @ts-expect-error
|
|
8152
|
-
loadedImageAsset = engine.assetLoader.loadGUID(face.id);
|
|
8155
|
+
jobs = mipmaps.map(function(mipmap) {
|
|
8156
|
+
return Promise.all(mipmap.map(function(pointer) {
|
|
8153
8157
|
// @ts-expect-error
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8158
|
-
|
|
8158
|
+
if (pointer.id) {
|
|
8159
|
+
// @ts-expect-error
|
|
8160
|
+
var loadedImageAsset = engine.assetLoader.loadGUID(pointer.id);
|
|
8161
|
+
// @ts-expect-error
|
|
8162
|
+
return loadedImageAsset.data;
|
|
8163
|
+
} else {
|
|
8164
|
+
return loadMipmapImage(pointer, bins);
|
|
8165
|
+
}
|
|
8166
|
+
}));
|
|
8167
|
+
});
|
|
8168
|
+
return [
|
|
8169
|
+
4,
|
|
8170
|
+
Promise.all(jobs)
|
|
8171
|
+
];
|
|
8172
|
+
case 1:
|
|
8173
|
+
loadedMipmaps = _state.sent();
|
|
8159
8174
|
return [
|
|
8160
8175
|
2,
|
|
8161
8176
|
_extends({
|
|
@@ -8169,17 +8184,17 @@ function _deserializeMipmapTexture() {
|
|
|
8169
8184
|
}
|
|
8170
8185
|
})
|
|
8171
8186
|
];
|
|
8172
|
-
case
|
|
8187
|
+
case 2:
|
|
8173
8188
|
// TODO: 补充测试用例
|
|
8174
8189
|
mipmaps1 = textureOptions.mipmaps, target1 = textureOptions.target;
|
|
8175
|
-
|
|
8190
|
+
jobs1 = mipmaps1.map(function(pointer) {
|
|
8176
8191
|
return loadMipmapImage(pointer, bins);
|
|
8177
8192
|
});
|
|
8178
8193
|
return [
|
|
8179
8194
|
4,
|
|
8180
|
-
Promise.all(
|
|
8195
|
+
Promise.all(jobs1)
|
|
8181
8196
|
];
|
|
8182
|
-
case
|
|
8197
|
+
case 3:
|
|
8183
8198
|
loadedMipmaps1 = _state.sent();
|
|
8184
8199
|
bin = files[mipmaps1[0][1][0]].url;
|
|
8185
8200
|
return [
|
|
@@ -8202,7 +8217,7 @@ function _deserializeMipmapTexture() {
|
|
|
8202
8217
|
}
|
|
8203
8218
|
})
|
|
8204
8219
|
];
|
|
8205
|
-
case
|
|
8220
|
+
case 4:
|
|
8206
8221
|
return [
|
|
8207
8222
|
2
|
|
8208
8223
|
];
|
|
@@ -11557,7 +11572,7 @@ var valueDefine = "#ifdef SHADER_VERTEX\n#define CURVE_VALUE_TEXTURE uVCurveValu
|
|
|
11557
11572
|
|
|
11558
11573
|
var screenMeshVert = "precision highp float;attribute vec2 aPos;varying vec2 uv;void main(){gl_Position=vec4(aPos,0.,1.0);uv=(aPos+vec2(1.0))/2.;}";
|
|
11559
11574
|
|
|
11560
|
-
var colorGradingFrag = "precision highp float;\n#define HALF_MAX 60000.0\n#define ACEScc_MIDGRAY 0.4135884\nvarying vec2 uv;uniform sampler2D _GaussianTex;uniform sampler2D _SceneTex;uniform float _BloomIntensity;uniform float _Brightness;uniform float _Saturation;uniform float _Contrast;uniform bool _UseBloom;uniform bool _UseToneMapping;uniform vec3 _VignetteColor;uniform vec2 _VignetteCenter;uniform float _VignetteIntensity;uniform float _VignetteSmoothness;uniform float _VignetteRoundness;mat3 LinearToACES=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);mat3 ACESToLinear=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);float log10(float x){return log(x)/log(10.0);}vec3 log10(vec3 v){return vec3(log10(v.x),log10(v.y),log10(v.z));}vec3 LinearToLogC(vec3 x){return 0.244161*log10(5.555556*x+0.047996)+0.386036;}vec3 LogCToLinear(vec3 x){return(pow(vec3(10.0),(x-0.386036)/0.244161)-0.047996)/5.555556;}vec3 rrt_and_odt_fit(vec3 col){vec3 a=col*(col+0.0245786)-0.000090537;vec3 b=col*(0.983729*col+0.4329510)+0.238081;return a/b;}vec3 ACESToneMapping(vec3 col){vec3 aces=LinearToACES*col;aces=rrt_and_odt_fit(aces);col=ACESToLinear*aces;return col;}vec3 LinearToSrgb(vec3 c){return mix(1.055*pow(c,vec3(1./2.4))-0.055,12.92*c,step(c,vec3(0.0031308)));}vec3 GammaCorrection(vec3 c){return pow(c,vec3(1.0/2.2));}vec3 ApplyVignette(vec3 inputColor,vec2 uv,vec2 center,float intensity,float roundness,float smoothness,vec3 color){vec2 dist=abs(uv-center)*intensity;dist.x*=roundness;float vfactor=pow(clamp((1.0-dot(dist,dist)),0.0,1.0),smoothness);return inputColor*mix(color,vec3(1.0),vfactor);}void main(){vec4 hdrColor=texture2D(_SceneTex,uv);hdrColor.rgb=pow(hdrColor.rgb,vec3(2.2));vec3 finalColor=hdrColor.rgb;if(_UseBloom){vec4 bloomColor=texture2D(_GaussianTex,uv);bloomColor.rgb*=_BloomIntensity;finalColor+=bloomColor.rgb;}if(_VignetteIntensity>0.0){finalColor=ApplyVignette(finalColor,uv,_VignetteCenter,_VignetteIntensity,_VignetteRoundness,_VignetteSmoothness,_VignetteColor);}finalColor=finalColor*_Brightness;vec3 colorLog=LinearToLogC(finalColor);colorLog=(colorLog-ACEScc_MIDGRAY)*_Contrast+ACEScc_MIDGRAY;finalColor=LogCToLinear(colorLog);finalColor=max(finalColor,0.0);float luminance=0.2125*finalColor.r+0.7154*finalColor.g+0.0721*finalColor.b;vec3 luminanceColor=vec3(luminance,luminance,luminance);finalColor=(finalColor-luminanceColor)*_Saturation+luminanceColor;finalColor=max(finalColor,0.0);if(_UseToneMapping){finalColor=max(vec3(0.0),ACESToneMapping(finalColor));}gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),1.0);}";
|
|
11575
|
+
var colorGradingFrag = "precision highp float;\n#define HALF_MAX 60000.0\n#define ACEScc_MIDGRAY 0.4135884\nvarying vec2 uv;uniform sampler2D _GaussianTex;uniform sampler2D _SceneTex;uniform float _BloomIntensity;uniform float _Brightness;uniform float _Saturation;uniform float _Contrast;uniform bool _UseBloom;uniform bool _UseToneMapping;uniform vec3 _VignetteColor;uniform vec2 _VignetteCenter;uniform float _VignetteIntensity;uniform float _VignetteSmoothness;uniform float _VignetteRoundness;mat3 LinearToACES=mat3(0.59719,0.07600,0.02840,0.35458,0.90834,0.13383,0.04823,0.01566,0.83777);mat3 ACESToLinear=mat3(1.60475,-0.10208,-0.00327,-0.53108,1.10813,-0.07276,-0.07367,-0.00605,1.07602);float log10(float x){return log(x)/log(10.0);}vec3 log10(vec3 v){return vec3(log10(v.x),log10(v.y),log10(v.z));}vec3 LinearToLogC(vec3 x){return 0.244161*log10(5.555556*x+0.047996)+0.386036;}vec3 LogCToLinear(vec3 x){return(pow(vec3(10.0),(x-0.386036)/0.244161)-0.047996)/5.555556;}vec3 rrt_and_odt_fit(vec3 col){vec3 a=col*(col+0.0245786)-0.000090537;vec3 b=col*(0.983729*col+0.4329510)+0.238081;return a/b;}vec3 ACESToneMapping(vec3 col){vec3 aces=LinearToACES*col;aces=rrt_and_odt_fit(aces);col=ACESToLinear*aces;return col;}vec3 LinearToSrgb(vec3 c){return mix(1.055*pow(c,vec3(1./2.4))-0.055,12.92*c,step(c,vec3(0.0031308)));}vec3 GammaCorrection(vec3 c){return pow(c,vec3(1.0/2.2));}vec3 ApplyVignette(vec3 inputColor,vec2 uv,vec2 center,float intensity,float roundness,float smoothness,vec3 color){vec2 dist=abs(uv-center)*intensity;dist.x*=roundness;float vfactor=pow(clamp((1.0-dot(dist,dist)),0.0,1.0),smoothness);return inputColor*mix(color,vec3(1.0),vfactor);}void main(){vec4 hdrColor=texture2D(_SceneTex,uv);hdrColor*=hdrColor.a;hdrColor.rgb=pow(hdrColor.rgb,vec3(2.2));vec3 finalColor=hdrColor.rgb;if(_UseBloom){vec4 bloomColor=texture2D(_GaussianTex,uv);bloomColor.rgb*=_BloomIntensity;finalColor+=bloomColor.rgb;}if(_VignetteIntensity>0.0){finalColor=ApplyVignette(finalColor,uv,_VignetteCenter,_VignetteIntensity,_VignetteRoundness,_VignetteSmoothness,_VignetteColor);}finalColor=finalColor*_Brightness;vec3 colorLog=LinearToLogC(finalColor);colorLog=(colorLog-ACEScc_MIDGRAY)*_Contrast+ACEScc_MIDGRAY;finalColor=LogCToLinear(colorLog);finalColor=max(finalColor,0.0);float luminance=0.2125*finalColor.r+0.7154*finalColor.g+0.0721*finalColor.b;vec3 luminanceColor=vec3(luminance,luminance,luminance);finalColor=(finalColor-luminanceColor)*_Saturation+luminanceColor;finalColor=max(finalColor,0.0);if(_UseToneMapping){finalColor=max(vec3(0.0),ACESToneMapping(finalColor));}gl_FragColor=vec4(clamp(GammaCorrection(finalColor),0.0,1.0),1.0);}";
|
|
11561
11576
|
|
|
11562
11577
|
var gaussianDown_frag = "precision highp float;varying vec2 uv;uniform sampler2D _MainTex;uniform vec2 _TextureSize;float GaussWeight2D(float x,float y,float sigma){float PI=3.14159265358;float E=2.71828182846;float sigma_2=pow(sigma,2.0);float a=-(x*x+y*y)/(2.0*sigma_2);return pow(E,a)/(2.0*PI*sigma_2);}vec3 GaussNxN(sampler2D tex,vec2 uv,vec2 stride,float sigma){vec3 color=vec3(0.,0.,0.);const int r=5/2;float weight=0.0;for(int i=-r;i<=r;i++){for(int j=-r;j<=r;j++){float w=GaussWeight2D(float(i),float(j),sigma);vec2 coord=uv+vec2(i,j)*stride;color+=texture2D(tex,coord).rgb*w;weight+=w;}}color/=weight;return color;}void main(){vec4 mainColor=texture2D(_MainTex,uv);vec3 color=mainColor.rgb;color=GaussNxN(_MainTex,uv,1.0/_TextureSize,1.0);gl_FragColor=vec4(color,1.0);}";
|
|
11563
11578
|
|
|
@@ -11845,7 +11860,7 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
11845
11860
|
this.screenMesh.material.setFloat("_Brightness", brightness);
|
|
11846
11861
|
this.screenMesh.material.setFloat("_Saturation", saturation);
|
|
11847
11862
|
this.screenMesh.material.setFloat("_Contrast", contrast);
|
|
11848
|
-
this.screenMesh.material.setInt("_UseBloom", useBloom);
|
|
11863
|
+
this.screenMesh.material.setInt("_UseBloom", Number(useBloom));
|
|
11849
11864
|
if (useBloom) {
|
|
11850
11865
|
this.screenMesh.material.setTexture("_GaussianTex", this.mainTexture);
|
|
11851
11866
|
this.screenMesh.material.setFloat("_BloomIntensity", bloomIntensity);
|
|
@@ -11857,7 +11872,7 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
11857
11872
|
this.screenMesh.material.setVector2("_VignetteCenter", new Vector2(0.5, 0.5));
|
|
11858
11873
|
this.screenMesh.material.setVector3("_VignetteColor", new Vector3(0.0, 0.0, 0.0));
|
|
11859
11874
|
}
|
|
11860
|
-
this.screenMesh.material.setInt("_UseToneMapping", useToneMapping);
|
|
11875
|
+
this.screenMesh.material.setInt("_UseToneMapping", Number(useToneMapping));
|
|
11861
11876
|
renderer.renderMeshes([
|
|
11862
11877
|
this.screenMesh
|
|
11863
11878
|
]);
|
|
@@ -11869,9 +11884,8 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
11869
11884
|
* 后处理配置
|
|
11870
11885
|
*/ var defaultGlobalVolume = {
|
|
11871
11886
|
useHDR: false,
|
|
11872
|
-
usePostProcessing: false,
|
|
11873
11887
|
/***** Material Uniform *****/ // Bloom
|
|
11874
|
-
useBloom:
|
|
11888
|
+
useBloom: true,
|
|
11875
11889
|
threshold: 1.0,
|
|
11876
11890
|
bloomIntensity: 1.0,
|
|
11877
11891
|
// ColorAdjustments
|
|
@@ -11885,7 +11899,7 @@ var ToneMappingPass = /*#__PURE__*/ function(RenderPass) {
|
|
|
11885
11899
|
vignetteSmoothness: 0.4,
|
|
11886
11900
|
vignetteRoundness: 1.0,
|
|
11887
11901
|
// ToneMapping
|
|
11888
|
-
useToneMapping:
|
|
11902
|
+
useToneMapping: true
|
|
11889
11903
|
};
|
|
11890
11904
|
|
|
11891
11905
|
var RENDER_PASS_NAME_PREFIX = "_effects_default_";
|
|
@@ -11954,20 +11968,36 @@ var seed$6 = 1;
|
|
|
11954
11968
|
];
|
|
11955
11969
|
this.setRenderPasses(renderPasses);
|
|
11956
11970
|
if (this.globalVolume) {
|
|
11957
|
-
var useBloom = this.globalVolume.useBloom;
|
|
11958
11971
|
var sceneTextureHandle = new RenderTargetHandle(engine); //保存后处理前的屏幕图像
|
|
11959
|
-
|
|
11960
|
-
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
|
|
11964
|
-
|
|
11965
|
-
|
|
11966
|
-
|
|
11967
|
-
|
|
11968
|
-
|
|
11969
|
-
|
|
11970
|
-
|
|
11972
|
+
var gaussianStep = 7; // 高斯模糊的迭代次数,次数越高模糊范围越大
|
|
11973
|
+
var viewport = [
|
|
11974
|
+
0,
|
|
11975
|
+
0,
|
|
11976
|
+
this.renderer.getWidth() / 2,
|
|
11977
|
+
this.renderer.getHeight() / 2
|
|
11978
|
+
];
|
|
11979
|
+
var gaussianDownResults = new Array(gaussianStep); //存放多个高斯Pass的模糊结果,用于Bloom
|
|
11980
|
+
var textureType1 = this.globalVolume.useHDR ? glContext.HALF_FLOAT : glContext.UNSIGNED_BYTE;
|
|
11981
|
+
var bloomThresholdPass = new BloomThresholdPass(renderer, {
|
|
11982
|
+
name: "BloomThresholdPass",
|
|
11983
|
+
attachments: [
|
|
11984
|
+
{
|
|
11985
|
+
texture: {
|
|
11986
|
+
format: glContext.RGBA,
|
|
11987
|
+
type: textureType1,
|
|
11988
|
+
minFilter: glContext.LINEAR,
|
|
11989
|
+
magFilter: glContext.LINEAR
|
|
11990
|
+
}
|
|
11991
|
+
}
|
|
11992
|
+
]
|
|
11993
|
+
});
|
|
11994
|
+
bloomThresholdPass.sceneTextureHandle = sceneTextureHandle;
|
|
11995
|
+
this.addRenderPass(bloomThresholdPass);
|
|
11996
|
+
for(var i = 0; i < gaussianStep; i++){
|
|
11997
|
+
gaussianDownResults[i] = new RenderTargetHandle(engine);
|
|
11998
|
+
var gaussianDownHPass = new HQGaussianDownSamplePass(renderer, "H", {
|
|
11999
|
+
name: "GaussianDownPassH" + i,
|
|
12000
|
+
viewport: viewport,
|
|
11971
12001
|
attachments: [
|
|
11972
12002
|
{
|
|
11973
12003
|
texture: {
|
|
@@ -11979,74 +12009,50 @@ var seed$6 = 1;
|
|
|
11979
12009
|
}
|
|
11980
12010
|
]
|
|
11981
12011
|
});
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
format: glContext.RGBA,
|
|
11993
|
-
type: textureType1,
|
|
11994
|
-
minFilter: glContext.LINEAR,
|
|
11995
|
-
magFilter: glContext.LINEAR
|
|
11996
|
-
}
|
|
11997
|
-
}
|
|
11998
|
-
]
|
|
11999
|
-
});
|
|
12000
|
-
var gaussianDownVPass = new HQGaussianDownSamplePass(renderer, "V", {
|
|
12001
|
-
name: "GaussianDownPassV" + i,
|
|
12002
|
-
viewport: viewport,
|
|
12003
|
-
attachments: [
|
|
12004
|
-
{
|
|
12005
|
-
texture: {
|
|
12006
|
-
format: glContext.RGBA,
|
|
12007
|
-
type: textureType1,
|
|
12008
|
-
minFilter: glContext.LINEAR,
|
|
12009
|
-
magFilter: glContext.LINEAR
|
|
12010
|
-
}
|
|
12012
|
+
var gaussianDownVPass = new HQGaussianDownSamplePass(renderer, "V", {
|
|
12013
|
+
name: "GaussianDownPassV" + i,
|
|
12014
|
+
viewport: viewport,
|
|
12015
|
+
attachments: [
|
|
12016
|
+
{
|
|
12017
|
+
texture: {
|
|
12018
|
+
format: glContext.RGBA,
|
|
12019
|
+
type: textureType1,
|
|
12020
|
+
minFilter: glContext.LINEAR,
|
|
12021
|
+
magFilter: glContext.LINEAR
|
|
12011
12022
|
}
|
|
12012
|
-
|
|
12013
|
-
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12017
|
-
|
|
12018
|
-
|
|
12019
|
-
|
|
12020
|
-
|
|
12021
|
-
|
|
12022
|
-
|
|
12023
|
-
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
|
|
12027
|
-
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
|
|
12023
|
+
}
|
|
12024
|
+
]
|
|
12025
|
+
});
|
|
12026
|
+
gaussianDownVPass.gaussianResult = gaussianDownResults[i];
|
|
12027
|
+
this.addRenderPass(gaussianDownHPass);
|
|
12028
|
+
this.addRenderPass(gaussianDownVPass);
|
|
12029
|
+
viewport[2] /= 2;
|
|
12030
|
+
viewport[3] /= 2;
|
|
12031
|
+
// TODO 限制最大迭代
|
|
12032
|
+
}
|
|
12033
|
+
viewport[2] *= 4;
|
|
12034
|
+
viewport[3] *= 4;
|
|
12035
|
+
for(var i1 = 0; i1 < gaussianStep - 1; i1++){
|
|
12036
|
+
var gaussianUpPass = new HQGaussianUpSamplePass(renderer, {
|
|
12037
|
+
name: "GaussianUpPass" + i1,
|
|
12038
|
+
viewport: viewport,
|
|
12039
|
+
attachments: [
|
|
12040
|
+
{
|
|
12041
|
+
texture: {
|
|
12042
|
+
format: glContext.RGBA,
|
|
12043
|
+
type: textureType1,
|
|
12044
|
+
minFilter: glContext.LINEAR,
|
|
12045
|
+
magFilter: glContext.LINEAR
|
|
12035
12046
|
}
|
|
12036
|
-
|
|
12037
|
-
|
|
12038
|
-
|
|
12039
|
-
|
|
12040
|
-
|
|
12041
|
-
|
|
12042
|
-
|
|
12043
|
-
}
|
|
12044
|
-
var postProcessPass;
|
|
12045
|
-
if (useBloom) {
|
|
12046
|
-
postProcessPass = new ToneMappingPass(renderer, sceneTextureHandle);
|
|
12047
|
-
} else {
|
|
12048
|
-
postProcessPass = new ToneMappingPass(renderer);
|
|
12047
|
+
}
|
|
12048
|
+
]
|
|
12049
|
+
});
|
|
12050
|
+
gaussianUpPass.gaussianDownSampleResult = gaussianDownResults[gaussianStep - 2 - i1];
|
|
12051
|
+
this.addRenderPass(gaussianUpPass);
|
|
12052
|
+
viewport[2] *= 2;
|
|
12053
|
+
viewport[3] *= 2;
|
|
12049
12054
|
}
|
|
12055
|
+
var postProcessPass = new ToneMappingPass(renderer, sceneTextureHandle);
|
|
12050
12056
|
this.addRenderPass(postProcessPass);
|
|
12051
12057
|
}
|
|
12052
12058
|
this.semantics = new SemanticMap(options.semantics);
|
|
@@ -13083,6 +13089,7 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
13083
13089
|
1
|
|
13084
13090
|
];
|
|
13085
13091
|
/** 是否响应点击和拖拽交互事件 */ _this._interactive = true;
|
|
13092
|
+
_this.hasBeenAddedToComposition = false;
|
|
13086
13093
|
_this.getHitTestParams = function(force) {
|
|
13087
13094
|
if (!_this.clickable) {
|
|
13088
13095
|
return;
|
|
@@ -13101,7 +13108,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
13101
13108
|
}
|
|
13102
13109
|
var _proto = InteractComponent.prototype;
|
|
13103
13110
|
_proto.start = function start() {
|
|
13104
|
-
var _this = this;
|
|
13105
13111
|
var options = this.item.props.content.options;
|
|
13106
13112
|
var env = this.item.engine.renderer.env;
|
|
13107
13113
|
var composition = this.item.composition;
|
|
@@ -13113,10 +13119,6 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
13113
13119
|
this.previewContent = new InteractMesh(this.item.props.content, rendererOptions, this.transform, this.engine);
|
|
13114
13120
|
}
|
|
13115
13121
|
}
|
|
13116
|
-
composition.addInteractiveItem(this.item, options.type);
|
|
13117
|
-
this.item.onEnd = function() {
|
|
13118
|
-
return composition.removeInteractiveItem(_this.item, options.type);
|
|
13119
|
-
};
|
|
13120
13122
|
if (options.type === InteractType.DRAG) {
|
|
13121
13123
|
if (env !== PLAYER_OPTIONS_ENV_EDITOR || options.enableInEditor) {
|
|
13122
13124
|
composition.event && this.beginDragTarget(options, composition.event);
|
|
@@ -13131,6 +13133,11 @@ var InteractComponent = /*#__PURE__*/ function(RendererComponent) {
|
|
|
13131
13133
|
_proto.update = function update(dt) {
|
|
13132
13134
|
var _this_previewContent;
|
|
13133
13135
|
(_this_previewContent = this.previewContent) == null ? void 0 : _this_previewContent.updateMesh();
|
|
13136
|
+
if (!this.hasBeenAddedToComposition && this.item.composition) {
|
|
13137
|
+
var options = this.item.props.content.options;
|
|
13138
|
+
this.item.composition.addInteractiveItem(this.item, options.type);
|
|
13139
|
+
this.hasBeenAddedToComposition = true;
|
|
13140
|
+
}
|
|
13134
13141
|
if (!this.dragEvent || !this.bouncingArg) {
|
|
13135
13142
|
return;
|
|
13136
13143
|
}
|
|
@@ -14854,8 +14861,7 @@ var RectangleEdge = /*#__PURE__*/ function() {
|
|
|
14854
14861
|
}();
|
|
14855
14862
|
var Edge = /*#__PURE__*/ function() {
|
|
14856
14863
|
function Edge(args) {
|
|
14857
|
-
|
|
14858
|
-
this._d = (args.width || 1) / 2;
|
|
14864
|
+
this._d = args.width || 1;
|
|
14859
14865
|
this.arcMode = args.arcMode;
|
|
14860
14866
|
}
|
|
14861
14867
|
var _proto = Edge.prototype;
|
|
@@ -20180,6 +20186,105 @@ function geometryToTriangles(geometry) {
|
|
|
20180
20186
|
return res;
|
|
20181
20187
|
}
|
|
20182
20188
|
|
|
20189
|
+
var PostProcessVolume = /*#__PURE__*/ function(ItemBehaviour) {
|
|
20190
|
+
_inherits(PostProcessVolume, ItemBehaviour);
|
|
20191
|
+
function PostProcessVolume() {
|
|
20192
|
+
var _this;
|
|
20193
|
+
_this = ItemBehaviour.apply(this, arguments) || this;
|
|
20194
|
+
_this.useHDR = true;
|
|
20195
|
+
// Bloom
|
|
20196
|
+
_this.useBloom = true;
|
|
20197
|
+
_this.threshold = 1.0;
|
|
20198
|
+
_this.bloomIntensity = 1.0;
|
|
20199
|
+
// ColorAdjustments
|
|
20200
|
+
_this.brightness = 1.0;
|
|
20201
|
+
_this.saturation = 1.0;
|
|
20202
|
+
_this.contrast = 1.0;
|
|
20203
|
+
// Vignette
|
|
20204
|
+
_this.vignetteIntensity = 0.2;
|
|
20205
|
+
_this.vignetteSmoothness = 0.4;
|
|
20206
|
+
_this.vignetteRoundness = 1.0;
|
|
20207
|
+
// ToneMapping
|
|
20208
|
+
_this.useToneMapping = true // 1: true, 0: false
|
|
20209
|
+
;
|
|
20210
|
+
return _this;
|
|
20211
|
+
}
|
|
20212
|
+
var _proto = PostProcessVolume.prototype;
|
|
20213
|
+
_proto.start = function start() {
|
|
20214
|
+
var composition = this.item.composition;
|
|
20215
|
+
if (composition) {
|
|
20216
|
+
composition.globalVolume = {
|
|
20217
|
+
useHDR: this.useHDR,
|
|
20218
|
+
useBloom: this.useBloom,
|
|
20219
|
+
threshold: this.threshold,
|
|
20220
|
+
bloomIntensity: this.bloomIntensity,
|
|
20221
|
+
brightness: this.brightness,
|
|
20222
|
+
saturation: this.saturation,
|
|
20223
|
+
contrast: this.contrast,
|
|
20224
|
+
vignetteIntensity: this.vignetteIntensity,
|
|
20225
|
+
vignetteSmoothness: this.vignetteSmoothness,
|
|
20226
|
+
vignetteRoundness: this.vignetteRoundness,
|
|
20227
|
+
useToneMapping: this.useToneMapping
|
|
20228
|
+
};
|
|
20229
|
+
composition.createRenderFrame();
|
|
20230
|
+
}
|
|
20231
|
+
};
|
|
20232
|
+
_proto.update = function update(dt) {
|
|
20233
|
+
var composition = this.item.composition;
|
|
20234
|
+
if (composition) {
|
|
20235
|
+
var globalVolume = composition.renderFrame.globalVolume;
|
|
20236
|
+
globalVolume.useHDR = this.useHDR;
|
|
20237
|
+
globalVolume.useBloom = this.useBloom;
|
|
20238
|
+
globalVolume.threshold = this.threshold;
|
|
20239
|
+
globalVolume.bloomIntensity = this.bloomIntensity;
|
|
20240
|
+
globalVolume.brightness = this.brightness;
|
|
20241
|
+
globalVolume.saturation = this.saturation;
|
|
20242
|
+
globalVolume.contrast = this.contrast;
|
|
20243
|
+
globalVolume.vignetteIntensity = this.vignetteIntensity;
|
|
20244
|
+
globalVolume.vignetteSmoothness = this.vignetteSmoothness;
|
|
20245
|
+
globalVolume.vignetteRoundness = this.vignetteRoundness;
|
|
20246
|
+
globalVolume.useToneMapping = this.useToneMapping;
|
|
20247
|
+
}
|
|
20248
|
+
};
|
|
20249
|
+
return PostProcessVolume;
|
|
20250
|
+
}(ItemBehaviour);
|
|
20251
|
+
__decorate([
|
|
20252
|
+
serialize()
|
|
20253
|
+
], PostProcessVolume.prototype, "useHDR", void 0);
|
|
20254
|
+
__decorate([
|
|
20255
|
+
serialize()
|
|
20256
|
+
], PostProcessVolume.prototype, "useBloom", void 0);
|
|
20257
|
+
__decorate([
|
|
20258
|
+
serialize()
|
|
20259
|
+
], PostProcessVolume.prototype, "threshold", void 0);
|
|
20260
|
+
__decorate([
|
|
20261
|
+
serialize()
|
|
20262
|
+
], PostProcessVolume.prototype, "bloomIntensity", void 0);
|
|
20263
|
+
__decorate([
|
|
20264
|
+
serialize()
|
|
20265
|
+
], PostProcessVolume.prototype, "brightness", void 0);
|
|
20266
|
+
__decorate([
|
|
20267
|
+
serialize()
|
|
20268
|
+
], PostProcessVolume.prototype, "saturation", void 0);
|
|
20269
|
+
__decorate([
|
|
20270
|
+
serialize()
|
|
20271
|
+
], PostProcessVolume.prototype, "contrast", void 0);
|
|
20272
|
+
__decorate([
|
|
20273
|
+
serialize()
|
|
20274
|
+
], PostProcessVolume.prototype, "vignetteIntensity", void 0);
|
|
20275
|
+
__decorate([
|
|
20276
|
+
serialize()
|
|
20277
|
+
], PostProcessVolume.prototype, "vignetteSmoothness", void 0);
|
|
20278
|
+
__decorate([
|
|
20279
|
+
serialize()
|
|
20280
|
+
], PostProcessVolume.prototype, "vignetteRoundness", void 0);
|
|
20281
|
+
__decorate([
|
|
20282
|
+
serialize()
|
|
20283
|
+
], PostProcessVolume.prototype, "useToneMapping", void 0);
|
|
20284
|
+
PostProcessVolume = __decorate([
|
|
20285
|
+
effectsClass("PostProcessVolume")
|
|
20286
|
+
], PostProcessVolume);
|
|
20287
|
+
|
|
20183
20288
|
var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
20184
20289
|
_inherits(VFXItem, EffectsObject);
|
|
20185
20290
|
function VFXItem(engine, props) {
|
|
@@ -20403,7 +20508,7 @@ var VFXItem = /*#__PURE__*/ function(EffectsObject) {
|
|
|
20403
20508
|
/**
|
|
20404
20509
|
* 获取元素用于计算光线投射的面片类型和参数
|
|
20405
20510
|
* @override
|
|
20406
|
-
* @param force 元素没有开启交互也返回参数
|
|
20511
|
+
* @param force - 元素没有开启交互也返回参数
|
|
20407
20512
|
*/ _proto.getHitTestParams = function getHitTestParams(force) {
|
|
20408
20513
|
// OVERRIDE
|
|
20409
20514
|
};
|
|
@@ -20653,42 +20758,6 @@ var Item;
|
|
|
20653
20758
|
}
|
|
20654
20759
|
Item.isNull = isNull;
|
|
20655
20760
|
})(Item || (Item = {}));
|
|
20656
|
-
/**
|
|
20657
|
-
* (待废弃) 根据元素的类型创建对应的 `VFXItem` 实例
|
|
20658
|
-
* @param props
|
|
20659
|
-
* @param composition
|
|
20660
|
-
*/ function createVFXItem(props, composition) {
|
|
20661
|
-
var type = props.type;
|
|
20662
|
-
var pluginName = props.pluginName;
|
|
20663
|
-
if (!pluginName) {
|
|
20664
|
-
switch(type){
|
|
20665
|
-
case ItemType.null:
|
|
20666
|
-
pluginName = "cal";
|
|
20667
|
-
break;
|
|
20668
|
-
case ItemType.sprite:
|
|
20669
|
-
pluginName = "sprite";
|
|
20670
|
-
break;
|
|
20671
|
-
case ItemType.particle:
|
|
20672
|
-
pluginName = "particle";
|
|
20673
|
-
break;
|
|
20674
|
-
case ItemType.interact:
|
|
20675
|
-
pluginName = "interact";
|
|
20676
|
-
break;
|
|
20677
|
-
case ItemType.camera:
|
|
20678
|
-
pluginName = "camera";
|
|
20679
|
-
break;
|
|
20680
|
-
case ItemType.text:
|
|
20681
|
-
pluginName = "text";
|
|
20682
|
-
break;
|
|
20683
|
-
case ItemType.tree:
|
|
20684
|
-
pluginName = "tree";
|
|
20685
|
-
break;
|
|
20686
|
-
default:
|
|
20687
|
-
throw new Error("Invalid vfx item type.");
|
|
20688
|
-
}
|
|
20689
|
-
}
|
|
20690
|
-
return composition.pluginSystem.createPluginItem(pluginName, props, composition);
|
|
20691
|
-
}
|
|
20692
20761
|
|
|
20693
20762
|
var pluginLoaderMap = {};
|
|
20694
20763
|
var defaultPlugins = [];
|
|
@@ -20701,6 +20770,9 @@ var pluginCtrlMap = {};
|
|
|
20701
20770
|
* @param isDefault load
|
|
20702
20771
|
*/ // eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
20703
20772
|
function registerPlugin(name, pluginClass, itemClass, isDefault) {
|
|
20773
|
+
if (pluginCtrlMap[name]) {
|
|
20774
|
+
logger.error("Duplicate registration for plugin " + name + ".");
|
|
20775
|
+
}
|
|
20704
20776
|
pluginCtrlMap[name] = itemClass;
|
|
20705
20777
|
pluginLoaderMap[name] = pluginClass;
|
|
20706
20778
|
if (isDefault) {
|
|
@@ -21279,8 +21351,8 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
21279
21351
|
if (this.engine.objectInstance[guid]) {
|
|
21280
21352
|
return this.engine.objectInstance[guid];
|
|
21281
21353
|
}
|
|
21282
|
-
var effectsObject;
|
|
21283
21354
|
var effectsObjectData = this.findData(guid);
|
|
21355
|
+
var effectsObject;
|
|
21284
21356
|
if (!effectsObjectData) {
|
|
21285
21357
|
console.error("Object data with uuid: " + guid + " not found.");
|
|
21286
21358
|
return undefined;
|
|
@@ -21316,7 +21388,7 @@ var SerializationHelper = /*#__PURE__*/ function() {
|
|
|
21316
21388
|
_proto.loadGUIDAsync = function loadGUIDAsync(guid) {
|
|
21317
21389
|
var _this = this;
|
|
21318
21390
|
return _async_to_generator(function() {
|
|
21319
|
-
var
|
|
21391
|
+
var effectsObjectData, effectsObject, classConstructor;
|
|
21320
21392
|
return __generator(this, function(_state) {
|
|
21321
21393
|
switch(_state.label){
|
|
21322
21394
|
case 0:
|
|
@@ -23581,14 +23653,6 @@ var seed$1 = 1;
|
|
|
23581
23653
|
case 0:
|
|
23582
23654
|
// TODO: 后面切换到新的数据版本,就不用掉用 getStandardJSON 做转换了
|
|
23583
23655
|
jsonScene = getStandardJSON(json);
|
|
23584
|
-
// FIXME: hack globalVolume,specification 更新后需移除
|
|
23585
|
-
// @ts-expect-error
|
|
23586
|
-
json.compositions.forEach(function(composition, i) {
|
|
23587
|
-
if (composition.globalVolume) {
|
|
23588
|
-
// @ts-expect-error
|
|
23589
|
-
jsonScene.compositions[i].globalVolume = composition.globalVolume;
|
|
23590
|
-
}
|
|
23591
|
-
});
|
|
23592
23656
|
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins, sceneCompositions = jsonScene.compositions, imgUsage = jsonScene.imgUsage, images = jsonScene.images;
|
|
23593
23657
|
pluginSystem = new PluginSystem(plugins);
|
|
23594
23658
|
return [
|
|
@@ -24376,9 +24440,7 @@ var listOrder = 0;
|
|
|
24376
24440
|
}
|
|
24377
24441
|
var _proto = CompositionSourceManager.prototype;
|
|
24378
24442
|
_proto.getContent = function getContent(composition) {
|
|
24379
|
-
|
|
24380
|
-
// @ts-expect-error
|
|
24381
|
-
var id = composition.id, duration = composition.duration, name = composition.name, endBehavior = composition.endBehavior, camera = composition.camera, globalVolume = composition.globalVolume, _composition_startTime = composition.startTime, startTime = _composition_startTime === void 0 ? 0 : _composition_startTime;
|
|
24443
|
+
var id = composition.id, duration = composition.duration, name = composition.name, endBehavior = composition.endBehavior, camera = composition.camera, _composition_startTime = composition.startTime, startTime = _composition_startTime === void 0 ? 0 : _composition_startTime;
|
|
24382
24444
|
var items = this.assembleItems(composition);
|
|
24383
24445
|
return _extends({}, composition, {
|
|
24384
24446
|
id: id,
|
|
@@ -24388,8 +24450,7 @@ var listOrder = 0;
|
|
|
24388
24450
|
// looping,
|
|
24389
24451
|
items: items,
|
|
24390
24452
|
camera: camera,
|
|
24391
|
-
startTime: startTime
|
|
24392
|
-
globalVolume: globalVolume
|
|
24453
|
+
startTime: startTime
|
|
24393
24454
|
});
|
|
24394
24455
|
};
|
|
24395
24456
|
_proto.assembleItems = function assembleItems(composition) {
|
|
@@ -24551,7 +24612,6 @@ var listOrder = 0;
|
|
|
24551
24612
|
this.rootComposition = this.rootItem.addComponent(CompositionComponent);
|
|
24552
24613
|
this.rootComposition.data = sourceContent;
|
|
24553
24614
|
var imageUsage = !reusable && imgUsage;
|
|
24554
|
-
this.globalVolume = sourceContent.globalVolume;
|
|
24555
24615
|
this.width = width;
|
|
24556
24616
|
this.height = height;
|
|
24557
24617
|
this.renderOrder = baseRenderOrder;
|
|
@@ -26756,7 +26816,10 @@ var FBGeometryDataT = /*#__PURE__*/ function() {
|
|
|
26756
26816
|
return FBGeometryDataT;
|
|
26757
26817
|
}();
|
|
26758
26818
|
|
|
26759
|
-
|
|
26819
|
+
/**
|
|
26820
|
+
* @since 2.0.0
|
|
26821
|
+
* @internal
|
|
26822
|
+
*/ var EffectsPackage = /*#__PURE__*/ function() {
|
|
26760
26823
|
function EffectsPackage() {
|
|
26761
26824
|
this.exportObjectDatas = [];
|
|
26762
26825
|
}
|
|
@@ -26781,8 +26844,7 @@ var EffectsPackage = /*#__PURE__*/ function() {
|
|
|
26781
26844
|
}
|
|
26782
26845
|
effectsPackage.exportObjects = exportObjects;
|
|
26783
26846
|
FBEffectsPackageData.finishFBEffectsPackageDataBuffer(fbb, effectsPackage.pack(fbb));
|
|
26784
|
-
|
|
26785
|
-
return buffer;
|
|
26847
|
+
return fbb.asUint8Array(); // Of type `Uint8Array`.
|
|
26786
26848
|
};
|
|
26787
26849
|
_proto.deserializeFromBinary = function deserializeFromBinary(buffer) {
|
|
26788
26850
|
var buf = new ByteBuffer(buffer);
|
|
@@ -26810,37 +26872,35 @@ var EffectsPackage = /*#__PURE__*/ function() {
|
|
|
26810
26872
|
_proto.geometryDataToBinary = function geometryDataToBinary(geometryData) {
|
|
26811
26873
|
var fbb = new Builder(1);
|
|
26812
26874
|
var fbGeometryData = new FBGeometryDataT();
|
|
26813
|
-
|
|
26814
|
-
fbGeometryData.
|
|
26815
|
-
fbGeometryData.
|
|
26816
|
-
fbGeometryData.
|
|
26817
|
-
|
|
26818
|
-
fbGeometryData.boneNames =
|
|
26819
|
-
|
|
26820
|
-
fbGeometryData.
|
|
26821
|
-
|
|
26822
|
-
fbGeometryData.inverseBindMatrices = (_geometryData_inverseBindMatrices = geometryData.inverseBindMatrices) != null ? _geometryData_inverseBindMatrices : [];
|
|
26823
|
-
var _geometryData_binaryData;
|
|
26824
|
-
fbGeometryData.binaryData = (_geometryData_binaryData = geometryData.binaryData) != null ? _geometryData_binaryData : [];
|
|
26875
|
+
var indexFormat = geometryData.indexFormat, indexOffset = geometryData.indexOffset, mode = geometryData.mode, id = geometryData.id, vertexData = geometryData.vertexData, _geometryData_boneNames = geometryData.boneNames, boneNames = _geometryData_boneNames === void 0 ? [] : _geometryData_boneNames, _geometryData_rootBoneName = geometryData.rootBoneName, rootBoneName = _geometryData_rootBoneName === void 0 ? "" : _geometryData_rootBoneName, _geometryData_inverseBindMatrices = geometryData.inverseBindMatrices, inverseBindMatrices = _geometryData_inverseBindMatrices === void 0 ? [] : _geometryData_inverseBindMatrices, _geometryData_binaryData = geometryData.binaryData, binaryData = _geometryData_binaryData === void 0 ? [] : _geometryData_binaryData;
|
|
26876
|
+
fbGeometryData.indexFormat = indexFormat;
|
|
26877
|
+
fbGeometryData.indexOffset = indexOffset;
|
|
26878
|
+
fbGeometryData.mode = mode;
|
|
26879
|
+
fbGeometryData.id = id;
|
|
26880
|
+
fbGeometryData.boneNames = boneNames;
|
|
26881
|
+
fbGeometryData.rootBoneName = rootBoneName;
|
|
26882
|
+
fbGeometryData.inverseBindMatrices = inverseBindMatrices;
|
|
26883
|
+
fbGeometryData.binaryData = binaryData;
|
|
26825
26884
|
var fbVertexdata = new FBVertexDataT();
|
|
26826
|
-
fbVertexdata.vertexCount =
|
|
26885
|
+
fbVertexdata.vertexCount = vertexData.vertexCount;
|
|
26827
26886
|
fbVertexdata.channels = [];
|
|
26828
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(
|
|
26887
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(vertexData.channels), _step; !(_step = _iterator()).done;){
|
|
26829
26888
|
var channel = _step.value;
|
|
26830
|
-
var
|
|
26889
|
+
var semantic = channel.semantic, offset = channel.offset, format = channel.format, dimension = channel.dimension, normalize = channel.normalize;
|
|
26890
|
+
var fbChannel = new FBVertexChannelT(semantic, offset, format, dimension, normalize);
|
|
26831
26891
|
fbVertexdata.channels.push(fbChannel);
|
|
26832
26892
|
}
|
|
26833
26893
|
fbGeometryData.vertexData = fbVertexdata;
|
|
26834
26894
|
var fbSubMeshes = [];
|
|
26835
26895
|
for(var _iterator1 = _create_for_of_iterator_helper_loose(geometryData.subMeshes), _step1; !(_step1 = _iterator1()).done;){
|
|
26836
26896
|
var subMesh = _step1.value;
|
|
26837
|
-
var
|
|
26897
|
+
var offset1 = subMesh.offset, indexCount = subMesh.indexCount, vertexCount = subMesh.vertexCount;
|
|
26898
|
+
var fbSubMesh = new FBSubMeshT(offset1, indexCount, vertexCount);
|
|
26838
26899
|
fbSubMeshes.push(fbSubMesh);
|
|
26839
26900
|
}
|
|
26840
26901
|
fbGeometryData.subMeshes = fbSubMeshes;
|
|
26841
26902
|
FBEffectsPackageData.finishFBEffectsPackageDataBuffer(fbb, fbGeometryData.pack(fbb));
|
|
26842
|
-
|
|
26843
|
-
return buffer;
|
|
26903
|
+
return fbb.asUint8Array(); // Of type `Uint8Array`.
|
|
26844
26904
|
};
|
|
26845
26905
|
_proto.binaryToGeometryData = function binaryToGeometryData(buffer) {
|
|
26846
26906
|
var buf = new ByteBuffer(buffer);
|
|
@@ -26862,7 +26922,8 @@ var EffectsPackage = /*#__PURE__*/ function() {
|
|
|
26862
26922
|
semantic: (_channel_semantic = channel.semantic()) != null ? _channel_semantic : "",
|
|
26863
26923
|
offset: channel.offset(),
|
|
26864
26924
|
format: channel.format(),
|
|
26865
|
-
dimension: channel.dimension()
|
|
26925
|
+
dimension: channel.dimension(),
|
|
26926
|
+
normalize: channel.normalize()
|
|
26866
26927
|
};
|
|
26867
26928
|
vertexData.channels.push(vertexChannel);
|
|
26868
26929
|
}
|
|
@@ -26875,7 +26936,8 @@ var EffectsPackage = /*#__PURE__*/ function() {
|
|
|
26875
26936
|
}
|
|
26876
26937
|
var subMesh = {
|
|
26877
26938
|
offset: fbSubMesh.offset(),
|
|
26878
|
-
vertexCount: fbSubMesh.vertexCount()
|
|
26939
|
+
vertexCount: fbSubMesh.vertexCount(),
|
|
26940
|
+
indexCount: fbSubMesh.indexCount()
|
|
26879
26941
|
};
|
|
26880
26942
|
subMeshes.push(subMesh);
|
|
26881
26943
|
}
|
|
@@ -27304,7 +27366,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
27304
27366
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
27305
27367
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
27306
27368
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
27307
|
-
var version$1 = "2.0.0-alpha.
|
|
27369
|
+
var version$1 = "2.0.0-alpha.28";
|
|
27308
27370
|
logger.info("Core version: " + version$1 + ".");
|
|
27309
27371
|
|
|
27310
27372
|
var _obj;
|
|
@@ -28937,8 +28999,8 @@ setMaxSpriteMeshItemCount(8);
|
|
|
28937
28999
|
*/ Mesh.create = function(engine, props) {
|
|
28938
29000
|
return new ThreeMesh(engine, props);
|
|
28939
29001
|
};
|
|
28940
|
-
var version = "2.0.0-alpha.
|
|
29002
|
+
var version = "2.0.0-alpha.28";
|
|
28941
29003
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
28942
29004
|
|
|
28943
|
-
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventSystem, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMacros, createShape,
|
|
29005
|
+
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, AssetLoader, AssetManager, BYTES_TYPE_MAP, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, CONSTANT_MAP_BLEND, CONSTANT_MAP_DEPTH, CONSTANT_MAP_STENCIL_FUNC, CONSTANT_MAP_STENCIL_OP, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, Database, DestroyOptions, Downloader, EFFECTS_COPY_MESH_NAME, EVENT_TYPE_CLICK, EVENT_TYPE_TOUCH_END, EVENT_TYPE_TOUCH_MOVE, EVENT_TYPE_TOUCH_START, EffectComponent, EffectsObject, EffectsPackage, Engine, EventSystem, FilterMode, Float16ArrayWrapper, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, ItemBehaviour, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, Mesh, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, RENDER_PASS_NAME_PREFIX, RENDER_PREFER_LOOKUP_TEXTURE, RUNTIME_ENV, RandomSetValue, RandomValue, RandomVectorValue, RenderFrame, RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, RenderTargetHandle, RenderTextureFormat, Renderbuffer, Renderer, RendererComponent, RuntimeClip, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_0, SEMANTIC_MAIN_PRE_COLOR_ATTACHMENT_SIZE_0, SEMANTIC_PRE_COLOR_ATTACHMENT_0, SEMANTIC_PRE_COLOR_ATTACHMENT_SIZE_0, SPRITE_VERTEX_STRIDE, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderType, ShaderVariant, SpriteColorPlayable, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TEXTURE_UNIFORM_MAP, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, ThreeComposition, ThreeDisplayObject, ThreeEngine, ThreeMaterial, ThreeSpriteComponent, ThreeTextComponent, ThreeTexture, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, compatible_frag as compatibleFrag, compatible_vert as compatibleVert, createCopyShader, createGLContext, createKeyFrameMeta, createShaderWithMacros, createShape, createValueGetter, decimalEqual, defaultGlobalVolume, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, getDefaultTemplateCanvasPool, getDefaultTextureFactory, getGeometryByShape, getGeometryTriangles, getImageItemRenderInfo, getKTXTextureOptions, getKeyFrameMetaByRawValue, getMergedStore, getParticleMeshShader, getPixelRatio, getPreMultiAlpha, getStandardComposition, getStandardImage, getStandardItem, getStandardJSON, getTextureSize, glContext, glType2VertexFormatType, gpuTimer, imageDataFromColor, imageDataFromGradient, initErrors, initGLContext, integrate, interpolateColor, isAlipayMiniApp, isAndroid, isArray, isCanvas, isFunction, isIOS, isIOSByUA, isMiniProgram, isObject, isSceneJSON, isSceneURL, isSceneWithOptions, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadBinary, loadBlob, loadImage, loadMedia, loadVideo, loadWebPOptional, logger, index as math, maxSpriteMeshItemCount, modifyMaxKeyframeShader, nearestPowerOfTwo, noop, normalizeColor, numberToFix, parsePercent$1 as parsePercent, particleFrag, particleOriginTranslateMap$1 as particleOriginTranslateMap, particleUniformTypeMap, particleVert, pluginLoaderMap, pointOnLine, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, setUniformValue, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecAssign, vecFill, vecMulCombine, vecNormalize, version, vertexFormatType2GLType };
|
|
28944
29006
|
//# sourceMappingURL=index.mjs.map
|