@galacean/engine-core 0.0.0-experimental-renderSort.4 → 0.0.0-experimental-shaderlab.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/LICENSE +2 -2
- package/dist/main.js +19511 -18844
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +19511 -18844
- package/dist/module.js +20755 -20091
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/BasicResources.d.ts +1 -0
- package/types/Camera.d.ts +48 -8
- package/types/Canvas.d.ts +15 -5
- package/types/Component.d.ts +2 -0
- package/types/ComponentsManager.d.ts +3 -0
- package/types/DisorderedArray.d.ts +1 -0
- package/types/Engine.d.ts +9 -3
- package/types/Entity.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +9 -32
- package/types/RenderPipeline/Index.d.ts +0 -1
- package/types/RenderPipeline/OpaqueTexturePass.d.ts +1 -0
- package/types/RenderPipeline/RenderQueue.d.ts +1 -9
- package/types/Renderer.d.ts +4 -1
- package/types/Scene.d.ts +14 -2
- package/types/SystemInfo.d.ts +2 -0
- package/types/Utils.d.ts +7 -1
- package/types/animation/AnimationClip.d.ts +32 -4
- package/types/animation/AnimationClipCurveBinding.d.ts +12 -2
- package/types/animation/AnimatorControllerLayer.d.ts +3 -0
- package/types/animation/AnimatorLayerMask.d.ts +45 -0
- package/types/animation/Keyframe.d.ts +1 -1
- package/types/animation/LayerPathMask.d.ts +16 -0
- package/types/animation/animationCurve/AnimationStringCurve.d.ts +7 -0
- package/types/animation/animationCurve/index.d.ts +1 -0
- package/types/animation/index.d.ts +1 -0
- package/types/asset/AssetPromise.d.ts +10 -5
- package/types/asset/AssetType.d.ts +6 -0
- package/types/asset/Loader.d.ts +7 -0
- package/types/asset/ReferResource.d.ts +3 -2
- package/types/asset/ResourceManager.d.ts +2 -0
- package/types/base/Constant.d.ts +1 -0
- package/types/enums/CameraType.d.ts +1 -0
- package/types/enums/Downsampling.d.ts +11 -0
- package/types/enums/MSAASamples.d.ts +13 -0
- package/types/index.d.ts +5 -1
- package/types/input/InputManager.d.ts +0 -2
- package/types/input/interface/IInput.d.ts +0 -8
- package/types/lighting/Light.d.ts +0 -1
- package/types/lighting/LightManager.d.ts +0 -1
- package/types/material/PBRMaterial.d.ts +23 -0
- package/types/mesh/SkinnedMeshRenderer.d.ts +2 -0
- package/types/particle/modules/MainModule.d.ts +2 -0
- package/types/particle/modules/shape/BaseShape.d.ts +2 -2
- package/types/particle/modules/shape/BoxShape.d.ts +2 -1
- package/types/particle/modules/shape/CircleShape.d.ts +2 -1
- package/types/particle/modules/shape/ConeShape.d.ts +2 -1
- package/types/particle/modules/shape/HemisphereShape.d.ts +2 -1
- package/types/particle/modules/shape/SphereShape.d.ts +2 -1
- package/types/particle/modules/shape/index.d.ts +1 -0
- package/types/physics/HitResult.d.ts +3 -0
- package/types/renderingHardwareInterface/IPlatformRenderTarget.d.ts +2 -2
- package/types/renderingHardwareInterface/index.d.ts +0 -1
- package/types/shader/Shader.d.ts +15 -2
- package/types/shader/state/DepthState.d.ts +2 -2
- package/types/shaderlib/ShaderFactory.d.ts +8 -1
- package/types/shadow/CascadedShadowCasterPass.d.ts +0 -1
- package/types/texture/RenderTarget.d.ts +5 -4
- package/types/texture/Texture.d.ts +1 -0
- package/types/texture/enums/RenderBufferDepthFormat.d.ts +11 -9
- package/types/texture/enums/TextureFormat.d.ts +30 -26
- package/types/xr/XRManager.d.ts +5 -0
|
@@ -13,8 +13,10 @@ export declare class AssetPromise<T> implements PromiseLike<T> {
|
|
|
13
13
|
get [Symbol.toStringTag](): string;
|
|
14
14
|
private _promise;
|
|
15
15
|
private _state;
|
|
16
|
-
private
|
|
17
|
-
private
|
|
16
|
+
private _taskCompleteProgress;
|
|
17
|
+
private _taskDetailProgress;
|
|
18
|
+
private _onTaskCompleteCallbacks;
|
|
19
|
+
private _onTaskDetailCallbacks;
|
|
18
20
|
private _onCancelHandler;
|
|
19
21
|
private _reject;
|
|
20
22
|
/**
|
|
@@ -27,10 +29,11 @@ export declare class AssetPromise<T> implements PromiseLike<T> {
|
|
|
27
29
|
constructor(executor: AssetPromiseExecutor<T>);
|
|
28
30
|
/**
|
|
29
31
|
* Progress callback.
|
|
30
|
-
* @param callback
|
|
32
|
+
* @param onTaskComplete - This callback function provides information about the overall progress of the task. For example, in batch processing tasks, you can use the loaded and total parameters to calculate the percentage of task completion or display a progress bar
|
|
33
|
+
* @param onTaskDetail - This callback function provides detailed progress information about the task. For instance, in file downloading scenarios, you can use the loaded and total parameters to calculate the download progress percentage and utilize the url parameter to provide additional details such as download speed and estimated remaining time
|
|
31
34
|
* @returns AssetPromise
|
|
32
35
|
*/
|
|
33
|
-
onProgress(
|
|
36
|
+
onProgress(onTaskComplete: (loaded: number, total: number) => void, onTaskDetail?: (identifier: string, loaded: number, total: number) => void): AssetPromise<T>;
|
|
34
37
|
then<TResult1 = T, TResult2 = never>(onfulfilled?: (value: T) => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>): AssetPromise<TResult1 | TResult2>;
|
|
35
38
|
/**
|
|
36
39
|
* Attaches a callback for only the rejection of the Promise.
|
|
@@ -52,6 +55,8 @@ export declare class AssetPromise<T> implements PromiseLike<T> {
|
|
|
52
55
|
cancel(): AssetPromise<T>;
|
|
53
56
|
}
|
|
54
57
|
interface AssetPromiseExecutor<T> {
|
|
55
|
-
(resolve: (value?: T | PromiseLike<T>) => void, reject?: (reason?: any) => void,
|
|
58
|
+
(resolve: (value?: T | PromiseLike<T>) => void, reject?: (reason?: any) => void, setTaskCompleteProgress?: TaskCompleteCallback, setTaskDetailProgress?: TaskDetailCallback, onCancel?: (callback: () => void) => void): void;
|
|
56
59
|
}
|
|
60
|
+
type TaskCompleteCallback = (loaded: number, total: number) => void;
|
|
61
|
+
type TaskDetailCallback = (url: string, loaded: number, total: number) => void;
|
|
57
62
|
export {};
|
|
@@ -23,6 +23,10 @@ export declare enum AssetType {
|
|
|
23
23
|
TextureCube = "TextureCube",
|
|
24
24
|
/** Material. */
|
|
25
25
|
Material = "Material",
|
|
26
|
+
/** Shader */
|
|
27
|
+
Shader = "Shader",
|
|
28
|
+
/** Shader Chunk */
|
|
29
|
+
ShaderChunk = "ShaderChunk",
|
|
26
30
|
/** Mesh. */
|
|
27
31
|
Mesh = "Mesh",
|
|
28
32
|
/** AnimationClip. */
|
|
@@ -39,6 +43,8 @@ export declare enum AssetType {
|
|
|
39
43
|
KTX2 = "KTX2",
|
|
40
44
|
/** Sprite. */
|
|
41
45
|
Sprite = "Sprite",
|
|
46
|
+
/** PrimitiveMesh. */
|
|
47
|
+
PrimitiveMesh = "PrimitiveMesh",
|
|
42
48
|
/** Sprite Atlas. */
|
|
43
49
|
SpriteAtlas = "SpriteAtlas",
|
|
44
50
|
/** Ambient light. */
|
package/types/asset/Loader.d.ts
CHANGED
|
@@ -24,7 +24,14 @@ export declare abstract class Loader<T> {
|
|
|
24
24
|
static getClass(className: string): {
|
|
25
25
|
new (...args: any): any;
|
|
26
26
|
};
|
|
27
|
+
/**
|
|
28
|
+
* Get the class name by class object.
|
|
29
|
+
* @param obj - class object
|
|
30
|
+
* @returns class name
|
|
31
|
+
*/
|
|
32
|
+
static getClassName(obj: Object): string;
|
|
27
33
|
private static _engineObjects;
|
|
34
|
+
private static _classNameMap;
|
|
28
35
|
constructor(useCache: boolean);
|
|
29
36
|
initialize?(engine: Engine, configuration: EngineConfiguration): Promise<void>;
|
|
30
37
|
abstract load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<T>;
|
|
@@ -8,6 +8,7 @@ export declare abstract class ReferResource extends EngineObject implements IRef
|
|
|
8
8
|
/** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */
|
|
9
9
|
isGCIgnored: boolean;
|
|
10
10
|
private _refCount;
|
|
11
|
+
private _superResources;
|
|
11
12
|
/**
|
|
12
13
|
* Counted by valid references.
|
|
13
14
|
*/
|
|
@@ -15,8 +16,8 @@ export declare abstract class ReferResource extends EngineObject implements IRef
|
|
|
15
16
|
protected constructor(engine: Engine);
|
|
16
17
|
/**
|
|
17
18
|
* Destroy self.
|
|
18
|
-
* @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully
|
|
19
|
-
* @returns Whether the release was successful
|
|
19
|
+
* @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully
|
|
20
|
+
* @returns Whether the release was successful
|
|
20
21
|
*/
|
|
21
22
|
destroy(force?: boolean): boolean;
|
|
22
23
|
}
|
|
@@ -15,6 +15,8 @@ export declare class ResourceManager {
|
|
|
15
15
|
retryInterval: number;
|
|
16
16
|
/** The default timeout period for loading assets, in milliseconds. */
|
|
17
17
|
timeout: number;
|
|
18
|
+
/** Base url for loading assets. */
|
|
19
|
+
baseUrl: string | null;
|
|
18
20
|
private _loadingPromises;
|
|
19
21
|
/** Asset path pool, key is the `instanceID` of resource, value is asset path. */
|
|
20
22
|
private _assetPool;
|
package/types/base/Constant.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export declare enum GLCapabilityType {
|
|
|
96
96
|
colorBufferHalfFloat = "EXT_color_buffer_half_float",
|
|
97
97
|
textureFilterAnisotropic = "EXT_texture_filter_anisotropic",
|
|
98
98
|
blendMinMax = "EXT_blend_minmax",
|
|
99
|
+
fragDepth = "EXT_frag_depth",
|
|
99
100
|
astc = "WEBGL_compressed_texture_astc",
|
|
100
101
|
astc_webkit = "WEBKIT_WEBGL_compressed_texture_astc",
|
|
101
102
|
etc = "WEBGL_compressed_texture_etc",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multi-sample anti-aliasing samples.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum MSAASamples {
|
|
5
|
+
/** No multi-sample anti-aliasing. */
|
|
6
|
+
None = 1,
|
|
7
|
+
/** Multi-sample anti-aliasing with 2 samples. */
|
|
8
|
+
TwoX = 2,
|
|
9
|
+
/** Multi-sample anti-aliasing with 4 samples. */
|
|
10
|
+
FourX = 4,
|
|
11
|
+
/** Multi-sample anti-aliasing with 8 samples. */
|
|
12
|
+
EightX = 8
|
|
13
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Platform } from "./Platform";
|
|
2
2
|
export { Engine } from "./Engine";
|
|
3
3
|
export { SystemInfo } from "./SystemInfo";
|
|
4
|
-
export
|
|
4
|
+
export { Canvas } from "./Canvas";
|
|
5
5
|
export { Scene } from "./Scene";
|
|
6
6
|
export { SceneManager } from "./SceneManager";
|
|
7
7
|
export { Entity } from "./Entity";
|
|
@@ -29,8 +29,12 @@ export { BackgroundMode } from "./enums/BackgroundMode";
|
|
|
29
29
|
export { DepthTextureMode } from "./enums/DepthTextureMode";
|
|
30
30
|
export { FogMode } from "./enums/FogMode";
|
|
31
31
|
export { CameraClearFlags } from "./enums/CameraClearFlags";
|
|
32
|
+
export { CameraType } from "./enums/CameraType";
|
|
33
|
+
export { MSAASamples } from "./enums/MSAASamples";
|
|
34
|
+
export { Downsampling } from "./enums/Downsampling";
|
|
32
35
|
export { ColorSpace } from "./enums/ColorSpace";
|
|
33
36
|
export { BackgroundTextureFillMode } from "./enums/BackgroundTextureFillMode";
|
|
37
|
+
export { XRManager } from "./xr/XRManager";
|
|
34
38
|
export * from "./input/index";
|
|
35
39
|
export * from "./lighting/index";
|
|
36
40
|
export * from "./shadow/index";
|
|
@@ -9,6 +9,9 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
9
9
|
private static _roughnessProp;
|
|
10
10
|
private static _roughnessMetallicTextureProp;
|
|
11
11
|
private static _iorProp;
|
|
12
|
+
private static _anisotropyInfoProp;
|
|
13
|
+
private static _anisotropyTextureProp;
|
|
14
|
+
private _anisotropyRotation;
|
|
12
15
|
/**
|
|
13
16
|
* Index Of Refraction.
|
|
14
17
|
* @defaultValue `1.5`
|
|
@@ -33,6 +36,26 @@ export declare class PBRMaterial extends PBRBaseMaterial {
|
|
|
33
36
|
*/
|
|
34
37
|
get roughnessMetallicTexture(): Texture2D;
|
|
35
38
|
set roughnessMetallicTexture(value: Texture2D);
|
|
39
|
+
/**
|
|
40
|
+
* The strength of anisotropy, when anisotropyTexture is present, this value is multiplied by the blue channel.
|
|
41
|
+
* @defaultValue `0`
|
|
42
|
+
*/
|
|
43
|
+
get anisotropy(): number;
|
|
44
|
+
set anisotropy(value: number);
|
|
45
|
+
/**
|
|
46
|
+
* The rotation of the anisotropy in tangent, bitangent space, value in degrees.
|
|
47
|
+
* @defaultValue `0`
|
|
48
|
+
*/
|
|
49
|
+
get anisotropyRotation(): number;
|
|
50
|
+
set anisotropyRotation(value: number);
|
|
51
|
+
/**
|
|
52
|
+
* The anisotropy texture.
|
|
53
|
+
* @remarks
|
|
54
|
+
* Red and green channels represent the anisotropy direction in [-1, 1] tangent, bitangent space, to be rotated by anisotropyRotation.
|
|
55
|
+
* The blue channel contains strength as [0, 1] to be multiplied by anisotropy.
|
|
56
|
+
*/
|
|
57
|
+
get anisotropyTexture(): Texture2D;
|
|
58
|
+
set anisotropyTexture(value: Texture2D);
|
|
36
59
|
/**
|
|
37
60
|
* Create a pbr metallic-roughness workflow material instance.
|
|
38
61
|
* @param engine - Engine to which the material belongs
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BoundingBox } from "@galacean/engine-math";
|
|
2
2
|
import { Entity } from "../Entity";
|
|
3
|
+
import { RenderContext } from "../RenderPipeline/RenderContext";
|
|
3
4
|
import { MeshRenderer } from "./MeshRenderer";
|
|
4
5
|
import { Skin } from "./Skin";
|
|
5
6
|
/**
|
|
@@ -38,6 +39,7 @@ export declare class SkinnedMeshRenderer extends MeshRenderer {
|
|
|
38
39
|
*/
|
|
39
40
|
get bones(): ReadonlyArray<Entity>;
|
|
40
41
|
set bones(value: ReadonlyArray<Entity>);
|
|
42
|
+
_updateShaderData(context: RenderContext, onlyMVP: boolean): void;
|
|
41
43
|
private _checkBlendShapeWeightLength;
|
|
42
44
|
private _onLocalBoundsChanged;
|
|
43
45
|
private _getEntityHierarchyPath;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Rand } from "@galacean/engine-math";
|
|
1
2
|
import { ICustomClone } from "../../clone/ComponentCloner";
|
|
2
3
|
import { ParticleScaleMode } from "../enums/ParticleScaleMode";
|
|
3
4
|
import { ParticleSimulationSpace } from "../enums/ParticleSimulationSpace";
|
|
@@ -54,6 +55,7 @@ export declare class MainModule implements ICustomClone {
|
|
|
54
55
|
scalingMode: ParticleScaleMode;
|
|
55
56
|
/** If set to true, the Particle Generator automatically begins to play on startup. */
|
|
56
57
|
playOnEnabled: boolean;
|
|
58
|
+
readonly _gravityModifierRand: Rand;
|
|
57
59
|
private _generator;
|
|
58
60
|
private _gravity;
|
|
59
61
|
/**
|
|
@@ -4,9 +4,9 @@ import { ParticleShapeType } from "./enums/ParticleShapeType";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare abstract class BaseShape {
|
|
6
6
|
/** The type of shape to emit particles from. */
|
|
7
|
-
shapeType: ParticleShapeType;
|
|
7
|
+
abstract readonly shapeType: ParticleShapeType;
|
|
8
8
|
/** Specifies whether the ShapeModule is enabled or disabled. */
|
|
9
|
-
|
|
9
|
+
enabled: boolean;
|
|
10
10
|
/** Randomizes the starting direction of particles. */
|
|
11
11
|
randomDirectionAmount: number;
|
|
12
12
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Vector3 } from "@galacean/engine-math";
|
|
2
2
|
import { BaseShape } from "./BaseShape";
|
|
3
|
+
import { ParticleShapeType } from "./enums/ParticleShapeType";
|
|
3
4
|
/**
|
|
4
5
|
* Particle shape that emits particles from a box.
|
|
5
6
|
*/
|
|
6
7
|
export declare class BoxShape extends BaseShape {
|
|
7
8
|
private static _tempVector30;
|
|
9
|
+
readonly shapeType = ParticleShapeType.Box;
|
|
8
10
|
/** The size of the box. */
|
|
9
11
|
size: Vector3;
|
|
10
|
-
constructor();
|
|
11
12
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BaseShape } from "./BaseShape";
|
|
2
2
|
import { ParticleShapeArcMode } from "./enums/ParticleShapeArcMode";
|
|
3
|
+
import { ParticleShapeType } from "./enums/ParticleShapeType";
|
|
3
4
|
/**
|
|
4
5
|
* Particle shape that emits particles from a circle.
|
|
5
6
|
*/
|
|
6
7
|
export declare class CircleShape extends BaseShape {
|
|
7
8
|
private static _tempPositionPoint;
|
|
9
|
+
readonly shapeType = ParticleShapeType.Circle;
|
|
8
10
|
/** Radius of the shape to emit particles from. */
|
|
9
11
|
radius: number;
|
|
10
12
|
/** Angle of the circle arc to emit particles from. */
|
|
@@ -13,5 +15,4 @@ export declare class CircleShape extends BaseShape {
|
|
|
13
15
|
arcMode: ParticleShapeArcMode;
|
|
14
16
|
/** The speed of complete 360 degree rotation. */
|
|
15
17
|
arcSpeed: number;
|
|
16
|
-
constructor();
|
|
17
18
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BaseShape } from "./BaseShape";
|
|
2
|
+
import { ParticleShapeType } from "./enums/ParticleShapeType";
|
|
2
3
|
/**
|
|
3
4
|
* Cone shape.
|
|
4
5
|
*/
|
|
@@ -7,6 +8,7 @@ export declare class ConeShape extends BaseShape {
|
|
|
7
8
|
private static _tempVector21;
|
|
8
9
|
private static _tempVector30;
|
|
9
10
|
private static _tempVector31;
|
|
11
|
+
readonly shapeType = ParticleShapeType.Cone;
|
|
10
12
|
/** Angle of the cone to emit particles from. */
|
|
11
13
|
angle: number;
|
|
12
14
|
/** Radius of the shape to emit particles from. */
|
|
@@ -15,7 +17,6 @@ export declare class ConeShape extends BaseShape {
|
|
|
15
17
|
length: number;
|
|
16
18
|
/** Cone emitter type. */
|
|
17
19
|
emitType: ConeEmitType;
|
|
18
|
-
constructor();
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Cone emitter type.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BaseShape } from "./BaseShape";
|
|
2
|
+
import { ParticleShapeType } from "./enums/ParticleShapeType";
|
|
2
3
|
/**
|
|
3
4
|
* Particle shape that emits particles from a hemisphere.
|
|
4
5
|
*/
|
|
5
6
|
export declare class HemisphereShape extends BaseShape {
|
|
7
|
+
readonly shapeType = ParticleShapeType.Hemisphere;
|
|
6
8
|
/** Radius of the shape to emit particles from. */
|
|
7
9
|
radius: number;
|
|
8
|
-
constructor();
|
|
9
10
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { BaseShape } from "./BaseShape";
|
|
2
|
+
import { ParticleShapeType } from "./enums/ParticleShapeType";
|
|
2
3
|
/**
|
|
3
4
|
* Particle shape that emits particles from a sphere.
|
|
4
5
|
*/
|
|
5
6
|
export declare class SphereShape extends BaseShape {
|
|
7
|
+
readonly shapeType = ParticleShapeType.Sphere;
|
|
6
8
|
/** Radius of the shape to emit particles from. */
|
|
7
9
|
radius: number;
|
|
8
|
-
constructor();
|
|
9
10
|
}
|
|
@@ -4,3 +4,4 @@ export { ConeShape, ConeEmitType } from "./ConeShape";
|
|
|
4
4
|
export { HemisphereShape } from "./HemisphereShape";
|
|
5
5
|
export { SphereShape } from "./SphereShape";
|
|
6
6
|
export { ParticleShapeArcMode } from "./enums/ParticleShapeArcMode";
|
|
7
|
+
export { ParticleShapeType } from "./enums/ParticleShapeType";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Entity } from "../Entity";
|
|
2
2
|
import { Vector3 } from "@galacean/engine-math";
|
|
3
|
+
import { ColliderShape } from "./shape";
|
|
3
4
|
/**
|
|
4
5
|
* Structure used to get information back from a raycast or a sweep.
|
|
5
6
|
*/
|
|
@@ -12,4 +13,6 @@ export declare class HitResult {
|
|
|
12
13
|
point: Vector3;
|
|
13
14
|
/** The normal of the surface the ray hit. */
|
|
14
15
|
normal: Vector3;
|
|
16
|
+
/** The shape of the collider that was hit. */
|
|
17
|
+
shape: ColliderShape;
|
|
15
18
|
}
|
|
@@ -5,10 +5,10 @@ import { TextureCubeFace } from "../texture";
|
|
|
5
5
|
export interface IPlatformRenderTarget {
|
|
6
6
|
/**
|
|
7
7
|
* Set which face and mipLevel of the cube texture to render to.
|
|
8
|
-
* @param faceIndex - Cube texture face
|
|
9
8
|
* @param mipLevel - Set mip level the data want to write
|
|
9
|
+
* @param faceIndex - Cube texture face
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
activeRenderTarget(mipLevel: number, faceIndex?: TextureCubeFace): void;
|
|
12
12
|
/**
|
|
13
13
|
* Blit FBO.
|
|
14
14
|
*/
|
package/types/shader/Shader.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Engine } from "../Engine";
|
|
2
|
+
import { IReferable } from "../asset/IReferable";
|
|
2
3
|
import { ShaderMacro } from "./ShaderMacro";
|
|
3
4
|
import { ShaderPass } from "./ShaderPass";
|
|
4
5
|
import { ShaderProperty } from "./ShaderProperty";
|
|
@@ -6,7 +7,7 @@ import { SubShader } from "./SubShader";
|
|
|
6
7
|
/**
|
|
7
8
|
* Shader for rendering.
|
|
8
9
|
*/
|
|
9
|
-
export declare class Shader {
|
|
10
|
+
export declare class Shader implements IReferable {
|
|
10
11
|
readonly name: string;
|
|
11
12
|
private static _shaderMap;
|
|
12
13
|
/**
|
|
@@ -57,11 +58,18 @@ export declare class Shader {
|
|
|
57
58
|
* @param name - Name of the shader
|
|
58
59
|
*/
|
|
59
60
|
static find(name: string): Shader;
|
|
61
|
+
private static _applyConstRenderStates;
|
|
62
|
+
private _refCount;
|
|
63
|
+
private _destroyed;
|
|
60
64
|
private _subShaders;
|
|
61
65
|
/**
|
|
62
66
|
* Sub shaders of the shader.
|
|
63
67
|
*/
|
|
64
68
|
get subShaders(): ReadonlyArray<SubShader>;
|
|
69
|
+
/**
|
|
70
|
+
* Whether it has been destroyed.
|
|
71
|
+
*/
|
|
72
|
+
get destroyed(): boolean;
|
|
65
73
|
private constructor();
|
|
66
74
|
/**
|
|
67
75
|
* Compile shader variant by macro name list.
|
|
@@ -74,7 +82,12 @@ export declare class Shader {
|
|
|
74
82
|
* @returns Is the compiled shader variant valid
|
|
75
83
|
*/
|
|
76
84
|
compileVariant(engine: Engine, macros: string[]): boolean;
|
|
77
|
-
|
|
85
|
+
/**
|
|
86
|
+
* Destroy the shader.
|
|
87
|
+
* @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
|
|
88
|
+
* @returns Whether the release was successful.
|
|
89
|
+
*/
|
|
90
|
+
destroy(force?: boolean): boolean;
|
|
78
91
|
/**
|
|
79
92
|
* @deprecated Please use `ShaderMacro.getByName` instead
|
|
80
93
|
*
|
|
@@ -6,9 +6,9 @@ export declare class DepthState {
|
|
|
6
6
|
private static _getGLCompareFunction;
|
|
7
7
|
/** Whether to enable the depth test. */
|
|
8
8
|
enabled: boolean;
|
|
9
|
-
/** Whether the depth value can be written.*/
|
|
10
|
-
writeEnabled: boolean;
|
|
11
9
|
/** Depth comparison function. */
|
|
12
10
|
compareFunction: CompareFunction;
|
|
11
|
+
/** Whether the depth value can be written.*/
|
|
12
|
+
writeEnabled: boolean;
|
|
13
13
|
private _platformApply;
|
|
14
14
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
export declare class ShaderFactory {
|
|
2
|
+
private static readonly _has300OutInFragReg;
|
|
2
3
|
static parseCustomMacros(macros: string[]): string;
|
|
3
4
|
static registerInclude(includeName: string, includeSource: string): void;
|
|
4
|
-
static
|
|
5
|
+
static unRegisterInclude(includeName: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* @param regex The default regex is for engine's builtin glsl `#include` syntax,
|
|
8
|
+
* since `ShaderLab` use the same parsing function but different syntax for `#include` --- `/^[ \t]*#include +"([\w\d.]+)"/gm`
|
|
9
|
+
*/
|
|
10
|
+
static parseIncludes(src: string, regex?: RegExp): string;
|
|
5
11
|
/**
|
|
6
12
|
* Convert lower GLSL version to GLSL 300 es.
|
|
7
13
|
* @param shader - code
|
|
8
14
|
* @param isFrag - Whether it is a fragment shader.
|
|
9
15
|
* */
|
|
10
16
|
static convertTo300(shader: string, isFrag?: boolean): string;
|
|
17
|
+
private static _has300Output;
|
|
11
18
|
private static _replaceMRTShader;
|
|
12
19
|
}
|
|
@@ -28,7 +28,6 @@ export declare class CascadedShadowCasterPass extends PipelinePass {
|
|
|
28
28
|
private _shadowSliceData;
|
|
29
29
|
private _lightUp;
|
|
30
30
|
private _lightSide;
|
|
31
|
-
private _existShadowMap;
|
|
32
31
|
private _splitBoundSpheres;
|
|
33
32
|
/** The end is project precision problem in shader. */
|
|
34
33
|
private _shadowMatrices;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { GraphicsResource } from "../asset/GraphicsResource";
|
|
2
2
|
import { Engine } from "../Engine";
|
|
3
3
|
import { RenderBufferDepthFormat } from "./enums/RenderBufferDepthFormat";
|
|
4
|
+
import { TextureFormat } from "./enums/TextureFormat";
|
|
4
5
|
import { Texture } from "./Texture";
|
|
5
6
|
/**
|
|
6
7
|
* The render target used for off-screen rendering.
|
|
@@ -43,10 +44,10 @@ export declare class RenderTarget extends GraphicsResource {
|
|
|
43
44
|
* @param width - Render target width
|
|
44
45
|
* @param height - Render target height
|
|
45
46
|
* @param colorTexture - Render color texture
|
|
46
|
-
* @param depthFormat - Depth format. default
|
|
47
|
+
* @param depthFormat - Depth format. default TextureFormat.Depth, engine will automatically select the supported precision
|
|
47
48
|
* @param antiAliasing - Anti-aliasing level, default is 1
|
|
48
49
|
*/
|
|
49
|
-
constructor(engine: Engine, width: number, height: number, colorTexture: Texture, depthFormat?:
|
|
50
|
+
constructor(engine: Engine, width: number, height: number, colorTexture: Texture, depthFormat?: TextureFormat | null | RenderBufferDepthFormat, antiAliasing?: number);
|
|
50
51
|
/**
|
|
51
52
|
* Create a render target through color texture and depth format.
|
|
52
53
|
* @remarks If the color texture is not transmitted, only the depth texture is generated.
|
|
@@ -64,10 +65,10 @@ export declare class RenderTarget extends GraphicsResource {
|
|
|
64
65
|
* @param width - Render target width
|
|
65
66
|
* @param height - Render target height
|
|
66
67
|
* @param colorTextures - Render color texture array
|
|
67
|
-
* @param depthFormat - Depth format. default
|
|
68
|
+
* @param depthFormat - Depth format. default TextureFormat.Depth,engine will automatically select the supported precision
|
|
68
69
|
* @param antiAliasing - Anti-aliasing level, default is 1
|
|
69
70
|
*/
|
|
70
|
-
constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthFormat?:
|
|
71
|
+
constructor(engine: Engine, width: number, height: number, colorTextures: Texture[], depthFormat?: TextureFormat | null | RenderBufferDepthFormat, antiAliasing?: number);
|
|
71
72
|
/**
|
|
72
73
|
* Create a render target with color texture array and depth texture.
|
|
73
74
|
* @param engine - Define the engine to use for this off-screen rendering
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @deprecated Please use `TextureFormat` instead.
|
|
3
|
+
*
|
|
2
4
|
* Render buffer depth format enumeration.
|
|
3
5
|
*/
|
|
4
6
|
export declare enum RenderBufferDepthFormat {
|
|
5
7
|
/** Render to depth buffer,engine will automatically select the supported precision. */
|
|
6
|
-
Depth =
|
|
7
|
-
/** Render to depth stencil buffer, engine will automatically select the supported precision. */
|
|
8
|
-
DepthStencil = 1,
|
|
8
|
+
Depth = 27,
|
|
9
9
|
/** Render to stencil buffer. */
|
|
10
|
-
Stencil =
|
|
10
|
+
Stencil = 28,
|
|
11
|
+
/** Render to depth stencil buffer, engine will automatically select the supported precision. */
|
|
12
|
+
DepthStencil = 29,
|
|
11
13
|
/** Force 16-bit depth buffer. */
|
|
12
|
-
Depth16 =
|
|
14
|
+
Depth16 = 30,
|
|
13
15
|
/** Force 24-bit depth buffer. */
|
|
14
|
-
Depth24 =
|
|
16
|
+
Depth24 = 31,
|
|
15
17
|
/** Force 32-bit depth buffer. */
|
|
16
|
-
Depth32 =
|
|
18
|
+
Depth32 = 32,
|
|
17
19
|
/** Force 16-bit depth + 8-bit stencil buffer. */
|
|
18
|
-
Depth24Stencil8 =
|
|
20
|
+
Depth24Stencil8 = 33,
|
|
19
21
|
/** Force 32-bit depth + 8-bit stencil buffer. */
|
|
20
|
-
Depth32Stencil8 =
|
|
22
|
+
Depth32Stencil8 = 34
|
|
21
23
|
}
|