|
@@ -20900,6 +20900,15 @@ declare module BABYLON {
|
|
|
*/
|
|
|
static CreateSphere(name: string, segments: number, diameter: number, scene?: Scene, updatable?: boolean, sideOrientation?: number): Mesh;
|
|
|
/**
|
|
|
+ * Creates a hemisphere mesh. Please consider using the same method from the MeshBuilder class instead
|
|
|
+ * @param name defines the name of the mesh to create
|
|
|
+ * @param segments sets the sphere number of horizontal stripes (positive integer, default 32)
|
|
|
+ * @param diameter sets the diameter size (float) of the sphere (default 1)
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @returns a new Mesh
|
|
|
+ */
|
|
|
+ static CreateHemisphere(name: string, segments: number, diameter: number, scene?: Scene): Mesh;
|
|
|
+ /**
|
|
|
* Creates a cylinder or a cone mesh. Please consider using the same method from the MeshBuilder class instead
|
|
|
* @param name defines the name of the mesh to create
|
|
|
* @param height sets the height size (float) of the cylinder/cone (float, default 2)
|
|
@@ -41815,174 +41824,459 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
- * Gizmo that enables viewing a light
|
|
|
+ * A directional light is defined by a direction (what a surprise!).
|
|
|
+ * The light is emitted from everywhere in the specified direction, and has an infinite range.
|
|
|
+ * An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object.
|
|
|
+ * Documentation: https://doc.babylonjs.com/babylon101/lights
|
|
|
*/
|
|
|
- export class LightGizmo extends Gizmo {
|
|
|
- private _box;
|
|
|
+ export class DirectionalLight extends ShadowLight {
|
|
|
+ private _shadowFrustumSize;
|
|
|
/**
|
|
|
- * Creates a LightGizmo
|
|
|
- * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ * Fix frustum size for the shadow generation. This is disabled if the value is 0.
|
|
|
*/
|
|
|
- constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
- private _light;
|
|
|
/**
|
|
|
- * The light that the gizmo is attached to
|
|
|
+ * Specifies a fix frustum size for the shadow generation.
|
|
|
+ */
|
|
|
+ shadowFrustumSize: number;
|
|
|
+ private _shadowOrthoScale;
|
|
|
+ /**
|
|
|
+ * Gets the shadow projection scale against the optimal computed one.
|
|
|
+ * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
|
|
|
+ * This does not impact in fixed frustum size (shadowFrustumSize being set)
|
|
|
*/
|
|
|
- light: Nullable<Light>;
|
|
|
/**
|
|
|
- * @hidden
|
|
|
- * Updates the gizmo to match the attached mesh's position/rotation
|
|
|
+ * Sets the shadow projection scale against the optimal computed one.
|
|
|
+ * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
|
|
|
+ * This does not impact in fixed frustum size (shadowFrustumSize being set)
|
|
|
+ */
|
|
|
+ shadowOrthoScale: number;
|
|
|
+ /**
|
|
|
+ * Automatically compute the projection matrix to best fit (including all the casters)
|
|
|
+ * on each frame.
|
|
|
*/
|
|
|
- protected _update(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
- export var backgroundFragmentDeclaration: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
- export var backgroundUboDeclaration: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
- export var backgroundPixelShader: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
- export var backgroundVertexDeclaration: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
- export var backgroundVertexShader: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
- * Background material used to create an efficient environement around your scene.
|
|
|
- */
|
|
|
- export class BackgroundMaterial extends PushMaterial {
|
|
|
+ autoUpdateExtends: boolean;
|
|
|
+ private _orthoLeft;
|
|
|
+ private _orthoRight;
|
|
|
+ private _orthoTop;
|
|
|
+ private _orthoBottom;
|
|
|
/**
|
|
|
- * Standard reflectance value at parallel view angle.
|
|
|
+ * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).
|
|
|
+ * The directional light is emitted from everywhere in the given direction.
|
|
|
+ * It can cast shadows.
|
|
|
+ * Documentation : https://doc.babylonjs.com/babylon101/lights
|
|
|
+ * @param name The friendly name of the light
|
|
|
+ * @param direction The direction of the light
|
|
|
+ * @param scene The scene the light belongs to
|
|
|
*/
|
|
|
- static StandardReflectance0: number;
|
|
|
+ constructor(name: string, direction: Vector3, scene: Scene);
|
|
|
/**
|
|
|
- * Standard reflectance value at grazing angle.
|
|
|
+ * Returns the string "DirectionalLight".
|
|
|
+ * @return The class name
|
|
|
*/
|
|
|
- static StandardReflectance90: number;
|
|
|
- protected _primaryColor: Color3;
|
|
|
+ getClassName(): string;
|
|
|
/**
|
|
|
- * Key light Color (multiply against the environement texture)
|
|
|
+ * Returns the integer 1.
|
|
|
+ * @return The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
|
*/
|
|
|
- primaryColor: Color3;
|
|
|
- protected __perceptualColor: Nullable<Color3>;
|
|
|
+ getTypeID(): number;
|
|
|
/**
|
|
|
- * Experimental Internal Use Only.
|
|
|
- *
|
|
|
- * Key light Color in "perceptual value" meaning the color you would like to see on screen.
|
|
|
- * This acts as a helper to set the primary color to a more "human friendly" value.
|
|
|
- * Conversion to linear space as well as exposure and tone mapping correction will be applied to keep the
|
|
|
- * output color as close as possible from the chosen value.
|
|
|
- * (This does not account for contrast color grading and color curves as they are considered post effect and not directly
|
|
|
- * part of lighting setup.)
|
|
|
- */
perceptualColor: Nullable<Color3>;
|
|
|
- protected _primaryColorShadowLevel: float;
|
|
|
+ * Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
|
+ * Returns the DirectionalLight Shadow projection matrix.
|
|
|
+ */
|
|
|
+ protected _setDefaultShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void;
|
|
|
/**
|
|
|
- * Defines the level of the shadows (dark area of the reflection map) in order to help scaling the colors.
|
|
|
- * The color opposite to the primary color is used at the level chosen to define what the black area would look.
|
|
|
+ * Sets the passed matrix "matrix" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
|
+ * Returns the DirectionalLight Shadow projection matrix.
|
|
|
*/
|
|
|
- primaryColorShadowLevel: float;
|
|
|
- protected _primaryColorHighlightLevel: float;
|
|
|
+ protected _setDefaultFixedFrustumShadowProjectionMatrix(matrix: Matrix): void;
|
|
|
/**
|
|
|
- * Defines the level of the highliights (highlight area of the reflection map) in order to help scaling the colors.
|
|
|
- * The primary color is used at the level chosen to define what the white area would look.
|
|
|
+ * Sets the passed matrix "matrix" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
|
+ * Returns the DirectionalLight Shadow projection matrix.
|
|
|
*/
|
|
|
- primaryColorHighlightLevel: float;
|
|
|
- protected _reflectionTexture: Nullable<BaseTexture>;
|
|
|
+ protected _setDefaultAutoExtendShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void;
|
|
|
+ protected _buildUniformLayout(): void;
|
|
|
/**
|
|
|
- * Reflection Texture used in the material.
|
|
|
- * Should be author in a specific way for the best result (refer to the documentation).
|
|
|
+ * Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.
|
|
|
+ * @param effect The effect to update
|
|
|
+ * @param lightIndex The index of the light in the effect to update
|
|
|
+ * @returns The directional light
|
|
|
*/
|
|
|
- reflectionTexture: Nullable<BaseTexture>;
|
|
|
- protected _reflectionBlur: float;
|
|
|
+ transferToEffect(effect: Effect, lightIndex: string): DirectionalLight;
|
|
|
/**
|
|
|
- * Reflection Texture level of blur.
|
|
|
+ * Gets the minZ used for shadow according to both the scene and the light.
|
|
|
*
|
|
|
- * Can be use to reuse an existing HDR Texture and target a specific LOD to prevent authoring the
|
|
|
- * texture twice.
|
|
|
+ * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
|
|
|
+ * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
|
|
|
+ * @param activeCamera The camera we are returning the min for
|
|
|
+ * @returns the depth min z
|
|
|
*/
|
|
|
- reflectionBlur: float;
|
|
|
- protected _diffuseTexture: Nullable<BaseTexture>;
|
|
|
+ getDepthMinZ(activeCamera: Camera): number;
|
|
|
/**
|
|
|
- * Diffuse Texture used in the material.
|
|
|
- * Should be author in a specific way for the best result (refer to the documentation).
|
|
|
+ * Gets the maxZ used for shadow according to both the scene and the light.
|
|
|
+ *
|
|
|
+ * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
|
|
|
+ * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
|
|
|
+ * @param activeCamera The camera we are returning the max for
|
|
|
+ * @returns the depth max z
|
|
|
*/
|
|
|
- diffuseTexture: Nullable<BaseTexture>;
|
|
|
- protected _shadowLights: Nullable<IShadowLight[]>;
|
|
|
+ getDepthMaxZ(activeCamera: Camera): number;
|
|
|
/**
|
|
|
- * Specify the list of lights casting shadow on the material.
|
|
|
- * All scene shadow lights will be included if null.
|
|
|
+ * Prepares the list of defines specific to the light type.
|
|
|
+ * @param defines the list of defines
|
|
|
+ * @param lightIndex defines the index of the light for the effect
|
|
|
*/
|
|
|
- shadowLights: Nullable<IShadowLight[]>;
|
|
|
- protected _shadowLevel: float;
|
|
|
+ prepareLightSpecificDefines(defines: any, lightIndex: number): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Class containing static functions to help procedurally build meshes
|
|
|
+ */
|
|
|
+ export class HemisphereBuilder {
|
|
|
/**
|
|
|
- * Helps adjusting the shadow to a softer level if required.
|
|
|
- * 0 means black shadows and 1 means no shadows.
|
|
|
+ * Creates a hemisphere mesh
|
|
|
+ * @param name defines the name of the mesh
|
|
|
+ * @param options defines the options used to create the mesh
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @returns the hemisphere mesh
|
|
|
*/
|
|
|
- shadowLevel: float;
|
|
|
- protected _sceneCenter: Vector3;
|
|
|
+ static CreateHemisphere(name: string, options: {
|
|
|
+ segments?: number;
|
|
|
+ diameter?: number;
|
|
|
+ sideOrientation?: number;
|
|
|
+ }, scene: any): Mesh;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * A spot light is defined by a position, a direction, an angle, and an exponent.
|
|
|
+ * These values define a cone of light starting from the position, emitting toward the direction.
|
|
|
+ * The angle, in radians, defines the size (field of illumination) of the spotlight's conical beam,
|
|
|
+ * and the exponent defines the speed of the decay of the light with distance (reach).
|
|
|
+ * Documentation: https://doc.babylonjs.com/babylon101/lights
|
|
|
+ */
|
|
|
+ export class SpotLight extends ShadowLight {
|
|
|
+ private _angle;
|
|
|
+ private _innerAngle;
|
|
|
+ private _cosHalfAngle;
|
|
|
+ private _lightAngleScale;
|
|
|
+ private _lightAngleOffset;
|
|
|
/**
|
|
|
- * In case of opacity Fresnel or reflection falloff, this is use as a scene center.
|
|
|
- * It is usually zero but might be interesting to modify according to your setup.
|
|
|
+ * Gets the cone angle of the spot light in Radians.
|
|
|
*/
|
|
|
- sceneCenter: Vector3;
|
|
|
- protected _opacityFresnel: boolean;
|
|
|
/**
|
|
|
- * This helps specifying that the material is falling off to the sky box at grazing angle.
|
|
|
- * This helps ensuring a nice transition when the camera goes under the ground.
|
|
|
- */
|
|
|
- opacityFresnel: boolean;
|
|
|
- protected _reflectionFresnel: boolean;
|
|
|
+ * Sets the cone angle of the spot light in Radians.
|
|
|
+ */
|
|
|
+ angle: number;
|
|
|
/**
|
|
|
- * This helps specifying that the material is falling off from diffuse to the reflection texture at grazing angle.
|
|
|
- * This helps adding a mirror texture on the ground.
|
|
|
+ * Only used in gltf falloff mode, this defines the angle where
|
|
|
+ * the directional falloff will start before cutting at angle which could be seen
|
|
|
+ * as outer angle.
|
|
|
*/
|
|
|
- reflectionFresnel: boolean;
|
|
|
- protected _reflectionFalloffDistance: number;
|
|
|
/**
|
|
|
- * This helps specifying the falloff radius off the reflection texture from the sceneCenter.
|
|
|
- * This helps adding a nice falloff effect to the reflection if used as a mirror for instance.
|
|
|
- */
|
|
|
- reflectionFalloffDistance: number;
|
|
|
- protected _reflectionAmount: number;
|
|
|
+ * Only used in gltf falloff mode, this defines the angle where
|
|
|
+ * the directional falloff will start before cutting at angle which could be seen
|
|
|
+ * as outer angle.
|
|
|
+ */
|
|
|
+ innerAngle: number;
|
|
|
+ private _shadowAngleScale;
|
|
|
/**
|
|
|
- * This specifies the weight of the reflection against the background in case of reflection Fresnel.
|
|
|
+ * Allows scaling the angle of the light for shadow generation only.
|
|
|
*/
|
|
|
- reflectionAmount: number;
|
|
|
- protected _reflectionReflectance0: number;
|
|
|
/**
|
|
|
- * This specifies the weight of the reflection at grazing angle.
|
|
|
- */
|
|
|
- reflectionReflectance0: number;
|
|
|
- protected _reflectionReflectance90: number;
|
|
|
+ * Allows scaling the angle of the light for shadow generation only.
|
|
|
+ */
|
|
|
+ shadowAngleScale: number;
|
|
|
/**
|
|
|
- * This specifies the weight of the reflection at a perpendicular point of view.
|
|
|
+ * The light decay speed with the distance from the emission spot.
|
|
|
*/
|
|
|
- reflectionReflectance90: number;
|
|
|
+ exponent: number;
|
|
|
+ private _projectionTextureMatrix;
|
|
|
+ /**
|
|
|
+ * Allows reading the projecton texture
|
|
|
+ */
|
|
|
+ readonly projectionTextureMatrix: Matrix;
|
|
|
+ protected _projectionTextureLightNear: number;
|
|
|
+ /**
|
|
|
+ * Gets the near clip of the Spotlight for texture projection.
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * Sets the near clip of the Spotlight for texture projection.
|
|
|
+ */
|
|
|
+ projectionTextureLightNear: number;
|
|
|
+ protected _projectionTextureLightFar: number;
|
|
|
+ /**
|
|
|
+ * Gets the far clip of the Spotlight for texture projection.
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * Sets the far clip of the Spotlight for texture projection.
|
|
|
+ */
|
|
|
+ projectionTextureLightFar: number;
|
|
|
+ protected _projectionTextureUpDirection: Vector3;
|
|
|
+ /**
|
|
|
+ * Gets the Up vector of the Spotlight for texture projection.
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * Sets the Up vector of the Spotlight for texture projection.
|
|
|
+ */
|
|
|
+ projectionTextureUpDirection: Vector3;
|
|
|
+ private _projectionTexture;
|
|
|
+ /**
|
|
|
+ * Gets the projection texture of the light.
|
|
|
+ */
|
|
|
+ /**
|
|
|
+ * Sets the projection texture of the light.
|
|
|
+ */
|
|
|
+ projectionTexture: Nullable<BaseTexture>;
|
|
|
+ private _projectionTextureViewLightDirty;
|
|
|
+ private _projectionTextureProjectionLightDirty;
|
|
|
+ private _projectionTextureDirty;
|
|
|
+ private _projectionTextureViewTargetVector;
|
|
|
+ private _projectionTextureViewLightMatrix;
|
|
|
+ private _projectionTextureProjectionLightMatrix;
|
|
|
+ private _projectionTextureScalingMatrix;
|
|
|
+ /**
|
|
|
+ * Creates a SpotLight object in the scene. A spot light is a simply light oriented cone.
|
|
|
+ * It can cast shadows.
|
|
|
+ * Documentation : https://doc.babylonjs.com/babylon101/lights
|
|
|
+ * @param name The light friendly name
|
|
|
+ * @param position The position of the spot light in the scene
|
|
|
+ * @param direction The direction of the light in the scene
|
|
|
+ * @param angle The cone angle of the light in Radians
|
|
|
+ * @param exponent The light decay speed with the distance from the emission spot
|
|
|
+ * @param scene The scene the lights belongs to
|
|
|
+ */
|
|
|
+ constructor(name: string, position: Vector3, direction: Vector3, angle: number, exponent: number, scene: Scene);
|
|
|
+ /**
|
|
|
+ * Returns the string "SpotLight".
|
|
|
+ * @returns the class name
|
|
|
+ */
|
|
|
+ getClassName(): string;
|
|
|
+ /**
|
|
|
+ * Returns the integer 2.
|
|
|
+ * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
|
+ */
|
|
|
+ getTypeID(): number;
|
|
|
+ /**
|
|
|
+ * Overrides the direction setter to recompute the projection texture view light Matrix.
|
|
|
+ */
|
|
|
+ protected _setDirection(value: Vector3): void;
|
|
|
+ /**
|
|
|
+ * Overrides the position setter to recompute the projection texture view light Matrix.
|
|
|
+ */
|
|
|
+ protected _setPosition(value: Vector3): void;
|
|
|
+ /**
|
|
|
+ * Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.
|
|
|
+ * Returns the SpotLight.
|
|
|
+ */
|
|
|
+ protected _setDefaultShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void;
|
|
|
+ protected _computeProjectionTextureViewLightMatrix(): void;
|
|
|
+ protected _computeProjectionTextureProjectionLightMatrix(): void;
|
|
|
+ /**
|
|
|
+ * Main function for light texture projection matrix computing.
|
|
|
+ */
|
|
|
+ protected _computeProjectionTextureMatrix(): void;
|
|
|
+ protected _buildUniformLayout(): void;
|
|
|
+ private _computeAngleValues;
|
|
|
+ /**
|
|
|
+ * Sets the passed Effect object with the SpotLight transfomed position (or position if not parented) and normalized direction.
|
|
|
+ * @param effect The effect to update
|
|
|
+ * @param lightIndex The index of the light in the effect to update
|
|
|
+ * @returns The spot light
|
|
|
+ */
|
|
|
+ transferToEffect(effect: Effect, lightIndex: string): SpotLight;
|
|
|
+ /**
|
|
|
+ * Disposes the light and the associated resources.
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ /**
|
|
|
+ * Prepares the list of defines specific to the light type.
|
|
|
+ * @param defines the list of defines
|
|
|
+ * @param lightIndex defines the index of the light for the effect
|
|
|
+ */
|
|
|
+ prepareLightSpecificDefines(defines: any, lightIndex: number): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Gizmo that enables viewing a light
|
|
|
+ */
|
|
|
+ export class LightGizmo extends Gizmo {
|
|
|
+ private _lightMesh;
|
|
|
+ private _material;
|
|
|
+ /**
|
|
|
+ * Creates a LightGizmo
|
|
|
+ * @param gizmoLayer The utility layer the gizmo will be added to
|
|
|
+ */
|
|
|
+ constructor(gizmoLayer?: UtilityLayerRenderer);
|
|
|
+ private _light;
|
|
|
+ /**
|
|
|
+ * The light that the gizmo is attached to
|
|
|
+ */
|
|
|
+ light: Nullable<Light>;
|
|
|
+ /**
|
|
|
+ * @hidden
|
|
|
+ * Updates the gizmo to match the attached mesh's position/rotation
|
|
|
+ */
|
|
|
+ protected _update(): void;
|
|
|
+ private static _Scale;
|
|
|
+ /**
|
|
|
+ * Creates the lines for a light mesh
|
|
|
+ */
|
|
|
+ private static _createLightLines;
|
|
|
+ private static _CreateHemisphericLightMesh;
|
|
|
+ private static _CreatePointLightMesh;
|
|
|
+ private static _CreateSpotLightMesh;
|
|
|
+ private static _CreateDirectionalLightMesh;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var backgroundFragmentDeclaration: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var backgroundUboDeclaration: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var backgroundPixelShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var backgroundVertexDeclaration: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var backgroundVertexShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Background material used to create an efficient environement around your scene.
|
|
|
+ */
|
|
|
+ export class BackgroundMaterial extends PushMaterial {
|
|
|
+ /**
|
|
|
+ * Standard reflectance value at parallel view angle.
|
|
|
+ */
|
|
|
+ static StandardReflectance0: number;
|
|
|
+ /**
|
|
|
+ * Standard reflectance value at grazing angle.
|
|
|
+ */
|
|
|
+ static StandardReflectance90: number;
|
|
|
+ protected _primaryColor: Color3;
|
|
|
+ /**
|
|
|
+ * Key light Color (multiply against the environement texture)
|
|
|
+ */
|
|
|
+ primaryColor: Color3;
|
|
|
+ protected __perceptualColor: Nullable<Color3>;
|
|
|
+ /**
|
|
|
+ * Experimental Internal Use Only.
|
|
|
+ *
|
|
|
+ * Key light Color in "perceptual value" meaning the color you would like to see on screen.
|
|
|
+ * This acts as a helper to set the primary color to a more "human friendly" value.
|
|
|
+ * Conversion to linear space as well as exposure and tone mapping correction will be applied to keep the
|
|
|
+ * output color as close as possible from the chosen value.
|
|
|
+ * (This does not account for contrast color grading and color curves as they are considered post effect and not directly
|
|
|
+ * part of lighting setup.)
|
|
|
+ */
perceptualColor: Nullable<Color3>;
|
|
|
+ protected _primaryColorShadowLevel: float;
|
|
|
+ /**
|
|
|
+ * Defines the level of the shadows (dark area of the reflection map) in order to help scaling the colors.
|
|
|
+ * The color opposite to the primary color is used at the level chosen to define what the black area would look.
|
|
|
+ */
|
|
|
+ primaryColorShadowLevel: float;
|
|
|
+ protected _primaryColorHighlightLevel: float;
|
|
|
+ /**
|
|
|
+ * Defines the level of the highliights (highlight area of the reflection map) in order to help scaling the colors.
|
|
|
+ * The primary color is used at the level chosen to define what the white area would look.
|
|
|
+ */
|
|
|
+ primaryColorHighlightLevel: float;
|
|
|
+ protected _reflectionTexture: Nullable<BaseTexture>;
|
|
|
+ /**
|
|
|
+ * Reflection Texture used in the material.
|
|
|
+ * Should be author in a specific way for the best result (refer to the documentation).
|
|
|
+ */
|
|
|
+ reflectionTexture: Nullable<BaseTexture>;
|
|
|
+ protected _reflectionBlur: float;
|
|
|
+ /**
|
|
|
+ * Reflection Texture level of blur.
|
|
|
+ *
|
|
|
+ * Can be use to reuse an existing HDR Texture and target a specific LOD to prevent authoring the
|
|
|
+ * texture twice.
|
|
|
+ */
|
|
|
+ reflectionBlur: float;
|
|
|
+ protected _diffuseTexture: Nullable<BaseTexture>;
|
|
|
+ /**
|
|
|
+ * Diffuse Texture used in the material.
|
|
|
+ * Should be author in a specific way for the best result (refer to the documentation).
|
|
|
+ */
|
|
|
+ diffuseTexture: Nullable<BaseTexture>;
|
|
|
+ protected _shadowLights: Nullable<IShadowLight[]>;
|
|
|
+ /**
|
|
|
+ * Specify the list of lights casting shadow on the material.
|
|
|
+ * All scene shadow lights will be included if null.
|
|
|
+ */
|
|
|
+ shadowLights: Nullable<IShadowLight[]>;
|
|
|
+ protected _shadowLevel: float;
|
|
|
+ /**
|
|
|
+ * Helps adjusting the shadow to a softer level if required.
|
|
|
+ * 0 means black shadows and 1 means no shadows.
|
|
|
+ */
|
|
|
+ shadowLevel: float;
|
|
|
+ protected _sceneCenter: Vector3;
|
|
|
+ /**
|
|
|
+ * In case of opacity Fresnel or reflection falloff, this is use as a scene center.
|
|
|
+ * It is usually zero but might be interesting to modify according to your setup.
|
|
|
+ */
|
|
|
+ sceneCenter: Vector3;
|
|
|
+ protected _opacityFresnel: boolean;
|
|
|
+ /**
|
|
|
+ * This helps specifying that the material is falling off to the sky box at grazing angle.
|
|
|
+ * This helps ensuring a nice transition when the camera goes under the ground.
|
|
|
+ */
|
|
|
+ opacityFresnel: boolean;
|
|
|
+ protected _reflectionFresnel: boolean;
|
|
|
+ /**
|
|
|
+ * This helps specifying that the material is falling off from diffuse to the reflection texture at grazing angle.
|
|
|
+ * This helps adding a mirror texture on the ground.
|
|
|
+ */
|
|
|
+ reflectionFresnel: boolean;
|
|
|
+ protected _reflectionFalloffDistance: number;
|
|
|
+ /**
|
|
|
+ * This helps specifying the falloff radius off the reflection texture from the sceneCenter.
|
|
|
+ * This helps adding a nice falloff effect to the reflection if used as a mirror for instance.
|
|
|
+ */
|
|
|
+ reflectionFalloffDistance: number;
|
|
|
+ protected _reflectionAmount: number;
|
|
|
+ /**
|
|
|
+ * This specifies the weight of the reflection against the background in case of reflection Fresnel.
|
|
|
+ */
|
|
|
+ reflectionAmount: number;
|
|
|
+ protected _reflectionReflectance0: number;
|
|
|
+ /**
|
|
|
+ * This specifies the weight of the reflection at grazing angle.
|
|
|
+ */
|
|
|
+ reflectionReflectance0: number;
|
|
|
+ protected _reflectionReflectance90: number;
|
|
|
+ /**
|
|
|
+ * This specifies the weight of the reflection at a perpendicular point of view.
|
|
|
+ */
|
|
|
+ reflectionReflectance90: number;
|
|
|
/**
|
|
|
* Sets the reflection reflectance fresnel values according to the default standard
|
|
|
* empirically know to work well :-)
|
|
@@ -46234,112 +46528,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
- * A directional light is defined by a direction (what a surprise!).
|
|
|
- * The light is emitted from everywhere in the specified direction, and has an infinite range.
|
|
|
- * An example of a directional light is when a distance planet is lit by the apparently parallel lines of light from its sun. Light in a downward direction will light the top of an object.
|
|
|
- * Documentation: https://doc.babylonjs.com/babylon101/lights
|
|
|
- */
|
|
|
- export class DirectionalLight extends ShadowLight {
|
|
|
- private _shadowFrustumSize;
|
|
|
- /**
|
|
|
- * Fix frustum size for the shadow generation. This is disabled if the value is 0.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Specifies a fix frustum size for the shadow generation.
|
|
|
- */
|
|
|
- shadowFrustumSize: number;
|
|
|
- private _shadowOrthoScale;
|
|
|
- /**
|
|
|
- * Gets the shadow projection scale against the optimal computed one.
|
|
|
- * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
|
|
|
- * This does not impact in fixed frustum size (shadowFrustumSize being set)
|
|
|
- */
|
|
|
- /**
|
|
|
- * Sets the shadow projection scale against the optimal computed one.
|
|
|
- * 0.1 by default which means that the projection window is increase by 10% from the optimal size.
|
|
|
- * This does not impact in fixed frustum size (shadowFrustumSize being set)
|
|
|
- */
|
|
|
- shadowOrthoScale: number;
|
|
|
- /**
|
|
|
- * Automatically compute the projection matrix to best fit (including all the casters)
|
|
|
- * on each frame.
|
|
|
- */
|
|
|
- autoUpdateExtends: boolean;
|
|
|
- private _orthoLeft;
|
|
|
- private _orthoRight;
|
|
|
- private _orthoTop;
|
|
|
- private _orthoBottom;
|
|
|
- /**
|
|
|
- * Creates a DirectionalLight object in the scene, oriented towards the passed direction (Vector3).
|
|
|
- * The directional light is emitted from everywhere in the given direction.
|
|
|
- * It can cast shadows.
|
|
|
- * Documentation : https://doc.babylonjs.com/babylon101/lights
|
|
|
- * @param name The friendly name of the light
|
|
|
- * @param direction The direction of the light
|
|
|
- * @param scene The scene the light belongs to
|
|
|
- */
|
|
|
- constructor(name: string, direction: Vector3, scene: Scene);
|
|
|
- /**
|
|
|
- * Returns the string "DirectionalLight".
|
|
|
- * @return The class name
|
|
|
- */
|
|
|
- getClassName(): string;
|
|
|
- /**
|
|
|
- * Returns the integer 1.
|
|
|
- * @return The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
|
- */
|
|
|
- getTypeID(): number;
|
|
|
- /**
|
|
|
- * Sets the passed matrix "matrix" as projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
|
- * Returns the DirectionalLight Shadow projection matrix.
|
|
|
- */
|
|
|
- protected _setDefaultShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void;
|
|
|
- /**
|
|
|
- * Sets the passed matrix "matrix" as fixed frustum projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
|
- * Returns the DirectionalLight Shadow projection matrix.
|
|
|
- */
|
|
|
- protected _setDefaultFixedFrustumShadowProjectionMatrix(matrix: Matrix): void;
|
|
|
- /**
|
|
|
- * Sets the passed matrix "matrix" as auto extend projection matrix for the shadows cast by the light according to the passed view matrix.
|
|
|
- * Returns the DirectionalLight Shadow projection matrix.
|
|
|
- */
|
|
|
- protected _setDefaultAutoExtendShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void;
|
|
|
- protected _buildUniformLayout(): void;
|
|
|
- /**
|
|
|
- * Sets the passed Effect object with the DirectionalLight transformed position (or position if not parented) and the passed name.
|
|
|
- * @param effect The effect to update
|
|
|
- * @param lightIndex The index of the light in the effect to update
|
|
|
- * @returns The directional light
|
|
|
- */
|
|
|
- transferToEffect(effect: Effect, lightIndex: string): DirectionalLight;
|
|
|
- /**
|
|
|
- * Gets the minZ used for shadow according to both the scene and the light.
|
|
|
- *
|
|
|
- * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
|
|
|
- * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
|
|
|
- * @param activeCamera The camera we are returning the min for
|
|
|
- * @returns the depth min z
|
|
|
- */
|
|
|
- getDepthMinZ(activeCamera: Camera): number;
|
|
|
- /**
|
|
|
- * Gets the maxZ used for shadow according to both the scene and the light.
|
|
|
- *
|
|
|
- * Values are fixed on directional lights as it relies on an ortho projection hence the need to convert being
|
|
|
- * -1 and 1 to 0 and 1 doing (depth + min) / (min + max) -> (depth + 1) / (1 + 1) -> (depth * 0.5) + 0.5.
|
|
|
- * @param activeCamera The camera we are returning the max for
|
|
|
- * @returns the depth max z
|
|
|
- */
|
|
|
- getDepthMaxZ(activeCamera: Camera): number;
|
|
|
- /**
|
|
|
- * Prepares the list of defines specific to the light type.
|
|
|
- * @param defines the list of defines
|
|
|
- * @param lightIndex defines the index of the light for the effect
|
|
|
- */
|
|
|
- prepareLightSpecificDefines(defines: any, lightIndex: number): void;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
* A point light is a light defined by an unique point in world space.
|
|
|
* The light is emitted in every direction from this point.
|
|
|
* A good example of a point light is a standard light bulb.
|
|
@@ -46429,156 +46617,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
- * A spot light is defined by a position, a direction, an angle, and an exponent.
|
|
|
- * These values define a cone of light starting from the position, emitting toward the direction.
|
|
|
- * The angle, in radians, defines the size (field of illumination) of the spotlight's conical beam,
|
|
|
- * and the exponent defines the speed of the decay of the light with distance (reach).
|
|
|
- * Documentation: https://doc.babylonjs.com/babylon101/lights
|
|
|
- */
|
|
|
- export class SpotLight extends ShadowLight {
|
|
|
- private _angle;
|
|
|
- private _innerAngle;
|
|
|
- private _cosHalfAngle;
|
|
|
- private _lightAngleScale;
|
|
|
- private _lightAngleOffset;
|
|
|
- /**
|
|
|
- * Gets the cone angle of the spot light in Radians.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Sets the cone angle of the spot light in Radians.
|
|
|
- */
|
|
|
- angle: number;
|
|
|
- /**
|
|
|
- * Only used in gltf falloff mode, this defines the angle where
|
|
|
- * the directional falloff will start before cutting at angle which could be seen
|
|
|
- * as outer angle.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Only used in gltf falloff mode, this defines the angle where
|
|
|
- * the directional falloff will start before cutting at angle which could be seen
|
|
|
- * as outer angle.
|
|
|
- */
|
|
|
- innerAngle: number;
|
|
|
- private _shadowAngleScale;
|
|
|
- /**
|
|
|
- * Allows scaling the angle of the light for shadow generation only.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Allows scaling the angle of the light for shadow generation only.
|
|
|
- */
|
|
|
- shadowAngleScale: number;
|
|
|
- /**
|
|
|
- * The light decay speed with the distance from the emission spot.
|
|
|
- */
|
|
|
- exponent: number;
|
|
|
- private _projectionTextureMatrix;
|
|
|
- /**
|
|
|
- * Allows reading the projecton texture
|
|
|
- */
|
|
|
- readonly projectionTextureMatrix: Matrix;
|
|
|
- protected _projectionTextureLightNear: number;
|
|
|
- /**
|
|
|
- * Gets the near clip of the Spotlight for texture projection.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Sets the near clip of the Spotlight for texture projection.
|
|
|
- */
|
|
|
- projectionTextureLightNear: number;
|
|
|
- protected _projectionTextureLightFar: number;
|
|
|
- /**
|
|
|
- * Gets the far clip of the Spotlight for texture projection.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Sets the far clip of the Spotlight for texture projection.
|
|
|
- */
|
|
|
- projectionTextureLightFar: number;
|
|
|
- protected _projectionTextureUpDirection: Vector3;
|
|
|
- /**
|
|
|
- * Gets the Up vector of the Spotlight for texture projection.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Sets the Up vector of the Spotlight for texture projection.
|
|
|
- */
|
|
|
- projectionTextureUpDirection: Vector3;
|
|
|
- private _projectionTexture;
|
|
|
- /**
|
|
|
- * Gets the projection texture of the light.
|
|
|
- */
|
|
|
- /**
|
|
|
- * Sets the projection texture of the light.
|
|
|
- */
|
|
|
- projectionTexture: Nullable<BaseTexture>;
|
|
|
- private _projectionTextureViewLightDirty;
|
|
|
- private _projectionTextureProjectionLightDirty;
|
|
|
- private _projectionTextureDirty;
|
|
|
- private _projectionTextureViewTargetVector;
|
|
|
- private _projectionTextureViewLightMatrix;
|
|
|
- private _projectionTextureProjectionLightMatrix;
|
|
|
- private _projectionTextureScalingMatrix;
|
|
|
- /**
|
|
|
- * Creates a SpotLight object in the scene. A spot light is a simply light oriented cone.
|
|
|
- * It can cast shadows.
|
|
|
- * Documentation : https://doc.babylonjs.com/babylon101/lights
|
|
|
- * @param name The light friendly name
|
|
|
- * @param position The position of the spot light in the scene
|
|
|
- * @param direction The direction of the light in the scene
|
|
|
- * @param angle The cone angle of the light in Radians
|
|
|
- * @param exponent The light decay speed with the distance from the emission spot
|
|
|
- * @param scene The scene the lights belongs to
|
|
|
- */
|
|
|
- constructor(name: string, position: Vector3, direction: Vector3, angle: number, exponent: number, scene: Scene);
|
|
|
- /**
|
|
|
- * Returns the string "SpotLight".
|
|
|
- * @returns the class name
|
|
|
- */
|
|
|
- getClassName(): string;
|
|
|
- /**
|
|
|
- * Returns the integer 2.
|
|
|
- * @returns The light Type id as a constant defines in Light.LIGHTTYPEID_x
|
|
|
- */
|
|
|
- getTypeID(): number;
|
|
|
- /**
|
|
|
- * Overrides the direction setter to recompute the projection texture view light Matrix.
|
|
|
- */
|
|
|
- protected _setDirection(value: Vector3): void;
|
|
|
- /**
|
|
|
- * Overrides the position setter to recompute the projection texture view light Matrix.
|
|
|
- */
|
|
|
- protected _setPosition(value: Vector3): void;
|
|
|
- /**
|
|
|
- * Sets the passed matrix "matrix" as perspective projection matrix for the shadows and the passed view matrix with the fov equal to the SpotLight angle and and aspect ratio of 1.0.
|
|
|
- * Returns the SpotLight.
|
|
|
- */
|
|
|
- protected _setDefaultShadowProjectionMatrix(matrix: Matrix, viewMatrix: Matrix, renderList: Array<AbstractMesh>): void;
|
|
|
- protected _computeProjectionTextureViewLightMatrix(): void;
|
|
|
- protected _computeProjectionTextureProjectionLightMatrix(): void;
|
|
|
- /**
|
|
|
- * Main function for light texture projection matrix computing.
|
|
|
- */
|
|
|
- protected _computeProjectionTextureMatrix(): void;
|
|
|
- protected _buildUniformLayout(): void;
|
|
|
- private _computeAngleValues;
|
|
|
- /**
|
|
|
- * Sets the passed Effect object with the SpotLight transfomed position (or position if not parented) and normalized direction.
|
|
|
- * @param effect The effect to update
|
|
|
- * @param lightIndex The index of the light in the effect to update
|
|
|
- * @returns The spot light
|
|
|
- */
|
|
|
- transferToEffect(effect: Effect, lightIndex: string): SpotLight;
|
|
|
- /**
|
|
|
- * Disposes the light and the associated resources.
|
|
|
- */
|
|
|
- dispose(): void;
|
|
|
- /**
|
|
|
- * Prepares the list of defines specific to the light type.
|
|
|
- * @param defines the list of defines
|
|
|
- * @param lightIndex defines the index of the light for the effect
|
|
|
- */
|
|
|
- prepareLightSpecificDefines(defines: any, lightIndex: number): void;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
* Header information of HDR texture files.
|
|
|
*/
|
|
|
export interface HDRInfo {
|