@galacean/effects-threejs 2.4.1-alpha.0 → 2.4.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/index.js +26 -15
- 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 +26 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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.4.1
|
|
6
|
+
* Version: v2.4.1
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import * as THREE from 'three';
|
|
@@ -867,7 +867,7 @@ function unregisterPlugin(name) {
|
|
|
867
867
|
removeItem(defaultPlugins, name);
|
|
868
868
|
}
|
|
869
869
|
var PluginSystem = /*#__PURE__*/ function() {
|
|
870
|
-
function PluginSystem() {
|
|
870
|
+
function PluginSystem(pluginNames) {
|
|
871
871
|
var loaders = {};
|
|
872
872
|
var loaded = [];
|
|
873
873
|
var addLoader = function(name) {
|
|
@@ -878,12 +878,15 @@ var PluginSystem = /*#__PURE__*/ function() {
|
|
|
878
878
|
}
|
|
879
879
|
};
|
|
880
880
|
defaultPlugins.forEach(addLoader);
|
|
881
|
-
|
|
882
|
-
var
|
|
883
|
-
if (!
|
|
884
|
-
throw new Error("The plugin '" +
|
|
881
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(pluginNames), _step; !(_step = _iterator()).done;){
|
|
882
|
+
var customPluginName = _step.value;
|
|
883
|
+
if (!pluginLoaderMap[customPluginName]) {
|
|
884
|
+
throw new Error("The plugin '" + customPluginName + "' not found." + getPluginUsageInfo(customPluginName));
|
|
885
885
|
}
|
|
886
|
-
|
|
886
|
+
}
|
|
887
|
+
this.plugins = Object.keys(loaders).map(function(name) {
|
|
888
|
+
var pluginConstructor = pluginLoaderMap[name];
|
|
889
|
+
var loader = new pluginConstructor();
|
|
887
890
|
loader.name = name;
|
|
888
891
|
return loader;
|
|
889
892
|
}).sort(function(a, b) {
|
|
@@ -7622,6 +7625,7 @@ var MaterialRenderType;
|
|
|
7622
7625
|
var MaskProcessor = /*#__PURE__*/ function() {
|
|
7623
7626
|
function MaskProcessor(engine) {
|
|
7624
7627
|
this.engine = engine;
|
|
7628
|
+
this.maskable = null;
|
|
7625
7629
|
this.stencilClearAction = {
|
|
7626
7630
|
stencilAction: TextureLoadAction.clear
|
|
7627
7631
|
};
|
|
@@ -7638,15 +7642,18 @@ var MaskProcessor = /*#__PURE__*/ function() {
|
|
|
7638
7642
|
maskMode = MaskMode.MASK;
|
|
7639
7643
|
} else if (mode === ObscuredMode.OBSCURED || mode === ObscuredMode.REVERSE_OBSCURED) {
|
|
7640
7644
|
maskMode = mode === ObscuredMode.OBSCURED ? MaskMode.OBSCURED : MaskMode.REVERSE_OBSCURED;
|
|
7641
|
-
|
|
7645
|
+
if (ref) {
|
|
7646
|
+
this.maskable = ref;
|
|
7647
|
+
}
|
|
7642
7648
|
}
|
|
7643
7649
|
}
|
|
7644
7650
|
return maskMode;
|
|
7645
7651
|
};
|
|
7646
7652
|
_proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7653
|
+
if (this.maskable) {
|
|
7654
|
+
renderer.clear(this.stencilClearAction);
|
|
7655
|
+
this.maskable.drawStencilMask(renderer);
|
|
7656
|
+
}
|
|
7650
7657
|
};
|
|
7651
7658
|
return MaskProcessor;
|
|
7652
7659
|
}();
|
|
@@ -12560,6 +12567,9 @@ function getBezier2DValue(out, t, p0, p1, cpx0, cpy0, cpx1, cpy1) {
|
|
|
12560
12567
|
/**
|
|
12561
12568
|
* @internal
|
|
12562
12569
|
*/ _proto.drawStencilMask = function drawStencilMask(renderer) {
|
|
12570
|
+
if (!this.isActiveAndEnabled) {
|
|
12571
|
+
return;
|
|
12572
|
+
}
|
|
12563
12573
|
var previousColorMask = this.material.colorMask;
|
|
12564
12574
|
this.material.colorMask = false;
|
|
12565
12575
|
this.draw(renderer);
|
|
@@ -29068,12 +29078,13 @@ var seed$1 = 1;
|
|
|
29068
29078
|
_proto.processJSON = function processJSON(json) {
|
|
29069
29079
|
var _this = this;
|
|
29070
29080
|
return _async_to_generator(function() {
|
|
29071
|
-
var jsonScene, pluginSystem;
|
|
29081
|
+
var jsonScene, _jsonScene_plugins, plugins, pluginSystem;
|
|
29072
29082
|
return __generator(this, function(_state) {
|
|
29073
29083
|
switch(_state.label){
|
|
29074
29084
|
case 0:
|
|
29075
29085
|
jsonScene = getStandardJSON(json);
|
|
29076
|
-
|
|
29086
|
+
_jsonScene_plugins = jsonScene.plugins, plugins = _jsonScene_plugins === void 0 ? [] : _jsonScene_plugins;
|
|
29087
|
+
pluginSystem = new PluginSystem(plugins);
|
|
29077
29088
|
return [
|
|
29078
29089
|
4,
|
|
29079
29090
|
pluginSystem.processRawJSON(jsonScene, _this.options)
|
|
@@ -31624,7 +31635,7 @@ registerPlugin("sprite", SpriteLoader, VFXItem);
|
|
|
31624
31635
|
registerPlugin("particle", ParticleLoader, VFXItem);
|
|
31625
31636
|
registerPlugin("cal", CalculateLoader, VFXItem);
|
|
31626
31637
|
registerPlugin("interact", InteractLoader, VFXItem);
|
|
31627
|
-
var version$1 = "2.4.1
|
|
31638
|
+
var version$1 = "2.4.1";
|
|
31628
31639
|
logger.info("Core version: " + version$1 + ".");
|
|
31629
31640
|
|
|
31630
31641
|
var _obj;
|
|
@@ -33226,7 +33237,7 @@ setMaxSpriteMeshItemCount(8);
|
|
|
33226
33237
|
*/ Mesh.create = function(engine, props) {
|
|
33227
33238
|
return new ThreeMesh(engine, props);
|
|
33228
33239
|
};
|
|
33229
|
-
var version = "2.4.1
|
|
33240
|
+
var version = "2.4.1";
|
|
33230
33241
|
logger.info("THREEJS plugin version: " + version + ".");
|
|
33231
33242
|
|
|
33232
33243
|
export { AbstractPlugin, ActivationPlayable, ActivationPlayableAsset, ActivationTrack, AnimationClip, AnimationClipPlayable, Asset, AssetLoader, AssetManager, AssetService, BYTES_TYPE_MAP, BaseRenderComponent, 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, ColorCurve, ColorPropertyPlayableAsset, ColorPropertyTrack, Component, Composition, CompositionComponent, 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, Ellipse, Engine, EventEmitter, EventSystem, Fake3DAnimationMode, Fake3DComponent, FilterMode, Float16ArrayWrapper, FloatPropertyPlayableAsset, FloatPropertyTrack, Framebuffer, GLSLVersion, GPUCapability, Geometry, GlobalUniforms, GradientValue, GraphicsPath, HELP_LINK, HitTestType, InteractComponent, InteractLoader, InteractMesh, Item, KTXTexture, LineSegments, LinearValue, MaskMode, MaskProcessor, Material, MaterialDataBlock, MaterialRenderType, MaterialTrack, Mesh, MeshCollider, ObjectBindingTrack, OrderType, PLAYER_OPTIONS_ENV_EDITOR, POST_PROCESS_SETTINGS, ParticleBehaviourPlayable, ParticleBehaviourPlayableAsset, ParticleLoader, ParticleMesh, ParticleSystem, ParticleSystemRenderer, ParticleTrack, PassTextureCache, PathSegments, PluginSystem, PolyStar, Polygon, 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, ShapePath, SpriteColorPlayableAsset, SpriteColorTrack, SpriteComponent, SpriteLoader, StarType, 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, Vector2Curve, Vector2PropertyPlayableAsset, Vector2PropertyTrack, Vector4Curve, Vector4PropertyPlayableAsset, Vector4PropertyTrack, addByOrder, addItem, addItemWithOrder, applyMixins, assertExist, asserts, base64ToFile, blend, buildLine, calculateTranslation, canvasPool, closePointEps, colorGradingFrag, colorStopsFromGradient, colorToArr$1 as colorToArr, combineImageTemplate, createCopyShader, createGLContext, createKeyFrameMeta, createShape, createValueGetter, curveEps, 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, 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, itemFrame_frag as 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, setUniformValue, sortByOrder, index$1 as spec, thresholdFrag, throwDestroyedError, trailVert, translatePoint, trianglesFromRect, unregisterPlugin, valIfUndefined, value, valueDefine, vecFill, vecMulCombine, version, vertexFormatType2GLType };
|