UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

104 lines (103 loc) 3.91 kB
import type { Nullable } from "../../types.js"; import type { BaseTexture } from "../../Materials/Textures/baseTexture.js"; import type { UniformBuffer } from "../../Materials/uniformBuffer.js"; import type { IAnimatable } from "../../Animations/animatable.interface.js"; import type { EffectFallbacks } from "../effectFallbacks.js"; import { MaterialPluginBase } from "../materialPluginBase.js"; import { MaterialDefines } from "../materialDefines.js"; import type { Scene } from "../../scene.js"; import type { PBRBaseMaterial } from "./pbrBaseMaterial.js"; /** * @internal */ export declare class MaterialIridescenceDefines extends MaterialDefines { IRIDESCENCE: boolean; IRIDESCENCE_TEXTURE: boolean; IRIDESCENCE_TEXTUREDIRECTUV: number; IRIDESCENCE_THICKNESS_TEXTURE: boolean; IRIDESCENCE_THICKNESS_TEXTUREDIRECTUV: number; } /** * Plugin that implements the iridescence (thin film) component of the PBR material */ export declare class PBRIridescenceConfiguration extends MaterialPluginBase { protected _material: PBRBaseMaterial; /** * The default minimum thickness of the thin-film layer given in nanometers (nm). * Defaults to 100 nm. * @internal */ static readonly _DefaultMinimumThickness = 100; /** * The default maximum thickness of the thin-film layer given in nanometers (nm). * Defaults to 400 nm. * @internal */ static readonly _DefaultMaximumThickness = 400; /** * The default index of refraction of the thin-film layer. * Defaults to 1.3 * @internal */ static readonly _DefaultIndexOfRefraction = 1.3; private _isEnabled; /** * Defines if the iridescence is enabled in the material. */ isEnabled: boolean; /** * Defines the iridescence layer strength (between 0 and 1) it defaults to 1. */ intensity: number; /** * Defines the minimum thickness of the thin-film layer given in nanometers (nm). */ minimumThickness: number; /** * Defines the maximum thickness of the thin-film layer given in nanometers (nm). This will be the thickness used if not thickness texture has been set. */ maximumThickness: number; /** * Defines the maximum thickness of the thin-film layer given in nanometers (nm). */ indexOfRefraction: number; private _texture; /** * Stores the iridescence intensity in a texture (red channel) */ texture: Nullable<BaseTexture>; private _thicknessTexture; /** * Stores the iridescence thickness in a texture (green channel) */ thicknessTexture: Nullable<BaseTexture>; /** @internal */ private _internalMarkAllSubMeshesAsTexturesDirty; /** @internal */ _markAllSubMeshesAsTexturesDirty(): void; /** * Gets a boolean indicating that the plugin is compatible with a given shader language. * @returns true if the plugin is compatible with the shader language */ isCompatible(): boolean; constructor(material: PBRBaseMaterial, addToPluginList?: boolean); isReadyForSubMesh(defines: MaterialIridescenceDefines, scene: Scene): boolean; prepareDefinesBeforeAttributes(defines: MaterialIridescenceDefines, scene: Scene): void; bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene): void; hasTexture(texture: BaseTexture): boolean; getActiveTextures(activeTextures: BaseTexture[]): void; getAnimatables(animatables: IAnimatable[]): void; dispose(forceDisposeTextures?: boolean): void; getClassName(): string; addFallbacks(defines: MaterialIridescenceDefines, fallbacks: EffectFallbacks, currentRank: number): number; getSamplers(samplers: string[]): void; getUniforms(): { ubo?: Array<{ name: string; size: number; type: string; }>; vertex?: string; fragment?: string; }; }