123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821 |
- import type { Nullable } from "../../types";
- import { Scene } from "../../scene";
- import type { Matrix } from "../../Maths/math.vector";
- import type { SubMesh } from "../../Meshes/subMesh";
- import type { AbstractMesh } from "../../Meshes/abstractMesh";
- import type { Mesh } from "../../Meshes/mesh";
- import { PBRBRDFConfiguration } from "./pbrBRDFConfiguration";
- import { PrePassConfiguration } from "../prePassConfiguration";
- import { Color3 } from "../../Maths/math.color";
- import type { IImageProcessingConfigurationDefines } from "../../Materials/imageProcessingConfiguration.defines";
- import { ImageProcessingConfiguration } from "../../Materials/imageProcessingConfiguration";
- import type { IMaterialCompilationOptions } from "../../Materials/material";
- import { Material } from "../../Materials/material";
- import { MaterialDefines } from "../../Materials/materialDefines";
- import { PushMaterial } from "../../Materials/pushMaterial";
- import type { BaseTexture } from "../../Materials/Textures/baseTexture";
- import type { IAnimatable } from "../../Animations/animatable.interface";
- import "../../Materials/Textures/baseTexture.polynomial";
- import "../../Shaders/pbr.fragment";
- import "../../Shaders/pbr.vertex";
- import { PBRClearCoatConfiguration } from "./pbrClearCoatConfiguration";
- import { PBRIridescenceConfiguration } from "./pbrIridescenceConfiguration";
- import { PBRAnisotropicConfiguration } from "./pbrAnisotropicConfiguration";
- import { PBRSheenConfiguration } from "./pbrSheenConfiguration";
- import { PBRSubSurfaceConfiguration } from "./pbrSubSurfaceConfiguration";
- import { DetailMapConfiguration } from "../material.detailMapConfiguration";
- /**
- * Manages the defines for the PBR Material.
- * @internal
- */
- export declare class PBRMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines {
- PBR: boolean;
- NUM_SAMPLES: string;
- REALTIME_FILTERING: boolean;
- MAINUV1: boolean;
- MAINUV2: boolean;
- MAINUV3: boolean;
- MAINUV4: boolean;
- MAINUV5: boolean;
- MAINUV6: boolean;
- UV1: boolean;
- UV2: boolean;
- UV3: boolean;
- UV4: boolean;
- UV5: boolean;
- UV6: boolean;
- ALBEDO: boolean;
- GAMMAALBEDO: boolean;
- ALBEDODIRECTUV: number;
- VERTEXCOLOR: boolean;
- BAKED_VERTEX_ANIMATION_TEXTURE: boolean;
- AMBIENT: boolean;
- AMBIENTDIRECTUV: number;
- AMBIENTINGRAYSCALE: boolean;
- OPACITY: boolean;
- VERTEXALPHA: boolean;
- OPACITYDIRECTUV: number;
- OPACITYRGB: boolean;
- ALPHATEST: boolean;
- DEPTHPREPASS: boolean;
- ALPHABLEND: boolean;
- ALPHAFROMALBEDO: boolean;
- ALPHATESTVALUE: string;
- SPECULAROVERALPHA: boolean;
- RADIANCEOVERALPHA: boolean;
- ALPHAFRESNEL: boolean;
- LINEARALPHAFRESNEL: boolean;
- PREMULTIPLYALPHA: boolean;
- EMISSIVE: boolean;
- EMISSIVEDIRECTUV: number;
- GAMMAEMISSIVE: boolean;
- REFLECTIVITY: boolean;
- REFLECTIVITY_GAMMA: boolean;
- REFLECTIVITYDIRECTUV: number;
- SPECULARTERM: boolean;
- MICROSURFACEFROMREFLECTIVITYMAP: boolean;
- MICROSURFACEAUTOMATIC: boolean;
- LODBASEDMICROSFURACE: boolean;
- MICROSURFACEMAP: boolean;
- MICROSURFACEMAPDIRECTUV: number;
- METALLICWORKFLOW: boolean;
- ROUGHNESSSTOREINMETALMAPALPHA: boolean;
- ROUGHNESSSTOREINMETALMAPGREEN: boolean;
- METALLNESSSTOREINMETALMAPBLUE: boolean;
- AOSTOREINMETALMAPRED: boolean;
- METALLIC_REFLECTANCE: boolean;
- METALLIC_REFLECTANCE_GAMMA: boolean;
- METALLIC_REFLECTANCEDIRECTUV: number;
- METALLIC_REFLECTANCE_USE_ALPHA_ONLY: boolean;
- REFLECTANCE: boolean;
- REFLECTANCE_GAMMA: boolean;
- REFLECTANCEDIRECTUV: number;
- ENVIRONMENTBRDF: boolean;
- ENVIRONMENTBRDF_RGBD: boolean;
- NORMAL: boolean;
- TANGENT: boolean;
- BUMP: boolean;
- BUMPDIRECTUV: number;
- OBJECTSPACE_NORMALMAP: boolean;
- PARALLAX: boolean;
- PARALLAX_RHS: boolean;
- PARALLAXOCCLUSION: boolean;
- NORMALXYSCALE: boolean;
- LIGHTMAP: boolean;
- LIGHTMAPDIRECTUV: number;
- USELIGHTMAPASSHADOWMAP: boolean;
- GAMMALIGHTMAP: boolean;
- RGBDLIGHTMAP: boolean;
- REFLECTION: boolean;
- REFLECTIONMAP_3D: boolean;
- REFLECTIONMAP_SPHERICAL: boolean;
- REFLECTIONMAP_PLANAR: boolean;
- REFLECTIONMAP_CUBIC: boolean;
- USE_LOCAL_REFLECTIONMAP_CUBIC: boolean;
- REFLECTIONMAP_PROJECTION: boolean;
- REFLECTIONMAP_SKYBOX: boolean;
- REFLECTIONMAP_EXPLICIT: boolean;
- REFLECTIONMAP_EQUIRECTANGULAR: boolean;
- REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
- REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
- INVERTCUBICMAP: boolean;
- USESPHERICALFROMREFLECTIONMAP: boolean;
- USEIRRADIANCEMAP: boolean;
- USESPHERICALINVERTEX: boolean;
- REFLECTIONMAP_OPPOSITEZ: boolean;
- LODINREFLECTIONALPHA: boolean;
- GAMMAREFLECTION: boolean;
- RGBDREFLECTION: boolean;
- LINEARSPECULARREFLECTION: boolean;
- RADIANCEOCCLUSION: boolean;
- HORIZONOCCLUSION: boolean;
- INSTANCES: boolean;
- THIN_INSTANCES: boolean;
- INSTANCESCOLOR: boolean;
- PREPASS: boolean;
- PREPASS_IRRADIANCE: boolean;
- PREPASS_IRRADIANCE_INDEX: number;
- PREPASS_ALBEDO_SQRT: boolean;
- PREPASS_ALBEDO_SQRT_INDEX: number;
- PREPASS_DEPTH: boolean;
- PREPASS_DEPTH_INDEX: number;
- PREPASS_NORMAL: boolean;
- PREPASS_NORMAL_INDEX: number;
- PREPASS_NORMAL_WORLDSPACE: boolean;
- PREPASS_POSITION: boolean;
- PREPASS_POSITION_INDEX: number;
- PREPASS_VELOCITY: boolean;
- PREPASS_VELOCITY_INDEX: number;
- PREPASS_REFLECTIVITY: boolean;
- PREPASS_REFLECTIVITY_INDEX: number;
- SCENE_MRT_COUNT: number;
- NUM_BONE_INFLUENCERS: number;
- BonesPerMesh: number;
- BONETEXTURE: boolean;
- BONES_VELOCITY_ENABLED: boolean;
- NONUNIFORMSCALING: boolean;
- MORPHTARGETS: boolean;
- MORPHTARGETS_NORMAL: boolean;
- MORPHTARGETS_TANGENT: boolean;
- MORPHTARGETS_UV: boolean;
- NUM_MORPH_INFLUENCERS: number;
- MORPHTARGETS_TEXTURE: boolean;
- IMAGEPROCESSING: boolean;
- VIGNETTE: boolean;
- VIGNETTEBLENDMODEMULTIPLY: boolean;
- VIGNETTEBLENDMODEOPAQUE: boolean;
- TONEMAPPING: boolean;
- TONEMAPPING_ACES: boolean;
- CONTRAST: boolean;
- COLORCURVES: boolean;
- COLORGRADING: boolean;
- COLORGRADING3D: boolean;
- SAMPLER3DGREENDEPTH: boolean;
- SAMPLER3DBGRMAP: boolean;
- DITHER: boolean;
- IMAGEPROCESSINGPOSTPROCESS: boolean;
- SKIPFINALCOLORCLAMP: boolean;
- EXPOSURE: boolean;
- MULTIVIEW: boolean;
- ORDER_INDEPENDENT_TRANSPARENCY: boolean;
- ORDER_INDEPENDENT_TRANSPARENCY_16BITS: boolean;
- USEPHYSICALLIGHTFALLOFF: boolean;
- USEGLTFLIGHTFALLOFF: boolean;
- TWOSIDEDLIGHTING: boolean;
- SHADOWFLOAT: boolean;
- CLIPPLANE: boolean;
- CLIPPLANE2: boolean;
- CLIPPLANE3: boolean;
- CLIPPLANE4: boolean;
- CLIPPLANE5: boolean;
- CLIPPLANE6: boolean;
- POINTSIZE: boolean;
- FOG: boolean;
- LOGARITHMICDEPTH: boolean;
- CAMERA_ORTHOGRAPHIC: boolean;
- CAMERA_PERSPECTIVE: boolean;
- FORCENORMALFORWARD: boolean;
- SPECULARAA: boolean;
- UNLIT: boolean;
- DECAL_AFTER_DETAIL: boolean;
- DEBUGMODE: number;
- /**
- * Initializes the PBR Material defines.
- * @param externalProperties The external properties
- */
- constructor(externalProperties?: {
- [name: string]: {
- type: string;
- default: any;
- };
- });
- /**
- * Resets the PBR Material defines.
- */
- reset(): void;
- }
- /**
- * The Physically based material base class of BJS.
- *
- * This offers the main features of a standard PBR material.
- * For more information, please refer to the documentation :
- * https://doc.babylonjs.com/features/featuresDeepDive/materials/using/introToPBR
- */
- export declare abstract class PBRBaseMaterial extends PushMaterial {
- /**
- * PBRMaterialTransparencyMode: No transparency mode, Alpha channel is not use.
- */
- static readonly PBRMATERIAL_OPAQUE = 0;
- /**
- * PBRMaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.
- */
- static readonly PBRMATERIAL_ALPHATEST = 1;
- /**
- * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
- */
- static readonly PBRMATERIAL_ALPHABLEND = 2;
- /**
- * PBRMaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
- * They are also discarded below the alpha cutoff threshold to improve performances.
- */
- static readonly PBRMATERIAL_ALPHATESTANDBLEND = 3;
- /**
- * Defines the default value of how much AO map is occluding the analytical lights
- * (point spot...).
- */
- static DEFAULT_AO_ON_ANALYTICAL_LIGHTS: number;
- /**
- * PBRMaterialLightFalloff Physical: light is falling off following the inverse squared distance law.
- */
- static readonly LIGHTFALLOFF_PHYSICAL = 0;
- /**
- * PBRMaterialLightFalloff gltf: light is falling off as described in the gltf moving to PBR document
- * to enhance interoperability with other engines.
- */
- static readonly LIGHTFALLOFF_GLTF = 1;
- /**
- * PBRMaterialLightFalloff Standard: light is falling off like in the standard material
- * to enhance interoperability with other materials.
- */
- static readonly LIGHTFALLOFF_STANDARD = 2;
- /**
- * Intensity of the direct lights e.g. the four lights available in your scene.
- * This impacts both the direct diffuse and specular highlights.
- * @internal
- */
- _directIntensity: number;
- /**
- * Intensity of the emissive part of the material.
- * This helps controlling the emissive effect without modifying the emissive color.
- * @internal
- */
- _emissiveIntensity: number;
- /**
- * Intensity of the environment e.g. how much the environment will light the object
- * either through harmonics for rough material or through the reflection for shiny ones.
- * @internal
- */
- _environmentIntensity: number;
- /**
- * This is a special control allowing the reduction of the specular highlights coming from the
- * four lights of the scene. Those highlights may not be needed in full environment lighting.
- * @internal
- */
- _specularIntensity: number;
- /**
- * This stores the direct, emissive, environment, and specular light intensities into a Vector4.
- */
- private _lightingInfos;
- /**
- * Debug Control allowing disabling the bump map on this material.
- * @internal
- */
- _disableBumpMap: boolean;
- /**
- * AKA Diffuse Texture in standard nomenclature.
- * @internal
- */
- _albedoTexture: Nullable<BaseTexture>;
- /**
- * AKA Occlusion Texture in other nomenclature.
- * @internal
- */
- _ambientTexture: Nullable<BaseTexture>;
- /**
- * AKA Occlusion Texture Intensity in other nomenclature.
- * @internal
- */
- _ambientTextureStrength: number;
- /**
- * Defines how much the AO map is occluding the analytical lights (point spot...).
- * 1 means it completely occludes it
- * 0 mean it has no impact
- * @internal
- */
- _ambientTextureImpactOnAnalyticalLights: number;
- /**
- * Stores the alpha values in a texture.
- * @internal
- */
- _opacityTexture: Nullable<BaseTexture>;
- /**
- * Stores the reflection values in a texture.
- * @internal
- */
- _reflectionTexture: Nullable<BaseTexture>;
- /**
- * Stores the emissive values in a texture.
- * @internal
- */
- _emissiveTexture: Nullable<BaseTexture>;
- /**
- * AKA Specular texture in other nomenclature.
- * @internal
- */
- _reflectivityTexture: Nullable<BaseTexture>;
- /**
- * Used to switch from specular/glossiness to metallic/roughness workflow.
- * @internal
- */
- _metallicTexture: Nullable<BaseTexture>;
- /**
- * Specifies the metallic scalar of the metallic/roughness workflow.
- * Can also be used to scale the metalness values of the metallic texture.
- * @internal
- */
- _metallic: Nullable<number>;
- /**
- * Specifies the roughness scalar of the metallic/roughness workflow.
- * Can also be used to scale the roughness values of the metallic texture.
- * @internal
- */
- _roughness: Nullable<number>;
- /**
- * In metallic workflow, specifies an F0 factor to help configuring the material F0.
- * By default the indexOfrefraction is used to compute F0;
- *
- * This is used as a factor against the default reflectance at normal incidence to tweak it.
- *
- * F0 = defaultF0 * metallicF0Factor * metallicReflectanceColor;
- * F90 = metallicReflectanceColor;
- * @internal
- */
- _metallicF0Factor: number;
- /**
- * In metallic workflow, specifies an F0 color.
- * By default the F90 is always 1;
- *
- * Please note that this factor is also used as a factor against the default reflectance at normal incidence.
- *
- * F0 = defaultF0_from_IOR * metallicF0Factor * metallicReflectanceColor
- * F90 = metallicF0Factor;
- * @internal
- */
- _metallicReflectanceColor: Color3;
- /**
- * Specifies that only the A channel from _metallicReflectanceTexture should be used.
- * If false, both RGB and A channels will be used
- * @internal
- */
- _useOnlyMetallicFromMetallicReflectanceTexture: boolean;
- /**
- * Defines to store metallicReflectanceColor in RGB and metallicF0Factor in A
- * This is multiply against the scalar values defined in the material.
- * @internal
- */
- _metallicReflectanceTexture: Nullable<BaseTexture>;
- /**
- * Defines to store reflectanceColor in RGB
- * This is multiplied against the scalar values defined in the material.
- * If both _reflectanceTexture and _metallicReflectanceTexture textures are provided and _useOnlyMetallicFromMetallicReflectanceTexture
- * is false, _metallicReflectanceTexture takes precedence and _reflectanceTexture is not used
- * @internal
- */
- _reflectanceTexture: Nullable<BaseTexture>;
- /**
- * Used to enable roughness/glossiness fetch from a separate channel depending on the current mode.
- * Gray Scale represents roughness in metallic mode and glossiness in specular mode.
- * @internal
- */
- _microSurfaceTexture: Nullable<BaseTexture>;
- /**
- * Stores surface normal data used to displace a mesh in a texture.
- * @internal
- */
- _bumpTexture: Nullable<BaseTexture>;
- /**
- * Stores the pre-calculated light information of a mesh in a texture.
- * @internal
- */
- _lightmapTexture: Nullable<BaseTexture>;
- /**
- * The color of a material in ambient lighting.
- * @internal
- */
- _ambientColor: Color3;
- /**
- * AKA Diffuse Color in other nomenclature.
- * @internal
- */
- _albedoColor: Color3;
- /**
- * AKA Specular Color in other nomenclature.
- * @internal
- */
- _reflectivityColor: Color3;
- /**
- * The color applied when light is reflected from a material.
- * @internal
- */
- _reflectionColor: Color3;
- /**
- * The color applied when light is emitted from a material.
- * @internal
- */
- _emissiveColor: Color3;
- /**
- * AKA Glossiness in other nomenclature.
- * @internal
- */
- _microSurface: number;
- /**
- * Specifies that the material will use the light map as a show map.
- * @internal
- */
- _useLightmapAsShadowmap: boolean;
- /**
- * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal
- * makes the reflect vector face the model (under horizon).
- * @internal
- */
- _useHorizonOcclusion: boolean;
- /**
- * This parameters will enable/disable radiance occlusion by preventing the radiance to lit
- * too much the area relying on ambient texture to define their ambient occlusion.
- * @internal
- */
- _useRadianceOcclusion: boolean;
- /**
- * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.
- * @internal
- */
- _useAlphaFromAlbedoTexture: boolean;
- /**
- * Specifies that the material will keeps the specular highlights over a transparent surface (only the most luminous ones).
- * A car glass is a good example of that. When sun reflects on it you can not see what is behind.
- * @internal
- */
- _useSpecularOverAlpha: boolean;
- /**
- * Specifies if the reflectivity texture contains the glossiness information in its alpha channel.
- * @internal
- */
- _useMicroSurfaceFromReflectivityMapAlpha: boolean;
- /**
- * Specifies if the metallic texture contains the roughness information in its alpha channel.
- * @internal
- */
- _useRoughnessFromMetallicTextureAlpha: boolean;
- /**
- * Specifies if the metallic texture contains the roughness information in its green channel.
- * @internal
- */
- _useRoughnessFromMetallicTextureGreen: boolean;
- /**
- * Specifies if the metallic texture contains the metallness information in its blue channel.
- * @internal
- */
- _useMetallnessFromMetallicTextureBlue: boolean;
- /**
- * Specifies if the metallic texture contains the ambient occlusion information in its red channel.
- * @internal
- */
- _useAmbientOcclusionFromMetallicTextureRed: boolean;
- /**
- * Specifies if the ambient texture contains the ambient occlusion information in its red channel only.
- * @internal
- */
- _useAmbientInGrayScale: boolean;
- /**
- * In case the reflectivity map does not contain the microsurface information in its alpha channel,
- * The material will try to infer what glossiness each pixel should be.
- * @internal
- */
- _useAutoMicroSurfaceFromReflectivityMap: boolean;
- /**
- * Defines the falloff type used in this material.
- * It by default is Physical.
- * @internal
- */
- _lightFalloff: number;
- /**
- * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).
- * A car glass is a good example of that. When the street lights reflects on it you can not see what is behind.
- * @internal
- */
- _useRadianceOverAlpha: boolean;
- /**
- * Allows using an object space normal map (instead of tangent space).
- * @internal
- */
- _useObjectSpaceNormalMap: boolean;
- /**
- * Allows using the bump map in parallax mode.
- * @internal
- */
- _useParallax: boolean;
- /**
- * Allows using the bump map in parallax occlusion mode.
- * @internal
- */
- _useParallaxOcclusion: boolean;
- /**
- * Controls the scale bias of the parallax mode.
- * @internal
- */
- _parallaxScaleBias: number;
- /**
- * If sets to true, disables all the lights affecting the material.
- * @internal
- */
- _disableLighting: boolean;
- /**
- * Number of Simultaneous lights allowed on the material.
- * @internal
- */
- _maxSimultaneousLights: number;
- /**
- * If sets to true, x component of normal map value will be inverted (x = 1.0 - x).
- * @internal
- */
- _invertNormalMapX: boolean;
- /**
- * If sets to true, y component of normal map value will be inverted (y = 1.0 - y).
- * @internal
- */
- _invertNormalMapY: boolean;
- /**
- * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
- * @internal
- */
- _twoSidedLighting: boolean;
- /**
- * Defines the alpha limits in alpha test mode.
- * @internal
- */
- _alphaCutOff: number;
- /**
- * Enforces alpha test in opaque or blend mode in order to improve the performances of some situations.
- * @internal
- */
- _forceAlphaTest: boolean;
- /**
- * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.
- * And/Or occlude the blended part. (alpha is converted to gamma to compute the fresnel)
- * @internal
- */
- _useAlphaFresnel: boolean;
- /**
- * A fresnel is applied to the alpha of the model to ensure grazing angles edges are not alpha tested.
- * And/Or occlude the blended part. (alpha stays linear to compute the fresnel)
- * @internal
- */
- _useLinearAlphaFresnel: boolean;
- /**
- * Specifies the environment BRDF texture used to compute the scale and offset roughness values
- * from cos theta and roughness:
- * http://blog.selfshadow.com/publications/s2013-shading-course/karis/s2013_pbs_epic_notes_v2.pdf
- * @internal
- */
- _environmentBRDFTexture: Nullable<BaseTexture>;
- /**
- * Force the shader to compute irradiance in the fragment shader in order to take bump in account.
- * @internal
- */
- _forceIrradianceInFragment: boolean;
- private _realTimeFiltering;
- /**
- * Enables realtime filtering on the texture.
- */
- get realTimeFiltering(): boolean;
- set realTimeFiltering(b: boolean);
- private _realTimeFilteringQuality;
- /**
- * Quality switch for realtime filtering
- */
- get realTimeFilteringQuality(): number;
- set realTimeFilteringQuality(n: number);
- /**
- * Can this material render to several textures at once
- */
- get canRenderToMRT(): boolean;
- /**
- * Force normal to face away from face.
- * @internal
- */
- _forceNormalForward: boolean;
- /**
- * Enables specular anti aliasing in the PBR shader.
- * It will both interacts on the Geometry for analytical and IBL lighting.
- * It also prefilter the roughness map based on the bump values.
- * @internal
- */
- _enableSpecularAntiAliasing: boolean;
- /**
- * Default configuration related to image processing available in the PBR Material.
- */
- protected _imageProcessingConfiguration: ImageProcessingConfiguration;
- /**
- * Keep track of the image processing observer to allow dispose and replace.
- */
- private _imageProcessingObserver;
- /**
- * Attaches a new image processing configuration to the PBR Material.
- * @param configuration
- */
- protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void;
- /**
- * Stores the available render targets.
- */
- private _renderTargets;
- /**
- * Sets the global ambient color for the material used in lighting calculations.
- */
- private _globalAmbientColor;
- /**
- * If set to true, no lighting calculations will be applied.
- */
- private _unlit;
- /**
- * If sets to true, the decal map will be applied after the detail map. Else, it is applied before (default: false)
- */
- private _applyDecalMapAfterDetailMap;
- private _debugMode;
- /**
- * @internal
- * This is reserved for the inspector.
- * Defines the material debug mode.
- * It helps seeing only some components of the material while troubleshooting.
- */
- debugMode: number;
- /**
- * @internal
- * This is reserved for the inspector.
- * Specify from where on screen the debug mode should start.
- * The value goes from -1 (full screen) to 1 (not visible)
- * It helps with side by side comparison against the final render
- * This defaults to -1
- */
- debugLimit: number;
- /**
- * @internal
- * This is reserved for the inspector.
- * As the default viewing range might not be enough (if the ambient is really small for instance)
- * You can use the factor to better multiply the final value.
- */
- debugFactor: number;
- /**
- * Defines the clear coat layer parameters for the material.
- */
- readonly clearCoat: PBRClearCoatConfiguration;
- /**
- * Defines the iridescence layer parameters for the material.
- */
- readonly iridescence: PBRIridescenceConfiguration;
- /**
- * Defines the anisotropic parameters for the material.
- */
- readonly anisotropy: PBRAnisotropicConfiguration;
- /**
- * Defines the BRDF parameters for the material.
- */
- readonly brdf: PBRBRDFConfiguration;
- /**
- * Defines the Sheen parameters for the material.
- */
- readonly sheen: PBRSheenConfiguration;
- /**
- * Defines the SubSurface parameters for the material.
- */
- readonly subSurface: PBRSubSurfaceConfiguration;
- /**
- * Defines additional PrePass parameters for the material.
- */
- readonly prePassConfiguration: PrePassConfiguration;
- /**
- * Defines the detail map parameters for the material.
- */
- readonly detailMap: DetailMapConfiguration;
- protected _cacheHasRenderTargetTextures: boolean;
- /**
- * Instantiates a new PBRMaterial instance.
- *
- * @param name The material name
- * @param scene The scene the material will be use in.
- */
- constructor(name: string, scene?: Scene);
- /**
- * Gets a boolean indicating that current material needs to register RTT
- */
- get hasRenderTargetTextures(): boolean;
- /**
- * Can this material render to prepass
- */
- get isPrePassCapable(): boolean;
- /**
- * @returns the name of the material class.
- */
- getClassName(): string;
- /**
- * Returns true if alpha blending should be disabled.
- */
- protected get _disableAlphaBlending(): boolean;
- /**
- * @returns whether or not this material should be rendered in alpha blend mode.
- */
- needAlphaBlending(): boolean;
- /**
- * @returns whether or not this material should be rendered in alpha test mode.
- */
- needAlphaTesting(): boolean;
- /**
- * @returns whether or not the alpha value of the albedo texture should be used for alpha blending.
- */
- protected _shouldUseAlphaFromAlbedoTexture(): boolean;
- /**
- * @returns whether or not there is a usable alpha channel for transparency.
- */
- protected _hasAlphaChannel(): boolean;
- /**
- * @returns the texture used for the alpha test.
- */
- getAlphaTestTexture(): Nullable<BaseTexture>;
- /**
- * Specifies that the submesh is ready to be used.
- * @param mesh - BJS mesh.
- * @param subMesh - A submesh of the BJS mesh. Used to check if it is ready.
- * @param useInstances - Specifies that instances should be used.
- * @returns - boolean indicating that the submesh is ready or not.
- */
- isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
- /**
- * Specifies if the material uses metallic roughness workflow.
- * @returns boolean specifying if the material uses metallic roughness workflow.
- */
- isMetallicWorkflow(): boolean;
- private _prepareEffect;
- private _prepareDefines;
- /**
- * Force shader compilation
- * @param mesh - Define the mesh we want to force the compilation for
- * @param onCompiled - Define a callback triggered when the compilation completes
- * @param options - Define the options used to create the compilation
- */
- forceCompilation(mesh: AbstractMesh, onCompiled?: (material: Material) => void, options?: Partial<IMaterialCompilationOptions>): void;
- /**
- * Initializes the uniform buffer layout for the shader.
- */
- buildUniformLayout(): void;
- /**
- * Binds the submesh data.
- * @param world - The world matrix.
- * @param mesh - The BJS mesh.
- * @param subMesh - A submesh of the BJS mesh.
- */
- bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
- /**
- * Returns the animatable textures.
- * If material have animatable metallic texture, then reflectivity texture will not be returned, even if it has animations.
- * @returns - Array of animatable textures.
- */
- getAnimatables(): IAnimatable[];
- /**
- * Returns the texture used for reflections.
- * @returns - Reflection texture if present. Otherwise, returns the environment texture.
- */
- private _getReflectionTexture;
- /**
- * Returns an array of the actively used textures.
- * @returns - Array of BaseTextures
- */
- getActiveTextures(): BaseTexture[];
- /**
- * Checks to see if a texture is used in the material.
- * @param texture - Base texture to use.
- * @returns - Boolean specifying if a texture is used in the material.
- */
- hasTexture(texture: BaseTexture): boolean;
- /**
- * Sets the required values to the prepass renderer.
- * It can't be sets when subsurface scattering of this material is disabled.
- * When scene have ability to enable subsurface prepass effect, it will enable.
- * @returns - If prepass is enabled or not.
- */
- setPrePassRenderer(): boolean;
- /**
- * Disposes the resources of the material.
- * @param forceDisposeEffect - Forces the disposal of effects.
- * @param forceDisposeTextures - Forces the disposal of all textures.
- */
- dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
- }
|