@galacean/effects-core 2.1.3-alpha.4 → 2.1.4
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 +36 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Description: Galacean Effects runtime core for the web
|
|
4
4
|
* Author: Ant Group CO., Ltd.
|
|
5
5
|
* Contributors: 燃然,飂兮,十弦,云垣,茂安,意绮
|
|
6
|
-
* Version: v2.1.
|
|
6
|
+
* Version: v2.1.4
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -10145,7 +10145,7 @@ var integrate = "float calculateMovement(float t,vec2 p1,vec2 p2,vec2 p3,vec2 p4
|
|
|
10145
10145
|
|
|
10146
10146
|
var itemVert = "precision highp float;attribute vec2 atlasOffset;attribute vec3 aPos;varying vec2 vTexCoord;varying vec3 vParams;varying vec4 vColor;uniform vec2 _Size;uniform vec3 _Scale;uniform vec4 _Color;uniform vec4 _TexParams;uniform vec4 _TexOffset;uniform mat4 effects_MatrixVP;uniform mat4 effects_ObjectToWorld;uniform mat4 effects_MatrixV;\n#ifdef ENV_EDITOR\nuniform vec4 uEditorTransform;\n#endif\nvoid main(){vec4 texParams=_TexParams;vTexCoord=vec2(atlasOffset.xy*_TexOffset.zw+_TexOffset.xy);vColor=_Color;vParams=vec3(0.0,texParams.y,texParams.x);if(texParams.z==1.0){vec4 pos=vec4(aPos.xy*_Size,aPos.z,1.0);gl_Position=effects_MatrixVP*effects_ObjectToWorld*pos;}else{mat4 view=effects_MatrixV;vec3 camRight=vec3(view[0][0],view[1][0],view[2][0]);vec3 camUp=vec3(view[0][1],view[1][1],view[2][1]);vec3 worldPosition=vec3(effects_ObjectToWorld*vec4(0.0,0.0,0.0,1.0));vec3 vertexPosition=worldPosition+camRight*aPos.x*_Size.x*_Scale.x+camUp*aPos.y*_Size.y*_Scale.y;gl_Position=effects_MatrixVP*vec4(vertexPosition,1.0);}\n#ifdef ENV_EDITOR\ngl_Position=vec4(gl_Position.xy*uEditorTransform.xy+uEditorTransform.zw*gl_Position.w,gl_Position.zw);\n#endif\n}";
|
|
10147
10147
|
|
|
10148
|
-
var itemFrag = "precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D _MainTex;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);vec4 texColor=texture2D(_MainTex,vTexCoord.xy);color=blendColor(texColor,vColor,floor(0.5+vParams.y))
|
|
10148
|
+
var itemFrag = "precision highp float;varying vec4 vColor;varying vec2 vTexCoord;varying vec3 vParams;uniform sampler2D _MainTex;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}void main(){vec4 color=vec4(0.);vec4 texColor=texture2D(_MainTex,vTexCoord.xy);color=blendColor(texColor,vColor,floor(0.5+vParams.y));\n#ifdef ALPHA_CLIP\nif(vParams.z==0.&&color.a<0.04){discard;}\n#endif\ncolor.a=clamp(color.a,0.0,1.0);gl_FragColor=color;}";
|
|
10149
10149
|
|
|
10150
10150
|
var particleFrag = "#version 100\nprecision mediump float;vec4 blendColor(vec4 color,vec4 vc,float mode){vec4 ret=color*vc;float alpha=ret.a;if(mode==1.){ret.rgb*=alpha;}else if(mode==2.){ret.rgb*=alpha;ret.a=dot(ret.rgb,vec3(0.33333333));}else if(mode==3.){alpha=color.r*alpha;ret=vec4(vc.rgb*alpha,alpha);}return ret;}\n#define PATICLE_SHADER 1\nvarying float vLife;varying vec2 vTexCoord;varying vec4 vColor;uniform vec3 emissionColor;uniform float emissionIntensity;uniform sampler2D uMaskTex;uniform vec4 uColorParams;uniform vec2 uTexOffset;\n#ifdef COLOR_OVER_LIFETIME\nuniform sampler2D uColorOverLifetime;\n#endif\n#ifdef USE_SPRITE\nvarying vec4 vTexCoordBlend;\n#endif\nvarying float vSeed;\n#ifdef PREVIEW_BORDER\nuniform vec4 uPreviewColor;\n#endif\n#ifdef USE_SPRITE\nvec4 getTextureColor(sampler2D tex,vec2 texCoord){if(vTexCoordBlend.w>0.){return mix(texture2D(tex,texCoord),texture2D(tex,vTexCoordBlend.xy+texCoord),vTexCoordBlend.z);}return texture2D(tex,texCoord);}\n#else\n#define getTextureColor texture2D\n#endif\n#ifndef WEBGL2\n#define round(a) floor(0.5+a)\n#endif\n#ifdef PREVIEW_BORDER\nvoid main(){gl_FragColor=uPreviewColor;}\n#else\nvoid main(){vec4 color=vec4(1.0);vec4 tempColor=vColor;vec2 texOffset=uTexOffset;if(vLife<0.){discard;}if(uColorParams.x>0.0){color=getTextureColor(uMaskTex,vTexCoord);}\n#ifdef COLOR_OVER_LIFETIME\n#ifndef ENABLE_VERTEX_TEXTURE\ntempColor*=texture2D(uColorOverLifetime,vec2(vLife,0.));\n#endif\n#endif\ncolor=blendColor(color,tempColor,round(uColorParams.y));if(color.a<=0.01&&uColorParams.w>0.){float _at=texture2D(uMaskTex,vTexCoord+texOffset).a+texture2D(uMaskTex,vTexCoord+texOffset*-1.).a;if(_at<=0.02){discard;}}vec3 emission=emissionColor*pow(2.0,emissionIntensity);color=vec4(pow(pow(color.rgb,vec3(2.2))+emission,vec3(1.0/2.2)),color.a);gl_FragColor=color;}\n#endif\n";
|
|
10151
10151
|
|
|
@@ -13344,6 +13344,11 @@ var ColorCurve = /*#__PURE__*/ function(ValueGetter) {
|
|
|
13344
13344
|
texParams.x = renderer.occlusion ? +renderer.transparentOcclusion : 1;
|
|
13345
13345
|
texParams.y = +this.preMultiAlpha;
|
|
13346
13346
|
texParams.z = renderer.renderMode;
|
|
13347
|
+
if (texParams.x === 0) {
|
|
13348
|
+
this.material.enableMacro("ALPHA_CLIP");
|
|
13349
|
+
} else {
|
|
13350
|
+
this.material.disableMacro("ALPHA_CLIP");
|
|
13351
|
+
}
|
|
13347
13352
|
}
|
|
13348
13353
|
var attributes = {
|
|
13349
13354
|
atlasOffset: new Float32Array(data.atlasOffset.length),
|
|
@@ -16935,9 +16940,9 @@ function spriteMeshShaderFromRenderInfo(renderInfo, count, level, env) {
|
|
|
16935
16940
|
env: env
|
|
16936
16941
|
});
|
|
16937
16942
|
shader.shared = true;
|
|
16938
|
-
if (!wireframe) {
|
|
16939
|
-
|
|
16940
|
-
}
|
|
16943
|
+
// if (!wireframe) {
|
|
16944
|
+
// shader.cacheId = spriteMeshShaderIdFromRenderInfo(renderInfo, count);
|
|
16945
|
+
// }
|
|
16941
16946
|
return shader;
|
|
16942
16947
|
}
|
|
16943
16948
|
// TODO: 只有单测用
|
|
@@ -22190,7 +22195,7 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
22190
22195
|
var rotation = aRot;
|
|
22191
22196
|
if (!this.rotationOverLifetime) {
|
|
22192
22197
|
aRotationMatrix.setZero();
|
|
22193
|
-
} else
|
|
22198
|
+
} else {
|
|
22194
22199
|
// Adjust rotation based on the specified lifetime components
|
|
22195
22200
|
if (this.rotationOverLifetime.x) {
|
|
22196
22201
|
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
@@ -22213,30 +22218,31 @@ var ParticleMesh = /*#__PURE__*/ function() {
|
|
|
22213
22218
|
rotation.z += this.rotationOverLifetime.z.getValue(life);
|
|
22214
22219
|
}
|
|
22215
22220
|
}
|
|
22216
|
-
} else {
|
|
22217
|
-
// Adjust rotation based on the specified lifetime components
|
|
22218
|
-
if (this.rotationOverLifetime.x) {
|
|
22219
|
-
if (_instanceof1(this.rotationOverLifetime.x, RandomValue)) {
|
|
22220
|
-
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
22221
|
-
} else {
|
|
22222
|
-
rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, duration) * duration;
|
|
22223
|
-
}
|
|
22224
|
-
}
|
|
22225
|
-
if (this.rotationOverLifetime.y) {
|
|
22226
|
-
if (_instanceof1(this.rotationOverLifetime.y, RandomValue)) {
|
|
22227
|
-
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
22228
|
-
} else {
|
|
22229
|
-
rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, duration) * duration;
|
|
22230
|
-
}
|
|
22231
|
-
}
|
|
22232
|
-
if (this.rotationOverLifetime.z) {
|
|
22233
|
-
if (_instanceof1(this.rotationOverLifetime.z, RandomValue)) {
|
|
22234
|
-
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
22235
|
-
} else {
|
|
22236
|
-
rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, duration) * duration;
|
|
22237
|
-
}
|
|
22238
|
-
}
|
|
22239
22221
|
}
|
|
22222
|
+
// else {
|
|
22223
|
+
// // Adjust rotation based on the specified lifetime components
|
|
22224
|
+
// if (this.rotationOverLifetime.x) {
|
|
22225
|
+
// if (this.rotationOverLifetime.x instanceof RandomValue) {
|
|
22226
|
+
// rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
22227
|
+
// } else {
|
|
22228
|
+
// rotation.x += this.rotationOverLifetime.x.getIntegrateValue(0.0, life, duration) * duration;
|
|
22229
|
+
// }
|
|
22230
|
+
// }
|
|
22231
|
+
// if (this.rotationOverLifetime.y) {
|
|
22232
|
+
// if (this.rotationOverLifetime.y instanceof RandomValue) {
|
|
22233
|
+
// rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
22234
|
+
// } else {
|
|
22235
|
+
// rotation.y += this.rotationOverLifetime.y.getIntegrateValue(0.0, life, duration) * duration;
|
|
22236
|
+
// }
|
|
22237
|
+
// }
|
|
22238
|
+
// if (this.rotationOverLifetime.z) {
|
|
22239
|
+
// if (this.rotationOverLifetime.z instanceof RandomValue) {
|
|
22240
|
+
// rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, aSeed) * duration;
|
|
22241
|
+
// } else {
|
|
22242
|
+
// rotation.z += this.rotationOverLifetime.z.getIntegrateValue(0.0, life, duration) * duration;
|
|
22243
|
+
// }
|
|
22244
|
+
// }
|
|
22245
|
+
// }
|
|
22240
22246
|
// If the rotation vector is zero, return the identity matrix
|
|
22241
22247
|
if (rotation.dot(rotation) === 0.0) {
|
|
22242
22248
|
aRotationMatrix.identity();
|
|
@@ -31375,7 +31381,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem, true);
|
|
|
31375
31381
|
registerPlugin("particle", ParticleLoader, VFXItem, true);
|
|
31376
31382
|
registerPlugin("cal", CalculateLoader, VFXItem, true);
|
|
31377
31383
|
registerPlugin("interact", InteractLoader, VFXItem, true);
|
|
31378
|
-
var version = "2.1.
|
|
31384
|
+
var version = "2.1.4";
|
|
31379
31385
|
logger.info("Core version: " + version + ".");
|
|
31380
31386
|
|
|
31381
31387
|
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, BYTES_TYPE_MAP, BaseRenderComponent, Behaviour, BezierCurve, BezierCurvePath, BezierCurveQuat, BinaryAsset, COMPRESSED_TEXTURE, COPY_FRAGMENT_SHADER, COPY_MESH_SHADER_ID, COPY_VERTEX_SHADER, CalculateLoader, Camera, CameraController, CameraVFXItemLoader, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, CompositionSourceManager, DEFAULT_FONTS, DEFAULT_FPS, 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, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, PassTextureCache, PathSegments, PluginSystem, PostProcessVolume, PropertyTrack, 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, Scene, SemanticMap, SerializationHelper, Shader, ShaderCompileResultStatus, ShaderFactory, ShaderType, ShaderVariant, ShapeComponent, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StaticValue, SubCompositionPlayableAsset, SubCompositionTrack, TEMPLATE_USE_OFFSCREEN_CANVAS, TextComponent, TextComponentBase, TextLayout, TextLoader, TextStyle, Texture, TextureFactory, TextureLoadAction, TextureSourceType, TextureStoreAction, Ticker, TimelineAsset, TimelineClip, TimelinePlayable, TrackAsset, TrackSortWrapper, TrackType, Transform, TransformAnimationPlayable, TransformPlayableAsset, TransformTrack, VFXItem, ValueGetter, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, calculateTranslation, canvasPool, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, decimalEqual, defaultPlugins, deserializeMipmapTexture, earcut, effectsClass, effectsClassStore, enlargeBuffer, ensureFixedNumber, ensureVec3, findPreviousRenderPass, gaussianDown_frag as gaussianDownFrag, gaussianDownHFrag, gaussianDownVFrag, gaussianUpFrag, generateEmptyTypedArray, generateGUID, generateHalfFloatTexture, generateTransparentTexture, generateWhiteTexture, getBackgroundImage, getColorFromGradientStops, getConfig, 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, isSimulatorCellPhone, isString, isUniformStruct, isUniformStructArray, isValidFontFamily, isWebGL2, isWechatMiniApp, itemFrag, itemFrameFrag, itemVert, loadAVIFOptional, 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, passRenderLevel, pluginLoaderMap, randomInRange, registerPlugin, removeItem, rotateVec2, screenMeshVert, serialize, setBlendMode, setConfig, setDefaultTextureFactory, setMaskMode, setMaxSpriteMeshItemCount, setRayFromCamera, setSideMode, setSpriteMeshMaxItemCountByGPU, sortByOrder, index$1 as spec, spriteMeshShaderFromFilter, spriteMeshShaderFromRenderInfo, spriteMeshShaderIdFromRenderInfo, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|