import { ShaderMaterial } from "@babylonjs/core/Materials/shaderMaterial"; import type { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture"; import type { Mesh } from "@babylonjs/core/Meshes/mesh"; import type { Scene } from "@babylonjs/core/scene"; import type { Nullable } from "@babylonjs/core/types"; declare module "@babylonjs/core/scene" { interface Scene { /** @internal */ _textureAlphaCheckerShader: Nullable; } } declare module "@babylonjs/core/Materials/Textures/renderTargetTexture" { interface RenderTargetTexture { /** * Gets or sets a boolean indicating that the prepass renderer should not be used with this render target */ noPrePassRenderer: boolean; } } /** * Material transparency mode * * Constants are same as Babylon.js MaterialTransparencyMode */ export declare enum TransparencyMode { Opaque, AlphaTest, AlphaBlend } /** * Texture alpha checker * * This class is used to check if the texture has alpha on geometry */ export declare class TextureAlphaChecker { private readonly _scene; private readonly _renderTargetTexture; private readonly _resultPixelsBuffer; /** * Create a texture alpha checker * @param scene Scene * @param resolution Resolution of the canvas used to check the texture */ constructor(scene: Scene, resolution?: number); private _renderTextureAsync; private _blockRendering; private readonly _taskQueue; /** * Check if the texture has translucent fragments on the geometry * * "Does the textures on the geometry have alpha" is simply to make sure that a portion of the textures (the part that is rendered) have alpha * @param texture Texture to check (must be ready) * @param mesh Mesh to check * @param subMeshIndices Sub mesh index to check (if null, all sub meshes are checked) * @param alphaThreshold alpha threshold * @param alphaBlendThreshold alpha blend threshold * @returns Transparency mode * @throws If the texture is not ready */ hasTranslucentFragmentsOnGeometryAsync(texture: BaseTexture, mesh: Mesh, subMeshIndex: Nullable, alphaThreshold: number, alphaBlendThreshold: number): Promise; /** * Check if texture fragments are completely opaque on the geometry * @param texture Texture to check (must be ready) * @param mesh Mesh to check * @param subMeshIndices Sub mesh index to check (if null, all sub meshes are checked) * @returns If the texture fragments are completely opaque in geometry */ hasFragmentsOnlyOpaqueOnGeometryAsync(texture: BaseTexture, mesh: Mesh, subMeshIndex: Nullable): Promise; /** * Dispose this object */ dispose(): void; private static _GetShader; /** * Dispose the texture alpha checker shader from the scene * * If you are no longer loading the mmd model, it will be helpful for your memory to call this method and dispose the shader * @param scene Scene */ static DisposeShader(scene: Scene): void; }