123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688 |
- import { SmartArray } from "../Misc/smartArray";
- import type { IAnimatable } from "../Animations/animatable.interface";
- import type { Nullable } from "../types";
- import { Scene } from "../scene";
- import { Matrix } from "../Maths/math.vector";
- import { Color3 } from "../Maths/math.color";
- import type { SubMesh } from "../Meshes/subMesh";
- import type { AbstractMesh } from "../Meshes/abstractMesh";
- import type { Mesh } from "../Meshes/mesh";
- import { PrePassConfiguration } from "./prePassConfiguration";
- import type { IImageProcessingConfigurationDefines } from "./imageProcessingConfiguration.defines";
- import { ImageProcessingConfiguration } from "./imageProcessingConfiguration";
- import type { ColorCurves } from "./colorCurves";
- import type { FresnelParameters } from "./fresnelParameters";
- import { MaterialDefines } from "../Materials/materialDefines";
- import { PushMaterial } from "./pushMaterial";
- import type { BaseTexture } from "../Materials/Textures/baseTexture";
- import type { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";
- import "../Shaders/default.fragment";
- import "../Shaders/default.vertex";
- import { DetailMapConfiguration } from "./material.detailMapConfiguration";
- /** @internal */
- export declare class StandardMaterialDefines extends MaterialDefines implements IImageProcessingConfigurationDefines {
- MAINUV1: boolean;
- MAINUV2: boolean;
- MAINUV3: boolean;
- MAINUV4: boolean;
- MAINUV5: boolean;
- MAINUV6: boolean;
- DIFFUSE: boolean;
- DIFFUSEDIRECTUV: number;
- BAKED_VERTEX_ANIMATION_TEXTURE: boolean;
- AMBIENT: boolean;
- AMBIENTDIRECTUV: number;
- OPACITY: boolean;
- OPACITYDIRECTUV: number;
- OPACITYRGB: boolean;
- REFLECTION: boolean;
- EMISSIVE: boolean;
- EMISSIVEDIRECTUV: number;
- SPECULAR: boolean;
- SPECULARDIRECTUV: number;
- BUMP: boolean;
- BUMPDIRECTUV: number;
- PARALLAX: boolean;
- PARALLAX_RHS: boolean;
- PARALLAXOCCLUSION: boolean;
- SPECULAROVERALPHA: boolean;
- CLIPPLANE: boolean;
- CLIPPLANE2: boolean;
- CLIPPLANE3: boolean;
- CLIPPLANE4: boolean;
- CLIPPLANE5: boolean;
- CLIPPLANE6: boolean;
- ALPHATEST: boolean;
- DEPTHPREPASS: boolean;
- ALPHAFROMDIFFUSE: boolean;
- POINTSIZE: boolean;
- FOG: boolean;
- SPECULARTERM: boolean;
- DIFFUSEFRESNEL: boolean;
- OPACITYFRESNEL: boolean;
- REFLECTIONFRESNEL: boolean;
- REFRACTIONFRESNEL: boolean;
- EMISSIVEFRESNEL: boolean;
- FRESNEL: boolean;
- NORMAL: boolean;
- TANGENT: boolean;
- UV1: boolean;
- UV2: boolean;
- UV3: boolean;
- UV4: boolean;
- UV5: boolean;
- UV6: boolean;
- VERTEXCOLOR: boolean;
- VERTEXALPHA: boolean;
- NUM_BONE_INFLUENCERS: number;
- BonesPerMesh: number;
- BONETEXTURE: boolean;
- BONES_VELOCITY_ENABLED: boolean;
- INSTANCES: boolean;
- THIN_INSTANCES: boolean;
- INSTANCESCOLOR: boolean;
- GLOSSINESS: boolean;
- ROUGHNESS: boolean;
- EMISSIVEASILLUMINATION: boolean;
- LINKEMISSIVEWITHDIFFUSE: boolean;
- REFLECTIONFRESNELFROMSPECULAR: boolean;
- LIGHTMAP: boolean;
- LIGHTMAPDIRECTUV: number;
- OBJECTSPACE_NORMALMAP: boolean;
- USELIGHTMAPASSHADOWMAP: boolean;
- REFLECTIONMAP_3D: boolean;
- REFLECTIONMAP_SPHERICAL: boolean;
- REFLECTIONMAP_PLANAR: boolean;
- REFLECTIONMAP_CUBIC: boolean;
- USE_LOCAL_REFLECTIONMAP_CUBIC: boolean;
- USE_LOCAL_REFRACTIONMAP_CUBIC: boolean;
- REFLECTIONMAP_PROJECTION: boolean;
- REFLECTIONMAP_SKYBOX: boolean;
- REFLECTIONMAP_EXPLICIT: boolean;
- REFLECTIONMAP_EQUIRECTANGULAR: boolean;
- REFLECTIONMAP_EQUIRECTANGULAR_FIXED: boolean;
- REFLECTIONMAP_MIRROREDEQUIRECTANGULAR_FIXED: boolean;
- REFLECTIONMAP_OPPOSITEZ: boolean;
- INVERTCUBICMAP: boolean;
- LOGARITHMICDEPTH: boolean;
- REFRACTION: boolean;
- REFRACTIONMAP_3D: boolean;
- REFLECTIONOVERALPHA: boolean;
- TWOSIDEDLIGHTING: boolean;
- SHADOWFLOAT: boolean;
- MORPHTARGETS: boolean;
- MORPHTARGETS_NORMAL: boolean;
- MORPHTARGETS_TANGENT: boolean;
- MORPHTARGETS_UV: boolean;
- NUM_MORPH_INFLUENCERS: number;
- MORPHTARGETS_TEXTURE: boolean;
- NONUNIFORMSCALING: boolean;
- PREMULTIPLYALPHA: boolean;
- ALPHATEST_AFTERALLALPHACOMPUTATIONS: boolean;
- ALPHABLEND: 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;
- RGBDLIGHTMAP: boolean;
- RGBDREFLECTION: boolean;
- RGBDREFRACTION: 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;
- MULTIVIEW: boolean;
- ORDER_INDEPENDENT_TRANSPARENCY: boolean;
- ORDER_INDEPENDENT_TRANSPARENCY_16BITS: boolean;
- CAMERA_ORTHOGRAPHIC: boolean;
- CAMERA_PERSPECTIVE: boolean;
- /**
- * If the reflection texture on this material is in linear color space
- * @internal
- */
- IS_REFLECTION_LINEAR: boolean;
- /**
- * If the refraction texture on this material is in linear color space
- * @internal
- */
- IS_REFRACTION_LINEAR: boolean;
- EXPOSURE: boolean;
- DECAL_AFTER_DETAIL: boolean;
- /**
- * Initializes the Standard Material defines.
- * @param externalProperties The external properties
- */
- constructor(externalProperties?: {
- [name: string]: {
- type: string;
- default: any;
- };
- });
- setReflectionMode(modeToEnable: string): void;
- }
- /**
- * This is the default material used in Babylon. It is the best trade off between quality
- * and performances.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
- */
- export declare class StandardMaterial extends PushMaterial {
- private _diffuseTexture;
- /**
- * The basic texture of the material as viewed under a light.
- */
- diffuseTexture: Nullable<BaseTexture>;
- private _ambientTexture;
- /**
- * AKA Occlusion Texture in other nomenclature, it helps adding baked shadows into your material.
- */
- ambientTexture: Nullable<BaseTexture>;
- private _opacityTexture;
- /**
- * Define the transparency of the material from a texture.
- * The final alpha value can be read either from the red channel (if texture.getAlphaFromRGB is false)
- * or from the luminance or the current texel (if texture.getAlphaFromRGB is true)
- */
- opacityTexture: Nullable<BaseTexture>;
- private _reflectionTexture;
- /**
- * Define the texture used to display the reflection.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#how-to-obtain-reflections-and-refractions
- */
- reflectionTexture: Nullable<BaseTexture>;
- private _emissiveTexture;
- /**
- * Define texture of the material as if self lit.
- * This will be mixed in the final result even in the absence of light.
- */
- emissiveTexture: Nullable<BaseTexture>;
- private _specularTexture;
- /**
- * Define how the color and intensity of the highlight given by the light in the material.
- */
- specularTexture: Nullable<BaseTexture>;
- private _bumpTexture;
- /**
- * Bump mapping is a technique to simulate bump and dents on a rendered surface.
- * These are made by creating a normal map from an image. The means to do this can be found on the web, a search for 'normal map generator' will bring up free and paid for methods of doing this.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/moreMaterials#bump-map
- */
- bumpTexture: Nullable<BaseTexture>;
- private _lightmapTexture;
- /**
- * Complex lighting can be computationally expensive to compute at runtime.
- * To save on computation, lightmaps may be used to store calculated lighting in a texture which will be applied to a given mesh.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/lights/lights_introduction#lightmaps
- */
- lightmapTexture: Nullable<BaseTexture>;
- private _refractionTexture;
- /**
- * Define the texture used to display the refraction.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#how-to-obtain-reflections-and-refractions
- */
- refractionTexture: Nullable<BaseTexture>;
- /**
- * The color of the material lit by the environmental background lighting.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction#ambient-color-example
- */
- ambientColor: Color3;
- /**
- * The basic color of the material as viewed under a light.
- */
- diffuseColor: Color3;
- /**
- * Define how the color and intensity of the highlight given by the light in the material.
- */
- specularColor: Color3;
- /**
- * Define the color of the material as if self lit.
- * This will be mixed in the final result even in the absence of light.
- */
- emissiveColor: Color3;
- /**
- * Defines how sharp are the highlights in the material.
- * The bigger the value the sharper giving a more glossy feeling to the result.
- * Reversely, the smaller the value the blurrier giving a more rough feeling to the result.
- */
- specularPower: number;
- private _useAlphaFromDiffuseTexture;
- /**
- * Does the transparency come from the diffuse texture alpha channel.
- */
- useAlphaFromDiffuseTexture: boolean;
- private _useEmissiveAsIllumination;
- /**
- * If true, the emissive value is added into the end result, otherwise it is multiplied in.
- */
- useEmissiveAsIllumination: boolean;
- private _linkEmissiveWithDiffuse;
- /**
- * If true, some kind of energy conservation will prevent the end result to be more than 1 by reducing
- * the emissive level when the final color is close to one.
- */
- linkEmissiveWithDiffuse: boolean;
- private _useSpecularOverAlpha;
- /**
- * Specifies that the material will keep the specular highlights over a transparent surface (only the most luminous ones).
- * A car glass is a good exemple of that. When sun reflects on it you can not see what is behind.
- */
- useSpecularOverAlpha: boolean;
- private _useReflectionOverAlpha;
- /**
- * Specifies that the material will keeps the reflection highlights over a transparent surface (only the most luminous ones).
- * A car glass is a good exemple of that. When the street lights reflects on it you can not see what is behind.
- */
- useReflectionOverAlpha: boolean;
- private _disableLighting;
- /**
- * Does lights from the scene impacts this material.
- * It can be a nice trick for performance to disable lighting on a fully emissive material.
- */
- disableLighting: boolean;
- private _useObjectSpaceNormalMap;
- /**
- * Allows using an object space normal map (instead of tangent space).
- */
- useObjectSpaceNormalMap: boolean;
- private _useParallax;
- /**
- * Is parallax enabled or not.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/parallaxMapping
- */
- useParallax: boolean;
- private _useParallaxOcclusion;
- /**
- * Is parallax occlusion enabled or not.
- * If true, the outcome is way more realistic than traditional Parallax but you can expect a performance hit that worthes consideration.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/parallaxMapping
- */
- useParallaxOcclusion: boolean;
- /**
- * Apply a scaling factor that determine which "depth" the height map should reprensent. A value between 0.05 and 0.1 is reasonnable in Parallax, you can reach 0.2 using Parallax Occlusion.
- */
- parallaxScaleBias: number;
- private _roughness;
- /**
- * Helps to define how blurry the reflections should appears in the material.
- */
- roughness: number;
- /**
- * In case of refraction, define the value of the index of refraction.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#how-to-obtain-reflections-and-refractions
- */
- indexOfRefraction: number;
- /**
- * Invert the refraction texture alongside the y axis.
- * It can be useful with procedural textures or probe for instance.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/reflectionTexture#how-to-obtain-reflections-and-refractions
- */
- invertRefractionY: boolean;
- /**
- * Defines the alpha limits in alpha test mode.
- */
- alphaCutOff: number;
- private _useLightmapAsShadowmap;
- /**
- * In case of light mapping, define whether the map contains light or shadow informations.
- */
- useLightmapAsShadowmap: boolean;
- private _diffuseFresnelParameters;
- /**
- * Define the diffuse fresnel parameters of the material.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/fresnelParameters
- */
- diffuseFresnelParameters: FresnelParameters;
- private _opacityFresnelParameters;
- /**
- * Define the opacity fresnel parameters of the material.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/fresnelParameters
- */
- opacityFresnelParameters: FresnelParameters;
- private _reflectionFresnelParameters;
- /**
- * Define the reflection fresnel parameters of the material.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/fresnelParameters
- */
- reflectionFresnelParameters: FresnelParameters;
- private _refractionFresnelParameters;
- /**
- * Define the refraction fresnel parameters of the material.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/fresnelParameters
- */
- refractionFresnelParameters: FresnelParameters;
- private _emissiveFresnelParameters;
- /**
- * Define the emissive fresnel parameters of the material.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/fresnelParameters
- */
- emissiveFresnelParameters: FresnelParameters;
- private _useReflectionFresnelFromSpecular;
- /**
- * If true automatically deducts the fresnels values from the material specularity.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/fresnelParameters
- */
- useReflectionFresnelFromSpecular: boolean;
- private _useGlossinessFromSpecularMapAlpha;
- /**
- * Defines if the glossiness/roughness of the material should be read from the specular map alpha channel
- */
- useGlossinessFromSpecularMapAlpha: boolean;
- private _maxSimultaneousLights;
- /**
- * Defines the maximum number of lights that can be used in the material
- */
- maxSimultaneousLights: number;
- private _invertNormalMapX;
- /**
- * If sets to true, x component of normal map value will invert (x = 1.0 - x).
- */
- invertNormalMapX: boolean;
- private _invertNormalMapY;
- /**
- * If sets to true, y component of normal map value will invert (y = 1.0 - y).
- */
- invertNormalMapY: boolean;
- private _twoSidedLighting;
- /**
- * If sets to true and backfaceCulling is false, normals will be flipped on the backside.
- */
- twoSidedLighting: boolean;
- private _applyDecalMapAfterDetailMap;
- /**
- * If sets to true, the decal map will be applied after the detail map. Else, it is applied before (default: false)
- */
- applyDecalMapAfterDetailMap: boolean;
- /**
- * Default configuration related to image processing available in the standard Material.
- */
- protected _imageProcessingConfiguration: ImageProcessingConfiguration;
- /**
- * Gets the image processing configuration used either in this material.
- */
- get imageProcessingConfiguration(): ImageProcessingConfiguration;
- /**
- * Sets the Default image processing configuration used either in the this material.
- *
- * If sets to null, the scene one is in use.
- */
- set imageProcessingConfiguration(value: ImageProcessingConfiguration);
- /**
- * Keep track of the image processing observer to allow dispose and replace.
- */
- private _imageProcessingObserver;
- /**
- * Attaches a new image processing configuration to the Standard Material.
- * @param configuration
- */
- protected _attachImageProcessingConfiguration(configuration: Nullable<ImageProcessingConfiguration>): void;
- /**
- * Defines additional PrePass parameters for the material.
- */
- readonly prePassConfiguration: PrePassConfiguration;
- /**
- * Can this material render to prepass
- */
- get isPrePassCapable(): boolean;
- /**
- * Gets whether the color curves effect is enabled.
- */
- get cameraColorCurvesEnabled(): boolean;
- /**
- * Sets whether the color curves effect is enabled.
- */
- set cameraColorCurvesEnabled(value: boolean);
- /**
- * Gets whether the color grading effect is enabled.
- */
- get cameraColorGradingEnabled(): boolean;
- /**
- * Gets whether the color grading effect is enabled.
- */
- set cameraColorGradingEnabled(value: boolean);
- /**
- * Gets whether tonemapping is enabled or not.
- */
- get cameraToneMappingEnabled(): boolean;
- /**
- * Sets whether tonemapping is enabled or not
- */
- set cameraToneMappingEnabled(value: boolean);
- /**
- * The camera exposure used on this material.
- * This property is here and not in the camera to allow controlling exposure without full screen post process.
- * This corresponds to a photographic exposure.
- */
- get cameraExposure(): number;
- /**
- * The camera exposure used on this material.
- * This property is here and not in the camera to allow controlling exposure without full screen post process.
- * This corresponds to a photographic exposure.
- */
- set cameraExposure(value: number);
- /**
- * Gets The camera contrast used on this material.
- */
- get cameraContrast(): number;
- /**
- * Sets The camera contrast used on this material.
- */
- set cameraContrast(value: number);
- /**
- * Gets the Color Grading 2D Lookup Texture.
- */
- get cameraColorGradingTexture(): Nullable<BaseTexture>;
- /**
- * Sets the Color Grading 2D Lookup Texture.
- */
- set cameraColorGradingTexture(value: Nullable<BaseTexture>);
- /**
- * The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
- * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
- * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
- * corresponding to low luminance, medium luminance, and high luminance areas respectively.
- */
- get cameraColorCurves(): Nullable<ColorCurves>;
- /**
- * The color grading curves provide additional color adjustment that is applied after any color grading transform (3D LUT).
- * They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
- * These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image;
- * corresponding to low luminance, medium luminance, and high luminance areas respectively.
- */
- set cameraColorCurves(value: Nullable<ColorCurves>);
- /**
- * Can this material render to several textures at once
- */
- get canRenderToMRT(): boolean;
- /**
- * Defines the detail map parameters for the material.
- */
- readonly detailMap: DetailMapConfiguration;
- protected _renderTargets: SmartArray<RenderTargetTexture>;
- protected _worldViewProjectionMatrix: Matrix;
- protected _globalAmbientColor: Color3;
- protected _cacheHasRenderTargetTextures: boolean;
- /**
- * Instantiates a new standard material.
- * This is the default material used in Babylon. It is the best trade off between quality
- * and performances.
- * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/using/materials_introduction
- * @param name Define the name of the material in the scene
- * @param scene Define the scene the material belong to
- */
- constructor(name: string, scene?: Scene);
- /**
- * Gets a boolean indicating that current material needs to register RTT
- */
- get hasRenderTargetTextures(): boolean;
- /**
- * Gets the current class name of the material e.g. "StandardMaterial"
- * Mainly use in serialization.
- * @returns the class name
- */
- getClassName(): string;
- /**
- * Specifies if the material will require alpha blending
- * @returns a boolean specifying if alpha blending is needed
- */
- needAlphaBlending(): boolean;
- /**
- * Specifies if this material should be rendered in alpha test mode
- * @returns a boolean specifying if an alpha test is needed.
- */
- needAlphaTesting(): boolean;
- /**
- * @returns whether or not the alpha value of the diffuse texture should be used for alpha blending.
- */
- protected _shouldUseAlphaFromDiffuseTexture(): boolean;
- /**
- * @returns whether or not there is a usable alpha channel for transparency.
- */
- protected _hasAlphaChannel(): boolean;
- /**
- * Get the texture used for alpha test purpose.
- * @returns the diffuse texture in case of the standard material.
- */
- getAlphaTestTexture(): Nullable<BaseTexture>;
- /**
- * Get if the submesh is ready to be used and all its information available.
- * Child classes can use it to update shaders
- * @param mesh defines the mesh to check
- * @param subMesh defines which submesh to check
- * @param useInstances specifies that instances should be used
- * @returns a boolean indicating that the submesh is ready or not
- */
- isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh, useInstances?: boolean): boolean;
- /**
- * Builds the material UBO layouts.
- * Used internally during the effect preparation.
- */
- buildUniformLayout(): void;
- /**
- * Binds the submesh to this material by preparing the effect and shader to draw
- * @param world defines the world transformation matrix
- * @param mesh defines the mesh containing the submesh
- * @param subMesh defines the submesh to bind the material to
- */
- bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
- /**
- * Get the list of animatables in the material.
- * @returns the list of animatables object used in the material
- */
- getAnimatables(): IAnimatable[];
- /**
- * Gets the active textures from the material
- * @returns an array of textures
- */
- getActiveTextures(): BaseTexture[];
- /**
- * Specifies if the material uses a texture
- * @param texture defines the texture to check against the material
- * @returns a boolean specifying if the material uses the texture
- */
- hasTexture(texture: BaseTexture): boolean;
- /**
- * Disposes the material
- * @param forceDisposeEffect specifies if effects should be forcefully disposed
- * @param forceDisposeTextures specifies if textures should be forcefully disposed
- */
- dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void;
- /**
- * Makes a duplicate of the material, and gives it a new name
- * @param name defines the new name for the duplicated material
- * @param cloneTexturesOnlyOnce - if a texture is used in more than one channel (e.g diffuse and opacity), only clone it once and reuse it on the other channels. Default false.
- * @param rootUrl defines the root URL to use to load textures
- * @returns the cloned material
- */
- clone(name: string, cloneTexturesOnlyOnce?: boolean, rootUrl?: string): StandardMaterial;
- /**
- * Creates a standard 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 standard material
- */
- static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial;
- /**
- * Are diffuse textures enabled in the application.
- */
- static get DiffuseTextureEnabled(): boolean;
- static set DiffuseTextureEnabled(value: boolean);
- /**
- * Are detail textures enabled in the application.
- */
- static get DetailTextureEnabled(): boolean;
- static set DetailTextureEnabled(value: boolean);
- /**
- * Are ambient textures enabled in the application.
- */
- static get AmbientTextureEnabled(): boolean;
- static set AmbientTextureEnabled(value: boolean);
- /**
- * Are opacity textures enabled in the application.
- */
- static get OpacityTextureEnabled(): boolean;
- static set OpacityTextureEnabled(value: boolean);
- /**
- * Are reflection textures enabled in the application.
- */
- static get ReflectionTextureEnabled(): boolean;
- static set ReflectionTextureEnabled(value: boolean);
- /**
- * Are emissive textures enabled in the application.
- */
- static get EmissiveTextureEnabled(): boolean;
- static set EmissiveTextureEnabled(value: boolean);
- /**
- * Are specular textures enabled in the application.
- */
- static get SpecularTextureEnabled(): boolean;
- static set SpecularTextureEnabled(value: boolean);
- /**
- * Are bump textures enabled in the application.
- */
- static get BumpTextureEnabled(): boolean;
- static set BumpTextureEnabled(value: boolean);
- /**
- * Are lightmap textures enabled in the application.
- */
- static get LightmapTextureEnabled(): boolean;
- static set LightmapTextureEnabled(value: boolean);
- /**
- * Are refraction textures enabled in the application.
- */
- static get RefractionTextureEnabled(): boolean;
- static set RefractionTextureEnabled(value: boolean);
- /**
- * Are color grading textures enabled in the application.
- */
- static get ColorGradingTextureEnabled(): boolean;
- static set ColorGradingTextureEnabled(value: boolean);
- /**
- * Are fresnels enabled in the application.
- */
- static get FresnelEnabled(): boolean;
- static set FresnelEnabled(value: boolean);
- }
|