import { type Nullable } from "@onerjs/core/types.js"; import { type Matrix } from "@onerjs/core/Maths/math.vector.js"; import { Color3 } from "@onerjs/core/Maths/math.color.js"; import { type BaseTexture } from "@onerjs/core/Materials/Textures/baseTexture.js"; import { type IShadowLight } from "@onerjs/core/Lights/shadowLight.js"; import { PushMaterial } from "@onerjs/core/Materials/pushMaterial.js"; import { type AbstractMesh } from "@onerjs/core/Meshes/abstractMesh.js"; import { type SubMesh } from "@onerjs/core/Meshes/subMesh.js"; import { type Mesh } from "@onerjs/core/Meshes/mesh.js"; import { Scene } from "@onerjs/core/scene.js"; /** * A transparent "shadow catcher" material: it renders only shadow strength into its alpha channel * (over {@link ShadowOnlyMaterial.shadowColor | shadowColor}, black by default), so shadows can be * composited over an arbitrary background. * * It can receive IBL shadows (via `IblShadowsRenderPipeline.addShadowReceivingMaterial` / * the Frame Graph IBL shadows task). Because the material has a single alpha output channel, IBL * shadows are received as **monochrome**: a colored IBL shadow is reduced to its luminance rather * than preserving per-channel hue. */ export declare class ShadowOnlyMaterial extends PushMaterial { private _activeLight; private _needAlphaBlending; private static readonly _ShaderLoader; /** * Instantiates a ShadowOnly Material in the given scene * @param name The friendly name of the material * @param scene The scene to add the material to * @param forceGLSL Use the GLSL code generation for the shader (even on WebGPU). Default is false */ constructor(name: string, scene?: Scene, forceGLSL?: boolean); /** * @internal * Force the material uniform buffer into "no UBO" (individual uniform) mode so that any attached * material plugin (e.g. IBLShadowsPluginMaterial) binds its uniforms directly on the effect. This * lets ShadowOnlyMaterial host plugins without declaring a dedicated "Material" uniform block in its * shaders (its own uniforms - alpha/shadowColor/... - stay individual uniforms). The base class only * does this on WebGPU ("leftovers UBO"); we extend it to every backend. */ _createUniformBuffer(): void; /** * The color the shadow is rendered with (black by default). Only its RGB is used; shadow * strength is written to the material's alpha channel. */ shadowColor: Color3; needAlphaBlending(): boolean; needAlphaTesting(): boolean; getAlphaTestTexture(): Nullable; get activeLight(): IShadowLight; set activeLight(light: IShadowLight); private _getFirstShadowLightForMesh; isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean; bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void; clone(name: string): ShadowOnlyMaterial; serialize(): any; getClassName(): string; /** * Creates a ShadowOnly material from parsed material data. * @param source defines the JSON representation of the material * @param scene defines the hosting scene * @param rootUrl defines the root URL to use to load textures and relative dependencies * @returns a new ShadowOnly material */ static Parse(source: any, scene: Scene, rootUrl: string): ShadowOnlyMaterial; }