@galacean/effects-specification 2.0.1 → 2.1.0-alpha.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/es/assets.d.ts +95 -0
- package/es/assets.js +18 -0
- package/es/buitin-object-guid.d.ts +1 -0
- package/es/buitin-object-guid.js +1 -0
- package/es/components.d.ts +7 -5
- package/es/components.js +7 -0
- package/es/composition.d.ts +0 -4
- package/es/curve-data/color-curve-data.d.ts +7 -0
- package/es/curve-data/color-curve-data.js +1 -0
- package/es/curve-data/index.d.ts +2 -0
- package/es/curve-data/index.js +2 -0
- package/es/curve-data/vector4-curve-data.d.ts +7 -0
- package/es/curve-data/vector4-curve-data.js +1 -0
- package/es/index.d.ts +6 -1
- package/es/index.js +6 -1
- package/es/item/audio-item.d.ts +46 -0
- package/es/item/audio-item.js +1 -0
- package/es/item/effect-item.d.ts +6 -0
- package/es/item/particle-item.d.ts +2 -2
- package/es/item/spine-item.d.ts +4 -0
- package/es/item/video-item.d.ts +82 -0
- package/es/item/video-item.js +1 -0
- package/es/item.d.ts +3 -1
- package/es/number-expression.d.ts +9 -1
- package/es/number-expression.js +8 -0
- package/es/render-settings.d.ts +4 -0
- package/es/render-settings.js +1 -0
- package/es/scene.d.ts +23 -6
- package/es/texture.d.ts +45 -0
- package/es/texture.js +1 -0
- package/es/type.d.ts +12 -15
- package/es/type.js +8 -0
- package/package.json +1 -1
- package/es/image.d.ts +0 -123
- package/es/image.js +0 -9
package/es/assets.d.ts
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import type { RenderLevel } from './type';
|
|
2
|
+
/**
|
|
3
|
+
* 资源基类
|
|
4
|
+
*/
|
|
5
|
+
export interface AssetBase {
|
|
6
|
+
/**
|
|
7
|
+
* 资源 ID
|
|
8
|
+
*/
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* 资源类型
|
|
12
|
+
*/
|
|
13
|
+
url: string;
|
|
14
|
+
/**
|
|
15
|
+
* 渲染等级
|
|
16
|
+
* 如果没有设置,按照 B+ 处理
|
|
17
|
+
*/
|
|
18
|
+
renderLevel?: RenderLevel;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 动态换图类型
|
|
22
|
+
* @since 1.1.0
|
|
23
|
+
*/
|
|
24
|
+
export declare enum BackgroundType {
|
|
25
|
+
video = "video",
|
|
26
|
+
image = "image"
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* 多媒体资源类型
|
|
30
|
+
* @since 2.1.0
|
|
31
|
+
*/
|
|
32
|
+
export declare enum MultimediaType {
|
|
33
|
+
video = "video",
|
|
34
|
+
audio = "audio"
|
|
35
|
+
}
|
|
36
|
+
export interface TemplateContent {
|
|
37
|
+
/**
|
|
38
|
+
* 当 template 宽高和 image 不相同时,会对 template 进行缩放,使其和 image 相同。
|
|
39
|
+
*/
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
background?: {
|
|
43
|
+
type: BackgroundType;
|
|
44
|
+
name: string;
|
|
45
|
+
url: string | HTMLImageElement;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export type TemplateVariables = Record<string, string | string[] | HTMLImageElement | HTMLImageElement[]>;
|
|
49
|
+
export type ImageSource = Image | TemplateImage | CompressedImage;
|
|
50
|
+
/**
|
|
51
|
+
* 纹理贴图属性
|
|
52
|
+
*/
|
|
53
|
+
export interface Image extends AssetBase {
|
|
54
|
+
/**
|
|
55
|
+
* WebP 地址
|
|
56
|
+
* 如果运行时支持 WebP,则优先使用 WebP
|
|
57
|
+
*/
|
|
58
|
+
webp?: string;
|
|
59
|
+
/**
|
|
60
|
+
* AVIF 地址
|
|
61
|
+
* 如果运行时支持 AVIF,则优先使用 AVIF
|
|
62
|
+
* @since 2.0.0
|
|
63
|
+
*/
|
|
64
|
+
avif?: string;
|
|
65
|
+
/**
|
|
66
|
+
* 是否使用 mipmap
|
|
67
|
+
* loader 发布压缩纹理的时候会根据此参数决定是否生成压缩纹理
|
|
68
|
+
* @default false
|
|
69
|
+
*/
|
|
70
|
+
mipmap?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* 图片 Y 轴的方向,如果 Y 轴向上(与 OpenGL 相同)则为 1
|
|
73
|
+
* 如果 Y 轴向下(与 OpenGL 相反)则为 -1,图片再绘制数据模板的时候需要翻转绘制
|
|
74
|
+
* @default 1
|
|
75
|
+
*/
|
|
76
|
+
oriY?: 1 | -1;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 模板贴图属性
|
|
80
|
+
*/
|
|
81
|
+
export interface TemplateImage extends Image {
|
|
82
|
+
template: TemplateContent;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 压缩贴图属性
|
|
86
|
+
*/
|
|
87
|
+
export interface CompressedImage extends Image {
|
|
88
|
+
/**
|
|
89
|
+
* 压缩贴图地址
|
|
90
|
+
*/
|
|
91
|
+
compressed: {
|
|
92
|
+
astc?: string;
|
|
93
|
+
pvrtc?: string;
|
|
94
|
+
};
|
|
95
|
+
}
|
package/es/assets.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 动态换图类型
|
|
3
|
+
* @since 1.1.0
|
|
4
|
+
*/
|
|
5
|
+
export var BackgroundType;
|
|
6
|
+
(function (BackgroundType) {
|
|
7
|
+
BackgroundType["video"] = "video";
|
|
8
|
+
BackgroundType["image"] = "image";
|
|
9
|
+
})(BackgroundType || (BackgroundType = {}));
|
|
10
|
+
/**
|
|
11
|
+
* 多媒体资源类型
|
|
12
|
+
* @since 2.1.0
|
|
13
|
+
*/
|
|
14
|
+
export var MultimediaType;
|
|
15
|
+
(function (MultimediaType) {
|
|
16
|
+
MultimediaType["video"] = "video";
|
|
17
|
+
MultimediaType["audio"] = "audio";
|
|
18
|
+
})(MultimediaType || (MultimediaType = {}));
|
package/es/buitin-object-guid.js
CHANGED
package/es/components.d.ts
CHANGED
|
@@ -20,10 +20,15 @@ export declare enum DataType {
|
|
|
20
20
|
SpriteColorTrack = "SpriteColorTrack",
|
|
21
21
|
ActivationTrack = "ActivationTrack",
|
|
22
22
|
SubCompositionTrack = "SubCompositionTrack",
|
|
23
|
+
FloatPropertyTrack = "FloatPropertyTrack",
|
|
24
|
+
ColorPropertyTrack = "ColorPropertyTrack",
|
|
25
|
+
Vector4PropertyTrack = "Vector4PropertyTrack",
|
|
23
26
|
TransformPlayableAsset = "TransformPlayableAsset",
|
|
24
27
|
SpriteColorPlayableAsset = "SpriteColorPlayableAsset",
|
|
25
28
|
ActivationPlayableAsset = "ActivationPlayableAsset",
|
|
26
29
|
SubCompositionPlayableAsset = "SubCompositionPlayableAsset",
|
|
30
|
+
FloatPropertyPlayableAsset = "FloatPropertyPlayableAsset",
|
|
31
|
+
ColorPropertyPlayableAsset = "ColorPropertyPlayableAsset",
|
|
27
32
|
MeshComponent = "MeshComponent",
|
|
28
33
|
SkyboxComponent = "SkyboxComponent",
|
|
29
34
|
LightComponent = "LightComponent",
|
|
@@ -32,6 +37,8 @@ export declare enum DataType {
|
|
|
32
37
|
TreeComponent = "TreeComponent",
|
|
33
38
|
AnimationComponent = "AnimationComponent",
|
|
34
39
|
SpineComponent = "SpineComponent",
|
|
40
|
+
VideoComponent = "VideoComponent",
|
|
41
|
+
AudioComponent = "AudioComponent",
|
|
35
42
|
TimelineClip = "TimelineClip"
|
|
36
43
|
}
|
|
37
44
|
export interface DataPath {
|
|
@@ -193,11 +200,6 @@ export interface ShaderData extends EffectsObjectData {
|
|
|
193
200
|
fragment: string;
|
|
194
201
|
properties?: string;
|
|
195
202
|
}
|
|
196
|
-
export interface EffectComponentData extends ComponentData {
|
|
197
|
-
_priority: number;
|
|
198
|
-
materials: DataPath[];
|
|
199
|
-
geometry: DataPath;
|
|
200
|
-
}
|
|
201
203
|
export interface EffectsPackageData {
|
|
202
204
|
fileSummary: FileSummary;
|
|
203
205
|
exportObjects: EffectsObjectData[];
|
package/es/components.js
CHANGED
|
@@ -21,10 +21,15 @@ export var DataType;
|
|
|
21
21
|
DataType["SpriteColorTrack"] = "SpriteColorTrack";
|
|
22
22
|
DataType["ActivationTrack"] = "ActivationTrack";
|
|
23
23
|
DataType["SubCompositionTrack"] = "SubCompositionTrack";
|
|
24
|
+
DataType["FloatPropertyTrack"] = "FloatPropertyTrack";
|
|
25
|
+
DataType["ColorPropertyTrack"] = "ColorPropertyTrack";
|
|
26
|
+
DataType["Vector4PropertyTrack"] = "Vector4PropertyTrack";
|
|
24
27
|
DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
|
|
25
28
|
DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
|
|
26
29
|
DataType["ActivationPlayableAsset"] = "ActivationPlayableAsset";
|
|
27
30
|
DataType["SubCompositionPlayableAsset"] = "SubCompositionPlayableAsset";
|
|
31
|
+
DataType["FloatPropertyPlayableAsset"] = "FloatPropertyPlayableAsset";
|
|
32
|
+
DataType["ColorPropertyPlayableAsset"] = "ColorPropertyPlayableAsset";
|
|
28
33
|
// FIXME: 先完成ECS的场景转换,后面移到spec中
|
|
29
34
|
DataType["MeshComponent"] = "MeshComponent";
|
|
30
35
|
DataType["SkyboxComponent"] = "SkyboxComponent";
|
|
@@ -34,6 +39,8 @@ export var DataType;
|
|
|
34
39
|
DataType["TreeComponent"] = "TreeComponent";
|
|
35
40
|
DataType["AnimationComponent"] = "AnimationComponent";
|
|
36
41
|
DataType["SpineComponent"] = "SpineComponent";
|
|
42
|
+
DataType["VideoComponent"] = "VideoComponent";
|
|
43
|
+
DataType["AudioComponent"] = "AudioComponent";
|
|
37
44
|
// Non-EffectObject
|
|
38
45
|
DataType["TimelineClip"] = "TimelineClip";
|
|
39
46
|
})(DataType || (DataType = {}));
|
package/es/composition.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './type';
|
|
2
2
|
export * from './composition';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './texture';
|
|
4
4
|
export * from './constants';
|
|
5
5
|
export * from './number-expression';
|
|
6
6
|
export * from './scene';
|
|
@@ -17,6 +17,8 @@ export * from './item/sprite-item';
|
|
|
17
17
|
export * from './item/spine-item';
|
|
18
18
|
export * from './item/effect-item';
|
|
19
19
|
export * from './item/text-item';
|
|
20
|
+
export * from './item/video-item';
|
|
21
|
+
export * from './item/audio-item';
|
|
20
22
|
export * from './item/model';
|
|
21
23
|
export * from './vfx-item-data';
|
|
22
24
|
export * from './animation-clip-data';
|
|
@@ -26,3 +28,6 @@ export * from './components';
|
|
|
26
28
|
export * from './vfx-item-data';
|
|
27
29
|
export * from './buitin-object-guid';
|
|
28
30
|
export * from './timeline';
|
|
31
|
+
export * from './assets';
|
|
32
|
+
export * from './render-settings';
|
|
33
|
+
export * from './curve-data';
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from './type';
|
|
2
2
|
export * from './composition';
|
|
3
|
-
export * from './
|
|
3
|
+
export * from './texture';
|
|
4
4
|
export * from './constants';
|
|
5
5
|
export * from './number-expression';
|
|
6
6
|
export * from './scene';
|
|
@@ -17,6 +17,8 @@ export * from './item/sprite-item';
|
|
|
17
17
|
export * from './item/spine-item';
|
|
18
18
|
export * from './item/effect-item';
|
|
19
19
|
export * from './item/text-item';
|
|
20
|
+
export * from './item/video-item';
|
|
21
|
+
export * from './item/audio-item';
|
|
20
22
|
export * from './item/model';
|
|
21
23
|
export * from './vfx-item-data';
|
|
22
24
|
export * from './animation-clip-data';
|
|
@@ -26,3 +28,6 @@ export * from './components';
|
|
|
26
28
|
export * from './vfx-item-data';
|
|
27
29
|
export * from './buitin-object-guid';
|
|
28
30
|
export * from './timeline';
|
|
31
|
+
export * from './assets';
|
|
32
|
+
export * from './render-settings';
|
|
33
|
+
export * from './curve-data';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ComponentData, DataPath } from '../components';
|
|
2
|
+
import type { ItemType } from '../type';
|
|
3
|
+
import type { BaseItem } from './base-item';
|
|
4
|
+
/**
|
|
5
|
+
* 音频元素
|
|
6
|
+
*/
|
|
7
|
+
export interface AudioItem extends BaseItem {
|
|
8
|
+
/**
|
|
9
|
+
* 元素类型(指定为 audio)
|
|
10
|
+
*/
|
|
11
|
+
type: ItemType.audio;
|
|
12
|
+
/**
|
|
13
|
+
* 音频元素基础属性
|
|
14
|
+
*/
|
|
15
|
+
content: AudioComponentData;
|
|
16
|
+
}
|
|
17
|
+
export interface AudioContentOptions {
|
|
18
|
+
/**
|
|
19
|
+
* 音频链接,索引到 scene 中的 audios 数组
|
|
20
|
+
*/
|
|
21
|
+
audio: DataPath;
|
|
22
|
+
/**
|
|
23
|
+
* 音频播放速度
|
|
24
|
+
* @default 1
|
|
25
|
+
*/
|
|
26
|
+
playbackRate?: number;
|
|
27
|
+
/**
|
|
28
|
+
* 是否静音播放
|
|
29
|
+
* @default false
|
|
30
|
+
*/
|
|
31
|
+
muted?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 音频音量大小
|
|
34
|
+
* @default 1
|
|
35
|
+
*/
|
|
36
|
+
volume?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 音频组件属性
|
|
40
|
+
*/
|
|
41
|
+
export interface AudioComponentData extends ComponentData {
|
|
42
|
+
/**
|
|
43
|
+
* 音频元素基础属性
|
|
44
|
+
*/
|
|
45
|
+
options: AudioContentOptions;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/item/effect-item.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComponentData, DataPath } from '../components';
|
|
1
2
|
import type { ItemType, PositionOverLifetime, RotationOverLifetime, SizeOverLifetime } from '../type';
|
|
2
3
|
import type { BaseItem, EndBehavior } from './base-item';
|
|
3
4
|
/**
|
|
@@ -33,3 +34,8 @@ export interface EffectContent {
|
|
|
33
34
|
*/
|
|
34
35
|
positionOverLifetime?: PositionOverLifetime;
|
|
35
36
|
}
|
|
37
|
+
export interface EffectComponentData extends ComponentData {
|
|
38
|
+
_priority: number;
|
|
39
|
+
materials: DataPath[];
|
|
40
|
+
geometry: DataPath;
|
|
41
|
+
}
|
|
@@ -2,7 +2,7 @@ import type { ItemType, RendererOptions, TextureSheetAnimation, BlendingMode, Sp
|
|
|
2
2
|
import type { FixedNumberExpression, NumberExpression, GradientColor, vec3, FixedVec3Expression, ColorExpression, FunctionExpression } from '../number-expression';
|
|
3
3
|
import type { BaseItem, EndBehavior } from './base-item';
|
|
4
4
|
import type { ParticleShape } from './particle-shape';
|
|
5
|
-
import type { ComponentData } from '../components';
|
|
5
|
+
import type { ComponentData, DataPath } from '../components';
|
|
6
6
|
/**
|
|
7
7
|
* 粒子交互行为
|
|
8
8
|
*/
|
|
@@ -472,7 +472,7 @@ export interface ParticleTrail {
|
|
|
472
472
|
/**
|
|
473
473
|
* 拖尾贴图
|
|
474
474
|
*/
|
|
475
|
-
texture?:
|
|
475
|
+
texture?: DataPath;
|
|
476
476
|
/**
|
|
477
477
|
* 位置受父节点影响
|
|
478
478
|
* 拖尾+图层绑定同一个父节点时使用
|
package/es/item/spine-item.d.ts
CHANGED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ComponentData, DataPath } from '../components';
|
|
2
|
+
import type { RGBAColorValue } from '../number-expression';
|
|
3
|
+
import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, InteractBehavior, RendererOptions, ItemType } from '../type';
|
|
4
|
+
import type { BaseItem, EndBehavior } from './base-item';
|
|
5
|
+
/**
|
|
6
|
+
* 视频元素
|
|
7
|
+
*/
|
|
8
|
+
export interface VideoItem extends BaseItem {
|
|
9
|
+
/**
|
|
10
|
+
* 元素类型(指定为 video)
|
|
11
|
+
*/
|
|
12
|
+
type: ItemType.video;
|
|
13
|
+
/**
|
|
14
|
+
* 视频元素渲染信息
|
|
15
|
+
*/
|
|
16
|
+
content: VideoComponentData;
|
|
17
|
+
endBehavior: EndBehavior;
|
|
18
|
+
}
|
|
19
|
+
export interface VideoContentOptions {
|
|
20
|
+
/**
|
|
21
|
+
* 元素基础颜色
|
|
22
|
+
* @default [255,255,255,255]
|
|
23
|
+
*/
|
|
24
|
+
startColor?: RGBAColorValue;
|
|
25
|
+
/**
|
|
26
|
+
* 视频链接,索引到 scene 中的 videos 数组
|
|
27
|
+
*/
|
|
28
|
+
video: DataPath;
|
|
29
|
+
/**
|
|
30
|
+
* 视频播放速度
|
|
31
|
+
* @default 1
|
|
32
|
+
*/
|
|
33
|
+
playbackRate?: number;
|
|
34
|
+
/**
|
|
35
|
+
* 是否静音播放
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
muted?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* 视频音量大小
|
|
41
|
+
* @default 1
|
|
42
|
+
*/
|
|
43
|
+
volume?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 视频组件属性
|
|
47
|
+
*/
|
|
48
|
+
export interface VideoComponentData extends ComponentData {
|
|
49
|
+
/**
|
|
50
|
+
* 视频元素基础属性
|
|
51
|
+
*/
|
|
52
|
+
options: VideoContentOptions;
|
|
53
|
+
/**
|
|
54
|
+
* 视频元素材质渲染属性
|
|
55
|
+
*/
|
|
56
|
+
renderer: RendererOptions;
|
|
57
|
+
/**
|
|
58
|
+
* 视频元素大小变化属性
|
|
59
|
+
*/
|
|
60
|
+
sizeOverLifetime?: SizeOverLifetime;
|
|
61
|
+
/**
|
|
62
|
+
* 视频元素旋转变化属性
|
|
63
|
+
*/
|
|
64
|
+
rotationOverLifetime?: RotationOverLifetime;
|
|
65
|
+
/**
|
|
66
|
+
* 视频元素位置变化属性
|
|
67
|
+
*/
|
|
68
|
+
positionOverLifetime?: PositionOverLifetime;
|
|
69
|
+
/**
|
|
70
|
+
* 视频元素色彩变化属性
|
|
71
|
+
*/
|
|
72
|
+
colorOverLifetime?: ColorOverLifetime;
|
|
73
|
+
/**
|
|
74
|
+
* 视频元素交互
|
|
75
|
+
*/
|
|
76
|
+
interaction?: {
|
|
77
|
+
/**
|
|
78
|
+
* 交互行为
|
|
79
|
+
*/
|
|
80
|
+
behavior: InteractBehavior;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/item.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ import type { ModelCameraItem, ModelLightItem, ModelMeshItem, ModelSkyboxItem, M
|
|
|
8
8
|
import type { CameraItem } from './item/camera-item';
|
|
9
9
|
import type { CompositionItem } from './item/composition-item';
|
|
10
10
|
import type { TextItem } from './item/text-item';
|
|
11
|
+
import type { VideoItem } from './item/video-item';
|
|
12
|
+
import type { AudioItem } from './item/audio-item';
|
|
11
13
|
/**
|
|
12
14
|
* Item 基类,无对应元素
|
|
13
15
|
*/
|
|
14
|
-
export type Item = SpriteItem | ParticleItem | NullItem | PluginItem | InteractItem | CameraItem | TextItem | ModelMeshItem<'json'> | ModelSkyboxItem<'json'> | ModelTreeItem<'json'> | ModelLightItem | ModelCameraItem | SpineItem | CompositionItem | ModelMeshItem<'studio'> | ModelSkyboxItem<'studio'> | ModelTreeItem<'studio'>;
|
|
16
|
+
export type Item = SpriteItem | ParticleItem | NullItem | PluginItem | InteractItem | CameraItem | TextItem | VideoItem | AudioItem | ModelMeshItem<'json'> | ModelSkyboxItem<'json'> | ModelTreeItem<'json'> | ModelLightItem | ModelCameraItem | SpineItem | CompositionItem | ModelMeshItem<'studio'> | ModelSkyboxItem<'studio'> | ModelTreeItem<'studio'>;
|
|
@@ -72,7 +72,15 @@ export declare enum ValueType {
|
|
|
72
72
|
/**
|
|
73
73
|
* 贝塞尔曲线四元数
|
|
74
74
|
*/
|
|
75
|
-
BEZIER_CURVE_QUAT = 23
|
|
75
|
+
BEZIER_CURVE_QUAT = 23,
|
|
76
|
+
/**
|
|
77
|
+
* 颜色曲线
|
|
78
|
+
*/
|
|
79
|
+
COLOR_CURVE = 24,
|
|
80
|
+
/**
|
|
81
|
+
* Vector4 曲线
|
|
82
|
+
*/
|
|
83
|
+
VECTOR4_CURVE = 25
|
|
76
84
|
}
|
|
77
85
|
export type vec2 = [x: number, y: number];
|
|
78
86
|
export type vec3 = [x: number, y: number, z: number];
|
package/es/number-expression.js
CHANGED
|
@@ -75,6 +75,14 @@ export var ValueType;
|
|
|
75
75
|
* 贝塞尔曲线四元数
|
|
76
76
|
*/
|
|
77
77
|
ValueType[ValueType["BEZIER_CURVE_QUAT"] = 23] = "BEZIER_CURVE_QUAT";
|
|
78
|
+
/**
|
|
79
|
+
* 颜色曲线
|
|
80
|
+
*/
|
|
81
|
+
ValueType[ValueType["COLOR_CURVE"] = 24] = "COLOR_CURVE";
|
|
82
|
+
/**
|
|
83
|
+
* Vector4 曲线
|
|
84
|
+
*/
|
|
85
|
+
ValueType[ValueType["VECTOR4_CURVE"] = 25] = "VECTOR4_CURVE";
|
|
78
86
|
})(ValueType || (ValueType = {}));
|
|
79
87
|
/**
|
|
80
88
|
* 关键帧类型
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/scene.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { Composition, CompositionData } from './composition';
|
|
2
2
|
import type { SpineResource } from './item/spine-item';
|
|
3
|
-
import type { PlayerVersion,
|
|
4
|
-
import type {
|
|
3
|
+
import type { PlayerVersion, ShapeGeometry } from './type';
|
|
4
|
+
import type { TextureDefine } from './texture';
|
|
5
5
|
import type { FontBase, FontDefine } from './text';
|
|
6
6
|
import type { BinaryFile } from './binary';
|
|
7
7
|
import type { ComponentData, EffectsObjectData, GeometryData, MaterialData, ShaderData } from './components';
|
|
8
8
|
import type { VFXItemData } from './vfx-item-data';
|
|
9
9
|
import type { AnimationClipData } from './animation-clip-data';
|
|
10
|
+
import type { AssetBase, ImageSource } from './assets';
|
|
11
|
+
import type { RenderSettings } from './render-settings';
|
|
10
12
|
/**
|
|
11
13
|
* runtime 2.0 之前的场景信息
|
|
12
14
|
* 素材信息存放于统一数据结构中
|
|
@@ -50,7 +52,7 @@ export interface JSONSceneLegacy {
|
|
|
50
52
|
/**
|
|
51
53
|
* 贴图信息
|
|
52
54
|
*/
|
|
53
|
-
images:
|
|
55
|
+
images: ImageSource[];
|
|
54
56
|
/**
|
|
55
57
|
* 根据合成ID,每个合成用到的 image 的数组索引
|
|
56
58
|
*/
|
|
@@ -62,7 +64,7 @@ export interface JSONSceneLegacy {
|
|
|
62
64
|
/**
|
|
63
65
|
* 蒙版形状信息
|
|
64
66
|
*/
|
|
65
|
-
shapes:
|
|
67
|
+
shapes: ShapeGeometry[];
|
|
66
68
|
/**
|
|
67
69
|
* 插件类型信息
|
|
68
70
|
* 'model@1.0'
|
|
@@ -107,6 +109,7 @@ export interface JSONScene {
|
|
|
107
109
|
* JSON 版本
|
|
108
110
|
*
|
|
109
111
|
* 3.0 EC 改造、移除滤镜元素
|
|
112
|
+
* 3.1 音视频
|
|
110
113
|
*/
|
|
111
114
|
version: string;
|
|
112
115
|
/**
|
|
@@ -127,11 +130,15 @@ export interface JSONScene {
|
|
|
127
130
|
* 渲染所需合成列表
|
|
128
131
|
*/
|
|
129
132
|
compositions: CompositionData[];
|
|
133
|
+
/**
|
|
134
|
+
* 渲染配置
|
|
135
|
+
*/
|
|
136
|
+
renderSettings?: RenderSettings;
|
|
130
137
|
/******************************** 以下皆为可复用信息,加载在对应 Manager 中 *******************************/
|
|
131
138
|
/**
|
|
132
139
|
* 贴图信息
|
|
133
140
|
*/
|
|
134
|
-
images:
|
|
141
|
+
images: ImageSource[];
|
|
135
142
|
/**
|
|
136
143
|
* 根据合成 ID,每个合成用到的 image 的数组索引
|
|
137
144
|
*/
|
|
@@ -143,7 +150,7 @@ export interface JSONScene {
|
|
|
143
150
|
/**
|
|
144
151
|
* 蒙版形状信息
|
|
145
152
|
*/
|
|
146
|
-
shapes:
|
|
153
|
+
shapes: ShapeGeometry[];
|
|
147
154
|
/**
|
|
148
155
|
* 插件类型信息
|
|
149
156
|
* 'model@1.0'
|
|
@@ -154,6 +161,16 @@ export interface JSONScene {
|
|
|
154
161
|
* 数据模板下掉可以不要 FontBase[]
|
|
155
162
|
*/
|
|
156
163
|
fonts?: FontBase[] | FontDefine[];
|
|
164
|
+
/**
|
|
165
|
+
* 视频资源
|
|
166
|
+
* @since 2.0.0
|
|
167
|
+
*/
|
|
168
|
+
videos?: AssetBase[];
|
|
169
|
+
/**
|
|
170
|
+
* 音频资源
|
|
171
|
+
* @since 2.0.0
|
|
172
|
+
*/
|
|
173
|
+
audios?: AssetBase[];
|
|
157
174
|
/**
|
|
158
175
|
* 二进制文件地址
|
|
159
176
|
*/
|
package/es/texture.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { BinaryPointer } from './binary';
|
|
2
|
+
import type { DataType } from './components';
|
|
3
|
+
export interface TextureFormatOptions {
|
|
4
|
+
format?: GLenum;
|
|
5
|
+
internalFormat?: GLenum;
|
|
6
|
+
type?: GLenum;
|
|
7
|
+
}
|
|
8
|
+
export interface TextureConfigOptionsBase {
|
|
9
|
+
generateMipmap?: boolean;
|
|
10
|
+
id?: string;
|
|
11
|
+
dataType?: DataType.Texture;
|
|
12
|
+
name?: string;
|
|
13
|
+
wrapS?: GLenum;
|
|
14
|
+
wrapT?: GLenum;
|
|
15
|
+
magFilter?: GLenum;
|
|
16
|
+
minFilter?: GLenum;
|
|
17
|
+
anisotropic?: number;
|
|
18
|
+
flipY?: boolean;
|
|
19
|
+
premultiplyAlpha?: boolean;
|
|
20
|
+
keepImageSource?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export type SerializedTextureCubeMipmap = [
|
|
23
|
+
TEXTURE_CUBE_MAP_POSITIVE_X: BinaryPointer,
|
|
24
|
+
TEXTURE_CUBE_MAP_NEGATIVE_X: BinaryPointer,
|
|
25
|
+
TEXTURE_CUBE_MAP_POSITIVE_Y: BinaryPointer,
|
|
26
|
+
TEXTURE_CUBE_MAP_NEGATIVE_Y: BinaryPointer,
|
|
27
|
+
TEXTURE_CUBE_MAP_POSITIVE_Z: BinaryPointer,
|
|
28
|
+
TEXTURE_CUBE_MAP_NEGATIVE_Z: BinaryPointer
|
|
29
|
+
];
|
|
30
|
+
export interface SerializedTexture2DImageSource extends TextureConfigOptionsBase, TextureFormatOptions {
|
|
31
|
+
target?: WebGLRenderingContext['TEXTURE_2D'];
|
|
32
|
+
source: number;
|
|
33
|
+
}
|
|
34
|
+
export interface SerializedTexture2DMipmapSource extends TextureConfigOptionsBase, TextureFormatOptions {
|
|
35
|
+
target?: WebGLRenderingContext['TEXTURE_2D'];
|
|
36
|
+
mipmaps: BinaryPointer[];
|
|
37
|
+
}
|
|
38
|
+
export interface SerializedTextureCube extends TextureConfigOptionsBase, TextureFormatOptions {
|
|
39
|
+
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'];
|
|
40
|
+
mipmaps: SerializedTextureCubeMipmap[];
|
|
41
|
+
}
|
|
42
|
+
export type SerializedTexture2D = SerializedTexture2DImageSource | SerializedTexture2DMipmapSource;
|
|
43
|
+
export type SerializedTextureSource = SerializedTexture2D | SerializedTextureCube;
|
|
44
|
+
export type TextureJSONOptions = SerializedTextureSource;
|
|
45
|
+
export type TextureDefine = TextureJSONOptions;
|
package/es/texture.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/type.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DataPath } from './components';
|
|
1
2
|
import type { FixedVec3Expression, vec2, vec3, GradientColor, ShapePoints, ShapeSplits, FixedNumberExpression } from './number-expression';
|
|
2
3
|
/**
|
|
3
4
|
* 播放器版本
|
|
@@ -31,19 +32,6 @@ export interface GLTF {
|
|
|
31
32
|
*/
|
|
32
33
|
reuse: boolean;
|
|
33
34
|
}
|
|
34
|
-
/**
|
|
35
|
-
* 形状属性
|
|
36
|
-
*/
|
|
37
|
-
export interface Shape {
|
|
38
|
-
/**
|
|
39
|
-
* 形状 ID
|
|
40
|
-
*/
|
|
41
|
-
id: number;
|
|
42
|
-
/**
|
|
43
|
-
* 形状数据
|
|
44
|
-
*/
|
|
45
|
-
shape: number[];
|
|
46
|
-
}
|
|
47
35
|
/**
|
|
48
36
|
* 插件参数
|
|
49
37
|
*/
|
|
@@ -457,7 +445,7 @@ export interface RendererOptions {
|
|
|
457
445
|
/**
|
|
458
446
|
* 贴图,索引到 scene 中的 images 数组
|
|
459
447
|
*/
|
|
460
|
-
texture?:
|
|
448
|
+
texture?: DataPath;
|
|
461
449
|
/**
|
|
462
450
|
* 蒙版模式
|
|
463
451
|
* @default none
|
|
@@ -543,7 +531,15 @@ export declare enum ItemType {
|
|
|
543
531
|
/**
|
|
544
532
|
* 节点元素
|
|
545
533
|
*/
|
|
546
|
-
node = "node"
|
|
534
|
+
node = "node",
|
|
535
|
+
/**
|
|
536
|
+
* 视频元素
|
|
537
|
+
*/
|
|
538
|
+
video = "video",
|
|
539
|
+
/**
|
|
540
|
+
* 音频元素
|
|
541
|
+
*/
|
|
542
|
+
audio = "audio"
|
|
547
543
|
}
|
|
548
544
|
/**
|
|
549
545
|
* 渲染模式
|
|
@@ -670,3 +666,4 @@ export declare enum RenderFace {
|
|
|
670
666
|
Back = "Back",
|
|
671
667
|
Front = "Front"
|
|
672
668
|
}
|
|
669
|
+
export type HTMLImageLike = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
|
package/es/type.js
CHANGED
|
@@ -264,6 +264,14 @@ export var ItemType;
|
|
|
264
264
|
* 节点元素
|
|
265
265
|
*/
|
|
266
266
|
ItemType["node"] = "node";
|
|
267
|
+
/**
|
|
268
|
+
* 视频元素
|
|
269
|
+
*/
|
|
270
|
+
ItemType["video"] = "video";
|
|
271
|
+
/**
|
|
272
|
+
* 音频元素
|
|
273
|
+
*/
|
|
274
|
+
ItemType["audio"] = "audio";
|
|
267
275
|
})(ItemType || (ItemType = {}));
|
|
268
276
|
/**
|
|
269
277
|
* 渲染模式
|
package/package.json
CHANGED
package/es/image.d.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import type { RenderLevel } from './type';
|
|
2
|
-
import type { BinaryPointer } from './binary';
|
|
3
|
-
import type { DataType } from './components';
|
|
4
|
-
export interface TextureFormatOptions {
|
|
5
|
-
format?: GLenum;
|
|
6
|
-
internalFormat?: GLenum;
|
|
7
|
-
type?: GLenum;
|
|
8
|
-
}
|
|
9
|
-
export interface TextureConfigOptionsBase {
|
|
10
|
-
generateMipmap?: boolean;
|
|
11
|
-
id?: string;
|
|
12
|
-
dataType?: DataType.Texture;
|
|
13
|
-
name?: string;
|
|
14
|
-
wrapS?: GLenum;
|
|
15
|
-
wrapT?: GLenum;
|
|
16
|
-
magFilter?: GLenum;
|
|
17
|
-
minFilter?: GLenum;
|
|
18
|
-
anisotropic?: number;
|
|
19
|
-
flipY?: boolean;
|
|
20
|
-
premultiplyAlpha?: boolean;
|
|
21
|
-
keepImageSource?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export type SerializedTextureCubeMipmap = [
|
|
24
|
-
TEXTURE_CUBE_MAP_POSITIVE_X: BinaryPointer,
|
|
25
|
-
TEXTURE_CUBE_MAP_NEGATIVE_X: BinaryPointer,
|
|
26
|
-
TEXTURE_CUBE_MAP_POSITIVE_Y: BinaryPointer,
|
|
27
|
-
TEXTURE_CUBE_MAP_NEGATIVE_Y: BinaryPointer,
|
|
28
|
-
TEXTURE_CUBE_MAP_POSITIVE_Z: BinaryPointer,
|
|
29
|
-
TEXTURE_CUBE_MAP_NEGATIVE_Z: BinaryPointer
|
|
30
|
-
];
|
|
31
|
-
export interface SerializedTexture2DImageSource extends TextureConfigOptionsBase, TextureFormatOptions {
|
|
32
|
-
target?: WebGLRenderingContext['TEXTURE_2D'];
|
|
33
|
-
source: number;
|
|
34
|
-
}
|
|
35
|
-
export interface SerializedTexture2DMipmapSource extends TextureConfigOptionsBase, TextureFormatOptions {
|
|
36
|
-
target?: WebGLRenderingContext['TEXTURE_2D'];
|
|
37
|
-
mipmaps: BinaryPointer[];
|
|
38
|
-
}
|
|
39
|
-
export interface SerializedTextureCube extends TextureConfigOptionsBase, TextureFormatOptions {
|
|
40
|
-
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'];
|
|
41
|
-
mipmaps: SerializedTextureCubeMipmap[];
|
|
42
|
-
}
|
|
43
|
-
export type SerializedTexture2D = SerializedTexture2DImageSource | SerializedTexture2DMipmapSource;
|
|
44
|
-
export type SerializedTextureSource = SerializedTexture2D | SerializedTextureCube;
|
|
45
|
-
export type TextureJSONOptions = SerializedTextureSource;
|
|
46
|
-
export type TextureDefine = TextureJSONOptions;
|
|
47
|
-
/**
|
|
48
|
-
* 动态换图类型
|
|
49
|
-
* @since 1.1.0
|
|
50
|
-
*/
|
|
51
|
-
export declare enum BackgroundType {
|
|
52
|
-
video = "video",
|
|
53
|
-
image = "image"
|
|
54
|
-
}
|
|
55
|
-
export interface TemplateContent {
|
|
56
|
-
/**
|
|
57
|
-
* 当 template 宽高和 image 不相同时,会对 template 进行缩放,使其和 image 相同。
|
|
58
|
-
*/
|
|
59
|
-
width: number;
|
|
60
|
-
height: number;
|
|
61
|
-
background?: {
|
|
62
|
-
type: BackgroundType;
|
|
63
|
-
name: string;
|
|
64
|
-
url: string | HTMLImageElement;
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export type TemplateVariables = Record<string, string | string[] | HTMLImageElement | HTMLImageElement[]>;
|
|
68
|
-
/**
|
|
69
|
-
* 纹理贴图属性
|
|
70
|
-
*/
|
|
71
|
-
export interface Image {
|
|
72
|
-
id: string;
|
|
73
|
-
/**
|
|
74
|
-
* 纹理贴图地址
|
|
75
|
-
*/
|
|
76
|
-
url: string;
|
|
77
|
-
/**
|
|
78
|
-
* WebP 地址
|
|
79
|
-
* 如果运行时支持 WebP,则优先使用 WebP
|
|
80
|
-
*/
|
|
81
|
-
webp?: string;
|
|
82
|
-
/**
|
|
83
|
-
* AVIF 地址
|
|
84
|
-
* 如果运行时支持 AVIF,则优先使用 AVIF
|
|
85
|
-
* @since 2.0.0
|
|
86
|
-
*/
|
|
87
|
-
avif?: string;
|
|
88
|
-
/**
|
|
89
|
-
* 纹理贴图渲染等级
|
|
90
|
-
* 如果没有设置,按照 B+ 处理
|
|
91
|
-
*/
|
|
92
|
-
renderLevel?: RenderLevel;
|
|
93
|
-
/**
|
|
94
|
-
* 是否使用 mipmap
|
|
95
|
-
* loader 发布压缩纹理的时候会根据此参数决定是否生成压缩纹理
|
|
96
|
-
* @default false
|
|
97
|
-
*/
|
|
98
|
-
mipmap?: boolean;
|
|
99
|
-
/**
|
|
100
|
-
* 图片 Y 轴的方向,如果 Y 轴向上(与 OpenGL 相同)则为 1
|
|
101
|
-
* 如果 Y 轴向下(与 OpenGL 相反)则为 -1,图片再绘制数据模板的时候需要翻转绘制
|
|
102
|
-
* @default 1
|
|
103
|
-
*/
|
|
104
|
-
oriY?: 1 | -1;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* 模板贴图属性
|
|
108
|
-
*/
|
|
109
|
-
export interface TemplateImage extends Image {
|
|
110
|
-
template: TemplateContent;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* 压缩贴图属性
|
|
114
|
-
*/
|
|
115
|
-
export interface CompressedImage extends Image {
|
|
116
|
-
/**
|
|
117
|
-
* 压缩贴图地址
|
|
118
|
-
*/
|
|
119
|
-
compressed: {
|
|
120
|
-
astc?: string;
|
|
121
|
-
pvrtc?: string;
|
|
122
|
-
};
|
|
123
|
-
}
|