@galacean/engine-core 2.0.0-alpha.5 → 2.0.0-alpha.50
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 +23868 -20447
- package/dist/main.js.map +1 -1
- package/dist/module.js +23856 -20439
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/assembler/ISpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/ISpriteRenderer.d.ts +3 -2
- package/types/2d/assembler/SimpleSpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/SlicedSpriteAssembler.d.ts +1 -0
- package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
- package/types/2d/atlas/FontAtlas.d.ts +23 -1
- package/types/2d/atlas/SpriteAtlas.d.ts +8 -0
- package/types/2d/sprite/Sprite.d.ts +30 -4
- package/types/2d/sprite/SpriteMask.d.ts +49 -1
- package/types/2d/sprite/SpriteRenderer.d.ts +35 -1
- package/types/2d/text/CharInfo.d.ts +20 -1
- package/types/2d/text/CharRenderInfo.d.ts +15 -1
- package/types/2d/text/Font.d.ts +11 -1
- package/types/2d/text/ITextRenderer.d.ts +3 -0
- package/types/2d/text/SubFont.d.ts +35 -1
- package/types/2d/text/TextRenderer.d.ts +54 -1
- package/types/2d/text/TextUtils.d.ts +89 -1
- package/types/Background.d.ts +19 -2
- package/types/BasicResources.d.ts +52 -0
- package/types/Camera.d.ts +73 -1
- package/types/Canvas.d.ts +36 -7
- package/types/Component.d.ts +35 -2
- package/types/ComponentsDependencies.d.ts +38 -1
- package/types/ComponentsManager.d.ts +17 -0
- package/types/Engine.d.ts +110 -4
- package/types/EngineEventType.d.ts +13 -0
- package/types/Entity.d.ts +112 -21
- package/types/Polyfill.d.ts +12 -1
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -1
- package/types/RenderPipeline/BatcherManager.d.ts +23 -1
- package/types/RenderPipeline/Blitter.d.ts +1 -1
- package/types/RenderPipeline/CullingResults.d.ts +17 -1
- package/types/RenderPipeline/DepthOnlyPass.d.ts +18 -1
- package/types/RenderPipeline/InstanceBuffer.d.ts +28 -0
- package/types/RenderPipeline/MaskManager.d.ts +36 -1
- package/types/RenderPipeline/OpaqueTexturePass.d.ts +16 -1
- package/types/RenderPipeline/PipelineUtils.d.ts +11 -1
- package/types/RenderPipeline/PrimitiveChunk.d.ts +27 -1
- package/types/RenderPipeline/PrimitiveChunkManager.d.ts +16 -1
- package/types/RenderPipeline/RenderContext.d.ts +46 -1
- package/types/RenderPipeline/RenderElement.d.ts +26 -6
- package/types/RenderPipeline/RenderQueue.d.ts +23 -1
- package/types/RenderPipeline/RenderTargetPool.d.ts +17 -1
- package/types/RenderPipeline/SubPrimitiveChunk.d.ts +14 -1
- package/types/RenderPipeline/VertexArea.d.ts +10 -1
- package/types/RenderPipeline/VertexMergeBatcher.d.ts +11 -0
- package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +9 -1
- package/types/RenderPipeline/index.d.ts +4 -1
- package/types/Renderer.d.ts +81 -18
- package/types/Scene.d.ts +34 -7
- package/types/SceneManager.d.ts +18 -6
- package/types/Script.d.ts +41 -0
- package/types/Signal.d.ts +69 -0
- package/types/SystemInfo.d.ts +13 -0
- package/types/Transform.d.ts +26 -1
- package/types/UpdateFlag.d.ts +4 -1
- package/types/UpdateFlagManager.d.ts +41 -1
- package/types/Utils.d.ts +20 -0
- package/types/VirtualCamera.d.ts +16 -1
- package/types/animation/AnimationClip.d.ts +13 -2
- package/types/animation/AnimationClipCurveBinding.d.ts +17 -2
- package/types/animation/AnimationEvent.d.ts +2 -2
- package/types/animation/Animator.d.ts +49 -10
- package/types/animation/AnimatorController.d.ts +20 -2
- package/types/animation/AnimatorControllerLayer.d.ts +17 -2
- package/types/animation/AnimatorControllerParameter.d.ts +4 -0
- package/types/animation/AnimatorState.d.ts +46 -2
- package/types/animation/AnimatorStateInstance.d.ts +46 -0
- package/types/animation/AnimatorStateMachine.d.ts +17 -2
- package/types/animation/AnimatorStateTransition.d.ts +9 -0
- package/types/animation/AnimatorStateTransitionCollection.d.ts +23 -1
- package/types/animation/Keyframe.d.ts +1 -1
- package/types/animation/StateMachineScript.d.ts +2 -0
- package/types/animation/animationCurve/AnimationArrayCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationBoolCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationColorCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationCurve.d.ts +9 -1
- package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +38 -0
- package/types/animation/animationCurve/AnimationFloatCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationQuaternionCurve.d.ts +41 -0
- package/types/animation/animationCurve/AnimationRectCurve.d.ts +18 -0
- package/types/animation/animationCurve/AnimationRefCurve.d.ts +20 -2
- package/types/animation/animationCurve/AnimationStringCurve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationVector2Curve.d.ts +39 -0
- package/types/animation/animationCurve/AnimationVector3Curve.d.ts +43 -0
- package/types/animation/animationCurve/AnimationVector4Curve.d.ts +39 -0
- package/types/animation/animationCurve/interfaces/IAnimationCurveCalculator.d.ts +18 -1
- package/types/animation/enums/AnimatorStatePlayState.d.ts +8 -1
- package/types/animation/index.d.ts +1 -0
- package/types/animation/internal/AnimationCurveLayerOwner.d.ts +15 -1
- package/types/animation/internal/AnimationEventHandler.d.ts +8 -1
- package/types/animation/internal/AnimatorLayerData.d.ts +28 -1
- package/types/animation/internal/AnimatorStateData.d.ts +14 -1
- package/types/animation/internal/AnimatorStatePlayData.d.ts +27 -1
- package/types/animation/internal/AnimatorTempValue.d.ts +12 -1
- package/types/animation/internal/animationCurveOwner/AnimationCurveOwner.d.ts +39 -0
- package/types/animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +12 -1
- package/types/animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts +10 -1
- package/types/animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts +13 -1
- package/types/animation/internal/animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts +23 -1
- package/types/asset/AssetPromise.d.ts +4 -4
- package/types/asset/AssetType.d.ts +7 -9
- package/types/asset/GraphicsResource.d.ts +10 -0
- package/types/asset/IReferable.d.ts +8 -0
- package/types/asset/JSONAsset.d.ts +1 -1
- package/types/asset/LoadItem.d.ts +1 -1
- package/types/asset/Loader.d.ts +2 -2
- package/types/asset/ReferResource.d.ts +28 -0
- package/types/asset/RenderingStatistics.d.ts +8 -0
- package/types/asset/ResourceManager.d.ts +117 -9
- package/types/audio/AudioClip.d.ts +8 -0
- package/types/audio/AudioManager.d.ts +18 -0
- package/types/audio/AudioSource.d.ts +20 -2
- package/types/base/DataObject.d.ts +6 -0
- package/types/base/EngineObject.d.ts +4 -0
- package/types/base/Time.d.ts +13 -0
- package/types/base/index.d.ts +1 -0
- package/types/clone/CloneDecorators.d.ts +37 -0
- package/types/clone/CloneUtil.d.ts +30 -0
- package/types/clone/ComponentCloner.d.ts +4 -10
- package/types/clone/ICloneHook.d.ts +12 -0
- package/types/enums/CameraType.d.ts +9 -1
- package/types/env-probe/CubeProbe.d.ts +2 -0
- package/types/env-probe/Probe.d.ts +1 -1
- package/types/graphic/Buffer.d.ts +23 -3
- package/types/graphic/BufferUtil.d.ts +8 -0
- package/types/graphic/IndexBufferBinding.d.ts +4 -0
- package/types/graphic/Mesh.d.ts +58 -1
- package/types/graphic/Primitive.d.ts +50 -1
- package/types/graphic/TransformFeedback.d.ts +46 -0
- package/types/graphic/TransformFeedbackPrimitive.d.ts +67 -0
- package/types/graphic/TransformFeedbackSimulator.d.ts +55 -0
- package/types/graphic/VertexBufferBinding.d.ts +4 -0
- package/types/graphic/VertexElement.d.ts +1 -0
- package/types/graphic/enums/BufferBindFlag.d.ts +5 -3
- package/types/index.d.ts +7 -4
- package/types/input/InputManager.d.ts +25 -6
- package/types/input/enums/PointerButton.d.ts +8 -0
- package/types/input/keyboard/KeyboardManager.d.ts +41 -1
- package/types/input/pointer/Pointer.d.ts +37 -1
- package/types/input/pointer/PointerEventData.d.ts +4 -0
- package/types/input/pointer/PointerManager.d.ts +58 -0
- package/types/input/pointer/emitter/IHitResult.d.ts +11 -1
- package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +20 -1
- package/types/input/wheel/WheelManager.d.ts +34 -1
- package/types/lighting/AmbientLight.d.ts +9 -8
- package/types/lighting/DirectLight.d.ts +17 -0
- package/types/lighting/KHR_lights.d.ts +13 -1
- package/types/lighting/Light.d.ts +2 -0
- package/types/lighting/LightManager.d.ts +57 -0
- package/types/lighting/PointLight.d.ts +17 -0
- package/types/lighting/SpotLight.d.ts +17 -0
- package/types/lighting/ambientOcclusion/AmbientOcclusion.d.ts +4 -0
- package/types/lighting/ambientOcclusion/ScalableAmbientObscurancePass.d.ts +38 -1
- package/types/material/BaseMaterial.d.ts +15 -11
- package/types/material/Material.d.ts +5 -9
- package/types/mesh/BlendShape.d.ts +14 -1
- package/types/mesh/BlendShapeFrame.d.ts +11 -4
- package/types/mesh/BlendShapeManager.d.ts +101 -1
- package/types/mesh/BufferMesh.d.ts +2 -2
- package/types/mesh/MeshRenderer.d.ts +42 -0
- package/types/mesh/ModelMesh.d.ts +23 -4
- package/types/mesh/PrimitiveMesh.d.ts +38 -4
- package/types/mesh/PrimitiveMeshRestorer.d.ts +107 -0
- package/types/mesh/Skin.d.ts +12 -3
- package/types/mesh/SkinnedMeshRenderer.d.ts +27 -1
- package/types/particle/ParticleBufferUtils.d.ts +26 -1
- package/types/particle/ParticleGenerator.d.ts +147 -2
- package/types/particle/ParticleMaterial.d.ts +3 -1
- package/types/particle/ParticleRenderer.d.ts +61 -1
- package/types/particle/ParticleTransformFeedbackSimulator.d.ts +52 -0
- package/types/particle/enums/ParticleRandomSubSeeds.d.ts +25 -1
- package/types/particle/enums/ParticleScaleMode.d.ts +5 -5
- package/types/particle/enums/ParticleSubEmitterInheritProperty.d.ts +17 -0
- package/types/particle/enums/ParticleSubEmitterType.d.ts +9 -0
- package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +6 -1
- package/types/particle/enums/attributes/ParticleFeedbackVertexAttribute.d.ts +8 -0
- package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +17 -1
- package/types/particle/index.d.ts +7 -0
- package/types/particle/modules/Burst.d.ts +23 -2
- package/types/particle/modules/ColorOverLifetimeModule.d.ts +19 -0
- package/types/particle/modules/CustomDataModule.d.ts +90 -0
- package/types/particle/modules/EmissionModule.d.ts +36 -0
- package/types/particle/modules/ForceOverLifetimeModule.d.ts +16 -1
- package/types/particle/modules/LimitVelocityOverLifetimeModule.d.ts +164 -0
- package/types/particle/modules/MainModule.d.ts +45 -6
- package/types/particle/modules/NoiseModule.d.ts +114 -0
- package/types/particle/modules/ParticleCompositeCurve.d.ts +42 -4
- package/types/particle/modules/ParticleCompositeGradient.d.ts +8 -2
- package/types/particle/modules/ParticleCurve.d.ts +31 -2
- package/types/particle/modules/ParticleGeneratorModule.d.ts +9 -3
- package/types/particle/modules/ParticleGradient.d.ts +22 -5
- package/types/particle/modules/RotationOverLifetimeModule.d.ts +27 -3
- package/types/particle/modules/SizeOverLifetimeModule.d.ts +25 -0
- package/types/particle/modules/SubEmitter.d.ts +31 -0
- package/types/particle/modules/SubEmittersModule.d.ts +57 -0
- package/types/particle/modules/TextureSheetAnimationModule.d.ts +14 -1
- package/types/particle/modules/VelocityOverLifetimeModule.d.ts +120 -0
- package/types/particle/modules/shape/BaseShape.d.ts +65 -2
- package/types/particle/modules/shape/BoxShape.d.ts +13 -2
- package/types/particle/modules/shape/CircleShape.d.ts +13 -1
- package/types/particle/modules/shape/ConeShape.d.ts +13 -4
- package/types/particle/modules/shape/HemisphereShape.d.ts +13 -0
- package/types/particle/modules/shape/MeshShape.d.ts +26 -3
- package/types/particle/modules/shape/ShapeUtils.d.ts +13 -1
- package/types/particle/modules/shape/SphereShape.d.ts +13 -0
- package/types/physics/CharacterController.d.ts +21 -0
- package/types/physics/Collider.d.ts +47 -2
- package/types/physics/Collision.d.ts +3 -0
- package/types/physics/DynamicCollider.d.ts +28 -1
- package/types/physics/HitResult.d.ts +2 -2
- package/types/physics/PhysicsMaterial.d.ts +3 -0
- package/types/physics/PhysicsScene.d.ts +56 -6
- package/types/physics/StaticCollider.d.ts +5 -0
- package/types/physics/enums/ColliderShapeChangeFlag.d.ts +8 -1
- package/types/physics/enums/HingeJointFlag.d.ts +14 -1
- package/types/physics/joint/HingeJoint.d.ts +4 -0
- package/types/physics/joint/Joint.d.ts +22 -2
- package/types/physics/joint/JointLimits.d.ts +2 -1
- package/types/physics/joint/JointMotor.d.ts +2 -1
- package/types/physics/shape/ColliderShape.d.ts +26 -3
- package/types/physics/shape/MeshColliderShape.d.ts +11 -5
- package/types/postProcess/FinalPass.d.ts +19 -1
- package/types/postProcess/PostProcess.d.ts +11 -6
- package/types/postProcess/PostProcessEffect.d.ts +6 -1
- package/types/postProcess/PostProcessEffectParameter.d.ts +23 -3
- package/types/postProcess/PostProcessManager.d.ts +43 -0
- package/types/postProcess/PostProcessPass.d.ts +3 -2
- package/types/postProcess/PostProcessUberPass.d.ts +2 -1
- package/types/postProcess/effects/BloomEffect.d.ts +26 -1
- package/types/postProcess/effects/TonemappingEffect.d.ts +3 -0
- package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +1 -0
- package/types/renderingHardwareInterface/IPlatformTransformFeedback.d.ts +36 -0
- package/types/renderingHardwareInterface/IPlatformTransformFeedbackPrimitive.d.ts +40 -0
- package/types/renderingHardwareInterface/index.d.ts +2 -0
- package/types/shader/Shader.d.ts +38 -22
- package/types/shader/ShaderBlockProperty.d.ts +19 -0
- package/types/shader/ShaderData.d.ts +43 -4
- package/types/shader/ShaderFactory.d.ts +78 -0
- package/types/shader/ShaderMacro.d.ts +17 -2
- package/types/shader/ShaderMacroCollection.d.ts +57 -1
- package/types/shader/ShaderMacroProcessor.d.ts +72 -0
- package/types/shader/ShaderPass.d.ts +46 -13
- package/types/shader/ShaderProgram.d.ts +91 -1
- package/types/shader/ShaderProgramMap.d.ts +20 -0
- package/types/shader/ShaderProperty.d.ts +17 -0
- package/types/shader/ShaderTagKey.d.ts +2 -0
- package/types/shader/ShaderUniform.d.ts +49 -1
- package/types/shader/ShaderUniformBlock.d.ts +9 -1
- package/types/shader/enums/ConstantBufferBindingPoint.d.ts +7 -0
- package/types/shader/enums/ShaderPreprocessorDirective.d.ts +16 -0
- package/types/shader/index.d.ts +1 -1
- package/types/shader/state/BlendState.d.ts +16 -1
- package/types/shader/state/DepthState.d.ts +16 -1
- package/types/shader/state/RasterState.d.ts +19 -1
- package/types/shader/state/RenderState.d.ts +13 -2
- package/types/shader/state/RenderTargetBlendState.d.ts +2 -1
- package/types/shader/state/StencilState.d.ts +15 -1
- package/types/shadow/CascadedShadowCasterPass.d.ts +5 -0
- package/types/shadow/ShadowSliceData.d.ts +13 -1
- package/types/shadow/ShadowUtils.d.ts +43 -1
- package/types/sky/Sky.d.ts +13 -4
- package/types/sky/SkyBoxMaterial.d.ts +0 -7
- package/types/texture/RenderTarget.d.ts +28 -3
- package/types/texture/Texture.d.ts +21 -0
- package/types/texture/Texture2D.d.ts +4 -0
- package/types/texture/Texture2DArray.d.ts +4 -0
- package/types/texture/TextureCube.d.ts +4 -0
- package/types/texture/TextureUtils.d.ts +16 -1
- package/types/trail/TrailRenderer.d.ts +13 -8
- package/types/ui/IUICanvas.d.ts +16 -1
- package/types/utils/DisorderedArray.d.ts +3 -1
- package/types/xr/XRManager.d.ts +28 -0
- package/types/RenderPipeline/BatchUtils.d.ts +0 -1
- package/types/RenderPipeline/SubRenderElement.d.ts +0 -22
- package/types/clone/CloneManager.d.ts +0 -31
- package/types/clone/enums/CloneMode.d.ts +0 -13
- package/types/shader/ShaderPool.d.ts +0 -1
- package/types/shader/ShaderProgramPool.d.ts +0 -1
- package/types/shader/state/index.d.ts +0 -6
- package/types/shaderlib/ShaderFactory.d.ts +0 -20
- package/types/shaderlib/ShaderLib.d.ts +0 -73
- package/types/shaderlib/index.d.ts +0 -1
- package/types/shaderlib/particle/index.d.ts +0 -15
- package/types/shaderlib/pbr/index.d.ts +0 -11
- package/types/shaderlib/shadow/index.d.ts +0 -8
|
@@ -13,6 +13,8 @@ export declare class PostProcess extends Component {
|
|
|
13
13
|
* The outer distance to start blending from, only takes effect when the `isGlobal` is false.
|
|
14
14
|
*/
|
|
15
15
|
blendDistance: number;
|
|
16
|
+
/** @internal */
|
|
17
|
+
_effects: PostProcessEffect[];
|
|
16
18
|
private _priority;
|
|
17
19
|
private _isGlobal;
|
|
18
20
|
/**
|
|
@@ -33,31 +35,34 @@ export declare class PostProcess extends Component {
|
|
|
33
35
|
/**
|
|
34
36
|
* Get the PostProcessEffect by type.
|
|
35
37
|
* @param type - The type of PostProcessEffect
|
|
36
|
-
* @returns The
|
|
38
|
+
* @returns The effect, or `undefined` if none matches.
|
|
37
39
|
*/
|
|
38
|
-
getEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T
|
|
40
|
+
getEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T> | undefined;
|
|
39
41
|
/**
|
|
40
42
|
* Add a PostProcessEffect to the PostProcess.
|
|
41
43
|
* @remarks Only one effect of the same type can be added to the PostProcess.
|
|
42
44
|
* @param type - The type of PostProcessEffect
|
|
43
|
-
* @returns The
|
|
45
|
+
* @returns The added effect, or `undefined` if the type already exists.
|
|
44
46
|
*/
|
|
45
|
-
addEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T
|
|
47
|
+
addEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T> | undefined;
|
|
46
48
|
/**
|
|
47
49
|
* Remove a PostProcessEffect from the PostProcess.
|
|
48
50
|
* @param type - The type of PostProcessEffect
|
|
49
|
-
* @returns The
|
|
51
|
+
* @returns The removed effect, or `undefined` if none matches.
|
|
50
52
|
*/
|
|
51
|
-
removeEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T
|
|
53
|
+
removeEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T> | undefined;
|
|
52
54
|
/**
|
|
55
|
+
* @internal
|
|
53
56
|
* @inheritdoc
|
|
54
57
|
*/
|
|
55
58
|
_onEnableInScene(): void;
|
|
56
59
|
/**
|
|
60
|
+
* @internal
|
|
57
61
|
* @inheritdoc
|
|
58
62
|
*/
|
|
59
63
|
_onDisableInScene(): void;
|
|
60
64
|
/**
|
|
65
|
+
* @internal
|
|
61
66
|
* @inheritdoc
|
|
62
67
|
*/
|
|
63
68
|
_onDestroy(): void;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { DataObject } from "../base/DataObject";
|
|
1
2
|
/**
|
|
2
3
|
* The base class for post process effect.
|
|
3
4
|
*/
|
|
4
|
-
export declare class PostProcessEffect {
|
|
5
|
+
export declare class PostProcessEffect extends DataObject {
|
|
5
6
|
private _enabled;
|
|
6
7
|
private _parameters;
|
|
7
8
|
private _parameterInitialized;
|
|
@@ -16,6 +17,10 @@ export declare class PostProcessEffect {
|
|
|
16
17
|
* This method can be overridden to control the effect's real validity.
|
|
17
18
|
*/
|
|
18
19
|
isValid(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
_lerp(to: PostProcessEffect, factor: number): void;
|
|
19
24
|
/**
|
|
20
25
|
* Get all parameters of the post process effect.
|
|
21
26
|
* @remarks
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataObject } from "../base/DataObject";
|
|
1
2
|
import { Color, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
2
3
|
import { Texture } from "../texture";
|
|
3
4
|
/**
|
|
@@ -5,7 +6,7 @@ import { Texture } from "../texture";
|
|
|
5
6
|
* @remarks
|
|
6
7
|
* The parameter will be mixed to a final value and be used in post process manager.
|
|
7
8
|
*/
|
|
8
|
-
export declare abstract class PostProcessEffectParameter<T> {
|
|
9
|
+
export declare abstract class PostProcessEffectParameter<T> extends DataObject {
|
|
9
10
|
/**
|
|
10
11
|
* Whether the parameter is enabled.
|
|
11
12
|
*/
|
|
@@ -18,6 +19,10 @@ export declare abstract class PostProcessEffectParameter<T> {
|
|
|
18
19
|
get value(): T;
|
|
19
20
|
set value(value: T);
|
|
20
21
|
constructor(value: T, needLerp?: boolean);
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
_lerp(to: T, factor: number): void;
|
|
21
26
|
}
|
|
22
27
|
/**
|
|
23
28
|
* Represents a float parameter of a post process effect.
|
|
@@ -35,6 +40,9 @@ export declare class PostProcessEffectFloatParameter extends PostProcessEffectPa
|
|
|
35
40
|
* @param needLerp - Whether the parameter needs to be lerp, default is true
|
|
36
41
|
*/
|
|
37
42
|
constructor(value: number, min?: number, max?: number, needLerp?: boolean);
|
|
43
|
+
/**
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
38
46
|
_lerp(to: number, factor: number): void;
|
|
39
47
|
}
|
|
40
48
|
/**
|
|
@@ -50,12 +58,12 @@ export declare class PostProcessEffectBoolParameter extends PostProcessEffectPar
|
|
|
50
58
|
/**
|
|
51
59
|
* Represents a texture parameter of a post process effect.
|
|
52
60
|
*/
|
|
53
|
-
export declare class PostProcessEffectTextureParameter extends PostProcessEffectParameter<Texture> {
|
|
61
|
+
export declare class PostProcessEffectTextureParameter extends PostProcessEffectParameter<Texture | null> {
|
|
54
62
|
/**
|
|
55
63
|
* Create a new texture parameter.
|
|
56
64
|
* @param value - The default texture of the parameter
|
|
57
65
|
*/
|
|
58
|
-
constructor(value: Texture);
|
|
66
|
+
constructor(value: Texture | null);
|
|
59
67
|
}
|
|
60
68
|
/**
|
|
61
69
|
* Represents a color parameter of a post process effect.
|
|
@@ -67,6 +75,9 @@ export declare class PostProcessEffectColorParameter extends PostProcessEffectPa
|
|
|
67
75
|
* @param needLerp - Whether the parameter needs to be lerp, default is true
|
|
68
76
|
*/
|
|
69
77
|
constructor(value: Color, needLerp?: boolean);
|
|
78
|
+
/**
|
|
79
|
+
* @internal
|
|
80
|
+
*/
|
|
70
81
|
_lerp(to: Color, factor: number): void;
|
|
71
82
|
}
|
|
72
83
|
/**
|
|
@@ -79,6 +90,9 @@ export declare class PostProcessEffectVector2Parameter extends PostProcessEffect
|
|
|
79
90
|
* @param needLerp - Whether the parameter needs to be lerp, default is true
|
|
80
91
|
*/
|
|
81
92
|
constructor(value: Vector2, needLerp?: boolean);
|
|
93
|
+
/**
|
|
94
|
+
* @internal
|
|
95
|
+
*/
|
|
82
96
|
_lerp(to: Vector2, factor: number): void;
|
|
83
97
|
}
|
|
84
98
|
/**
|
|
@@ -91,6 +105,9 @@ export declare class PostProcessEffectVector3Parameter extends PostProcessEffect
|
|
|
91
105
|
* @param needLerp - Whether the parameter needs to be lerp, default is true
|
|
92
106
|
*/
|
|
93
107
|
constructor(value: Vector3, needLerp?: boolean);
|
|
108
|
+
/**
|
|
109
|
+
* @internal
|
|
110
|
+
*/
|
|
94
111
|
_lerp(to: Vector3, factor: number): void;
|
|
95
112
|
}
|
|
96
113
|
/**
|
|
@@ -103,6 +120,9 @@ export declare class PostProcessEffectVector4Parameter extends PostProcessEffect
|
|
|
103
120
|
* @param needLerp - Whether the parameter needs to be lerp, default is true
|
|
104
121
|
*/
|
|
105
122
|
constructor(value: Vector4, needLerp?: boolean);
|
|
123
|
+
/**
|
|
124
|
+
* @internal
|
|
125
|
+
*/
|
|
106
126
|
_lerp(to: Vector4, factor: number): void;
|
|
107
127
|
}
|
|
108
128
|
/**
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { Camera } from "../Camera";
|
|
1
2
|
import { Scene } from "../Scene";
|
|
3
|
+
import { Material } from "../material";
|
|
4
|
+
import { RenderTarget } from "../texture";
|
|
5
|
+
import { PostProcess } from "./PostProcess";
|
|
2
6
|
import { PostProcessEffect } from "./PostProcessEffect";
|
|
3
7
|
/**
|
|
4
8
|
* A global manager of the PostProcess.
|
|
@@ -7,6 +11,12 @@ export declare class PostProcessManager {
|
|
|
7
11
|
readonly scene: Scene;
|
|
8
12
|
private static _tempColliders;
|
|
9
13
|
private static _tempVector3;
|
|
14
|
+
/** @internal */
|
|
15
|
+
_uberMaterial: Material;
|
|
16
|
+
/** @internal */
|
|
17
|
+
_postProcessNeedSorting: boolean;
|
|
18
|
+
/** @internal */
|
|
19
|
+
_postProcessPassNeedSorting: boolean;
|
|
10
20
|
private _activePostProcesses;
|
|
11
21
|
private _swapRenderTarget;
|
|
12
22
|
private _srcRenderTarget;
|
|
@@ -22,6 +32,23 @@ export declare class PostProcessManager {
|
|
|
22
32
|
* @param scene - Scene to which the current PostProcessManager belongs
|
|
23
33
|
*/
|
|
24
34
|
constructor(scene: Scene);
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
* Whether has any valid post process pass.
|
|
38
|
+
*/
|
|
39
|
+
_isValid(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @internal
|
|
42
|
+
*/
|
|
43
|
+
_update(camera: Camera): void;
|
|
44
|
+
/**
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
_addPostProcess(postProcess: PostProcess): void;
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
_removePostProcess(postProcess: PostProcess): void;
|
|
25
52
|
/**
|
|
26
53
|
* Get the blend effect by type.
|
|
27
54
|
* @remarks
|
|
@@ -30,6 +57,22 @@ export declare class PostProcessManager {
|
|
|
30
57
|
* @returns The PostProcessEffect instance found
|
|
31
58
|
*/
|
|
32
59
|
getBlendEffect<T extends typeof PostProcessEffect>(type: T): InstanceType<T>;
|
|
60
|
+
/**
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
_render(camera: Camera, srcRenderTarget: RenderTarget, destRenderTarget: RenderTarget | null): void;
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
_releaseSwapRenderTarget(): void;
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
_releaseOutputRenderTarget(): void;
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
_getOutputRenderTarget(camera: Camera): RenderTarget;
|
|
33
76
|
private _sortActivePostProcess;
|
|
34
77
|
private _resetDefaultValue;
|
|
35
78
|
private _initSwapRenderTarget;
|
|
@@ -40,10 +40,11 @@ export declare abstract class PostProcessPass extends EngineObject {
|
|
|
40
40
|
* Execute the post process pass if it is active.
|
|
41
41
|
* @param camera - The camera used to render
|
|
42
42
|
* @param srcTexture - The source texture from last render target
|
|
43
|
-
* @param destTarget - The destination render target
|
|
43
|
+
* @param destTarget - The destination render target, or null for the canvas
|
|
44
44
|
*/
|
|
45
|
-
abstract onRender(camera: Camera, srcTexture: Texture2D, destTarget: RenderTarget): void;
|
|
45
|
+
abstract onRender(camera: Camera, srcTexture: Texture2D, destTarget: RenderTarget | null): void;
|
|
46
46
|
/**
|
|
47
|
+
* @internal
|
|
47
48
|
* @inheritdoc
|
|
48
49
|
*/
|
|
49
50
|
_onDestroy(): void;
|
|
@@ -4,7 +4,7 @@ import { RenderTarget, Texture2D } from "../texture";
|
|
|
4
4
|
import { PostProcessManager } from "./PostProcessManager";
|
|
5
5
|
import { PostProcessPass } from "./PostProcessPass";
|
|
6
6
|
export declare class PostProcessUberPass extends PostProcessPass {
|
|
7
|
-
static readonly UBER_SHADER_NAME = "
|
|
7
|
+
static readonly UBER_SHADER_NAME = "PostProcess/Uber";
|
|
8
8
|
private _uberMaterial;
|
|
9
9
|
private _bloomMaterial;
|
|
10
10
|
private _mipDownRT;
|
|
@@ -17,6 +17,7 @@ export declare class PostProcessUberPass extends PostProcessPass {
|
|
|
17
17
|
*/
|
|
18
18
|
onRender(camera: Camera, srcTexture: Texture2D, destTarget: RenderTarget): void;
|
|
19
19
|
/**
|
|
20
|
+
* @internal
|
|
20
21
|
* @inheritdoc
|
|
21
22
|
*/
|
|
22
23
|
_onDestroy(): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ShaderMacro, ShaderProperty } from "../../shader";
|
|
1
2
|
import { PostProcessEffect } from "../PostProcessEffect";
|
|
2
3
|
import { PostProcessEffectBoolParameter, PostProcessEffectColorParameter, PostProcessEffectEnumParameter, PostProcessEffectFloatParameter, PostProcessEffectTextureParameter } from "../PostProcessEffectParameter";
|
|
3
4
|
/**
|
|
@@ -10,7 +11,31 @@ export declare enum BloomDownScaleMode {
|
|
|
10
11
|
Quarter = 1
|
|
11
12
|
}
|
|
12
13
|
export declare class BloomEffect extends PostProcessEffect {
|
|
13
|
-
static readonly SHADER_NAME = "
|
|
14
|
+
static readonly SHADER_NAME = "PostProcess/Bloom";
|
|
15
|
+
/** @internal */
|
|
16
|
+
static _maxIterations: number;
|
|
17
|
+
/** @internal */
|
|
18
|
+
static _hqMacro: ShaderMacro;
|
|
19
|
+
/** @internal */
|
|
20
|
+
static _dirtMacro: ShaderMacro;
|
|
21
|
+
/** @internal */
|
|
22
|
+
static _bloomParams: ShaderProperty;
|
|
23
|
+
/** @internal */
|
|
24
|
+
static _lowMipTextureProp: ShaderProperty;
|
|
25
|
+
/** @internal */
|
|
26
|
+
static _lowMipTexelSizeProp: ShaderProperty;
|
|
27
|
+
/** @internal */
|
|
28
|
+
static _enableMacro: ShaderMacro;
|
|
29
|
+
/** @internal */
|
|
30
|
+
static _bloomTextureProp: ShaderProperty;
|
|
31
|
+
/** @internal */
|
|
32
|
+
static _dirtTextureProp: ShaderProperty;
|
|
33
|
+
/** @internal */
|
|
34
|
+
static _tintProp: ShaderProperty;
|
|
35
|
+
/** @internal */
|
|
36
|
+
static _bloomIntensityParams: ShaderProperty;
|
|
37
|
+
/** @internal */
|
|
38
|
+
static _dirtTilingOffsetProp: ShaderProperty;
|
|
14
39
|
/**
|
|
15
40
|
* Controls whether to use bicubic sampling instead of bilinear sampling for the upSampling passes.
|
|
16
41
|
* @remarks This is slightly more expensive but helps getting smoother visuals.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ShaderMacro } from "../../shader";
|
|
1
2
|
import { PostProcessEffect } from "../PostProcessEffect";
|
|
2
3
|
import { PostProcessEffectEnumParameter } from "../PostProcessEffectParameter";
|
|
3
4
|
/**
|
|
@@ -18,6 +19,8 @@ export declare enum TonemappingMode {
|
|
|
18
19
|
ACES = 1
|
|
19
20
|
}
|
|
20
21
|
export declare class TonemappingEffect extends PostProcessEffect {
|
|
22
|
+
/** @internal */
|
|
23
|
+
static _enableMacro: ShaderMacro;
|
|
21
24
|
/**
|
|
22
25
|
* Use this to select a tonemapping algorithm to use.
|
|
23
26
|
*/
|
|
@@ -3,5 +3,6 @@ export interface IPlatformBuffer {
|
|
|
3
3
|
bind(): void;
|
|
4
4
|
setData(byteLength: number, data: ArrayBuffer | ArrayBufferView, bufferByteOffset?: number, dataOffset?: number, dataLength?: number, options?: SetDataOptions): void;
|
|
5
5
|
getData(data: ArrayBufferView, bufferByteOffset?: number, dataOffset?: number, dataLength?: number): void;
|
|
6
|
+
copyFromBuffer(srcBuffer: IPlatformBuffer, srcByteOffset: number, dstByteOffset: number, byteLength: number): void;
|
|
6
7
|
destroy(): void;
|
|
7
8
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IPlatformBuffer } from "./IPlatformBuffer";
|
|
2
|
+
/**
|
|
3
|
+
* Platform interface for Transform Feedback operations.
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
export interface IPlatformTransformFeedback {
|
|
7
|
+
/**
|
|
8
|
+
* Bind a buffer range as Transform Feedback output at the given index.
|
|
9
|
+
*/
|
|
10
|
+
bindBufferRange(index: number, buffer: IPlatformBuffer, byteOffset: number, byteSize: number): void;
|
|
11
|
+
/**
|
|
12
|
+
* Unbind buffer from Transform Feedback output at the given index.
|
|
13
|
+
*/
|
|
14
|
+
unbindBuffer(index: number): void;
|
|
15
|
+
/**
|
|
16
|
+
* Begin a Transform Feedback pass.
|
|
17
|
+
* @param primitiveMode - The primitive mode (e.g., POINTS)
|
|
18
|
+
*/
|
|
19
|
+
begin(primitiveMode: number): void;
|
|
20
|
+
/**
|
|
21
|
+
* End the current Transform Feedback pass.
|
|
22
|
+
*/
|
|
23
|
+
end(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Bind this Transform Feedback object as the active TF.
|
|
26
|
+
*/
|
|
27
|
+
bind(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Unbind the Transform Feedback object.
|
|
30
|
+
*/
|
|
31
|
+
unbind(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Destroy native resources.
|
|
34
|
+
*/
|
|
35
|
+
destroy(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform interface for Transform Feedback primitive operations.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
export interface IPlatformTransformFeedbackPrimitive {
|
|
6
|
+
/**
|
|
7
|
+
* Update vertex layout. Auto-rebuilds when program changes.
|
|
8
|
+
* @param program - Shader program (for attribute locations)
|
|
9
|
+
* @param readBinding - Current read buffer binding
|
|
10
|
+
* @param writeBinding - Current write buffer binding
|
|
11
|
+
* @param feedbackElements - Vertex elements for feedback buffer
|
|
12
|
+
* @param inputBinding - Input buffer binding
|
|
13
|
+
* @param inputElements - Vertex elements for input buffer
|
|
14
|
+
*/
|
|
15
|
+
updateVertexLayout(program: any, readBinding: any, writeBinding: any, feedbackElements: any[], inputBinding: any, inputElements: any[]): void;
|
|
16
|
+
/**
|
|
17
|
+
* Bind attribute state for the given read direction.
|
|
18
|
+
* @param readIsA - Whether to use direction A as read
|
|
19
|
+
*/
|
|
20
|
+
bind(readIsA: boolean): void;
|
|
21
|
+
/**
|
|
22
|
+
* Unbind attribute state.
|
|
23
|
+
*/
|
|
24
|
+
unbind(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Issue a draw call.
|
|
27
|
+
* @param mode - Primitive topology
|
|
28
|
+
* @param first - First vertex index
|
|
29
|
+
* @param count - Number of vertices
|
|
30
|
+
*/
|
|
31
|
+
draw(mode: number, first: number, count: number): void;
|
|
32
|
+
/**
|
|
33
|
+
* Invalidate cached state, forcing rebuild on next updateVertexLayout.
|
|
34
|
+
*/
|
|
35
|
+
invalidate(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Destroy native resources.
|
|
38
|
+
*/
|
|
39
|
+
destroy(): void;
|
|
40
|
+
}
|
|
@@ -4,3 +4,5 @@ export type { IPlatformTexture } from "./IPlatformTexture";
|
|
|
4
4
|
export type { IPlatformTexture2D } from "./IPlatformTexture2D";
|
|
5
5
|
export type { IPlatformTexture2DArray } from "./IPlatformTexture2DArray";
|
|
6
6
|
export type { IPlatformTextureCube } from "./IPlatformTextureCube";
|
|
7
|
+
export type { IPlatformTransformFeedback } from "./IPlatformTransformFeedback";
|
|
8
|
+
export type { IPlatformTransformFeedbackPrimitive } from "./IPlatformTransformFeedbackPrimitive";
|
package/types/shader/Shader.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { IShaderCompiler, IPrecompiledShader } from "@galacean/engine-design";
|
|
1
2
|
import { Engine } from "../Engine";
|
|
2
3
|
import { IReferable } from "../asset/IReferable";
|
|
3
4
|
import { ShaderMacro } from "./ShaderMacro";
|
|
5
|
+
import { ShaderMacroCollection } from "./ShaderMacroCollection";
|
|
4
6
|
import { ShaderPass } from "./ShaderPass";
|
|
5
7
|
import { ShaderProperty } from "./ShaderProperty";
|
|
6
8
|
import { SubShader } from "./SubShader";
|
|
@@ -10,57 +12,63 @@ import { ShaderLanguage } from "./enums/ShaderLanguage";
|
|
|
10
12
|
*/
|
|
11
13
|
export declare class Shader implements IReferable {
|
|
12
14
|
readonly name: string;
|
|
15
|
+
/** @internal */
|
|
16
|
+
static readonly _compileMacros: ShaderMacroCollection;
|
|
17
|
+
/** @internal */
|
|
18
|
+
static _shaderCompiler?: IShaderCompiler;
|
|
13
19
|
private static _shaderMap;
|
|
14
20
|
/**
|
|
15
21
|
* Create a shader by source code.
|
|
16
22
|
*
|
|
17
23
|
* @remarks
|
|
18
24
|
*
|
|
19
|
-
*
|
|
25
|
+
* The shader compiler must be enabled first as follows:
|
|
20
26
|
* ```ts
|
|
21
|
-
* // Import
|
|
22
|
-
* import {
|
|
23
|
-
* // Create engine with
|
|
24
|
-
* const engine = await WebGLEngine.create({ canvas: "canvas",
|
|
27
|
+
* // Import the shader compiler
|
|
28
|
+
* import { ShaderCompiler } from "@galacean/engine-shader-compiler";
|
|
29
|
+
* // Create engine with the shader compiler
|
|
30
|
+
* const engine = await WebGLEngine.create({ canvas: "canvas", shaderCompiler: new ShaderCompiler() });
|
|
25
31
|
* ...
|
|
26
32
|
* ```
|
|
27
33
|
*
|
|
28
34
|
* @param shaderSource - Shader code
|
|
29
|
-
* @param platformTarget - Shader platform target, @defaultValue ShaderLanguage.
|
|
30
|
-
* @param path - Shader location path
|
|
31
|
-
* @returns
|
|
35
|
+
* @param platformTarget - Shader platform target, @defaultValue ShaderLanguage.GLSLES100
|
|
36
|
+
* @param path - Shader location path, used to resolve relative `#include` paths in ShaderLab source
|
|
37
|
+
* @returns The shader, or `undefined` if its name already exists.
|
|
32
38
|
*
|
|
33
39
|
* @throws
|
|
34
|
-
* Throw string exception if
|
|
40
|
+
* Throw string exception if the shader compiler has not been enabled properly.
|
|
35
41
|
*/
|
|
36
|
-
static create(shaderSource: string, platformTarget?: ShaderLanguage, path?: string): Shader;
|
|
37
|
-
/**
|
|
38
|
-
* Create a shader.
|
|
39
|
-
* @param name - Name of the shader
|
|
40
|
-
* @param vertexSource - Vertex source code
|
|
41
|
-
* @param fragmentSource - Fragment source code
|
|
42
|
-
* @returns Shader
|
|
43
|
-
*/
|
|
44
|
-
static create(name: string, vertexSource: string, fragmentSource: string): Shader;
|
|
42
|
+
static create(shaderSource: string, platformTarget?: ShaderLanguage, path?: string): Shader | undefined;
|
|
45
43
|
/**
|
|
46
44
|
* Create a shader.
|
|
47
45
|
* @param name - Name of the shader
|
|
48
46
|
* @param shaderPasses - Shader passes
|
|
49
|
-
* @returns
|
|
47
|
+
* @returns The shader, or `undefined` if its name already exists.
|
|
50
48
|
*/
|
|
51
|
-
static create(name: string, shaderPasses: ShaderPass[]): Shader;
|
|
49
|
+
static create(name: string, shaderPasses: ShaderPass[]): Shader | undefined;
|
|
52
50
|
/**
|
|
53
51
|
* Create a shader.
|
|
54
52
|
* @param name - Name of the shader
|
|
55
53
|
* @param subShaders - Sub shaders
|
|
56
|
-
* @returns
|
|
54
|
+
* @returns The shader, or `undefined` if its name already exists.
|
|
57
55
|
*/
|
|
58
|
-
static create(name: string, subShaders: SubShader[]): Shader;
|
|
56
|
+
static create(name: string, subShaders: SubShader[]): Shader | undefined;
|
|
59
57
|
/**
|
|
60
58
|
* Find a shader by name.
|
|
61
59
|
* @param name - Name of the shader
|
|
62
60
|
*/
|
|
63
61
|
static find(name: string): Shader;
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
static _createFromPrecompiled(data: IPrecompiledShader): Shader | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
*/
|
|
69
|
+
static _clear(engine: Engine): void;
|
|
70
|
+
private static _resolveUsePass;
|
|
71
|
+
private static _applyRenderStates;
|
|
64
72
|
private static _applyConstRenderStates;
|
|
65
73
|
private _refCount;
|
|
66
74
|
private _destroyed;
|
|
@@ -91,6 +99,14 @@ export declare class Shader implements IReferable {
|
|
|
91
99
|
* @returns Whether the release was successful.
|
|
92
100
|
*/
|
|
93
101
|
destroy(force?: boolean): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
_getReferCount(): number;
|
|
106
|
+
/**
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
_addReferCount(value: number): void;
|
|
94
110
|
/**
|
|
95
111
|
* @deprecated Please use `ShaderMacro.getByName` instead
|
|
96
112
|
*
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
* Shader block property, used to identify uniform blocks by id.
|
|
4
|
+
*/
|
|
5
|
+
export declare class ShaderBlockProperty {
|
|
6
|
+
private static _counter;
|
|
7
|
+
private static _nameMap;
|
|
8
|
+
/**
|
|
9
|
+
* Get shader block property by name.
|
|
10
|
+
* @param name - Name of the uniform block
|
|
11
|
+
* @returns Shader block property
|
|
12
|
+
*/
|
|
13
|
+
static getByName(name: string): ShaderBlockProperty;
|
|
14
|
+
/** Uniform block name. */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
/** @internal */
|
|
17
|
+
readonly _uniqueId: number;
|
|
18
|
+
private constructor();
|
|
19
|
+
}
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
+
import { DataObject } from "../base/DataObject";
|
|
1
2
|
import { IClone } from "@galacean/engine-design";
|
|
2
3
|
import { Color, Matrix, Vector2, Vector3, Vector4 } from "@galacean/engine-math";
|
|
3
4
|
import { IReferable } from "../asset/IReferable";
|
|
5
|
+
import type { ICloneHook } from "../clone/ICloneHook";
|
|
4
6
|
import { Texture } from "../texture/Texture";
|
|
5
7
|
import { ShaderMacro } from "./ShaderMacro";
|
|
8
|
+
import { ShaderMacroCollection } from "./ShaderMacroCollection";
|
|
6
9
|
import { ShaderProperty } from "./ShaderProperty";
|
|
10
|
+
import { ShaderDataGroup } from "./enums/ShaderDataGroup";
|
|
11
|
+
import { ShaderPropertyType } from "./enums/ShaderPropertyType";
|
|
7
12
|
/**
|
|
8
13
|
* Shader data collection,Correspondence includes shader properties data and macros data.
|
|
9
14
|
*/
|
|
10
|
-
export declare class ShaderData implements IReferable, IClone {
|
|
15
|
+
export declare class ShaderData extends DataObject implements IReferable, IClone, ICloneHook<ShaderData> {
|
|
16
|
+
/** @internal */
|
|
17
|
+
_group: ShaderDataGroup;
|
|
18
|
+
/** @internal */
|
|
19
|
+
_propertyValueMap: Record<number, ShaderPropertyValueType>;
|
|
20
|
+
/** @internal */
|
|
21
|
+
_macroCollection: ShaderMacroCollection;
|
|
22
|
+
private _batchSharedFields;
|
|
11
23
|
private _macroMap;
|
|
12
24
|
private _refCount;
|
|
25
|
+
/**
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
constructor(group: ShaderDataGroup);
|
|
13
29
|
/**
|
|
14
30
|
* Get float by shader property name.
|
|
15
31
|
* @param propertyName - Shader property name
|
|
@@ -261,13 +277,13 @@ export declare class ShaderData implements IReferable, IClone {
|
|
|
261
277
|
* @param propertyName - Shader property name
|
|
262
278
|
* @param value - Texture
|
|
263
279
|
*/
|
|
264
|
-
setTexture(propertyName: string, value: Texture): void;
|
|
280
|
+
setTexture(propertyName: string, value: Texture | null): void;
|
|
265
281
|
/**
|
|
266
282
|
* Set texture by shader property.
|
|
267
283
|
* @param property - Shader property, use `ShaderProperty.getByName` to get
|
|
268
284
|
* @param value - Texture
|
|
269
285
|
*/
|
|
270
|
-
setTexture(property: ShaderProperty, value: Texture): void;
|
|
286
|
+
setTexture(property: ShaderProperty, value: Texture | null): void;
|
|
271
287
|
/**
|
|
272
288
|
* Get texture array by shader property name.
|
|
273
289
|
* @param propertyName - Shader property name
|
|
@@ -346,5 +362,28 @@ export declare class ShaderData implements IReferable, IClone {
|
|
|
346
362
|
getProperties(out: ShaderProperty[]): void;
|
|
347
363
|
clone(): ShaderData;
|
|
348
364
|
cloneTo(target: ShaderData): void;
|
|
365
|
+
/**
|
|
366
|
+
* @internal
|
|
367
|
+
* @inheritdoc
|
|
368
|
+
*/
|
|
369
|
+
_onClone(target: ShaderData): void;
|
|
370
|
+
/**
|
|
371
|
+
* @internal
|
|
372
|
+
*/
|
|
373
|
+
_setPropertyValue<T extends ShaderPropertyValueType>(property: string | ShaderProperty, type: ShaderPropertyType, value: T): void;
|
|
374
|
+
/**
|
|
375
|
+
* @internal
|
|
376
|
+
*/
|
|
377
|
+
_matchesRendererBatchShared(other: ShaderData): boolean;
|
|
378
|
+
/**
|
|
379
|
+
* @internal
|
|
380
|
+
*/
|
|
381
|
+
_getReferCount(): number;
|
|
382
|
+
/**
|
|
383
|
+
* @internal
|
|
384
|
+
*/
|
|
385
|
+
_addReferCount(value: number): void;
|
|
386
|
+
private _addTexturesReferCount;
|
|
387
|
+
private _updateRendererBatchSharedFields;
|
|
349
388
|
}
|
|
350
|
-
export type ShaderPropertyValueType = number | Vector2 | Vector3 | Vector4 | Color | Matrix | Texture | Texture[] | Int32Array | Float32Array;
|
|
389
|
+
export type ShaderPropertyValueType = null | number | Vector2 | Vector3 | Vector4 | Color | Matrix | Texture | Texture[] | Int32Array | Float32Array;
|