@galacean/effects-specification 2.0.0-alpha.2 → 2.0.0-alpha.21
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/README.md +2 -10
- package/es/animation-clip-data.d.ts +26 -0
- package/es/animation-clip-data.js +1 -0
- package/{dist/src → es}/binary.d.ts +9 -2
- package/es/binary.js +1 -0
- package/es/buitin-object-guid.d.ts +5 -0
- package/es/buitin-object-guid.js +5 -0
- package/es/components.d.ts +209 -0
- package/es/components.js +129 -0
- package/{dist/src → es}/composition.d.ts +28 -70
- package/es/composition.js +12 -0
- package/{dist/src → es}/constants.d.ts +23 -0
- package/es/constants.js +34 -0
- package/{dist/src → es}/image.d.ts +21 -27
- package/es/image.js +9 -0
- package/{dist/src → es}/index.d.ts +4 -2
- package/es/index.js +28 -0
- package/{dist/src → es}/item/base-item.d.ts +27 -8
- package/es/item/base-item.js +27 -0
- package/{dist/src → es}/item/camera-item.d.ts +6 -6
- package/es/item/camera-item.js +1 -0
- package/{dist/src → es}/item/composition-item.d.ts +4 -4
- package/es/item/composition-item.js +1 -0
- package/es/item/effect-item.d.ts +35 -0
- package/es/item/effect-item.js +1 -0
- package/{dist/src → es}/item/interact-item.d.ts +3 -3
- package/es/item/interact-item.js +1 -0
- package/es/item/model/binary.js +1 -0
- package/{dist/src → es}/item/model/camera.d.ts +2 -2
- package/es/item/model/camera.js +5 -0
- package/es/item/model/index.js +35 -0
- package/{dist/src → es}/item/model/light.d.ts +2 -2
- package/es/item/model/light.js +19 -0
- package/{dist/src → es}/item/model/material.d.ts +3 -3
- package/es/item/model/material.js +16 -0
- package/{dist/src → es}/item/model/mesh.d.ts +9 -8
- package/es/item/model/mesh.js +5 -0
- package/es/item/model/render.js +42 -0
- package/{dist/src → es}/item/model/skybox.d.ts +9 -3
- package/es/item/model/skybox.js +1 -0
- package/{dist/src → es}/item/model/tree.d.ts +10 -0
- package/es/item/model/tree.js +1 -0
- package/es/item/null-item.d.ts +46 -0
- package/es/item/null-item.js +1 -0
- package/{dist/src → es}/item/particle-item.d.ts +20 -23
- package/es/item/particle-item.js +14 -0
- package/es/item/particle-shape.js +19 -0
- package/{dist/src → es}/item/plugin-item.d.ts +3 -3
- package/es/item/plugin-item.js +1 -0
- package/{dist/src → es}/item/spine-item.d.ts +44 -20
- package/es/item/spine-item.js +1 -0
- package/{dist/src → es}/item/sprite-item.d.ts +3 -3
- package/es/item/sprite-item.js +1 -0
- package/{dist/src → es}/item/text-item.d.ts +3 -3
- package/es/item/text-item.js +1 -0
- package/{dist/src → es}/item.d.ts +2 -5
- package/es/item.js +1 -0
- package/{dist/src → es}/number-expression.d.ts +21 -8
- package/es/number-expression.js +91 -0
- package/{dist/src → es}/scene.d.ts +19 -19
- package/es/scene.js +1 -0
- package/{dist/src → es}/text.d.ts +3 -55
- package/es/text.js +84 -0
- package/es/timeline/index.d.ts +5 -0
- package/es/timeline/index.js +5 -0
- package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +8 -0
- package/es/timeline/playables/sprite-color-playable-asset-data.js +1 -0
- package/es/timeline/playables/transform-playable-asset-data.d.ts +17 -0
- package/es/timeline/playables/transform-playable-asset-data.js +1 -0
- package/es/timeline/timeline-asset-data.d.ts +8 -0
- package/es/timeline/timeline-asset-data.js +1 -0
- package/es/timeline/timeline-clip-data.d.ts +11 -0
- package/es/timeline/timeline-clip-data.js +1 -0
- package/es/timeline/track/track-asset-data.d.ts +9 -0
- package/es/timeline/track/track-asset-data.js +1 -0
- package/{dist/src → es}/type.d.ts +45 -20
- package/es/type.js +342 -0
- package/{dist/src → es}/vfx-item-data.d.ts +10 -11
- package/es/vfx-item-data.js +1 -0
- package/package.json +26 -47
- package/dist/fallback/camera.d.ts +0 -2
- package/dist/fallback/filter.d.ts +0 -2
- package/dist/fallback/index.d.ts +0 -12
- package/dist/fallback/interact.d.ts +0 -2
- package/dist/fallback/migration.d.ts +0 -13
- package/dist/fallback/particle.d.ts +0 -2
- package/dist/fallback/sprite.d.ts +0 -3
- package/dist/fallback/utils.d.ts +0 -36
- package/dist/fallback.js +0 -2155
- package/dist/fallback.js.map +0 -1
- package/dist/fallback.mjs +0 -2127
- package/dist/fallback.mjs.map +0 -1
- package/dist/index.js +0 -758
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -743
- package/dist/index.mjs.map +0 -1
- package/dist/src/components.d.ts +0 -93
- package/dist/src/item/effect-item.d.ts +0 -17
- package/dist/src/item/filter-item.d.ts +0 -99
- package/dist/src/item/null-item.d.ts +0 -94
- /package/{dist/src → es}/item/model/binary.d.ts +0 -0
- /package/{dist/src → es}/item/model/index.d.ts +0 -0
- /package/{dist/src → es}/item/model/render.d.ts +0 -0
- /package/{dist/src → es}/item/particle-shape.d.ts +0 -0
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { RenderLevel } from './type';
|
|
2
|
-
import type { StringTemplate } from './text';
|
|
3
2
|
import type { BinaryPointer } from './binary';
|
|
3
|
+
import type { DataType } from './components';
|
|
4
4
|
export interface TextureFormatOptions {
|
|
5
5
|
format?: GLenum;
|
|
6
6
|
internalFormat?: GLenum;
|
|
7
7
|
type?: GLenum;
|
|
8
8
|
}
|
|
9
9
|
export interface TextureConfigOptionsBase {
|
|
10
|
+
generateMipmap?: boolean;
|
|
11
|
+
id?: string;
|
|
12
|
+
dataType?: DataType.Texture;
|
|
10
13
|
name?: string;
|
|
11
14
|
wrapS?: GLenum;
|
|
12
15
|
wrapT?: GLenum;
|
|
@@ -41,29 +44,23 @@ export type SerializedTexture2D = SerializedTexture2DImageSource | SerializedTex
|
|
|
41
44
|
export type SerializedTextureSource = SerializedTexture2D | SerializedTextureCube;
|
|
42
45
|
export type TextureJSONOptions = SerializedTextureSource;
|
|
43
46
|
export type TextureDefine = TextureJSONOptions;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
/**
|
|
48
|
+
* 动态换图类型
|
|
49
|
+
* @since 1.1.0
|
|
50
|
+
*/
|
|
51
|
+
export declare enum BackgroundType {
|
|
52
|
+
video = "video",
|
|
53
|
+
image = "image"
|
|
54
|
+
}
|
|
55
|
+
export interface TemplateContent {
|
|
47
56
|
variables: Record<string, number | string>;
|
|
48
57
|
/**
|
|
49
|
-
* 当template宽高和image不相同时,会对template进行缩放,使其和image相同。
|
|
58
|
+
* 当 template 宽高和 image 不相同时,会对 template 进行缩放,使其和 image 相同。
|
|
50
59
|
*/
|
|
51
60
|
width: number;
|
|
52
61
|
height: number;
|
|
53
|
-
}
|
|
54
|
-
export interface TemplateContentV1 extends TemplateContentBase {
|
|
55
|
-
/**
|
|
56
|
-
* 贴图属性,svg 字段
|
|
57
|
-
*/
|
|
58
|
-
content: string;
|
|
59
|
-
asImage?: boolean;
|
|
60
|
-
backgroundWidth: number;
|
|
61
|
-
backgroundHeight: number;
|
|
62
|
-
}
|
|
63
|
-
export interface TemplateContentV2 extends TemplateContentBase {
|
|
64
|
-
v: 2;
|
|
65
|
-
content?: StringTemplate;
|
|
66
62
|
background?: {
|
|
63
|
+
type: BackgroundType;
|
|
67
64
|
name: string;
|
|
68
65
|
url: string;
|
|
69
66
|
};
|
|
@@ -72,13 +69,14 @@ export interface TemplateContentV2 extends TemplateContentBase {
|
|
|
72
69
|
* 纹理贴图属性
|
|
73
70
|
*/
|
|
74
71
|
export interface Image {
|
|
72
|
+
id: string;
|
|
75
73
|
/**
|
|
76
74
|
* 纹理贴图地址
|
|
77
75
|
*/
|
|
78
76
|
url: string;
|
|
79
77
|
/**
|
|
80
|
-
*
|
|
81
|
-
* 如果运行时支持
|
|
78
|
+
* WebP 地址
|
|
79
|
+
* 如果运行时支持 WebP,则优先使用 WebP
|
|
82
80
|
*/
|
|
83
81
|
webp?: string;
|
|
84
82
|
/**
|
|
@@ -93,8 +91,8 @@ export interface Image {
|
|
|
93
91
|
*/
|
|
94
92
|
mipmap?: boolean;
|
|
95
93
|
/**
|
|
96
|
-
* 图片Y轴的方向,如果Y轴向上(与OpenGL相同)则为 1
|
|
97
|
-
* 如果Y轴向下(与OpenGL相反)则为 -1
|
|
94
|
+
* 图片 Y 轴的方向,如果 Y 轴向上(与 OpenGL 相同)则为 1
|
|
95
|
+
* 如果 Y 轴向下(与 OpenGL 相反)则为 -1,图片再绘制数据模板的时候需要翻转绘制
|
|
98
96
|
* @default 1
|
|
99
97
|
*/
|
|
100
98
|
oriY?: 1 | -1;
|
|
@@ -103,7 +101,7 @@ export interface Image {
|
|
|
103
101
|
* 模板贴图属性
|
|
104
102
|
*/
|
|
105
103
|
export interface TemplateImage extends Image {
|
|
106
|
-
template:
|
|
104
|
+
template: TemplateContent;
|
|
107
105
|
}
|
|
108
106
|
/**
|
|
109
107
|
* 压缩贴图属性
|
|
@@ -117,7 +115,3 @@ export interface CompressedImage extends Image {
|
|
|
117
115
|
pvrtc?: string;
|
|
118
116
|
};
|
|
119
117
|
}
|
|
120
|
-
export interface VideoImage extends Image {
|
|
121
|
-
type: 'video';
|
|
122
|
-
loop?: boolean;
|
|
123
|
-
}
|
package/es/image.js
ADDED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from 'uuid/dist/esm-browser/v4';
|
|
2
1
|
export * from './type';
|
|
3
2
|
export * from './composition';
|
|
4
3
|
export * from './image';
|
|
@@ -16,11 +15,14 @@ export * from './item/particle-shape';
|
|
|
16
15
|
export * from './item/plugin-item';
|
|
17
16
|
export * from './item/sprite-item';
|
|
18
17
|
export * from './item/spine-item';
|
|
19
|
-
export * from './item/
|
|
18
|
+
export * from './item/effect-item';
|
|
20
19
|
export * from './item/text-item';
|
|
21
20
|
export * from './item/model';
|
|
22
21
|
export * from './vfx-item-data';
|
|
22
|
+
export * from './animation-clip-data';
|
|
23
23
|
export * from './binary';
|
|
24
24
|
export * from './text';
|
|
25
25
|
export * from './components';
|
|
26
26
|
export * from './vfx-item-data';
|
|
27
|
+
export * from './buitin-object-guid';
|
|
28
|
+
export * from './timeline';
|
package/es/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from './type';
|
|
2
|
+
export * from './composition';
|
|
3
|
+
export * from './image';
|
|
4
|
+
export * from './constants';
|
|
5
|
+
export * from './number-expression';
|
|
6
|
+
export * from './scene';
|
|
7
|
+
export * from './item';
|
|
8
|
+
export * from './item/base-item';
|
|
9
|
+
export * from './item/camera-item';
|
|
10
|
+
export * from './item/composition-item';
|
|
11
|
+
export * from './item/interact-item';
|
|
12
|
+
export * from './item/null-item';
|
|
13
|
+
export * from './item/particle-item';
|
|
14
|
+
export * from './item/particle-shape';
|
|
15
|
+
export * from './item/plugin-item';
|
|
16
|
+
export * from './item/sprite-item';
|
|
17
|
+
export * from './item/spine-item';
|
|
18
|
+
export * from './item/effect-item';
|
|
19
|
+
export * from './item/text-item';
|
|
20
|
+
export * from './item/model';
|
|
21
|
+
export * from './vfx-item-data';
|
|
22
|
+
export * from './animation-clip-data';
|
|
23
|
+
export * from './binary';
|
|
24
|
+
export * from './text';
|
|
25
|
+
export * from './components';
|
|
26
|
+
export * from './vfx-item-data';
|
|
27
|
+
export * from './buitin-object-guid';
|
|
28
|
+
export * from './timeline';
|
|
@@ -1,21 +1,40 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BinaryEnv } from '../binary';
|
|
2
2
|
import type { vec3, vec4 } from '../number-expression';
|
|
3
3
|
import type { ItemType, RenderLevel } from '../type';
|
|
4
4
|
import type { CameraContent } from './camera-item';
|
|
5
5
|
import type { CompositionContent } from './composition-item';
|
|
6
|
+
import type { EffectContent } from './effect-item';
|
|
6
7
|
import type { InteractContent } from './interact-item';
|
|
8
|
+
import type { ModelLightContent, ModelMeshItemContent, ModelTreeContent, SkyboxContent } from './model';
|
|
7
9
|
import type { NullContent } from './null-item';
|
|
8
10
|
import type { ParticleContent } from './particle-item';
|
|
9
11
|
import type { PluginContent } from './plugin-item';
|
|
12
|
+
import type { SpineContent } from './spine-item';
|
|
10
13
|
import type { SpriteContent } from './sprite-item';
|
|
11
14
|
import type { TextContent } from './text-item';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* 结束行为
|
|
17
|
+
*/
|
|
18
|
+
export declare enum EndBehavior {
|
|
19
|
+
/**
|
|
20
|
+
* 销毁
|
|
21
|
+
*/
|
|
22
|
+
destroy = 0,
|
|
23
|
+
/**
|
|
24
|
+
* 重播
|
|
25
|
+
*/
|
|
26
|
+
restart = 5,
|
|
27
|
+
/**
|
|
28
|
+
* 无限播放
|
|
29
|
+
*/
|
|
30
|
+
forward = 2,
|
|
31
|
+
/**
|
|
32
|
+
* 冻结
|
|
33
|
+
*/
|
|
34
|
+
freeze = 4
|
|
16
35
|
}
|
|
17
36
|
export declare enum ParentItemEndBehavior {
|
|
18
|
-
destroyChildren
|
|
37
|
+
destroyChildren = 6
|
|
19
38
|
}
|
|
20
39
|
export interface BaseItem {
|
|
21
40
|
/**
|
|
@@ -54,7 +73,7 @@ export interface BaseItem {
|
|
|
54
73
|
* 元素结束行为
|
|
55
74
|
* @default destroy
|
|
56
75
|
*/
|
|
57
|
-
endBehavior:
|
|
76
|
+
endBehavior: EndBehavior | ParentItemEndBehavior;
|
|
58
77
|
/**
|
|
59
78
|
* 元素播放延时(单位秒)
|
|
60
79
|
* @default 0
|
|
@@ -123,4 +142,4 @@ export interface TransformData {
|
|
|
123
142
|
size?: Vector2Data;
|
|
124
143
|
anchor?: Vector2Data;
|
|
125
144
|
}
|
|
126
|
-
export type BaseContent = SpriteContent | ParticleContent | NullContent | InteractContent | PluginContent | CompositionContent | CameraContent |
|
|
145
|
+
export type BaseContent = SpriteContent | ParticleContent | NullContent | InteractContent | PluginContent | CompositionContent | CameraContent | TextContent | SpineContent | EffectContent | ModelTreeContent<BinaryEnv> | ModelMeshItemContent<BinaryEnv> | ModelLightContent | SkyboxContent<BinaryEnv> | any;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { END_BEHAVIOR_DESTROY, END_BEHAVIOR_DESTROY_CHILDREN, END_BEHAVIOR_FORWARD, END_BEHAVIOR_FREEZE, END_BEHAVIOR_RESTART, } from '../constants';
|
|
2
|
+
/**
|
|
3
|
+
* 结束行为
|
|
4
|
+
*/
|
|
5
|
+
export var EndBehavior;
|
|
6
|
+
(function (EndBehavior) {
|
|
7
|
+
/**
|
|
8
|
+
* 销毁
|
|
9
|
+
*/
|
|
10
|
+
EndBehavior[EndBehavior["destroy"] = 0] = "destroy";
|
|
11
|
+
/**
|
|
12
|
+
* 重播
|
|
13
|
+
*/
|
|
14
|
+
EndBehavior[EndBehavior["restart"] = 5] = "restart";
|
|
15
|
+
/**
|
|
16
|
+
* 无限播放
|
|
17
|
+
*/
|
|
18
|
+
EndBehavior[EndBehavior["forward"] = 2] = "forward";
|
|
19
|
+
/**
|
|
20
|
+
* 冻结
|
|
21
|
+
*/
|
|
22
|
+
EndBehavior[EndBehavior["freeze"] = 4] = "freeze";
|
|
23
|
+
})(EndBehavior || (EndBehavior = {}));
|
|
24
|
+
export var ParentItemEndBehavior;
|
|
25
|
+
(function (ParentItemEndBehavior) {
|
|
26
|
+
ParentItemEndBehavior[ParentItemEndBehavior["destroyChildren"] = 6] = "destroyChildren";
|
|
27
|
+
})(ParentItemEndBehavior || (ParentItemEndBehavior = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseItem,
|
|
1
|
+
import type { BaseItem, EndBehavior } from './base-item';
|
|
2
2
|
import type { ItemType, RotationOverLifetime } from '../type';
|
|
3
3
|
import type { FixedNumberExpression, FixedVec3Expression } from '../number-expression';
|
|
4
4
|
import type { CameraClipMode } from '../composition';
|
|
@@ -11,7 +11,7 @@ export interface CameraItem extends BaseItem {
|
|
|
11
11
|
* 相机元素渲染信息
|
|
12
12
|
*/
|
|
13
13
|
content: CameraContent;
|
|
14
|
-
endBehavior:
|
|
14
|
+
endBehavior: EndBehavior;
|
|
15
15
|
}
|
|
16
16
|
export interface CameraContent {
|
|
17
17
|
/**
|
|
@@ -35,7 +35,7 @@ export interface CameraContent {
|
|
|
35
35
|
*/
|
|
36
36
|
clipMode?: CameraClipMode;
|
|
37
37
|
/**
|
|
38
|
-
* 默认不提供,等于canvas width/height
|
|
38
|
+
* 默认不提供,等于 canvas width/height
|
|
39
39
|
*/
|
|
40
40
|
aspect?: number;
|
|
41
41
|
};
|
|
@@ -50,15 +50,15 @@ export interface CameraContent {
|
|
|
50
50
|
}
|
|
51
51
|
export interface CameraPositionOverLifetime {
|
|
52
52
|
/**
|
|
53
|
-
* x轴位置变化信息
|
|
53
|
+
* x 轴位置变化信息
|
|
54
54
|
*/
|
|
55
55
|
linearX?: FixedNumberExpression;
|
|
56
56
|
/**
|
|
57
|
-
* y轴位置变化信息
|
|
57
|
+
* y 轴位置变化信息
|
|
58
58
|
*/
|
|
59
59
|
linearY?: FixedNumberExpression;
|
|
60
60
|
/**
|
|
61
|
-
* z轴位置变化信息
|
|
61
|
+
* z 轴位置变化信息
|
|
62
62
|
*/
|
|
63
63
|
linearZ?: FixedNumberExpression;
|
|
64
64
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseItem,
|
|
1
|
+
import type { BaseItem, EndBehavior } from './base-item';
|
|
2
2
|
import type { SizeOverLifetime, RotationOverLifetime, ColorOverLifetime, ItemType } from '../type';
|
|
3
3
|
import type { RGBAColorValue, vec3 } from '../number-expression';
|
|
4
4
|
import type { PositionOverLifetime } from '../type';
|
|
@@ -7,14 +7,14 @@ import type { PositionOverLifetime } from '../type';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface CompositionItem extends BaseItem {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 元素类型(指定为 composition)
|
|
11
11
|
*/
|
|
12
12
|
type: ItemType.composition;
|
|
13
13
|
/**
|
|
14
14
|
* 预合成元素渲染信息
|
|
15
15
|
*/
|
|
16
16
|
content: CompositionContent;
|
|
17
|
-
endBehavior:
|
|
17
|
+
endBehavior: EndBehavior;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* 预合成元素
|
|
@@ -25,7 +25,7 @@ export interface CompositionContent {
|
|
|
25
25
|
*/
|
|
26
26
|
options: {
|
|
27
27
|
/**
|
|
28
|
-
* 引用的合成
|
|
28
|
+
* 引用的合成 ID
|
|
29
29
|
*/
|
|
30
30
|
refId: string;
|
|
31
31
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ItemType, PositionOverLifetime, RotationOverLifetime, SizeOverLifetime } from '../type';
|
|
2
|
+
import type { BaseItem, EndBehavior } from './base-item';
|
|
3
|
+
/**
|
|
4
|
+
* 特效元素
|
|
5
|
+
*/
|
|
6
|
+
export interface EffectItem extends BaseItem {
|
|
7
|
+
type: ItemType.effect;
|
|
8
|
+
content: EffectContent;
|
|
9
|
+
endBehavior: EndBehavior;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 特效元素属性
|
|
13
|
+
*/
|
|
14
|
+
export interface EffectContent {
|
|
15
|
+
/**
|
|
16
|
+
* 特效元素材质数据索引组
|
|
17
|
+
*/
|
|
18
|
+
materials: number[];
|
|
19
|
+
/**
|
|
20
|
+
* 特效元素几何数据索引
|
|
21
|
+
*/
|
|
22
|
+
geometry: number;
|
|
23
|
+
/**
|
|
24
|
+
* 特效元素大小变化属性
|
|
25
|
+
*/
|
|
26
|
+
sizeOverLifetime?: SizeOverLifetime;
|
|
27
|
+
/**
|
|
28
|
+
* 特效元素旋转变化属性
|
|
29
|
+
*/
|
|
30
|
+
rotationOverLifetime?: RotationOverLifetime;
|
|
31
|
+
/**
|
|
32
|
+
* 特效元素位置变化属性
|
|
33
|
+
*/
|
|
34
|
+
positionOverLifetime?: PositionOverLifetime;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { InteractBehavior, InteractType, ItemType } from '../type';
|
|
2
2
|
import type { RGBAColor } from '../number-expression';
|
|
3
|
-
import type { BaseItem,
|
|
3
|
+
import type { BaseItem, EndBehavior } from './base-item';
|
|
4
4
|
import type { ComponentData } from '../components';
|
|
5
5
|
/**
|
|
6
6
|
* 交互元素
|
|
7
7
|
*/
|
|
8
8
|
export interface InteractItem extends BaseItem {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 元素类型(指定为 interact)
|
|
11
11
|
*/
|
|
12
12
|
type: ItemType.interact;
|
|
13
13
|
/**
|
|
14
14
|
* 交互元素渲染信息
|
|
15
15
|
*/
|
|
16
16
|
content: InteractContent;
|
|
17
|
-
endBehavior:
|
|
17
|
+
endBehavior: EndBehavior;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* 交互元素渲染属性
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseItem,
|
|
1
|
+
import type { BaseItem, EndBehavior } from '../base-item';
|
|
2
2
|
import type { CameraClipMode, CameraOptions } from '../../composition';
|
|
3
3
|
import type { RotationOverLifetime, PositionOverLifetime } from '../../type';
|
|
4
4
|
import type { ComponentData } from '../../components';
|
|
@@ -30,7 +30,7 @@ export interface ModelCameraItem extends BaseItem {
|
|
|
30
30
|
type: 'camera';
|
|
31
31
|
pluginName: 'model';
|
|
32
32
|
content: ModelCameraContent;
|
|
33
|
-
endBehavior:
|
|
33
|
+
endBehavior: EndBehavior;
|
|
34
34
|
}
|
|
35
35
|
export declare enum CameraType {
|
|
36
36
|
orthographic = "orthographic",
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export * from './skybox';
|
|
2
|
+
export * from './light';
|
|
3
|
+
export * from './mesh';
|
|
4
|
+
export * from './tree';
|
|
5
|
+
export * from './camera';
|
|
6
|
+
export * from './material';
|
|
7
|
+
export * from './binary';
|
|
8
|
+
export * from './render';
|
|
9
|
+
/***
|
|
10
|
+
* 一个 meshItem 打包出来的 json 案例:
|
|
11
|
+
*
|
|
12
|
+
* {
|
|
13
|
+
* type:'mesh',
|
|
14
|
+
* pluginName:'model',
|
|
15
|
+
* content:{
|
|
16
|
+
* options:{
|
|
17
|
+
* skins:{},
|
|
18
|
+
* primitives:[
|
|
19
|
+
* {
|
|
20
|
+
* material:{
|
|
21
|
+
* baseColorFactor:[0,0.5,1,1],
|
|
22
|
+
* baseColorTexture: {
|
|
23
|
+
* magFilter:33071,
|
|
24
|
+
* imageFileId:[0,556,1342]
|
|
25
|
+
* }
|
|
26
|
+
* },
|
|
27
|
+
* geometry:[0,0,556]
|
|
28
|
+
* }
|
|
29
|
+
* ]
|
|
30
|
+
* }
|
|
31
|
+
*
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* bins:[{url:'https://to/some/bin'}]
|
|
35
|
+
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RGBAColorValue } from '../../number-expression';
|
|
2
|
-
import type { BaseItem,
|
|
2
|
+
import type { BaseItem, EndBehavior } from '../base-item';
|
|
3
3
|
import type { RotationOverLifetime, PositionOverLifetime, ItemType } from '../../type';
|
|
4
4
|
import type { ColorData, ComponentData } from '../../components';
|
|
5
5
|
export interface ModelLightBaseOptions {
|
|
@@ -69,7 +69,7 @@ export interface ModelLightItem extends BaseItem {
|
|
|
69
69
|
type: ItemType.light;
|
|
70
70
|
pluginName: 'model';
|
|
71
71
|
content: ModelLightContent;
|
|
72
|
-
endBehavior:
|
|
72
|
+
endBehavior: EndBehavior;
|
|
73
73
|
}
|
|
74
74
|
export declare enum LightType {
|
|
75
75
|
/**
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export var LightType;
|
|
2
|
+
(function (LightType) {
|
|
3
|
+
/**
|
|
4
|
+
* 点光源
|
|
5
|
+
*/
|
|
6
|
+
LightType["point"] = "point";
|
|
7
|
+
/**
|
|
8
|
+
* 聚光灯
|
|
9
|
+
*/
|
|
10
|
+
LightType["spot"] = "spot";
|
|
11
|
+
/**
|
|
12
|
+
* 方向光
|
|
13
|
+
*/
|
|
14
|
+
LightType["directional"] = "directional";
|
|
15
|
+
/**
|
|
16
|
+
* 环境光
|
|
17
|
+
*/
|
|
18
|
+
LightType["ambient"] = "ambient";
|
|
19
|
+
})(LightType || (LightType = {}));
|
|
@@ -13,9 +13,9 @@ export declare enum MaterialType {
|
|
|
13
13
|
hair = "hair"
|
|
14
14
|
}
|
|
15
15
|
export declare enum MaterialBlending {
|
|
16
|
-
opaque = 100
|
|
17
|
-
masked = 101
|
|
18
|
-
translucent = 102
|
|
16
|
+
opaque = 100,// 不透明
|
|
17
|
+
masked = 101,// 遮罩
|
|
18
|
+
translucent = 102,// 半透明
|
|
19
19
|
additive = 103
|
|
20
20
|
}
|
|
21
21
|
export type MaterialOptions<T extends BinaryEnv> = MaterialUnlitOptions<T> | MaterialPBROptions<T>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// 材质类型
|
|
2
|
+
export var MaterialType;
|
|
3
|
+
(function (MaterialType) {
|
|
4
|
+
MaterialType["unlit"] = "unlit";
|
|
5
|
+
MaterialType["pbr"] = "pbr";
|
|
6
|
+
// 头发材质,在 pbr 材质基础上扩展
|
|
7
|
+
MaterialType["hair"] = "hair";
|
|
8
|
+
})(MaterialType || (MaterialType = {}));
|
|
9
|
+
// 混合模式
|
|
10
|
+
export var MaterialBlending;
|
|
11
|
+
(function (MaterialBlending) {
|
|
12
|
+
MaterialBlending[MaterialBlending["opaque"] = 100] = "opaque";
|
|
13
|
+
MaterialBlending[MaterialBlending["masked"] = 101] = "masked";
|
|
14
|
+
MaterialBlending[MaterialBlending["translucent"] = 102] = "translucent";
|
|
15
|
+
MaterialBlending[MaterialBlending["additive"] = 103] = "additive";
|
|
16
|
+
})(MaterialBlending || (MaterialBlending = {}));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { BinaryEnv } from '../../binary';
|
|
2
|
-
import type { BaseItem,
|
|
2
|
+
import type { BaseItem, EndBehavior } from '../base-item';
|
|
3
3
|
import type { MaterialOptions } from './material';
|
|
4
4
|
import type { GeometryPointer } from './binary';
|
|
5
5
|
import type { vec3 } from '../../number-expression';
|
|
6
6
|
import type { InteractBehavior, ItemType } from '../../type';
|
|
7
7
|
import type { ModelAnimationTrackDataPointer } from './binary';
|
|
8
|
-
import type { ComponentData, DataPath
|
|
8
|
+
import type { ComponentData, DataPath } from '../../components';
|
|
9
9
|
export type BufferType = WebGLRenderingContext['FLOAT'] | WebGLRenderingContext['INT'] | WebGLRenderingContext['SHORT'] | WebGLRenderingContext['BYTE'] | WebGLRenderingContext['UNSIGNED_INT'] | WebGLRenderingContext['UNSIGNED_SHORT'] | WebGLRenderingContext['UNSIGNED_BYTE'];
|
|
10
10
|
export interface PrimitiveOptions<T extends BinaryEnv> {
|
|
11
11
|
geometry: GeometryPointer<T>;
|
|
@@ -66,11 +66,11 @@ export interface ModelMeshItem<T extends BinaryEnv> extends BaseItem {
|
|
|
66
66
|
type: ItemType.mesh;
|
|
67
67
|
pluginName: 'model';
|
|
68
68
|
content: ModelMeshItemContent<T>;
|
|
69
|
-
endBehavior:
|
|
69
|
+
endBehavior: EndBehavior;
|
|
70
70
|
}
|
|
71
71
|
export interface PrimitiveData {
|
|
72
|
-
geometry:
|
|
73
|
-
material:
|
|
72
|
+
geometry: DataPath;
|
|
73
|
+
material: DataPath;
|
|
74
74
|
}
|
|
75
75
|
export interface SkinData {
|
|
76
76
|
name?: string;
|
|
@@ -84,13 +84,14 @@ export interface MorphData {
|
|
|
84
84
|
export interface ModelMeshComponentData extends ComponentData {
|
|
85
85
|
hide?: boolean;
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
87
|
+
* 骨骼根节点
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
rootBone?: DataPath;
|
|
90
90
|
/**
|
|
91
91
|
* Morph数据
|
|
92
92
|
*/
|
|
93
93
|
morph?: MorphData;
|
|
94
|
-
|
|
94
|
+
geometry: DataPath;
|
|
95
|
+
materials: DataPath[];
|
|
95
96
|
interaction?: ModelItemBounding;
|
|
96
97
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 3D渲染模式:将渲染过程中的中间结果输出,主要用于排查渲染效果问题,支持 pbr 和 unlit 材质
|
|
3
|
+
*/
|
|
4
|
+
export var RenderMode3D;
|
|
5
|
+
(function (RenderMode3D) {
|
|
6
|
+
/**
|
|
7
|
+
* 正常渲染
|
|
8
|
+
*/
|
|
9
|
+
RenderMode3D["none"] = "none";
|
|
10
|
+
/**
|
|
11
|
+
* 纹理坐标
|
|
12
|
+
*/
|
|
13
|
+
RenderMode3D["uv"] = "uv";
|
|
14
|
+
/**
|
|
15
|
+
* 世界坐标法线
|
|
16
|
+
*/
|
|
17
|
+
RenderMode3D["normal"] = "normal";
|
|
18
|
+
/**
|
|
19
|
+
* 基础颜色
|
|
20
|
+
*/
|
|
21
|
+
RenderMode3D["basecolor"] = "basecolor";
|
|
22
|
+
/**
|
|
23
|
+
* 基础颜色 Alpha
|
|
24
|
+
*/
|
|
25
|
+
RenderMode3D["alpha"] = "alpha";
|
|
26
|
+
/**
|
|
27
|
+
* 金属度
|
|
28
|
+
*/
|
|
29
|
+
RenderMode3D["metallic"] = "metallic";
|
|
30
|
+
/**
|
|
31
|
+
* 粗超度
|
|
32
|
+
*/
|
|
33
|
+
RenderMode3D["roughness"] = "roughness";
|
|
34
|
+
/**
|
|
35
|
+
* 环境遮蔽
|
|
36
|
+
*/
|
|
37
|
+
RenderMode3D["ao"] = "ao";
|
|
38
|
+
/**
|
|
39
|
+
* 自发光
|
|
40
|
+
*/
|
|
41
|
+
RenderMode3D["emissive"] = "emissive";
|
|
42
|
+
})(RenderMode3D || (RenderMode3D = {}));
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import type { BaseItem,
|
|
1
|
+
import type { BaseItem, EndBehavior } from '../base-item';
|
|
2
2
|
import type { BinaryEnv } from '../../binary';
|
|
3
3
|
import type { SkyboxCubeTexturePointer } from './binary';
|
|
4
4
|
import type { ItemType } from '../../type';
|
|
5
|
-
import type { ComponentData, DataPath } from '../../components';
|
|
5
|
+
import type { ComponentData, DataPath, Vector4Data } from '../../components';
|
|
6
6
|
export interface SkyboxOptions<T extends BinaryEnv> {
|
|
7
|
+
/**
|
|
8
|
+
* 环境光旋转
|
|
9
|
+
* UI显示"环境光旋转"
|
|
10
|
+
* @default { x: 0, y: 0, z: 0, w: 0 }
|
|
11
|
+
*/
|
|
12
|
+
rotation: Vector4Data;
|
|
7
13
|
renderable: boolean;
|
|
8
14
|
intensity: number;
|
|
9
15
|
reflectionsIntensity: number;
|
|
@@ -23,7 +29,7 @@ export interface ModelSkyboxItem<T extends BinaryEnv> extends BaseItem {
|
|
|
23
29
|
type: ItemType.skybox;
|
|
24
30
|
pluginName: 'model';
|
|
25
31
|
content: SkyboxContent<T>;
|
|
26
|
-
endBehavior:
|
|
32
|
+
endBehavior: EndBehavior;
|
|
27
33
|
}
|
|
28
34
|
/**
|
|
29
35
|
* 一个 skybox 打包出来:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|