@galacean/effects-core 1.1.1 → 1.1.2
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 +29 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/asset-manager.d.ts +0 -135
- package/dist/camera.d.ts +0 -183
- package/dist/comp-vfx-item.d.ts +0 -71
- package/dist/composition-source-manager.d.ts +0 -41
- package/dist/composition.d.ts +0 -406
- package/dist/config.d.ts +0 -7
- package/dist/constants.d.ts +0 -11
- package/dist/downloader.d.ts +0 -83
- package/dist/engine.d.ts +0 -38
- package/dist/filter.d.ts +0 -63
- package/dist/filters/alpha-frame.d.ts +0 -5
- package/dist/filters/alpha-mask.d.ts +0 -5
- package/dist/filters/bloom.d.ts +0 -8
- package/dist/filters/camera-move.d.ts +0 -5
- package/dist/filters/delay.d.ts +0 -14
- package/dist/filters/distortion.d.ts +0 -5
- package/dist/filters/gaussian.d.ts +0 -27
- package/dist/filters/index.d.ts +0 -2
- package/dist/filters/lum.d.ts +0 -5
- package/dist/filters/utils.d.ts +0 -7
- package/dist/gl/create-gl-context.d.ts +0 -9
- package/dist/gl/gpu-time.d.ts +0 -5
- package/dist/gl/index.d.ts +0 -6
- package/dist/index.d.ts +0 -31
- package/dist/libs/earcut.d.ts +0 -37
- package/dist/material/index.d.ts +0 -4
- package/dist/material/material-data-block.d.ts +0 -27
- package/dist/material/material.d.ts +0 -347
- package/dist/material/types.d.ts +0 -66
- package/dist/material/utils.d.ts +0 -17
- package/dist/math/float16array-wrapper.d.ts +0 -5
- package/dist/math/index.d.ts +0 -4
- package/dist/math/translate.d.ts +0 -10
- package/dist/math/utils.d.ts +0 -19
- package/dist/math/value-getter.d.ts +0 -127
- package/dist/paas-texture-cache.d.ts +0 -24
- package/dist/pass-render-level.d.ts +0 -1
- package/dist/plugin-system.d.ts +0 -34
- package/dist/plugins/cal/calculate-item.d.ts +0 -84
- package/dist/plugins/cal/calculate-loader.d.ts +0 -3
- package/dist/plugins/cal/calculate-vfx-item.d.ts +0 -26
- package/dist/plugins/camera/camera-controller-node.d.ts +0 -17
- package/dist/plugins/camera/camera-vfx-item-loader.d.ts +0 -3
- package/dist/plugins/camera/camera-vfx-item.d.ts +0 -13
- package/dist/plugins/index.d.ts +0 -26
- package/dist/plugins/interact/click-handler.d.ts +0 -66
- package/dist/plugins/interact/event-system.d.ts +0 -37
- package/dist/plugins/interact/interact-item.d.ts +0 -2
- package/dist/plugins/interact/interact-loader.d.ts +0 -13
- package/dist/plugins/interact/interact-mesh.d.ts +0 -16
- package/dist/plugins/interact/interact-vfx-item.d.ts +0 -28
- package/dist/plugins/particle/burst.d.ts +0 -21
- package/dist/plugins/particle/link.d.ts +0 -21
- package/dist/plugins/particle/particle-loader.d.ts +0 -18
- package/dist/plugins/particle/particle-mesh.d.ts +0 -164
- package/dist/plugins/particle/particle-system.d.ts +0 -198
- package/dist/plugins/particle/particle-vfx-item.d.ts +0 -27
- package/dist/plugins/particle/trail-mesh.d.ts +0 -61
- package/dist/plugins/plugin.d.ts +0 -125
- package/dist/plugins/sprite/filter-sprite-vfx-item.d.ts +0 -13
- package/dist/plugins/sprite/sprite-group.d.ts +0 -95
- package/dist/plugins/sprite/sprite-item.d.ts +0 -106
- package/dist/plugins/sprite/sprite-loader.d.ts +0 -20
- package/dist/plugins/sprite/sprite-mesh.d.ts +0 -67
- package/dist/plugins/sprite/sprite-vfx-item.d.ts +0 -33
- package/dist/plugins/text/text-item.d.ts +0 -117
- package/dist/plugins/text/text-layout.d.ts +0 -28
- package/dist/plugins/text/text-loader.d.ts +0 -18
- package/dist/plugins/text/text-mesh.d.ts +0 -15
- package/dist/plugins/text/text-style.d.ts +0 -67
- package/dist/plugins/text/text-vfx-item.d.ts +0 -28
- package/dist/polyfill.d.ts +0 -4
- package/dist/render/create-copy-shader.d.ts +0 -6
- package/dist/render/frame-buffer.d.ts +0 -48
- package/dist/render/geometry.d.ts +0 -118
- package/dist/render/global-volume.d.ts +0 -15
- package/dist/render/gpu-capability.d.ts +0 -49
- package/dist/render/index.d.ts +0 -12
- package/dist/render/mesh.d.ts +0 -82
- package/dist/render/post-process-pass.d.ts +0 -37
- package/dist/render/render-buffer.d.ts +0 -20
- package/dist/render/render-frame.d.ts +0 -269
- package/dist/render/render-pass.d.ts +0 -309
- package/dist/render/renderer.d.ts +0 -62
- package/dist/render/shader.d.ts +0 -97
- package/dist/render/types.d.ts +0 -5
- package/dist/scene.d.ts +0 -29
- package/dist/semantic-map.d.ts +0 -14
- package/dist/shader/index.d.ts +0 -30
- package/dist/shape/2d-shape.d.ts +0 -32
- package/dist/shape/cone.d.ts +0 -11
- package/dist/shape/donut.d.ts +0 -9
- package/dist/shape/earcut.d.ts +0 -1
- package/dist/shape/geometry.d.ts +0 -30
- package/dist/shape/index.d.ts +0 -3
- package/dist/shape/shape.d.ts +0 -21
- package/dist/shape/sphere.d.ts +0 -15
- package/dist/shape/texture-shape.d.ts +0 -11
- package/dist/template-image/index.d.ts +0 -67
- package/dist/template-image/qcanvas-viewer.d.ts +0 -21
- package/dist/template-image/qtext.d.ts +0 -96
- package/dist/template-image/template-v1.d.ts +0 -27
- package/dist/template-image/text-metrics.d.ts +0 -18
- package/dist/texture/index.d.ts +0 -5
- package/dist/texture/ktx-texture.d.ts +0 -21
- package/dist/texture/texture-factory.d.ts +0 -13
- package/dist/texture/texture.d.ts +0 -78
- package/dist/texture/types.d.ts +0 -165
- package/dist/texture/utils.d.ts +0 -5
- package/dist/ticker.d.ts +0 -48
- package/dist/transform.d.ts +0 -221
- package/dist/utils/array.d.ts +0 -19
- package/dist/utils/asserts.d.ts +0 -2
- package/dist/utils/color.d.ts +0 -10
- package/dist/utils/device.d.ts +0 -4
- package/dist/utils/image-data.d.ts +0 -10
- package/dist/utils/index.d.ts +0 -67
- package/dist/utils/sortable.d.ts +0 -23
- package/dist/utils/timeline-component.d.ts +0 -39
- package/dist/vfx-item.d.ts +0 -360
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import type * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { vec4 } from '@galacean/effects-specification';
|
|
3
|
-
import type { Camera } from '../camera';
|
|
4
|
-
import type { Mesh, MeshDestroyOptions, Renderer } from '../render';
|
|
5
|
-
import { FrameBuffer } from '../render';
|
|
6
|
-
import type { SemanticGetter } from '../semantic-map';
|
|
7
|
-
import { SemanticMap } from '../semantic-map';
|
|
8
|
-
import type { TextureConfigOptions, TextureLoadAction } from '../texture';
|
|
9
|
-
import { Texture } from '../texture';
|
|
10
|
-
import type { Disposable, Sortable } from '../utils';
|
|
11
|
-
import { DestroyOptions, OrderType } from '../utils';
|
|
12
|
-
import type { RenderBuffer } from './render-buffer';
|
|
13
|
-
import type { RenderingData } from './render-frame';
|
|
14
|
-
import type { Engine } from '../engine';
|
|
15
|
-
export declare const RenderPassPriorityPrepare = 0;
|
|
16
|
-
export declare const RenderPassPriorityNormal = 1000;
|
|
17
|
-
export declare const RenderPassPriorityPostprocess = 3000;
|
|
18
|
-
/**
|
|
19
|
-
* RenderPass Attachment 存储类型
|
|
20
|
-
*/
|
|
21
|
-
export declare enum RenderPassAttachmentStorageType {
|
|
22
|
-
none = 0,
|
|
23
|
-
color = 1,
|
|
24
|
-
stencil_8_opaque = 2,
|
|
25
|
-
depth_16_opaque = 3,
|
|
26
|
-
depth_stencil_opaque = 4,
|
|
27
|
-
depth_16_texture = 5,
|
|
28
|
-
depth_24_stencil_8_texture = 6
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Attachment 结束后清除行为
|
|
32
|
-
*/
|
|
33
|
-
export declare enum TextureStoreAction {
|
|
34
|
-
/**
|
|
35
|
-
* 不清除 Attachment
|
|
36
|
-
*/
|
|
37
|
-
store = 0,
|
|
38
|
-
/**
|
|
39
|
-
* 清除 Attachment
|
|
40
|
-
*/
|
|
41
|
-
clear = 2
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* RenderPass 开始前的清除行为
|
|
45
|
-
*/
|
|
46
|
-
export interface RenderPassClearAction {
|
|
47
|
-
clearColor?: vec4;
|
|
48
|
-
colorAction?: TextureLoadAction;
|
|
49
|
-
clearDepth?: number;
|
|
50
|
-
depthAction?: TextureLoadAction;
|
|
51
|
-
clearStencil?: number;
|
|
52
|
-
stencilAction?: TextureLoadAction;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* RenderPass 结束后的清除行为
|
|
56
|
-
*/
|
|
57
|
-
export interface RenderPassStoreAction {
|
|
58
|
-
colorAction?: TextureStoreAction;
|
|
59
|
-
depthAction?: TextureStoreAction;
|
|
60
|
-
stencilAction?: TextureStoreAction;
|
|
61
|
-
}
|
|
62
|
-
export interface RenderPassColorAttachmentTextureOptions extends spec.TextureFormatOptions, TextureConfigOptions {
|
|
63
|
-
size?: [x: number, y: number];
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* RenderPass ColorAttachment 选项
|
|
67
|
-
*/
|
|
68
|
-
export interface RenderPassColorAttachmentOptions {
|
|
69
|
-
size?: [x: number, y: number];
|
|
70
|
-
name?: string;
|
|
71
|
-
/**
|
|
72
|
-
* ColorAttachment 的纹理参数
|
|
73
|
-
*/
|
|
74
|
-
texture?: Texture | RenderPassColorAttachmentTextureOptions;
|
|
75
|
-
/**
|
|
76
|
-
* ColorAttachment 的 Buffer 参数
|
|
77
|
-
*/
|
|
78
|
-
buffer?: RenderBuffer;
|
|
79
|
-
/**
|
|
80
|
-
* WebGL2 下 RenderBuffer 超采数目。默认是0,即不启用超采。
|
|
81
|
-
* @default 0
|
|
82
|
-
*/
|
|
83
|
-
multiSample?: number;
|
|
84
|
-
/**
|
|
85
|
-
* 是否持久的对象
|
|
86
|
-
*/
|
|
87
|
-
persistent?: boolean;
|
|
88
|
-
}
|
|
89
|
-
export declare class RenderTargetHandle implements Disposable {
|
|
90
|
-
texture: Texture;
|
|
91
|
-
readonly textureOptions?: RenderPassColorAttachmentTextureOptions;
|
|
92
|
-
readonly externalTexture: boolean;
|
|
93
|
-
protected destroyed: boolean;
|
|
94
|
-
constructor(engine: Engine, options?: RenderPassColorAttachmentOptions);
|
|
95
|
-
dispose(): void;
|
|
96
|
-
get isDestroyed(): boolean;
|
|
97
|
-
get storageType(): RenderPassAttachmentStorageType;
|
|
98
|
-
get size(): [x: number, y: number];
|
|
99
|
-
get width(): number;
|
|
100
|
-
get height(): number;
|
|
101
|
-
}
|
|
102
|
-
export interface RenderPassDepthStencilAttachment {
|
|
103
|
-
readonly storageType: RenderPassAttachmentStorageType;
|
|
104
|
-
readonly storage?: RenderBuffer;
|
|
105
|
-
readonly texture?: Texture;
|
|
106
|
-
}
|
|
107
|
-
export interface RenderPassDepthStencilAttachmentOptions {
|
|
108
|
-
storageType: RenderPassAttachmentStorageType;
|
|
109
|
-
storage?: RenderBuffer;
|
|
110
|
-
texture?: Texture;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* RenderPass Attachment 销毁类型
|
|
114
|
-
*/
|
|
115
|
-
export declare enum RenderPassDestroyAttachmentType {
|
|
116
|
-
/**
|
|
117
|
-
* 强制销毁
|
|
118
|
-
*/
|
|
119
|
-
force = 0,
|
|
120
|
-
/**
|
|
121
|
-
* 保留,不销毁
|
|
122
|
-
*/
|
|
123
|
-
keep = 1,
|
|
124
|
-
/**
|
|
125
|
-
* 如果是外部传入的 Attachment,就不销毁
|
|
126
|
-
*/
|
|
127
|
-
keepExternal = 2,
|
|
128
|
-
/**
|
|
129
|
-
* 强制销毁
|
|
130
|
-
*/
|
|
131
|
-
destroy = 0
|
|
132
|
-
}
|
|
133
|
-
export type RenderPassDestroyOptions = {
|
|
134
|
-
meshes?: MeshDestroyOptions | DestroyOptions.keep;
|
|
135
|
-
semantics?: DestroyOptions;
|
|
136
|
-
colorAttachment?: RenderPassDestroyAttachmentType;
|
|
137
|
-
depthStencilAttachment?: RenderPassDestroyAttachmentType;
|
|
138
|
-
};
|
|
139
|
-
/**
|
|
140
|
-
* RenderPass 渲染过程回调
|
|
141
|
-
*/
|
|
142
|
-
export interface RenderPassDelegate {
|
|
143
|
-
/**
|
|
144
|
-
* 开始前回调
|
|
145
|
-
* @param renderPass - 当前 RenderPass
|
|
146
|
-
* @param state - 当前渲染状态
|
|
147
|
-
*/
|
|
148
|
-
willBeginRenderPass?: (renderPass: RenderPass, state: RenderingData) => void;
|
|
149
|
-
/**
|
|
150
|
-
* 结束后回调
|
|
151
|
-
* @param renderPass - 当前 RenderPass
|
|
152
|
-
* @param state - 当前渲染状态
|
|
153
|
-
*/
|
|
154
|
-
didEndRenderPass?: (renderPass: RenderPass, state: RenderingData) => void;
|
|
155
|
-
/**
|
|
156
|
-
* Mesh 渲染前回调
|
|
157
|
-
* @param mesh - 当前 Mesh
|
|
158
|
-
* @param state - 当前渲染状态
|
|
159
|
-
*/
|
|
160
|
-
willRenderMesh?: (mesh: Mesh, state: RenderingData) => void;
|
|
161
|
-
/**
|
|
162
|
-
* Mesh 渲染后回调
|
|
163
|
-
* @param mesh - 当前 Mesh
|
|
164
|
-
* @param state - 当前渲染状态
|
|
165
|
-
*/
|
|
166
|
-
didiRenderMesh?: (mesh: Mesh, state: RenderingData) => void;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* RenderPass Attachment 选项
|
|
170
|
-
*/
|
|
171
|
-
export interface RenderPassAttachmentOptions {
|
|
172
|
-
attachments?: RenderPassColorAttachmentOptions[];
|
|
173
|
-
depthStencilAttachment?: RenderPassDepthStencilAttachmentOptions;
|
|
174
|
-
/**
|
|
175
|
-
* RenderPass 视口大小,如果没有指定,会用 viewportScale 计算
|
|
176
|
-
*/
|
|
177
|
-
viewport?: [x: number, y: number, width: number, height: number];
|
|
178
|
-
/**
|
|
179
|
-
* 视口缩放系数
|
|
180
|
-
* 1. viewport 提供时,忽略此参数,RenderPass 视口大小由 viewport 决定;
|
|
181
|
-
* 2. 默认为1,RenderPass 视口大小由画布大小* viewportScale 决定,画布尺寸变化时,RenderPass 视口也会变化;
|
|
182
|
-
*/
|
|
183
|
-
viewportScale?: number;
|
|
184
|
-
}
|
|
185
|
-
export interface RenderPassOptions extends RenderPassAttachmentOptions {
|
|
186
|
-
name?: string;
|
|
187
|
-
meshes?: Mesh[];
|
|
188
|
-
priority?: number;
|
|
189
|
-
meshOrder?: OrderType;
|
|
190
|
-
clearAction?: RenderPassClearAction;
|
|
191
|
-
storeAction?: RenderPassStoreAction;
|
|
192
|
-
semantics?: Record<string, SemanticGetter>;
|
|
193
|
-
delegate?: RenderPassDelegate;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* RenderPass 抽象类
|
|
197
|
-
*/
|
|
198
|
-
export declare class RenderPass implements Disposable, Sortable {
|
|
199
|
-
/**
|
|
200
|
-
* 优先级
|
|
201
|
-
*/
|
|
202
|
-
priority: number;
|
|
203
|
-
/**
|
|
204
|
-
* 渲染时的回调函数
|
|
205
|
-
*/
|
|
206
|
-
delegate: RenderPassDelegate;
|
|
207
|
-
/**
|
|
208
|
-
* ColorAttachment 数组
|
|
209
|
-
*/
|
|
210
|
-
attachments: RenderTargetHandle[];
|
|
211
|
-
frameBuffer?: FrameBuffer;
|
|
212
|
-
/**
|
|
213
|
-
* 名称
|
|
214
|
-
*/
|
|
215
|
-
readonly name: string;
|
|
216
|
-
/**
|
|
217
|
-
* 包含的 Mesh 列表
|
|
218
|
-
*/
|
|
219
|
-
readonly meshes: Mesh[];
|
|
220
|
-
/**
|
|
221
|
-
* Mesh 渲染顺序,按照优先级升序或降序
|
|
222
|
-
*/
|
|
223
|
-
readonly meshOrder: OrderType;
|
|
224
|
-
/**
|
|
225
|
-
* 相机
|
|
226
|
-
*/
|
|
227
|
-
readonly camera?: Camera;
|
|
228
|
-
/**
|
|
229
|
-
* 深度和蒙版 Attachment 类型,注意区分纹理和 RenderBuffer
|
|
230
|
-
*/
|
|
231
|
-
readonly depthStencilType: RenderPassAttachmentStorageType;
|
|
232
|
-
/**
|
|
233
|
-
* 渲染前清除缓冲区操作
|
|
234
|
-
*/
|
|
235
|
-
readonly clearAction: RenderPassClearAction;
|
|
236
|
-
/**
|
|
237
|
-
* 渲染后清除缓冲区操作,iOS 上有性能提升, 默认关闭
|
|
238
|
-
*/
|
|
239
|
-
readonly storeAction: RenderPassStoreAction;
|
|
240
|
-
/**
|
|
241
|
-
* RenderPass 公用的 Shader Uniform 变量
|
|
242
|
-
*/
|
|
243
|
-
readonly semantics: SemanticMap;
|
|
244
|
-
protected destroyed: boolean;
|
|
245
|
-
protected options: RenderPassAttachmentOptions;
|
|
246
|
-
protected renderer: Renderer;
|
|
247
|
-
private initialized;
|
|
248
|
-
private viewportScale;
|
|
249
|
-
private depthTexture?;
|
|
250
|
-
private stencilTexture?;
|
|
251
|
-
private isCustomViewport;
|
|
252
|
-
private customViewport?;
|
|
253
|
-
constructor(renderer: Renderer, options: RenderPassOptions);
|
|
254
|
-
get isDestroyed(): boolean;
|
|
255
|
-
get viewport(): spec.vec4;
|
|
256
|
-
get stencilAttachment(): RenderPassDepthStencilAttachment | undefined;
|
|
257
|
-
get depthAttachment(): RenderPassDepthStencilAttachment | undefined;
|
|
258
|
-
addMesh(mesh: Mesh): void;
|
|
259
|
-
removeMesh(mesh: Mesh): void;
|
|
260
|
-
setMeshes(meshes: Mesh[]): Mesh[];
|
|
261
|
-
/**
|
|
262
|
-
* 获取当前 Attachment 数组,注意 RenderPass 可能没有创建完成
|
|
263
|
-
*/
|
|
264
|
-
getInitAttachments(): RenderPassColorAttachmentOptions[] | RenderTargetHandle[] | undefined;
|
|
265
|
-
/**
|
|
266
|
-
* 配置当前pass的RT,在每帧渲染前调用
|
|
267
|
-
*/
|
|
268
|
-
configure(renderer: Renderer): void;
|
|
269
|
-
/**
|
|
270
|
-
* 执行当前pass,每帧调用一次
|
|
271
|
-
*/
|
|
272
|
-
execute(renderer: Renderer): void;
|
|
273
|
-
/**
|
|
274
|
-
* 每帧所有的pass渲染完后调用,通常用于清空临时的RT资源
|
|
275
|
-
*/
|
|
276
|
-
frameCleanup(renderer: Renderer): void;
|
|
277
|
-
/**
|
|
278
|
-
* 重置 ColorAttachment 数组,会直接替换掉
|
|
279
|
-
* @param colors - 纹理数组,作为新的 ColorAttachment
|
|
280
|
-
*/
|
|
281
|
-
resetColorAttachments(colors: Texture[]): void;
|
|
282
|
-
/**
|
|
283
|
-
* 重置所有 Attachment,会替换掉所有 Attachment
|
|
284
|
-
* @param options - Attachment 和视口数据
|
|
285
|
-
*/
|
|
286
|
-
resetAttachments(options: RenderPassAttachmentOptions): void;
|
|
287
|
-
private setViewportOptions;
|
|
288
|
-
private _resetAttachments;
|
|
289
|
-
/**
|
|
290
|
-
* 获取当前视口大小,格式:[x偏移,y偏移,宽度,高度]
|
|
291
|
-
*/
|
|
292
|
-
getViewport(): vec4;
|
|
293
|
-
/**
|
|
294
|
-
* 获取深度 Attachment,可能没有
|
|
295
|
-
*/
|
|
296
|
-
getDepthAttachment(): RenderPassDepthStencilAttachment | undefined;
|
|
297
|
-
/**
|
|
298
|
-
* 获取蒙版 Attachment,可能没有
|
|
299
|
-
*/
|
|
300
|
-
getStencilAttachment(): RenderPassDepthStencilAttachment | undefined;
|
|
301
|
-
private getDepthTexture;
|
|
302
|
-
private getStencilTexture;
|
|
303
|
-
initialize(renderer: Renderer): RenderPass;
|
|
304
|
-
/**
|
|
305
|
-
* 销毁 RenderPass
|
|
306
|
-
* @param options - 有选择销毁内部对象
|
|
307
|
-
*/
|
|
308
|
-
dispose(options?: RenderPassDestroyOptions): void;
|
|
309
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Matrix4 } from '@galacean/effects-math/es/core/index';
|
|
2
|
-
import type { LostHandler, RestoreHandler } from '../utils';
|
|
3
|
-
import type { FilterMode, FrameBuffer, RenderTextureFormat } from './frame-buffer';
|
|
4
|
-
import type { Mesh } from './mesh';
|
|
5
|
-
import type { RenderFrame, RenderingData } from './render-frame';
|
|
6
|
-
import type { RenderPassClearAction, RenderPassStoreAction } from './render-pass';
|
|
7
|
-
import type { ShaderLibrary } from './shader';
|
|
8
|
-
import type { Geometry } from './geometry';
|
|
9
|
-
import type { Material } from '../material';
|
|
10
|
-
import type { Engine } from '../engine';
|
|
11
|
-
export declare class Renderer implements LostHandler, RestoreHandler {
|
|
12
|
-
static create: (canvas: HTMLCanvasElement | OffscreenCanvas, framework: 'webgl' | 'webgl2', renderOptions?: WebGLContextAttributes) => Renderer;
|
|
13
|
-
engine: Engine;
|
|
14
|
-
env: string;
|
|
15
|
-
/**
|
|
16
|
-
* 存放渲染需要用到的数据
|
|
17
|
-
*/
|
|
18
|
-
renderingData: RenderingData;
|
|
19
|
-
constructor();
|
|
20
|
-
setGlobalFloat(name: string, value: number): void;
|
|
21
|
-
setGlobalInt(name: string, value: number): void;
|
|
22
|
-
setGlobalMatrix(name: string, value: Matrix4): void;
|
|
23
|
-
getFrameBuffer(): FrameBuffer | null;
|
|
24
|
-
setFrameBuffer(frameBuffer: FrameBuffer | null): void;
|
|
25
|
-
setViewport(x: number, y: number, width: number, height: number): void;
|
|
26
|
-
resize(canvasWidth: number, canvasHeight: number): void;
|
|
27
|
-
clear(action: RenderPassClearAction | RenderPassStoreAction): void;
|
|
28
|
-
getWidth(): number;
|
|
29
|
-
getHeight(): number;
|
|
30
|
-
/**
|
|
31
|
-
* 添加 webglcontextlost 事件回调
|
|
32
|
-
* @override
|
|
33
|
-
* @param lostHandler
|
|
34
|
-
*/
|
|
35
|
-
addLostHandler(lostHandler: LostHandler): void;
|
|
36
|
-
/**
|
|
37
|
-
* 添加 webglContextrestored 事件的回调
|
|
38
|
-
* @override
|
|
39
|
-
* @param restoreHandler
|
|
40
|
-
*/
|
|
41
|
-
addRestoreHandler(restoreHandler: RestoreHandler): void;
|
|
42
|
-
/**
|
|
43
|
-
* @override
|
|
44
|
-
* @param e
|
|
45
|
-
*/
|
|
46
|
-
lost(e: Event): void;
|
|
47
|
-
/**
|
|
48
|
-
* @override
|
|
49
|
-
*/
|
|
50
|
-
restore(): void;
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @override
|
|
54
|
-
* @returns
|
|
55
|
-
*/
|
|
56
|
-
getShaderLibrary(): ShaderLibrary | undefined;
|
|
57
|
-
renderRenderFrame(renderFrame: RenderFrame): void;
|
|
58
|
-
renderMeshes(meshes: Mesh[]): void;
|
|
59
|
-
drawGeometry(geometry: Geometry, material: Material): void;
|
|
60
|
-
getTemporaryRT(name: string, width: number, height: number, depthBuffer: number, filter: FilterMode, format: RenderTextureFormat): FrameBuffer | null;
|
|
61
|
-
dispose(haltGL?: boolean): void;
|
|
62
|
-
}
|
package/dist/render/shader.d.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
export type ShaderMarcos = [key: string, value: string | number | boolean][];
|
|
2
|
-
export declare enum ShaderCompileResultStatus {
|
|
3
|
-
noShader = 0,
|
|
4
|
-
success = 1,
|
|
5
|
-
fail = 2,
|
|
6
|
-
compiling = 3
|
|
7
|
-
}
|
|
8
|
-
export interface ShaderCompileResult {
|
|
9
|
-
status: ShaderCompileResultStatus;
|
|
10
|
-
cacheId?: string;
|
|
11
|
-
error?: string | null;
|
|
12
|
-
shared?: boolean;
|
|
13
|
-
compileTime?: number;
|
|
14
|
-
}
|
|
15
|
-
export declare enum GLSLVersion {
|
|
16
|
-
'GLSL1' = "100",
|
|
17
|
-
'GLSL3' = "300 es"
|
|
18
|
-
}
|
|
19
|
-
export interface InstancedShaderWithSource {
|
|
20
|
-
/**
|
|
21
|
-
* fragment shader字符串
|
|
22
|
-
*/
|
|
23
|
-
fragment: string;
|
|
24
|
-
/**
|
|
25
|
-
* vertex shader字符串
|
|
26
|
-
*/
|
|
27
|
-
vertex: string;
|
|
28
|
-
/**
|
|
29
|
-
* shader 字符串的版本,用于添加版本头
|
|
30
|
-
*/
|
|
31
|
-
glslVersion?: GLSLVersion;
|
|
32
|
-
/**
|
|
33
|
-
* shader的name
|
|
34
|
-
*/
|
|
35
|
-
name?: string;
|
|
36
|
-
/**
|
|
37
|
-
* shader的宏定义
|
|
38
|
-
*/
|
|
39
|
-
marcos?: ShaderMarcos;
|
|
40
|
-
/**
|
|
41
|
-
* shader是否共享
|
|
42
|
-
*/
|
|
43
|
-
shared?: false;
|
|
44
|
-
}
|
|
45
|
-
export interface SharedShaderWithSource {
|
|
46
|
-
/**
|
|
47
|
-
* fragment shader字符串
|
|
48
|
-
*/
|
|
49
|
-
fragment: string;
|
|
50
|
-
/**
|
|
51
|
-
* vertex shader字符串
|
|
52
|
-
*/
|
|
53
|
-
vertex: string;
|
|
54
|
-
/**
|
|
55
|
-
* shader 字符串的版本,用于添加版本头
|
|
56
|
-
*/
|
|
57
|
-
glslVersion?: GLSLVersion;
|
|
58
|
-
/**
|
|
59
|
-
* shader的name
|
|
60
|
-
*/
|
|
61
|
-
name?: string;
|
|
62
|
-
/**
|
|
63
|
-
* shader的宏定义
|
|
64
|
-
*/
|
|
65
|
-
marcos?: ShaderMarcos;
|
|
66
|
-
/**
|
|
67
|
-
* 是否共用GLProgram
|
|
68
|
-
* shared为true时,
|
|
69
|
-
* 如果提供了cacheId,cacheId相同的shader会共用一个GLProgram
|
|
70
|
-
* 如果没有提供cacheId,会根据字符串hash计算出cacheId,字符串相同的shader将会使用同一个GLProgram
|
|
71
|
-
*/
|
|
72
|
-
shared?: true;
|
|
73
|
-
/**
|
|
74
|
-
* 相同cacheId的shader会使用同一个GLProgram
|
|
75
|
-
*/
|
|
76
|
-
cacheId?: string;
|
|
77
|
-
}
|
|
78
|
-
export type ShaderWithSource = InstancedShaderWithSource | SharedShaderWithSource;
|
|
79
|
-
export declare abstract class Shader {
|
|
80
|
-
readonly source: ShaderWithSource;
|
|
81
|
-
constructor(source: ShaderWithSource);
|
|
82
|
-
}
|
|
83
|
-
export interface ShaderLibrary {
|
|
84
|
-
readonly shaderResults: {
|
|
85
|
-
[cacheId: string]: ShaderCompileResult;
|
|
86
|
-
};
|
|
87
|
-
addShader(shader: ShaderWithSource): void;
|
|
88
|
-
/**
|
|
89
|
-
* @param cacheId
|
|
90
|
-
*/
|
|
91
|
-
deleteShader(cacheId: string): void;
|
|
92
|
-
/***
|
|
93
|
-
* 编译现有的所有shader
|
|
94
|
-
* @param asyncCallback 如果传入,则会启用异步编译,当所有编译完成后被回调
|
|
95
|
-
*/
|
|
96
|
-
compileAllShaders(asyncCallback?: (results: ShaderCompileResult[]) => void): void;
|
|
97
|
-
}
|
package/dist/render/types.d.ts
DELETED
package/dist/scene.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { JSONValue } from './downloader';
|
|
3
|
-
import type { Texture } from './texture';
|
|
4
|
-
import type { PluginSystem } from './plugin-system';
|
|
5
|
-
export type ImageSource = spec.TemplateImage | spec.Image | spec.CompressedImage;
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export interface Scene {
|
|
10
|
-
readonly jsonScene: spec.JSONScene;
|
|
11
|
-
readonly images: ImageSource[];
|
|
12
|
-
readonly textureOptions: Record<string, any>[];
|
|
13
|
-
readonly bins: ArrayBuffer[];
|
|
14
|
-
readonly pluginSystem: PluginSystem;
|
|
15
|
-
readonly renderLevel?: spec.RenderLevel;
|
|
16
|
-
readonly storage: Record<string, any>;
|
|
17
|
-
consumed?: boolean;
|
|
18
|
-
textures?: Texture[];
|
|
19
|
-
/**
|
|
20
|
-
* 加载总耗时
|
|
21
|
-
*/
|
|
22
|
-
totalTime?: number;
|
|
23
|
-
/**
|
|
24
|
-
* 加载开始时间
|
|
25
|
-
*/
|
|
26
|
-
startTime?: number;
|
|
27
|
-
url: string | JSONValue;
|
|
28
|
-
}
|
|
29
|
-
export declare function isScene(scene: any): scene is Scene;
|
package/dist/semantic-map.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { UniformValue } from './material';
|
|
2
|
-
import type { RenderingData } from './render';
|
|
3
|
-
import type { Disposable } from './utils';
|
|
4
|
-
export type SemanticFunc = (state: RenderingData) => UniformValue | undefined;
|
|
5
|
-
export type SemanticGetter = UniformValue | SemanticFunc;
|
|
6
|
-
export declare class SemanticMap implements Disposable {
|
|
7
|
-
readonly semantics: Record<string, SemanticGetter>;
|
|
8
|
-
constructor(semantics?: Record<string, SemanticGetter>);
|
|
9
|
-
toObject(): Record<string, SemanticGetter>;
|
|
10
|
-
setSemantic(name: string, value?: SemanticGetter): void;
|
|
11
|
-
getSemanticValue(name: string, state: RenderingData): number | Float32Array | Int32Array | Float64Array | Uint8Array | Uint32Array | Uint16Array | Int8Array | Int16Array | number[] | number[][] | import("@galacean/effects-math/es").Matrix4 | import("@galacean/effects-math/es").Vector3 | import("@galacean/effects-math/es").Matrix3 | import("./texture").Texture | import("@galacean/effects-math/es").Vector2 | import("@galacean/effects-math/es").Vector4 | import("./texture").Texture[] | import("./material").UniformStruct | import("./material").UniformStruct[] | SemanticFunc | undefined;
|
|
12
|
-
hasSemanticValue(name: string): boolean;
|
|
13
|
-
dispose(): void;
|
|
14
|
-
}
|
package/dist/shader/index.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export { default as blend } from './blend.glsl';
|
|
2
|
-
export { default as compatibleFrag } from './compatible.frag.glsl';
|
|
3
|
-
export { default as compatibleVert } from './compatible.vert.glsl';
|
|
4
|
-
export { default as itemFrameFrag } from './item-frame.frag.glsl';
|
|
5
|
-
export { default as integrate } from './integrate.glsl';
|
|
6
|
-
export { default as itemVert } from './item.vert.glsl';
|
|
7
|
-
export { default as itemDefine } from './item.define.glsl';
|
|
8
|
-
export { default as itemFrag } from './item.frag.glsl';
|
|
9
|
-
export { default as particleFrag } from './particle.frag.glsl';
|
|
10
|
-
export { default as particleVert } from './particle.vert.glsl';
|
|
11
|
-
export { default as trailVert } from './trail.vert.glsl';
|
|
12
|
-
export { default as value } from './value.glsl';
|
|
13
|
-
export { default as valueDefine } from './value-define.glsl';
|
|
14
|
-
export { default as copyFrag } from './adjust/copy.frag.glsl';
|
|
15
|
-
export { default as alphaFrameFrag } from './adjust/alpha-frame.frag.glsl';
|
|
16
|
-
export { default as alphaMaskFrag } from './adjust/alpha-mask.frag.glsl';
|
|
17
|
-
export { default as cameraMoveFrag } from './adjust/camera-move.frag.glsl';
|
|
18
|
-
export { default as cameraMoveVert } from './adjust/camera-move.vert.glsl';
|
|
19
|
-
export { default as delayFrag } from './adjust/delay.frag.glsl';
|
|
20
|
-
export { default as distortionFrag } from './adjust/distortion.frag.glsl';
|
|
21
|
-
export { default as distortionVert } from './adjust/distortion.vert.glsl';
|
|
22
|
-
export { default as bloomMixVert } from './adjust/bloom-mix.frag.glsl';
|
|
23
|
-
export { default as bloomThresholdVert } from './adjust/bloom-threshold.frag.glsl';
|
|
24
|
-
export { default as screenMeshVert } from './post-processing/screen-mesh.vert.glsl';
|
|
25
|
-
export { default as colorGradingFrag } from './post-processing/color-grading.frag.glsl';
|
|
26
|
-
export { default as gaussianDownFrag } from './post-processing/gaussian-down.frag.glsl';
|
|
27
|
-
export { default as gaussianDownHFrag } from './post-processing/gaussian-down-h.frag.glsl';
|
|
28
|
-
export { default as gaussianDownVFrag } from './post-processing/gaussian-down-v.frag.glsl';
|
|
29
|
-
export { default as gaussianUpFrag } from './post-processing/gaussian-up.frag.glsl';
|
|
30
|
-
export { default as thresholdFrag } from './post-processing/threshold.frag.glsl';
|
package/dist/shape/2d-shape.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { Shape, ShapeGeneratorOptions, ShapeParticle } from './shape';
|
|
3
|
-
export declare class Circle implements Shape {
|
|
4
|
-
radius: number;
|
|
5
|
-
arc: number;
|
|
6
|
-
arcMode: number;
|
|
7
|
-
constructor(props: Record<string, any>);
|
|
8
|
-
generate(opt: ShapeGeneratorOptions): ShapeParticle;
|
|
9
|
-
}
|
|
10
|
-
export declare class Rectangle implements Shape {
|
|
11
|
-
_d: number;
|
|
12
|
-
_h: number;
|
|
13
|
-
constructor(arg: any);
|
|
14
|
-
generate(opt: ShapeGeneratorOptions): ShapeParticle;
|
|
15
|
-
}
|
|
16
|
-
export declare class RectangleEdge implements Shape {
|
|
17
|
-
width: number;
|
|
18
|
-
height: number;
|
|
19
|
-
arcMode: number;
|
|
20
|
-
arc: number;
|
|
21
|
-
_d: number;
|
|
22
|
-
_h: number;
|
|
23
|
-
constructor(arg: any);
|
|
24
|
-
generate(opt: ShapeGeneratorOptions): ShapeParticle;
|
|
25
|
-
}
|
|
26
|
-
export declare class Edge implements Shape {
|
|
27
|
-
width: number;
|
|
28
|
-
arcMode: spec.ShapeArcMode;
|
|
29
|
-
_d: number;
|
|
30
|
-
constructor(args: any);
|
|
31
|
-
generate(options: ShapeGeneratorOptions): ShapeParticle;
|
|
32
|
-
}
|
package/dist/shape/cone.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { Shape, ShapeGeneratorOptions, ShapeParticle } from './index';
|
|
3
|
-
export declare class Cone implements Shape {
|
|
4
|
-
radius: number;
|
|
5
|
-
angle: number;
|
|
6
|
-
arc: number;
|
|
7
|
-
arcMode: number;
|
|
8
|
-
constructor(props: Record<string, any>);
|
|
9
|
-
generate(opt: ShapeGeneratorOptions): ShapeParticle;
|
|
10
|
-
}
|
|
11
|
-
export declare function getArcAngle(arc: number, arcMode: spec.ShapeArcMode, opt: ShapeGeneratorOptions): number;
|
package/dist/shape/donut.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Shape, ShapeGeneratorOptions, ShapeParticle } from './shape';
|
|
2
|
-
export declare class Donut implements Shape {
|
|
3
|
-
radius: number;
|
|
4
|
-
donutRadius: number;
|
|
5
|
-
arc: number;
|
|
6
|
-
arcMode: number;
|
|
7
|
-
constructor(props: Record<string, any>);
|
|
8
|
-
generate(opt: ShapeGeneratorOptions): ShapeParticle;
|
|
9
|
-
}
|
package/dist/shape/earcut.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function earcut(data: number[], holeIndices: number[] | null, dim: number, ib: number): number[];
|
package/dist/shape/geometry.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import type { vec2 } from '@galacean/effects-specification';
|
|
3
|
-
export type Shape2D = {
|
|
4
|
-
gs?: spec.ShapeGeometry[];
|
|
5
|
-
t: number;
|
|
6
|
-
g: spec.ShapeGeometry;
|
|
7
|
-
};
|
|
8
|
-
export type GeometryFromShape = {
|
|
9
|
-
aPoint: number[] | Float32Array;
|
|
10
|
-
index: number[] | Uint16Array;
|
|
11
|
-
};
|
|
12
|
-
type ShapeGeometryPre = {
|
|
13
|
-
p: spec.ShapePoints[1];
|
|
14
|
-
s: spec.ShapeSplits[1];
|
|
15
|
-
};
|
|
16
|
-
export type ShapeData = {
|
|
17
|
-
gs: ShapeGeometryPre[];
|
|
18
|
-
} & {
|
|
19
|
-
g: ShapeGeometryPre;
|
|
20
|
-
} & spec.ShapeGeometry;
|
|
21
|
-
export declare function getGeometryTriangles(geometry: spec.ShapeGeometry, options: {
|
|
22
|
-
indexBase?: number;
|
|
23
|
-
uvTransform?: number[];
|
|
24
|
-
}): {
|
|
25
|
-
aPoint: Float32Array;
|
|
26
|
-
index: Uint16Array;
|
|
27
|
-
};
|
|
28
|
-
export declare function getGeometryByShape(shape: ShapeData, uvTransform: number[]): GeometryFromShape;
|
|
29
|
-
export declare function rotateVec2(out: vec2 | number[], vec2: vec2, angleInRad: number): vec2;
|
|
30
|
-
export {};
|
package/dist/shape/index.d.ts
DELETED
package/dist/shape/shape.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import * as spec from '@galacean/effects-specification';
|
|
2
|
-
import { Vector3 } from '@galacean/effects-math/es/core/index';
|
|
3
|
-
export type ShapeGeneratorOptions = {
|
|
4
|
-
total: number;
|
|
5
|
-
index: number;
|
|
6
|
-
burstIndex: number;
|
|
7
|
-
burstCount: number;
|
|
8
|
-
};
|
|
9
|
-
export type ShapeParticle = {
|
|
10
|
-
direction: Vector3;
|
|
11
|
-
position: Vector3;
|
|
12
|
-
};
|
|
13
|
-
export interface Shape {
|
|
14
|
-
generate(options: ShapeGeneratorOptions): ShapeParticle;
|
|
15
|
-
}
|
|
16
|
-
export type ShapeGenerator = Shape & {
|
|
17
|
-
reverseDirection?: boolean;
|
|
18
|
-
alignSpeedDirection?: boolean;
|
|
19
|
-
upDirection?: Vector3;
|
|
20
|
-
};
|
|
21
|
-
export declare function createShape(shapeOptions: spec.ParticleShape): Shape;
|
package/dist/shape/sphere.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Shape, ShapeGeneratorOptions, ShapeParticle } from '.';
|
|
2
|
-
export declare class Sphere implements Shape {
|
|
3
|
-
arc: number;
|
|
4
|
-
radius: number;
|
|
5
|
-
arcMode: number;
|
|
6
|
-
constructor(props: Record<string, any>);
|
|
7
|
-
getHorizontalAngle(): number;
|
|
8
|
-
generate(opt: ShapeGeneratorOptions): ShapeParticle;
|
|
9
|
-
}
|
|
10
|
-
export declare class Hemisphere extends Sphere {
|
|
11
|
-
arc: number;
|
|
12
|
-
radius: number;
|
|
13
|
-
arcMode: number;
|
|
14
|
-
getHorizontalAngle(): number;
|
|
15
|
-
}
|