import { type Atmosphere } from "./atmosphere.js"; import { type BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.pure.js"; import { type Material } from "@babylonjs/core/Materials/material.pure.js"; import { MaterialDefines } from "@babylonjs/core/Materials/materialDefines.js"; import { MaterialPluginBase } from "@babylonjs/core/Materials/materialPluginBase.pure.js"; import { type Nullable } from "@babylonjs/core/types.js"; import { type UniformBuffer } from "@babylonjs/core/Materials/uniformBuffer.js"; import { ShaderLanguage } from "@babylonjs/core/Materials/shaderLanguage.js"; declare class AtmospherePBRMaterialDefines extends MaterialDefines { USE_CUSTOM_REFLECTION: boolean; USE_AERIAL_PERSPECTIVE_LUT: boolean; APPLY_AERIAL_PERSPECTIVE_INTENSITY: boolean; APPLY_AERIAL_PERSPECTIVE_RADIANCE_BIAS: boolean; SAMPLE_TRANSMITTANCE_LUT: boolean; EXCLUDE_RAY_MARCHING_FUNCTIONS: boolean; /** * Constructs the {@link AtmospherePBRMaterialDefines}. * @param useAerialPerspectiveLut - Whether to use the aerial perspective LUT. */ constructor(useAerialPerspectiveLut: boolean); } /** * Adds shading logic to a PBRMaterial that provides radiance, diffuse sky irradiance, and aerial perspective from the atmosphere. */ export declare class AtmospherePBRMaterialPlugin extends MaterialPluginBase { private readonly _atmosphere; private readonly _isAerialPerspectiveEnabled; /** * Constructs the {@link AtmospherePBRMaterialPlugin}. * @param material - The material to apply the plugin to. * @param _atmosphere - The atmosphere to use for shading. * @param _isAerialPerspectiveEnabled - Whether to apply aerial perspective. */ constructor(material: Material, _atmosphere: Atmosphere, _isAerialPerspectiveEnabled?: boolean); /** * @override */ isCompatible(): boolean; /** * @override */ getUniformBuffersNames(_ubos: string[]): void; /** * @override */ getUniforms(): { ubo: { name: string; size: number; type: string; }[]; fragment: string; externalUniforms: string[]; }; /** * @override */ isReadyForSubMesh(): boolean; /** * Ensures the shader includes for this material's shader language are registered, kicking off a lazy * load if needed. Registration from a previously created material (or an explicit preload) is detected * synchronously via the ShaderStore, so only the very first atmosphere material can incur a load delay. * @returns True when the includes are registered and the plugin can proceed. */ private _ensureShaderIncludesLoaded; /** * Fire-and-forget load of the shader includes used from isReadyForSubMesh. Backs off after a failure and * logs so a missing registration doesn't silently stall rendering forever; a retry still recovers from * transient failures such as a dropped network request. * @param shaderLanguage - The shader language whose includes to load. * @param state - The shared load state for that language. */ private _tryLoadShaderIncludesAsync; /** * Preloads (and registers into the ShaderStore) the atmosphere shader includes for the given shader * language, ahead of creating any atmosphere-enabled material. Await this before creating meshes when * they must render in their creation frame with zero delay. Safe to call multiple times; concurrent * calls coalesce onto a single load. * * As an alternative, `Material.forceCompilationAsync(mesh)` (or `Scene.whenReadyAsync`) also awaits the * includes, because readiness is gated through `isReadyForSubMesh`. * @param shaderLanguage - The shader language to preload includes for (defaults to GLSL). Pass `ShaderLanguage.WGSL` for WebGPU. * @returns A promise that resolves once the includes are registered. */ static PreloadShaderIncludesAsync(shaderLanguage?: ShaderLanguage): Promise; /** * @override */ getActiveTextures(_activeTextures: BaseTexture[]): void; /** * @override */ bindForSubMesh(uniformBuffer: UniformBuffer): void; /** * @override */ prepareDefines(defines: AtmospherePBRMaterialDefines): void; /** * @override */ getSamplers(samplers: string[]): void; /** * @override */ getCustomCode(shaderType: string, shaderLanguage: ShaderLanguage): Nullable>; } export {};