@galacean/effects-specification 2.1.0-beta.0 → 2.2.0-alpha.0
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/animation-clip-data.d.ts +1 -1
- package/es/assets.d.ts +95 -0
- package/es/assets.js +18 -0
- package/es/binary.d.ts +2 -1
- package/es/buitin-object-guid.d.ts +1 -0
- package/es/buitin-object-guid.js +1 -0
- package/es/components/component-data.d.ts +7 -0
- package/es/components/component-data.js +1 -0
- package/es/components/index.d.ts +2 -0
- package/es/components/index.js +2 -0
- package/es/components/post-process-volume-data.d.ts +38 -0
- package/es/components/post-process-volume-data.js +1 -0
- package/es/composition.d.ts +0 -4
- package/es/constants.d.ts +6 -0
- package/es/constants.js +6 -0
- 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/vector-curve-datas.d.ts +16 -0
- package/es/curve-data/vector-curve-datas.js +1 -0
- package/es/data-type.d.ts +50 -0
- package/es/data-type.js +55 -0
- package/es/effects-object-data.d.ts +6 -0
- package/es/effects-object-data.js +1 -0
- package/es/effects-package-data.d.ts +9 -0
- package/es/effects-package-data.js +1 -0
- package/es/{components.d.ts → geometry-data.d.ts} +1 -95
- package/es/{components.js → geometry-data.js} +0 -39
- package/es/index.d.ts +17 -2
- package/es/index.js +17 -2
- package/es/item/audio-item.d.ts +46 -0
- package/es/item/audio-item.js +1 -0
- package/es/item/base-item.d.ts +3 -10
- package/es/item/effect-item.d.ts +6 -0
- package/es/item/interact-item.d.ts +1 -5
- package/es/item/model/light.d.ts +6 -1
- package/es/item/model/render.d.ts +5 -1
- package/es/item/model/render.js +4 -0
- package/es/item/model/skybox.d.ts +4 -11
- package/es/item/model/tree.d.ts +12 -12
- package/es/item/particle-item.d.ts +3 -68
- package/es/item/particle-shape.d.ts +12 -12
- package/es/item/rich-text-item.d.ts +35 -0
- package/es/item/rich-text-item.js +1 -0
- package/es/item/spine-item.d.ts +7 -2
- package/es/item/sprite-item.d.ts +1 -43
- package/es/item/text-item.d.ts +35 -64
- package/es/item/video-item.d.ts +82 -0
- package/es/item/video-item.js +1 -0
- package/es/item.d.ts +4 -1
- package/es/material-data.d.ts +21 -0
- package/es/material-data.js +1 -0
- package/es/math/color-data.d.ts +6 -0
- package/es/math/color-data.js +1 -0
- package/es/math/index.d.ts +2 -0
- package/es/math/index.js +2 -0
- package/es/math/vector-data.d.ts +15 -0
- package/es/math/vector-data.js +1 -0
- package/es/number-expression.d.ts +18 -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 +33 -8
- package/es/scene.js +5 -1
- package/es/shader-data.d.ts +6 -0
- package/es/shader-data.js +1 -0
- package/es/shape/custom-shape-data.d.ts +68 -0
- package/es/shape/custom-shape-data.js +1 -0
- package/es/shape/ellipse-data.d.ts +28 -0
- package/es/shape/ellipse-data.js +1 -0
- package/es/shape/index.d.ts +9 -0
- package/es/shape/index.js +9 -0
- package/es/shape/polygon-data.d.ts +28 -0
- package/es/shape/polygon-data.js +1 -0
- package/es/shape/rectangle-data.d.ts +28 -0
- package/es/shape/rectangle-data.js +1 -0
- package/es/shape/shape-component-data.d.ts +16 -0
- package/es/shape/shape-component-data.js +1 -0
- package/es/shape/shape-fill-param.d.ts +10 -0
- package/es/shape/shape-fill-param.js +1 -0
- package/es/shape/shape-primitive-type.d.ts +25 -0
- package/es/shape/shape-primitive-type.js +26 -0
- package/es/shape/shape-stroke-param.d.ts +26 -0
- package/es/shape/shape-stroke-param.js +8 -0
- package/es/shape/star-data.d.ts +36 -0
- package/es/shape/star-data.js +1 -0
- package/es/texture.d.ts +48 -0
- package/es/texture.js +1 -0
- package/es/timeline/playables/sprite-color-playable-asset-data.d.ts +2 -1
- package/es/timeline/playables/transform-playable-asset-data.d.ts +2 -1
- package/es/timeline/timeline-asset-data.d.ts +3 -1
- package/es/timeline/track/track-asset-data.d.ts +2 -1
- package/es/type.d.ts +25 -16
- package/es/type.js +33 -13
- package/es/vfx-item-data.d.ts +2 -1
- package/package.json +13 -12
- package/es/image.d.ts +0 -123
- package/es/image.js +0 -9
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { TransformData } from '../item/base-item';
|
|
2
|
+
import type { ShapeComponentData } from './shape-component-data';
|
|
3
|
+
import type { ShapeFillParam } from './shape-fill-param';
|
|
4
|
+
/**
|
|
5
|
+
* 星形参数
|
|
6
|
+
*/
|
|
7
|
+
export interface StarData extends ShapeComponentData {
|
|
8
|
+
/**
|
|
9
|
+
* 顶点数 - 内外顶点同数
|
|
10
|
+
*/
|
|
11
|
+
pointCount: number;
|
|
12
|
+
/**
|
|
13
|
+
* 内径
|
|
14
|
+
*/
|
|
15
|
+
innerRadius: number;
|
|
16
|
+
/**
|
|
17
|
+
* 外径
|
|
18
|
+
*/
|
|
19
|
+
outerRadius: number;
|
|
20
|
+
/**
|
|
21
|
+
* 内径点圆度
|
|
22
|
+
*/
|
|
23
|
+
innerRoundness: number;
|
|
24
|
+
/**
|
|
25
|
+
* 外径点圆度
|
|
26
|
+
*/
|
|
27
|
+
outerRoundness: number;
|
|
28
|
+
/**
|
|
29
|
+
* 填充属性
|
|
30
|
+
*/
|
|
31
|
+
fill?: ShapeFillParam;
|
|
32
|
+
/**
|
|
33
|
+
* 空间变换
|
|
34
|
+
*/
|
|
35
|
+
transform?: TransformData;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/es/texture.d.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { BinaryPointer } from './binary';
|
|
2
|
+
import type { DataType } from './data-type';
|
|
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
|
+
dataType: DataType.Texture;
|
|
32
|
+
target?: WebGLRenderingContext['TEXTURE_2D'];
|
|
33
|
+
source: number;
|
|
34
|
+
}
|
|
35
|
+
export interface SerializedTexture2DMipmapSource extends TextureConfigOptionsBase, TextureFormatOptions {
|
|
36
|
+
dataType: DataType.Texture;
|
|
37
|
+
target?: WebGLRenderingContext['TEXTURE_2D'];
|
|
38
|
+
mipmaps: BinaryPointer[];
|
|
39
|
+
}
|
|
40
|
+
export interface SerializedTextureCube extends TextureConfigOptionsBase, TextureFormatOptions {
|
|
41
|
+
dataType: DataType.Texture;
|
|
42
|
+
target: WebGLRenderingContext['TEXTURE_CUBE_MAP'];
|
|
43
|
+
mipmaps: SerializedTextureCubeMipmap[];
|
|
44
|
+
}
|
|
45
|
+
export type SerializedTexture2D = SerializedTexture2DImageSource | SerializedTexture2DMipmapSource;
|
|
46
|
+
export type SerializedTextureSource = SerializedTexture2D | SerializedTextureCube;
|
|
47
|
+
export type TextureJSONOptions = SerializedTextureSource;
|
|
48
|
+
export type TextureDefine = TextureJSONOptions;
|
package/es/texture.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { DataType, EffectsObjectData } from '../../components';
|
|
2
1
|
import type { RGBAColorValue } from '../../number-expression';
|
|
3
2
|
import type { ColorOverLifetime } from '../../type';
|
|
3
|
+
import type { DataType } from '../../data-type';
|
|
4
|
+
import type { EffectsObjectData } from '../../effects-object-data';
|
|
4
5
|
export interface SpriteColorPlayableAssetData extends EffectsObjectData {
|
|
5
6
|
dataType: DataType.SpriteColorPlayableAsset;
|
|
6
7
|
colorOverLifetime?: ColorOverLifetime;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { EffectsObjectData } from '../../effects-object-data';
|
|
2
2
|
import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime } from '../../type';
|
|
3
|
+
import type { DataType } from '../../data-type';
|
|
3
4
|
export interface TransformPlayableAssetData extends EffectsObjectData {
|
|
4
5
|
dataType: DataType.TransformPlayableAsset;
|
|
5
6
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DataPath } from '../components';
|
|
2
|
+
import type { DataType } from '../data-type';
|
|
3
|
+
import type { EffectsObjectData } from '../effects-object-data';
|
|
2
4
|
export interface TimelineAssetData extends EffectsObjectData {
|
|
3
5
|
dataType: DataType.TimelineAsset;
|
|
4
6
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { DataPath
|
|
1
|
+
import type { DataPath } from '../../components';
|
|
2
2
|
import type { TimelineClipData } from '../timeline-clip-data';
|
|
3
|
+
import type { EffectsObjectData } from '../../effects-object-data';
|
|
3
4
|
export interface TrackAssetData extends EffectsObjectData {
|
|
4
5
|
/**
|
|
5
6
|
* 子轨道数据(TrackAssetData)
|
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
|
*/
|
|
@@ -329,7 +317,7 @@ export declare enum MaskMode {
|
|
|
329
317
|
/**
|
|
330
318
|
* 发射器形状
|
|
331
319
|
*/
|
|
332
|
-
export declare enum
|
|
320
|
+
export declare enum ParticleEmitterShapeType {
|
|
333
321
|
/**
|
|
334
322
|
* 没有类型
|
|
335
323
|
*/
|
|
@@ -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
|
|
@@ -540,10 +528,30 @@ export declare enum ItemType {
|
|
|
540
528
|
* 特效元素
|
|
541
529
|
*/
|
|
542
530
|
effect = "effect",
|
|
531
|
+
/**
|
|
532
|
+
* 形状元素
|
|
533
|
+
*/
|
|
534
|
+
shape = "shape",
|
|
535
|
+
/**
|
|
536
|
+
* 后处理元素
|
|
537
|
+
*/
|
|
538
|
+
postProcessVolume = "postProcessVolume",
|
|
543
539
|
/**
|
|
544
540
|
* 节点元素
|
|
545
541
|
*/
|
|
546
|
-
node = "node"
|
|
542
|
+
node = "node",
|
|
543
|
+
/**
|
|
544
|
+
* 视频元素
|
|
545
|
+
*/
|
|
546
|
+
video = "video",
|
|
547
|
+
/**
|
|
548
|
+
* 音频元素
|
|
549
|
+
*/
|
|
550
|
+
audio = "audio",
|
|
551
|
+
/**
|
|
552
|
+
* 富文本元素
|
|
553
|
+
*/
|
|
554
|
+
richtext = "richtext"
|
|
547
555
|
}
|
|
548
556
|
/**
|
|
549
557
|
* 渲染模式
|
|
@@ -670,3 +678,4 @@ export declare enum RenderFace {
|
|
|
670
678
|
Back = "Back",
|
|
671
679
|
Front = "Front"
|
|
672
680
|
}
|
|
681
|
+
export type HTMLImageLike = HTMLImageElement | HTMLCanvasElement | HTMLVideoElement;
|
package/es/type.js
CHANGED
|
@@ -93,49 +93,49 @@ export var MaskMode;
|
|
|
93
93
|
/**
|
|
94
94
|
* 发射器形状
|
|
95
95
|
*/
|
|
96
|
-
export var
|
|
97
|
-
(function (
|
|
96
|
+
export var ParticleEmitterShapeType;
|
|
97
|
+
(function (ParticleEmitterShapeType) {
|
|
98
98
|
/**
|
|
99
99
|
* 没有类型
|
|
100
100
|
*/
|
|
101
|
-
|
|
101
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["NONE"] = 0] = "NONE";
|
|
102
102
|
/**
|
|
103
103
|
* 圆球
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["SPHERE"] = 1] = "SPHERE";
|
|
106
106
|
/**
|
|
107
107
|
* 圆锥
|
|
108
108
|
*/
|
|
109
|
-
|
|
109
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["CONE"] = 2] = "CONE";
|
|
110
110
|
/**
|
|
111
111
|
* 半球
|
|
112
112
|
*/
|
|
113
|
-
|
|
113
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["HEMISPHERE"] = 3] = "HEMISPHERE";
|
|
114
114
|
/**
|
|
115
115
|
* 圆
|
|
116
116
|
*/
|
|
117
|
-
|
|
117
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["CIRCLE"] = 4] = "CIRCLE";
|
|
118
118
|
/**
|
|
119
119
|
* 圆环
|
|
120
120
|
*/
|
|
121
|
-
|
|
121
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["DONUT"] = 5] = "DONUT";
|
|
122
122
|
/**
|
|
123
123
|
* 矩形
|
|
124
124
|
*/
|
|
125
|
-
|
|
125
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE"] = 6] = "RECTANGLE";
|
|
126
126
|
/**
|
|
127
127
|
* 矩形框
|
|
128
128
|
*/
|
|
129
|
-
|
|
129
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["RECTANGLE_EDGE"] = 7] = "RECTANGLE_EDGE";
|
|
130
130
|
/**
|
|
131
131
|
* 直线
|
|
132
132
|
*/
|
|
133
|
-
|
|
133
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["EDGE"] = 8] = "EDGE";
|
|
134
134
|
/**
|
|
135
135
|
* 贴图
|
|
136
136
|
*/
|
|
137
|
-
|
|
138
|
-
})(
|
|
137
|
+
ParticleEmitterShapeType[ParticleEmitterShapeType["TEXTURE"] = 9] = "TEXTURE";
|
|
138
|
+
})(ParticleEmitterShapeType || (ParticleEmitterShapeType = {}));
|
|
139
139
|
/**
|
|
140
140
|
* 插件类型
|
|
141
141
|
*/
|
|
@@ -260,10 +260,30 @@ export var ItemType;
|
|
|
260
260
|
* 特效元素
|
|
261
261
|
*/
|
|
262
262
|
ItemType["effect"] = "effect";
|
|
263
|
+
/**
|
|
264
|
+
* 形状元素
|
|
265
|
+
*/
|
|
266
|
+
ItemType["shape"] = "shape";
|
|
267
|
+
/**
|
|
268
|
+
* 后处理元素
|
|
269
|
+
*/
|
|
270
|
+
ItemType["postProcessVolume"] = "postProcessVolume";
|
|
263
271
|
/**
|
|
264
272
|
* 节点元素
|
|
265
273
|
*/
|
|
266
274
|
ItemType["node"] = "node";
|
|
275
|
+
/**
|
|
276
|
+
* 视频元素
|
|
277
|
+
*/
|
|
278
|
+
ItemType["video"] = "video";
|
|
279
|
+
/**
|
|
280
|
+
* 音频元素
|
|
281
|
+
*/
|
|
282
|
+
ItemType["audio"] = "audio";
|
|
283
|
+
/**
|
|
284
|
+
* 富文本元素
|
|
285
|
+
*/
|
|
286
|
+
ItemType["richtext"] = "richtext";
|
|
267
287
|
})(ItemType || (ItemType = {}));
|
|
268
288
|
/**
|
|
269
289
|
* 渲染模式
|
package/es/vfx-item-data.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { DataPath
|
|
1
|
+
import type { DataPath } from './components';
|
|
2
|
+
import type { EffectsObjectData } from './effects-object-data';
|
|
2
3
|
import type { EndBehavior, BaseContent, TransformData } from './item/base-item';
|
|
3
4
|
import type { ItemType, RenderLevel } from './type';
|
|
4
5
|
export interface VFXItemData extends EffectsObjectData {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/effects-specification",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-alpha.0",
|
|
4
4
|
"description": "Galacean Effects JSON Specification",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"main": "./es/index.js",
|
|
@@ -15,6 +15,17 @@
|
|
|
15
15
|
"types": "./es/index.d.ts"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"prebuild": "pnpm clean",
|
|
20
|
+
"build": "pnpm build:lib",
|
|
21
|
+
"build:lib": "tsc -b tsconfig.build.json",
|
|
22
|
+
"lint": "eslint src --ext .ts,.mjs",
|
|
23
|
+
"lint:fix": "eslint src --fix --quiet --ext .ts,.mjs",
|
|
24
|
+
"check:ts": "tsc -b tsconfig.check.json",
|
|
25
|
+
"clean": "rimraf es/**",
|
|
26
|
+
"prepare": "husky install",
|
|
27
|
+
"prepublishOnly": "npm run build"
|
|
28
|
+
},
|
|
18
29
|
"browserslist": [
|
|
19
30
|
"iOS 9"
|
|
20
31
|
],
|
|
@@ -37,15 +48,5 @@
|
|
|
37
48
|
"publishConfig": {
|
|
38
49
|
"access": "public",
|
|
39
50
|
"registry": "https://registry.npmjs.org"
|
|
40
|
-
},
|
|
41
|
-
"scripts": {
|
|
42
|
-
"prebuild": "npm run clean:all",
|
|
43
|
-
"build": "npm run build:lib",
|
|
44
|
-
"build:lib": "tsc -b tsconfig.build.json",
|
|
45
|
-
"lint": "eslint src --ext .ts,.mjs",
|
|
46
|
-
"lint:fix": "eslint src --fix --quiet --ext .ts,.mjs",
|
|
47
|
-
"check:ts": "tsc -b tsconfig.check.json",
|
|
48
|
-
"clean:all": "npm run clean:lib",
|
|
49
|
-
"clean:lib": "rimraf es/**"
|
|
50
51
|
}
|
|
51
|
-
}
|
|
52
|
+
}
|
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
|
-
}
|