import type { Scene } from "../scene.js";
import type { Effect, IEffectCreationOptions } from "./effect.js";
import type { AbstractMesh } from "../Meshes/abstractMesh.js";
import type { UniformBuffer } from "./uniformBuffer.js";
import type { BaseTexture } from "./Textures/baseTexture.js";
import type { PrePassConfiguration } from "./prePassConfiguration.js";
import type { Light } from "../Lights/light.js";
import type { MaterialDefines } from "./materialDefines.js";
import type { EffectFallbacks } from "./effectFallbacks.js";
import type { AbstractEngine } from "../Engines/abstractEngine.js";
import type { Material } from "./material.js";
import type { Nullable } from "../types.js";
import type { MorphTargetManager } from "../Morph/morphTargetManager.js";
import type { Color3 } from "../Maths/math.color.js";
import type { Geometry } from "../Meshes/geometry.js";
export * from "./materialHelper.functions.pure.js";
/**
 * Binds the fog information from the scene to the effect for the given mesh.
 * @param scene The scene the lights belongs to
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param linearSpace Defines if the fog effect is applied in linear space
 */
export declare function BindFogParameters(scene: Scene, mesh?: AbstractMesh, effect?: Effect, linearSpace?: boolean): void;
/**
 * Prepares the list of attributes and defines required for morph targets.
 * @param morphTargetManager The manager for the morph targets
 * @param defines The current list of defines
 * @param attribs The current list of attributes
 * @param mesh The mesh to prepare the defines and attributes for
 * @param usePositionMorph Whether the position morph target is used
 * @param useNormalMorph Whether the normal morph target is used
 * @param useTangentMorph Whether the tangent morph target is used
 * @param useUVMorph Whether the UV morph target is used
 * @param useUV2Morph Whether the UV2 morph target is used
 * @param useColorMorph Whether the color morph target is used
 * @returns The maxSimultaneousMorphTargets for the effect
 */
export declare function PrepareDefinesAndAttributesForMorphTargets(morphTargetManager: MorphTargetManager, defines: string[], attribs: string[], mesh: AbstractMesh, usePositionMorph: boolean, useNormalMorph: boolean, useTangentMorph: boolean, useUVMorph: boolean, useUV2Morph: boolean, useColorMorph: boolean): number;
/**
 * Prepares the list of attributes required for morph targets according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the morph targets attributes for
 * @param influencers The number of influencers
 */
export declare function PrepareAttributesForMorphTargetsInfluencers(attribs: string[], mesh: AbstractMesh, influencers: number): void;
/**
 * Prepares the list of attributes required for morph targets according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the morph targets attributes for
 * @param defines The current Defines of the effect
 * @param usePositionMorph Whether the position morph target is used
 */
export declare function PrepareAttributesForMorphTargets(attribs: string[], mesh: AbstractMesh, defines: any, usePositionMorph?: boolean): void;
/**
 * Add the list of attributes required for instances to the attribs array.
 * @param attribs The current list of supported attribs
 * @param needsPreviousMatrices If the shader needs previous matrices
 */
export declare function PushAttributesForInstances(attribs: string[], needsPreviousMatrices?: boolean): void;
/**
 * Binds the morph targets information from the mesh to the effect.
 * @param abstractMesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 */
export declare function BindMorphTargetParameters(abstractMesh: AbstractMesh, effect: Effect): void;
/**
 * Binds the scene's uniform buffer to the effect.
 * @param effect defines the effect to bind to the scene uniform buffer
 * @param sceneUbo defines the uniform buffer storing scene data
 */
export declare function BindSceneUniformBuffer(effect: Effect, sceneUbo: UniformBuffer): void;
/**
 * Update parameters for IBL
 * @param scene The scene
 * @param defines The list of shader defines for the material
 * @param ubo The uniform buffer to update
 * @param reflectionColor The color to use for the reflection
 * @param reflectionTexture The IBL texture
 * @param realTimeFiltering Whether realtime filtering of IBL texture is being used
 * @param supportTextureInfo Whether the texture info is supported
 * @param supportLocalProjection Whether local projection is supported
 * @param usePBR Whether PBR is being used
 * @param supportSH Whether spherical harmonics are supported
 * @param useColor Whether to use the reflection color
 * @param reflectionBlur The level of blur of the reflection
 */
export declare function BindIBLParameters(scene: Scene, defines: any, ubo: UniformBuffer, reflectionColor: Color3, reflectionTexture?: Nullable<BaseTexture>, realTimeFiltering?: boolean, supportTextureInfo?: boolean, supportLocalProjection?: boolean, usePBR?: boolean, supportSH?: boolean, useColor?: boolean, reflectionBlur?: number): void;
/**
 * Update parameters for IBL
 * @param scene The scene
 * @param defines The list of shader defines for the material
 * @param ubo The uniform buffer to update
 * @param reflectionTexture The IBL texture
 * @param realTimeFiltering Whether realtime filtering of IBL texture is being used
 */
export declare function BindIBLSamplers(scene: Scene, defines: any, ubo: UniformBuffer, reflectionTexture?: Nullable<BaseTexture>, realTimeFiltering?: boolean): void;
/**
 * Helps preparing the defines values about the UVs in used in the effect.
 * UVs are shared as much as we can across channels in the shaders.
 * @param texture The texture we are preparing the UVs for
 * @param defines The defines to update
 * @param key The channel key "diffuse", "specular"... used in the shader
 */
export declare function PrepareDefinesForMergedUV(texture: BaseTexture, defines: any, key: string): void;
/**
 * Binds a texture matrix value to its corresponding uniform
 * @param texture The texture to bind the matrix for
 * @param uniformBuffer The uniform buffer receiving the data
 * @param key The channel key "diffuse", "specular"... used in the shader
 */
export declare function BindTextureMatrix(texture: BaseTexture, uniformBuffer: UniformBuffer, key: string): void;
/**
 * Prepares the list of attributes required for baked vertex animations according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare for baked vertex animations
 * @param defines The current Defines of the effect
 */
export declare function PrepareAttributesForBakedVertexAnimation(attribs: string[], mesh: AbstractMesh, defines: any): void;
/**
 * Binds the bones information from the mesh to the effect.
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param prePassConfiguration Configuration for the prepass, in case prepass is activated
 */
export declare function BindBonesParameters(mesh?: AbstractMesh, effect?: Effect, prePassConfiguration?: PrePassConfiguration): void;
/**
 * Binds the light information to the effect.
 * @param light The light containing the generator
 * @param effect The effect we are binding the data to
 * @param lightIndex The light index in the effect used to render
 */
export declare function BindLightProperties(light: Light, effect: Effect, lightIndex: number): void;
/**
 * Binds the lights information from the scene to the effect for the given mesh.
 * @param light Light to bind
 * @param lightIndex Light index
 * @param scene The scene where the light belongs to
 * @param effect The effect we are binding the data to
 * @param useSpecular Defines if specular is supported
 * @param receiveShadows Defines if the effect (mesh) we bind the light for receives shadows
 */
export declare function BindLight(light: Light, lightIndex: number, scene: Scene, effect: Effect, useSpecular: boolean, receiveShadows?: boolean): void;
/**
 * Binds the lights information from the scene to the effect for the given mesh.
 * @param scene The scene the lights belongs to
 * @param mesh The mesh we are binding the information to render
 * @param effect The effect we are binding the data to
 * @param defines The generated defines for the effect
 * @param maxSimultaneousLights The maximum number of light that can be bound to the effect
 */
export declare function BindLights(scene: Scene, mesh: AbstractMesh, effect: Effect, defines: any, maxSimultaneousLights?: number): void;
/**
 * Prepares the list of attributes required for bones according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param mesh The mesh to prepare the bones attributes for
 * @param defines The current Defines of the effect
 * @param fallbacks The current effect fallback strategy
 */
export declare function PrepareAttributesForBones(attribs: string[], mesh: AbstractMesh, defines: any, fallbacks: EffectFallbacks): void;
/**
 * Check and prepare the list of attributes required for instances according to the effect defines.
 * @param attribs The current list of supported attribs
 * @param defines The current MaterialDefines of the effect
 */
export declare function PrepareAttributesForInstances(attribs: string[], defines: MaterialDefines): void;
/**
 * This helps decreasing rank by rank the shadow quality (0 being the highest rank and quality)
 * @param defines The defines to update while falling back
 * @param fallbacks The authorized effect fallbacks
 * @param maxSimultaneousLights The maximum number of lights allowed
 * @param rank the current rank of the Effect
 * @returns The newly affected rank
 */
export declare function HandleFallbacksForShadows(defines: any, fallbacks: EffectFallbacks, maxSimultaneousLights?: number, rank?: number): number;
/**
 * Gets the current status of the fog (should it be enabled?)
 * @param mesh defines the mesh to evaluate for fog support
 * @param scene defines the hosting scene
 * @returns true if fog must be enabled
 */
export declare function GetFogState(mesh: AbstractMesh, scene: Scene): boolean;
/**
 * Interface representing metadata for vertex pulling
 */
export interface IVertexPullingMetadata {
    /**
     * Offset in vertex buffer where data starts
     */
    offset: number;
    /**
     * Stride between elements in the vertex buffer
     */
    stride: number;
    /**
     * Type of the vertex buffer (e.g., float, int)
     */
    type: number;
}
/**
 * Prepares vertex pulling uniforms for the given attributes and mesh
 * @param geometry The geometry containing the vertex buffers
 * @returns A map of attribute names to their metadata, or null if unavailable
 */
export declare function PrepareVertexPullingUniforms(geometry: Geometry): Nullable<Map<string, IVertexPullingMetadata>>;
/**
 * Bind vertex pulling uniforms to the effect
 * @param effect The effect to bind the uniforms to
 * @param metadata The vertex pulling metadata
 */
export declare function BindVertexPullingUniforms(effect: Effect, metadata: Map<string, IVertexPullingMetadata>): void;
/**
 * Helper used to prepare the list of defines associated with misc. values for shader compilation
 * @param mesh defines the current mesh
 * @param scene defines the current scene
 * @param useLogarithmicDepth defines if logarithmic depth has to be turned on
 * @param pointsCloud defines if point cloud rendering has to be turned on
 * @param fogEnabled defines if fog has to be turned on
 * @param alphaTest defines if alpha testing has to be turned on
 * @param defines defines the current list of defines
 * @param applyDecalAfterDetail Defines if the decal is applied after or before the detail
 * @param useVertexPulling Defines if vertex pulling is used
 * @param renderingMesh The mesh used for rendering
 * @param setVertexOutputInvariant Defines if the vertex output should be invariant
 */
export declare function PrepareDefinesForMisc(mesh: AbstractMesh, scene: Scene, useLogarithmicDepth: boolean, pointsCloud: boolean, fogEnabled: boolean, alphaTest: boolean, defines: any, applyDecalAfterDetail?: boolean, useVertexPulling?: boolean, renderingMesh?: AbstractMesh, setVertexOutputInvariant?: boolean): void;
/**
 * Prepares the defines related to the light information passed in parameter
 * @param scene The scene we are intending to draw
 * @param mesh The mesh the effect is compiling for
 * @param defines The defines to update
 * @param specularSupported Specifies whether specular is supported or not (override lights data)
 * @param maxSimultaneousLights Specifies how manuy lights can be added to the effect at max
 * @param disableLighting Specifies whether the lighting is disabled (override scene and light)
 * @returns true if normals will be required for the rest of the effect
 */
export declare function PrepareDefinesForLights(scene: Scene, mesh: AbstractMesh, defines: any, specularSupported: boolean, maxSimultaneousLights?: number, disableLighting?: boolean): boolean;
/**
 * Prepare defines relating to IBL logic.
 * @param scene The scene
 * @param reflectionTexture The texture to use for IBL
 * @param defines The defines to update
 * @param realTimeFiltering Whether realtime filting of IBL texture is being used
 * @param realTimeFilteringQuality The quality of realtime filtering
 * @param forceSHInVertex Whether the SH are handled in the vertex shader
 * @returns true if the defines were updated
 */
export declare function PrepareDefinesForIBL(scene: Scene, reflectionTexture: Nullable<BaseTexture>, defines: any, realTimeFiltering?: boolean, realTimeFilteringQuality?: number, forceSHInVertex?: boolean): boolean;
/**
 * Prepares the defines related to the light information passed in parameter
 * @param scene The scene we are intending to draw
 * @param mesh The mesh the effect is compiling for
 * @param light The light the effect is compiling for
 * @param lightIndex The index of the light
 * @param defines The defines to update
 * @param specularSupported Specifies whether specular is supported or not (override lights data)
 * @param state Defines the current state regarding what is needed (normals, etc...)
 * @param state.needNormals
 * @param state.needRebuild
 * @param state.shadowEnabled
 * @param state.specularEnabled
 * @param state.lightmapMode
 */
export declare function PrepareDefinesForLight(scene: Scene, mesh: AbstractMesh, light: Light, lightIndex: number, defines: any, specularSupported: boolean, state: {
    needNormals: boolean;
    needRebuild: boolean;
    shadowEnabled: boolean;
    specularEnabled: boolean;
    lightmapMode: boolean;
}): void;
/**
 * Helper used to prepare the list of defines associated with frame values for shader compilation
 * @param scene defines the current scene
 * @param engine defines the current engine
 * @param material defines the material we are compiling the shader for
 * @param defines specifies the list of active defines
 * @param useInstances defines if instances have to be turned on
 * @param useClipPlane defines if clip plane have to be turned on
 * @param useThinInstances defines if thin instances have to be turned on
 */
export declare function PrepareDefinesForFrameBoundValues(scene: Scene, engine: AbstractEngine, material: Material, defines: any, useInstances: boolean, useClipPlane?: Nullable<boolean>, useThinInstances?: boolean): void;
/**
 * Prepares the defines for bones
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
export declare function PrepareDefinesForBones(mesh: AbstractMesh, defines: any): void;
/**
 * Prepares the defines for morph targets
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
export declare function PrepareDefinesForMorphTargets(mesh: AbstractMesh, defines: any): void;
/**
 * Prepares the defines for baked vertex animation
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 */
export declare function PrepareDefinesForBakedVertexAnimation(mesh: AbstractMesh, defines: any): void;
/**
 * Prepares the defines used in the shader depending on the attributes data available in the mesh
 * @param mesh The mesh containing the geometry data we will draw
 * @param defines The defines to update
 * @param useVertexColor Precise whether vertex colors should be used or not (override mesh info)
 * @param useBones Precise whether bones should be used or not (override mesh info)
 * @param useMorphTargets Precise whether morph targets should be used or not (override mesh info)
 * @param useVertexAlpha Precise whether vertex alpha should be used or not (override mesh info)
 * @param useBakedVertexAnimation Precise whether baked vertex animation should be used or not (override mesh info)
 * @returns false if defines are considered not dirty and have not been checked
 */
export declare function PrepareDefinesForAttributes(mesh: AbstractMesh, defines: any, useVertexColor: boolean, useBones: boolean, useMorphTargets?: boolean, useVertexAlpha?: boolean, useBakedVertexAnimation?: boolean): boolean;
/**
 * Prepares the defines related to multiview
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 */
export declare function PrepareDefinesForMultiview(scene: Scene, defines: any): void;
/**
 * Prepares the defines related to order independant transparency
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 * @param needAlphaBlending Determines if the material needs alpha blending
 */
export declare function PrepareDefinesForOIT(scene: Scene, defines: any, needAlphaBlending: boolean): void;
/**
 * Prepares the defines related to the prepass
 * @param scene The scene we are intending to draw
 * @param defines The defines to update
 * @param canRenderToMRT Indicates if this material renders to several textures in the prepass
 */
export declare function PrepareDefinesForPrePass(scene: Scene, defines: any, canRenderToMRT: boolean): void;
/**
 * Helper used to prepare the defines relative to the active camera
 * @param scene defines the current scene
 * @param defines specifies the list of active defines
 * @returns true if the defines have been updated, else false
 */
export declare function PrepareDefinesForCamera(scene: Scene, defines: any): boolean;
/**
 * Prepares the uniforms and samplers list to be used in the effect (for a specific light)
 * @param lightIndex defines the light index
 * @param uniformsList The uniform list
 * @param samplersList The sampler list
 * @param projectedLightTexture defines if projected texture must be used
 * @param uniformBuffersList defines an optional list of uniform buffers
 * @param updateOnlyBuffersList True to only update the uniformBuffersList array
 * @param iesLightTexture defines if IES texture must be used
 * @param clusteredLightTextures defines if the clustered light textures must be used
 */
export declare function PrepareUniformsAndSamplersForLight(lightIndex: number, uniformsList: string[], samplersList: string[], projectedLightTexture?: any, uniformBuffersList?: Nullable<string[]>, updateOnlyBuffersList?: boolean, iesLightTexture?: boolean, clusteredLightTextures?: boolean): void;
/**
 * Append uniforms and samplers related to IBL to the provided lists
 * @param uniformsList The list of uniforms to append to
 * @param samplersList The list of samplers to append to
 * @param useSH Whether to include spherical harmonics uniforms
 */
export declare function PrepareUniformsAndSamplersForIBL(uniformsList: string[], samplersList: string[], useSH: boolean): void;
/**
 * Prepares the uniforms and samplers list to be used in the effect
 * @param uniformsListOrOptions The uniform names to prepare or an EffectCreationOptions containing the list and extra information
 * @param samplersList The sampler list
 * @param defines The defines helping in the list generation
 * @param maxSimultaneousLights The maximum number of simultaneous light allowed in the effect
 */
export declare function PrepareUniformsAndSamplersList(uniformsListOrOptions: string[] | IEffectCreationOptions, samplersList?: string[], defines?: any, maxSimultaneousLights?: number): void;
/**
 *
 * @param ubo Add uniforms to UBO
 * @param supportTextureInfo Add uniforms for texture info if true
 * @param supportLocalProjection Add uniforms for local projection if true
 * @param usePBR Add uniforms for IBL if true
 * @param supportSH Add uniforms for spherical harmonics if true
 * @param useColor Add uniforms for reflection color if true
 */
export declare function PrepareUniformLayoutForIBL(ubo: UniformBuffer, supportTextureInfo?: boolean, supportLocalProjection?: boolean, usePBR?: boolean, supportSH?: boolean, useColor?: boolean): void;
