@galacean/engine-core 1.2.0-beta.6 → 1.2.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/dist/main.js +151 -53
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +151 -53
- package/dist/module.js +152 -54
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Camera.d.ts +7 -4
- package/types/Entity.d.ts +4 -1
- package/types/RenderPipeline/BatcherManager.d.ts +1 -12
- package/types/RenderPipeline/PrimitiveChunk.d.ts +1 -0
- package/types/RenderPipeline/PrimitiveChunkManager.d.ts +1 -0
- package/types/RenderPipeline/SubPrimitiveChunk.d.ts +1 -0
- package/types/RenderPipeline/SubRenderElement.d.ts +22 -0
- package/types/RenderPipeline/VertexArea.d.ts +1 -0
- package/types/animation/AnimatorCondition.d.ts +13 -0
- package/types/animation/AnimatorControllerParameter.d.ts +10 -0
- package/types/animation/AnimatorStateTransition.d.ts +51 -0
- package/types/asset/ResourceManager.d.ts +3 -1
- package/types/enums/ReplacementFailureStrategy.d.ts +9 -0
- package/types/index.d.ts +1 -0
- package/types/postProcess/PostProcessManager.d.ts +1 -0
- package/types/postProcess/effects/BloomEffect.d.ts +94 -0
- package/types/postProcess/effects/TonemappingEffect.d.ts +35 -0
- package/types/postProcess/effects/index.d.ts +2 -0
- package/types/postProcess/index.d.ts +3 -0
- package/types/shader/enums/ShaderPlatformTarget.d.ts +4 -0
- package/types/shader/enums/ShaderType.d.ts +1 -0
- package/types/utils/ClearableObjectPool.d.ts +16 -0
- package/types/utils/ObjectPool.d.ts +16 -0
- package/types/utils/ReturnableObjectPool.d.ts +16 -0
- package/types/utils/index.d.ts +4 -0
- package/types/RenderPipeline/RenderData2D.d.ts +0 -14
- package/types/RenderPipeline/RenderPass.d.ts +0 -55
- package/types/RenderPipeline/enums/ForceUploadShaderDataFlag.d.ts +0 -15
- package/types/RenderPipeline/enums/RenderDataUsage.d.ts +0 -13
- package/types/input/pointer/PointerEvent.d.ts +0 -4
- package/types/input/pointer/PointerEventType.d.ts +0 -7
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +0 -6
- package/types/ui/Image.d.ts +0 -41
- package/types/ui/RedBlackTree.d.ts +0 -2
- package/types/ui/UICanvas.d.ts +0 -49
- package/types/ui/UIRenderer.d.ts +0 -20
- package/types/ui/UITransform.d.ts +0 -20
- package/types/ui/enums/BlockingObjects.d.ts +0 -6
- package/types/ui/enums/CanvasRenderMode.d.ts +0 -8
- package/types/ui/enums/ResolutionAdaptationStrategy.d.ts +0 -10
- package/types/ui/index.d.ts +0 -6
- package/types/utils/Pool.d.ts +0 -12
- /package/types/RenderPipeline/{DynamicGeometryData.d.ts → BatchUtils.d.ts} +0 -0
- /package/types/RenderPipeline/{DynamicGeometryDataManager.d.ts → MaskManager.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.2.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"types/**/*"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@galacean/engine-math": "1.2.0
|
|
18
|
+
"@galacean/engine-math": "1.2.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@galacean/engine-design": "1.2.0
|
|
21
|
+
"@galacean/engine-design": "1.2.0"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"b:types": "tsc"
|
package/types/Camera.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
|
5
5
|
import { DepthTextureMode } from "./enums/DepthTextureMode";
|
|
6
6
|
import { Downsampling } from "./enums/Downsampling";
|
|
7
7
|
import { MSAASamples } from "./enums/MSAASamples";
|
|
8
|
+
import { ReplacementFailureStrategy } from "./enums/ReplacementFailureStrategy";
|
|
8
9
|
import { Shader } from "./shader/Shader";
|
|
9
10
|
import { ShaderData } from "./shader/ShaderData";
|
|
10
11
|
import { ShaderTagKey } from "./shader/ShaderTagKey";
|
|
@@ -245,22 +246,24 @@ export declare class Camera extends Component {
|
|
|
245
246
|
* Set the replacement shader.
|
|
246
247
|
* @param shader - Replacement shader
|
|
247
248
|
* @param replacementTagName - Sub shader tag name
|
|
249
|
+
* @param failureStrategy - Replacement failure strategy, @defaultValue `ReplacementFailureStrategy.KeepOriginalShader`
|
|
248
250
|
*
|
|
249
251
|
* @remarks
|
|
250
252
|
* If replacementTagName is not specified, the first sub shader will be replaced.
|
|
251
|
-
* If replacementTagName is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey.
|
|
253
|
+
* If replacementTagName is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey. If failed to find the sub shader, the strategy will be determined by failureStrategy.
|
|
252
254
|
*/
|
|
253
|
-
setReplacementShader(shader: Shader, replacementTagName?: string): any;
|
|
255
|
+
setReplacementShader(shader: Shader, replacementTagName?: string, failureStrategy?: ReplacementFailureStrategy): any;
|
|
254
256
|
/**
|
|
255
257
|
* Set the replacement shader.
|
|
256
258
|
* @param shader - Replacement shader
|
|
257
259
|
* @param replacementTag - Sub shader tag
|
|
260
|
+
* @param failureStrategy - Replacement failure strategy, @defaultValue `ReplacementFailureStrategy.KeepOriginalShader`
|
|
258
261
|
*
|
|
259
262
|
* @remarks
|
|
260
263
|
* If replacementTag is not specified, the first sub shader will be replaced.
|
|
261
|
-
* If replacementTag is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey.
|
|
264
|
+
* If replacementTag is specified, the replacement shader will find the first sub shader which has the same tag value get by replacementTagKey. If failed to find the sub shader, the strategy will be determined by failureStrategy.
|
|
262
265
|
*/
|
|
263
|
-
setReplacementShader(shader: Shader, replacementTag?: ShaderTagKey): any;
|
|
266
|
+
setReplacementShader(shader: Shader, replacementTag?: ShaderTagKey, failureStrategy?: ReplacementFailureStrategy): any;
|
|
264
267
|
/**
|
|
265
268
|
* Reset and clear the replacement shader.
|
|
266
269
|
*/
|
package/types/Entity.d.ts
CHANGED
|
@@ -58,9 +58,10 @@ export declare class Entity extends EngineObject {
|
|
|
58
58
|
/**
|
|
59
59
|
* Add component based on the component type.
|
|
60
60
|
* @param type - The type of the component
|
|
61
|
+
* @param args - The arguments of the component
|
|
61
62
|
* @returns The component which has been added
|
|
62
63
|
*/
|
|
63
|
-
addComponent<T extends
|
|
64
|
+
addComponent<T extends new (entity: Entity, ...args: any[]) => Component>(type: T, ...args: ComponentArguments<T>): InstanceType<T>;
|
|
64
65
|
/**
|
|
65
66
|
* Get component which match the type.
|
|
66
67
|
* @param type - The type of the component
|
|
@@ -152,3 +153,5 @@ export declare class Entity extends EngineObject {
|
|
|
152
153
|
*/
|
|
153
154
|
getInvModelMatrix(): Matrix;
|
|
154
155
|
}
|
|
156
|
+
type ComponentArguments<T extends new (entity: Entity, ...args: any[]) => Component> = T extends new (entity: Entity, ...args: infer P) => Component ? P : never;
|
|
157
|
+
export {};
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { RenderContext } from "./RenderContext";
|
|
3
|
-
import { RenderData } from "./RenderData";
|
|
4
|
-
import { RenderElement } from "./RenderElement";
|
|
5
|
-
export declare class BatcherManager {
|
|
6
|
-
constructor(engine: Engine);
|
|
7
|
-
destroy(): void;
|
|
8
|
-
commitRenderData(context: RenderContext, data: RenderData): void;
|
|
9
|
-
batch(elements: Array<RenderElement>, batchedElements: Array<RenderElement>): void;
|
|
10
|
-
uploadBuffer(): void;
|
|
11
|
-
clear(): void;
|
|
12
|
-
}
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Renderer } from "../Renderer";
|
|
2
|
+
import { Primitive, SubMesh } from "../graphic";
|
|
3
|
+
import { Material } from "../material";
|
|
4
|
+
import { ShaderData, ShaderPass } from "../shader";
|
|
5
|
+
import { Texture2D } from "../texture";
|
|
6
|
+
import { IPoolElement } from "../utils/ObjectPool";
|
|
7
|
+
import { RenderQueueFlags } from "./BasicRenderPipeline";
|
|
8
|
+
import { SubPrimitiveChunk } from "./SubPrimitiveChunk";
|
|
9
|
+
export declare class SubRenderElement implements IPoolElement {
|
|
10
|
+
component: Renderer;
|
|
11
|
+
primitive: Primitive;
|
|
12
|
+
material: Material;
|
|
13
|
+
subPrimitive: SubMesh;
|
|
14
|
+
shaderPasses: ReadonlyArray<ShaderPass>;
|
|
15
|
+
shaderData?: ShaderData;
|
|
16
|
+
batched: boolean;
|
|
17
|
+
renderQueueFlags: RenderQueueFlags;
|
|
18
|
+
texture?: Texture2D;
|
|
19
|
+
subChunk?: SubPrimitiveChunk;
|
|
20
|
+
set(component: Renderer, material: Material, primitive: Primitive, subPrimitive: SubMesh, texture?: Texture2D, subChunk?: SubPrimitiveChunk): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
|
|
2
|
+
import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
|
|
3
|
+
/**
|
|
4
|
+
* Condition that is used to determine if a transition must be taken.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AnimatorCondition {
|
|
7
|
+
/** The mode of the condition. */
|
|
8
|
+
mode: AnimatorConditionMode;
|
|
9
|
+
/** The name of the parameter used in the condition. */
|
|
10
|
+
parameterName: string;
|
|
11
|
+
/** The AnimatorParameter's threshold value for the condition to be true. */
|
|
12
|
+
threshold?: AnimatorControllerParameterValueType;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type AnimatorControllerParameterValueType = number | string | boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Used to communicate between scripting and the controller, parameters can be set in scripting and used by the controller.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AnimatorControllerParameter {
|
|
6
|
+
/** The name of the parameter. */
|
|
7
|
+
name: string;
|
|
8
|
+
/** The value of the parameter. */
|
|
9
|
+
value: AnimatorControllerParameterValueType;
|
|
10
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
|
|
2
|
+
import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
|
|
3
|
+
import { AnimatorCondition } from "./AnimatorCondition";
|
|
4
|
+
import { AnimatorState } from "./AnimatorState";
|
|
5
|
+
/**
|
|
6
|
+
* Transitions define when and how the state machine switch from on state to another. AnimatorTransition always originate from a StateMachine or a StateMachine entry.
|
|
7
|
+
*/
|
|
8
|
+
export declare class AnimatorStateTransition {
|
|
9
|
+
/** The duration of the transition. This is represented in normalized time. */
|
|
10
|
+
duration: number;
|
|
11
|
+
/** The time at which the destination state will start. This is represented in normalized time. */
|
|
12
|
+
offset: number;
|
|
13
|
+
/** ExitTime represents the exact time at which the transition can take effect. This is represented in normalized time. */
|
|
14
|
+
exitTime: number;
|
|
15
|
+
/** The destination state of the transition. */
|
|
16
|
+
destinationState: AnimatorState;
|
|
17
|
+
/** Mutes the transition. The transition will never occur. */
|
|
18
|
+
mute: boolean;
|
|
19
|
+
private _conditions;
|
|
20
|
+
private _solo;
|
|
21
|
+
/**
|
|
22
|
+
* Is the transition destination the exit of the current state machine.
|
|
23
|
+
*/
|
|
24
|
+
get isExit(): Readonly<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Mutes all other transitions in the source state.
|
|
27
|
+
*/
|
|
28
|
+
get solo(): boolean;
|
|
29
|
+
set solo(value: boolean);
|
|
30
|
+
/**
|
|
31
|
+
* The conditions in the transition.
|
|
32
|
+
*/
|
|
33
|
+
get conditions(): Readonly<AnimatorCondition[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Add a condition to a transition.
|
|
36
|
+
* @param mode - The AnimatorCondition mode of the condition
|
|
37
|
+
* @param parameterName - The name of the parameter
|
|
38
|
+
* @param threshold - The threshold value of the condition
|
|
39
|
+
*/
|
|
40
|
+
addCondition(mode: AnimatorConditionMode, parameterName: string, threshold?: AnimatorControllerParameterValueType): AnimatorCondition;
|
|
41
|
+
/**
|
|
42
|
+
* Add a condition to a transition.
|
|
43
|
+
* @param animatorCondition - The condition to add
|
|
44
|
+
*/
|
|
45
|
+
addCondition(animatorCondition: AnimatorCondition): AnimatorCondition;
|
|
46
|
+
/**
|
|
47
|
+
* Remove a condition from the transition.
|
|
48
|
+
* @param condition - The condition to remove
|
|
49
|
+
*/
|
|
50
|
+
removeCondition(condition: AnimatorCondition): void;
|
|
51
|
+
}
|
|
@@ -102,11 +102,13 @@ export declare class ResourceManager {
|
|
|
102
102
|
addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
|
|
103
103
|
private _assignDefaultOptions;
|
|
104
104
|
private _loadSingleItem;
|
|
105
|
-
private
|
|
105
|
+
private _loadMainAsset;
|
|
106
|
+
private _createSubAssetPromiseCallback;
|
|
106
107
|
private _gc;
|
|
107
108
|
private _getResolveResource;
|
|
108
109
|
private _parseURL;
|
|
109
110
|
private _parseQueryPath;
|
|
111
|
+
private _releaseSubAssetPromiseCallback;
|
|
110
112
|
}
|
|
111
113
|
/**
|
|
112
114
|
* Declare ResourceLoader's decorator.
|
package/types/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { FogMode } from "./enums/FogMode";
|
|
|
31
31
|
export { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
32
32
|
export { CameraType } from "./enums/CameraType";
|
|
33
33
|
export { MSAASamples } from "./enums/MSAASamples";
|
|
34
|
+
export { ReplacementFailureStrategy } from "./enums/ReplacementFailureStrategy";
|
|
34
35
|
export { Downsampling } from "./enums/Downsampling";
|
|
35
36
|
export { ColorSpace } from "./enums/ColorSpace";
|
|
36
37
|
export { BackgroundTextureFillMode } from "./enums/BackgroundTextureFillMode";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Color } from "@galacean/engine-math";
|
|
2
|
+
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
3
|
+
import { Material } from "../../material";
|
|
4
|
+
import { Texture2D } from "../../texture";
|
|
5
|
+
/**
|
|
6
|
+
* This controls the size of the bloom texture.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum BloomDownScaleMode {
|
|
9
|
+
/**
|
|
10
|
+
* Use this to select half size as the starting resolution.
|
|
11
|
+
*/
|
|
12
|
+
Half = 0,
|
|
13
|
+
/**
|
|
14
|
+
* Use this to select quarter size as the starting resolution.
|
|
15
|
+
*/
|
|
16
|
+
Quarter = 1
|
|
17
|
+
}
|
|
18
|
+
export declare class BloomEffect {
|
|
19
|
+
private _uberMaterial;
|
|
20
|
+
static readonly SHADER_NAME = "PostProcessEffect Bloom";
|
|
21
|
+
private static _hqMacro;
|
|
22
|
+
private static _dirtMacro;
|
|
23
|
+
private static _bloomParams;
|
|
24
|
+
private static _lowMipTextureProp;
|
|
25
|
+
private static _lowMipTexelSizeProp;
|
|
26
|
+
private static _enableMacro;
|
|
27
|
+
private static _bloomTextureProp;
|
|
28
|
+
private static _dirtTextureProp;
|
|
29
|
+
private static _tintProp;
|
|
30
|
+
private static _bloomIntensityParams;
|
|
31
|
+
private static _dirtTilingOffsetProp;
|
|
32
|
+
private _bloomMaterial;
|
|
33
|
+
private _threshold;
|
|
34
|
+
private _scatter;
|
|
35
|
+
private _highQualityFiltering;
|
|
36
|
+
private _mipDownRT;
|
|
37
|
+
private _mipUpRT;
|
|
38
|
+
private _maxIterations;
|
|
39
|
+
private _enabled;
|
|
40
|
+
/**
|
|
41
|
+
* Controls the starting resolution that this effect begins processing.
|
|
42
|
+
*/
|
|
43
|
+
downScale: BloomDownScaleMode;
|
|
44
|
+
/**
|
|
45
|
+
* Indicates whether the post process effect is enabled.
|
|
46
|
+
*/
|
|
47
|
+
get enabled(): boolean;
|
|
48
|
+
set enabled(value: boolean);
|
|
49
|
+
/**
|
|
50
|
+
* Set the level of brightness to filter out pixels under this level.
|
|
51
|
+
* @remarks This value is expressed in gamma-space.
|
|
52
|
+
*/
|
|
53
|
+
get threshold(): number;
|
|
54
|
+
set threshold(value: number);
|
|
55
|
+
/**
|
|
56
|
+
* Controls the radius of the bloom effect.
|
|
57
|
+
*/
|
|
58
|
+
get scatter(): number;
|
|
59
|
+
set scatter(value: number);
|
|
60
|
+
/**
|
|
61
|
+
* Controls the strength of the bloom effect.
|
|
62
|
+
*/
|
|
63
|
+
get intensity(): number;
|
|
64
|
+
set intensity(value: number);
|
|
65
|
+
/**
|
|
66
|
+
* Specifies the tint of the bloom effect.
|
|
67
|
+
*/
|
|
68
|
+
get tint(): Color;
|
|
69
|
+
set tint(value: Color);
|
|
70
|
+
/**
|
|
71
|
+
* Controls whether to use bicubic sampling instead of bilinear sampling for the upSampling passes.
|
|
72
|
+
* @remarks This is slightly more expensive but helps getting smoother visuals.
|
|
73
|
+
*/
|
|
74
|
+
get highQualityFiltering(): boolean;
|
|
75
|
+
set highQualityFiltering(value: boolean);
|
|
76
|
+
/**
|
|
77
|
+
* Specifies a Texture to add smudges or dust to the bloom effect.
|
|
78
|
+
*/
|
|
79
|
+
get dirtTexture(): Texture2D;
|
|
80
|
+
set dirtTexture(value: Texture2D);
|
|
81
|
+
/**
|
|
82
|
+
* Controls the strength of the lens dirt.
|
|
83
|
+
*/
|
|
84
|
+
get dirtIntensity(): number;
|
|
85
|
+
set dirtIntensity(value: number);
|
|
86
|
+
constructor(_uberMaterial: Material);
|
|
87
|
+
onRender(context: RenderContext, srcTexture: Texture2D): void;
|
|
88
|
+
private _calculateMipCount;
|
|
89
|
+
private _prefilter;
|
|
90
|
+
private _downsample;
|
|
91
|
+
private _upsample;
|
|
92
|
+
private _setupUber;
|
|
93
|
+
private _releaseRenderTargets;
|
|
94
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Material } from "../../material";
|
|
2
|
+
/**
|
|
3
|
+
* Options to select a tonemapping algorithm to use.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum TonemappingMode {
|
|
6
|
+
/**
|
|
7
|
+
* Neutral tonemapper
|
|
8
|
+
* @remarks Use this option if you only want range-remapping with minimal impact on color hue and saturation.
|
|
9
|
+
*/
|
|
10
|
+
Neutral = 0,
|
|
11
|
+
/**
|
|
12
|
+
* ACES Filmic reference tonemapper (custom approximation)
|
|
13
|
+
* @remarks
|
|
14
|
+
* Use this option to apply a close approximation of the reference ACES tonemapper for a more filmic look.
|
|
15
|
+
* It is more contrasted than Neutral and has an effect on actual color hue and saturation.
|
|
16
|
+
*/
|
|
17
|
+
ACES = 1
|
|
18
|
+
}
|
|
19
|
+
export declare class TonemappingEffect {
|
|
20
|
+
private _uberMaterial;
|
|
21
|
+
private static _enableMacro;
|
|
22
|
+
private _mode;
|
|
23
|
+
private _enabled;
|
|
24
|
+
/**
|
|
25
|
+
* Indicates whether the post process effect is enabled.
|
|
26
|
+
*/
|
|
27
|
+
get enabled(): boolean;
|
|
28
|
+
set enabled(value: boolean);
|
|
29
|
+
/**
|
|
30
|
+
* Use this to select a tonemapping algorithm to use.
|
|
31
|
+
*/
|
|
32
|
+
get mode(): TonemappingMode;
|
|
33
|
+
set mode(value: TonemappingMode);
|
|
34
|
+
constructor(_uberMaterial: Material);
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IPoolElement, ObjectPool } from "./ObjectPool";
|
|
2
|
+
/**
|
|
3
|
+
* Clearable Object Pool.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ClearableObjectPool<T extends IPoolElement> extends ObjectPool<T> {
|
|
6
|
+
private _usedElementCount;
|
|
7
|
+
constructor(type: new () => T);
|
|
8
|
+
/**
|
|
9
|
+
* Get an object.
|
|
10
|
+
*/
|
|
11
|
+
get(): T;
|
|
12
|
+
/**
|
|
13
|
+
* Clear used object count to 0, not destroy any object, just change index.
|
|
14
|
+
*/
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare abstract class ObjectPool<T extends IPoolElement> {
|
|
2
|
+
protected _type: new () => T;
|
|
3
|
+
protected _elements: T[];
|
|
4
|
+
constructor(type: new () => T);
|
|
5
|
+
garbageCollection(): void;
|
|
6
|
+
abstract get(): T;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The basic interface for Object Pool's element.
|
|
10
|
+
*/
|
|
11
|
+
export interface IPoolElement {
|
|
12
|
+
/**
|
|
13
|
+
* Called when the object need be release.
|
|
14
|
+
*/
|
|
15
|
+
dispose?(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IPoolElement, ObjectPool } from "./ObjectPool";
|
|
2
|
+
/**
|
|
3
|
+
* Returnable Object Pool.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ReturnableObjectPool<T extends IPoolElement> extends ObjectPool<T> {
|
|
6
|
+
private _lastElementIndex;
|
|
7
|
+
constructor(type: new () => T, initializeCount?: number);
|
|
8
|
+
/**
|
|
9
|
+
* Get an object from the pool.
|
|
10
|
+
*/
|
|
11
|
+
get(): T;
|
|
12
|
+
/**
|
|
13
|
+
* Return an object to the pool.
|
|
14
|
+
*/
|
|
15
|
+
return(element: T): void;
|
|
16
|
+
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Primitive, SubMesh } from "../graphic";
|
|
2
|
-
import { Material } from "../material/Material";
|
|
3
|
-
import { Renderer } from "../Renderer";
|
|
4
|
-
import { Texture2D } from "../texture";
|
|
5
|
-
import { IPoolElement } from "../utils/Pool";
|
|
6
|
-
import { Chunk } from "./DynamicGeometryData";
|
|
7
|
-
import { RenderData } from "./RenderData";
|
|
8
|
-
export declare class RenderData2D extends RenderData implements IPoolElement {
|
|
9
|
-
texture: Texture2D;
|
|
10
|
-
chunk: Chunk;
|
|
11
|
-
constructor();
|
|
12
|
-
set(component: Renderer, material: Material, primitive: Primitive, subPrimitive: SubMesh, texture?: Texture2D, chunk?: Chunk): void;
|
|
13
|
-
dispose(): void;
|
|
14
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { Color } from "@galacean/engine-math";
|
|
2
|
-
import { Camera } from "../Camera";
|
|
3
|
-
import { CameraClearFlags } from "../enums/CameraClearFlags";
|
|
4
|
-
import { Layer } from "../Layer";
|
|
5
|
-
import { Material } from "../material/Material";
|
|
6
|
-
import { RenderTarget } from "../texture/RenderTarget";
|
|
7
|
-
import { RenderQueue } from "./RenderQueue";
|
|
8
|
-
/**
|
|
9
|
-
* RenderPass.
|
|
10
|
-
*/
|
|
11
|
-
declare class RenderPass {
|
|
12
|
-
name: string;
|
|
13
|
-
enabled: boolean;
|
|
14
|
-
priority: number;
|
|
15
|
-
renderTarget: RenderTarget;
|
|
16
|
-
replaceMaterial: Material;
|
|
17
|
-
mask: Layer;
|
|
18
|
-
renderOverride: boolean;
|
|
19
|
-
clearFlags: CameraClearFlags | undefined;
|
|
20
|
-
clearColor: Color | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Create a RenderPass.
|
|
23
|
-
* @param name - Pass name
|
|
24
|
-
* @param priority - Priority, less than 0 before the default pass, greater than 0 after the default pass
|
|
25
|
-
* @param renderTarget - The specified Render Target
|
|
26
|
-
* @param replaceMaterial - Replaced material
|
|
27
|
-
* @param mask - Perform bit and operations with Entity.Layer to filter the objects that this Pass needs to render
|
|
28
|
-
*/
|
|
29
|
-
constructor(name?: string, priority?: number, renderTarget?: any, replaceMaterial?: any, mask?: any);
|
|
30
|
-
/**
|
|
31
|
-
* Rendering callback, will be executed if renderOverride is set to true.
|
|
32
|
-
* @param camera - Camera
|
|
33
|
-
* @param opaqueQueue - Opaque queue
|
|
34
|
-
* @param alphaTestQueue - Alpha test queue
|
|
35
|
-
* @param transparentQueue - Transparent queue
|
|
36
|
-
*/
|
|
37
|
-
render(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
38
|
-
/**
|
|
39
|
-
* Post rendering callback.
|
|
40
|
-
* @param camera - Camera
|
|
41
|
-
* @param opaqueQueue - Opaque queue
|
|
42
|
-
* @param alphaTestQueue - Alpha test queue
|
|
43
|
-
* @param transparentQueue - Transparent queue
|
|
44
|
-
*/
|
|
45
|
-
preRender(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
46
|
-
/**
|
|
47
|
-
* Post rendering callback.
|
|
48
|
-
* @param camera - Camera
|
|
49
|
-
* @param opaqueQueue - Opaque queue
|
|
50
|
-
* @param alphaTestQueue - Alpha test queue
|
|
51
|
-
* @param transparentQueue - Transparent queue
|
|
52
|
-
*/
|
|
53
|
-
postRender(camera: Camera, opaqueQueue: RenderQueue, alphaTestQueue: RenderQueue, transparentQueue: RenderQueue): void;
|
|
54
|
-
}
|
|
55
|
-
export { RenderPass };
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Force upload shader data flag.
|
|
3
|
-
*/
|
|
4
|
-
export declare enum ForceUploadShaderDataFlag {
|
|
5
|
-
/** Upload nothing. */
|
|
6
|
-
None = 0,
|
|
7
|
-
/** Upload scene shader data. */
|
|
8
|
-
Scene = 1,
|
|
9
|
-
/** Upload camera shader data. */
|
|
10
|
-
Camera = 2,
|
|
11
|
-
/** Upload renderer shader data. */
|
|
12
|
-
Renderer = 4,
|
|
13
|
-
/** Upload material shader data. */
|
|
14
|
-
Material = 8
|
|
15
|
-
}
|
package/types/ui/Image.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Color } from "@galacean/engine-math";
|
|
2
|
-
import { Sprite, SpriteDrawMode, SpriteTileMode } from "../2d";
|
|
3
|
-
import { RenderElement } from "../RenderPipeline/RenderElement";
|
|
4
|
-
import { UIRenderer } from "./UIRenderer";
|
|
5
|
-
export declare class Image extends UIRenderer {
|
|
6
|
-
private _color;
|
|
7
|
-
private _sprite;
|
|
8
|
-
private _drawMode;
|
|
9
|
-
private _assembler;
|
|
10
|
-
private _tileMode;
|
|
11
|
-
private _tiledAdaptiveThreshold;
|
|
12
|
-
/**
|
|
13
|
-
* The draw mode of the sprite renderer.
|
|
14
|
-
*/
|
|
15
|
-
get drawMode(): SpriteDrawMode;
|
|
16
|
-
set drawMode(value: SpriteDrawMode);
|
|
17
|
-
/**
|
|
18
|
-
* The tiling mode of the sprite renderer. (Only works in tiled mode.)
|
|
19
|
-
*/
|
|
20
|
-
get tileMode(): SpriteTileMode;
|
|
21
|
-
set tileMode(value: SpriteTileMode);
|
|
22
|
-
/**
|
|
23
|
-
* Stretch Threshold in Tile Adaptive Mode, specified in normalized. (Only works in tiled adaptive mode.)
|
|
24
|
-
*/
|
|
25
|
-
get tiledAdaptiveThreshold(): number;
|
|
26
|
-
set tiledAdaptiveThreshold(value: number);
|
|
27
|
-
/**
|
|
28
|
-
* The Sprite to render.
|
|
29
|
-
*/
|
|
30
|
-
get sprite(): Sprite;
|
|
31
|
-
set sprite(value: Sprite | null);
|
|
32
|
-
/**
|
|
33
|
-
* Rendering color for the Sprite graphic.
|
|
34
|
-
*/
|
|
35
|
-
get color(): Color;
|
|
36
|
-
set color(value: Color);
|
|
37
|
-
protected _canBatch(elementA: RenderElement, elementB: RenderElement): boolean;
|
|
38
|
-
protected _batchRenderElement(elementA: RenderElement, elementB?: RenderElement): void;
|
|
39
|
-
protected _onDestroy(): void;
|
|
40
|
-
private _onSpriteChange;
|
|
41
|
-
}
|