|
@@ -597,56 +597,61 @@ declare module "babylonjs/Engines/constants" {
|
|
|
export class Constants {
|
|
|
/** Defines that alpha blending is disabled */
|
|
|
static readonly ALPHA_DISABLE: number;
|
|
|
- /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
|
|
|
+ /** Defines that alpha blending is SRC ALPHA * SRC + DEST */
|
|
|
static readonly ALPHA_ADD: number;
|
|
|
- /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
|
|
|
+ /** Defines that alpha blending is SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
|
|
|
static readonly ALPHA_COMBINE: number;
|
|
|
- /** Defines that alpha blending to DEST - SRC * DEST */
|
|
|
+ /** Defines that alpha blending is DEST - SRC * DEST */
|
|
|
static readonly ALPHA_SUBTRACT: number;
|
|
|
- /** Defines that alpha blending to SRC * DEST */
|
|
|
+ /** Defines that alpha blending is SRC * DEST */
|
|
|
static readonly ALPHA_MULTIPLY: number;
|
|
|
- /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
|
|
|
+ /** Defines that alpha blending is SRC ALPHA * SRC + (1 - SRC) * DEST */
|
|
|
static readonly ALPHA_MAXIMIZED: number;
|
|
|
- /** Defines that alpha blending to SRC + DEST */
|
|
|
+ /** Defines that alpha blending is SRC + DEST */
|
|
|
static readonly ALPHA_ONEONE: number;
|
|
|
- /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
|
|
|
+ /** Defines that alpha blending is SRC + (1 - SRC ALPHA) * DEST */
|
|
|
static readonly ALPHA_PREMULTIPLIED: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
|
|
|
+ * Defines that alpha blending is SRC + (1 - SRC ALPHA) * DEST
|
|
|
* Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
|
|
|
*/
|
|
|
static readonly ALPHA_PREMULTIPLIED_PORTERDUFF: number;
|
|
|
- /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
|
|
|
+ /** Defines that alpha blending is CST * SRC + (1 - CST) * DEST */
|
|
|
static readonly ALPHA_INTERPOLATE: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + (1 - SRC) * DEST
|
|
|
+ * Defines that alpha blending is SRC + (1 - SRC) * DEST
|
|
|
* Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
|
|
|
*/
|
|
|
static readonly ALPHA_SCREENMODE: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + DST
|
|
|
+ * Defines that alpha blending is SRC + DST
|
|
|
* Alpha will be set to SRC ALPHA + DST ALPHA
|
|
|
*/
|
|
|
static readonly ALPHA_ONEONE_ONEONE: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC * DST ALPHA + DST
|
|
|
+ * Defines that alpha blending is SRC * DST ALPHA + DST
|
|
|
* Alpha will be set to 0
|
|
|
*/
|
|
|
static readonly ALPHA_ALPHATOCOLOR: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC * (1 - DST) + DST * (1 - SRC)
|
|
|
+ * Defines that alpha blending is SRC * (1 - DST) + DST * (1 - SRC)
|
|
|
*/
|
|
|
static readonly ALPHA_REVERSEONEMINUS: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + DST * (1 - SRC ALPHA)
|
|
|
+ * Defines that alpha blending is SRC + DST * (1 - SRC ALPHA)
|
|
|
* Alpha will be set to SRC ALPHA + DST ALPHA * (1 - SRC ALPHA)
|
|
|
*/
|
|
|
static readonly ALPHA_SRC_DSTONEMINUSSRCALPHA: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + DST
|
|
|
+ * Defines that alpha blending is SRC + DST
|
|
|
* Alpha will be set to SRC ALPHA
|
|
|
*/
|
|
|
static readonly ALPHA_ONEONE_ONEZERO: number;
|
|
|
+ /**
|
|
|
+ * Defines that alpha blending is SRC * (1 - DST) + DST * (1 - SRC)
|
|
|
+ * Alpha will be set to DST ALPHA
|
|
|
+ */
|
|
|
+ static readonly ALPHA_EXCLUSION: number;
|
|
|
/** Defines that alpha blending equation a SUM */
|
|
|
static readonly ALPHA_EQUATION_ADD: number;
|
|
|
/** Defines that alpha blending equation a SUBSTRACTION */
|
|
@@ -30474,6 +30479,7 @@ declare module "babylonjs/Materials/effect" {
|
|
|
private _allFallbacksProcessed;
|
|
|
private _attributesNames;
|
|
|
private _attributes;
|
|
|
+ private _attributeLocationByName;
|
|
|
private _uniforms;
|
|
|
/**
|
|
|
* Key for the effect.
|
|
@@ -30611,7 +30617,7 @@ declare module "babylonjs/Materials/effect" {
|
|
|
* @param texture Texture to bind.
|
|
|
* @hidden
|
|
|
*/
|
|
|
- _bindTexture(channel: string, texture: InternalTexture): void;
|
|
|
+ _bindTexture(channel: string, texture: Nullable<InternalTexture>): void;
|
|
|
/**
|
|
|
* Sets a texture on the engine to be used in the shader.
|
|
|
* @param channel Name of the sampler variable.
|
|
@@ -31098,30 +31104,37 @@ declare module "babylonjs/Engines/instancingAttributeInfo" {
|
|
|
*/
|
|
|
export interface InstancingAttributeInfo {
|
|
|
/**
|
|
|
+ * Name of the GLSL attribute
|
|
|
+ * if attribute index is not specified, this is used to retrieve the index from the effect
|
|
|
+ */
|
|
|
+ attributeName: string;
|
|
|
+ /**
|
|
|
* Index/offset of the attribute in the vertex shader
|
|
|
+ * if not specified, this will be computes from the name.
|
|
|
*/
|
|
|
- index: number;
|
|
|
+ index?: number;
|
|
|
/**
|
|
|
* size of the attribute, 1, 2, 3 or 4
|
|
|
*/
|
|
|
attributeSize: number;
|
|
|
/**
|
|
|
- * type of the attribute, gl.BYTE, gl.UNSIGNED_BYTE, gl.SHORT, gl.UNSIGNED_SHORT, gl.FIXED, gl.FLOAT.
|
|
|
- * default is FLOAT
|
|
|
+ * Offset of the data in the Vertex Buffer acting as the instancing buffer
|
|
|
*/
|
|
|
- attributeType: number;
|
|
|
+ offset: number;
|
|
|
/**
|
|
|
- * normalization of fixed-point data. behavior unclear, use FALSE, default is FALSE
|
|
|
+ * Modifies the rate at which generic vertex attributes advance when rendering multiple instances
|
|
|
+ * default to 1
|
|
|
*/
|
|
|
- normalized: boolean;
|
|
|
+ divisor?: number;
|
|
|
/**
|
|
|
- * Offset of the data in the Vertex Buffer acting as the instancing buffer
|
|
|
+ * type of the attribute, gl.BYTE, gl.UNSIGNED_BYTE, gl.SHORT, gl.UNSIGNED_SHORT, gl.FIXED, gl.FLOAT.
|
|
|
+ * default is FLOAT
|
|
|
*/
|
|
|
- offset: number;
|
|
|
+ attributeType?: number;
|
|
|
/**
|
|
|
- * Name of the GLSL attribute, for debugging purpose only
|
|
|
+ * normalization of fixed-point data. behavior unclear, use FALSE, default is FALSE
|
|
|
*/
|
|
|
- attributeName: string;
|
|
|
+ normalized?: boolean;
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Engines/Extensions/engine.videoTexture" {
|
|
@@ -31462,7 +31475,6 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
/** @hidden */
|
|
|
_caps: EngineCapabilities;
|
|
|
private _isStencilEnable;
|
|
|
- protected _colorWrite: boolean;
|
|
|
private _glVersion;
|
|
|
private _glRenderer;
|
|
|
private _glVendor;
|
|
@@ -31493,11 +31505,19 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
*/
|
|
|
disableVertexArrayObjects: boolean;
|
|
|
/** @hidden */
|
|
|
+ protected _colorWrite: boolean;
|
|
|
+ /** @hidden */
|
|
|
+ protected _colorWriteChanged: boolean;
|
|
|
+ /** @hidden */
|
|
|
protected _depthCullingState: DepthCullingState;
|
|
|
/** @hidden */
|
|
|
protected _stencilState: StencilState;
|
|
|
/** @hidden */
|
|
|
- protected _alphaState: AlphaState;
|
|
|
+ _alphaState: AlphaState;
|
|
|
+ /** @hidden */
|
|
|
+ _alphaMode: number;
|
|
|
+ /** @hidden */
|
|
|
+ _alphaEquation: number;
|
|
|
/** @hidden */
|
|
|
_internalTexturesCache: InternalTexture[];
|
|
|
/** @hidden */
|
|
@@ -31596,7 +31616,7 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
* @param options defines further options to be sent to the getContext() function
|
|
|
* @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
|
|
|
*/
|
|
|
- constructor(canvasOrContext: Nullable<HTMLCanvasElement | WebGLRenderingContext>, antialias?: boolean, options?: EngineOptions, adaptToDeviceRatio?: boolean);
|
|
|
+ constructor(canvasOrContext: Nullable<HTMLCanvasElement | WebGLRenderingContext | WebGL2RenderingContext>, antialias?: boolean, options?: EngineOptions, adaptToDeviceRatio?: boolean);
|
|
|
private _rebuildInternalTextures;
|
|
|
private _rebuildEffects;
|
|
|
/**
|
|
@@ -31857,9 +31877,27 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
*/
|
|
|
updateAndBindInstancesBuffer(instancesBuffer: DataBuffer, data: Float32Array, offsetLocations: number[] | InstancingAttributeInfo[]): void;
|
|
|
/**
|
|
|
- * Apply all cached states (depth, culling, stencil and alpha)
|
|
|
+ * Bind the content of a webGL buffer used with instanciation
|
|
|
+ * @param instancesBuffer defines the webGL buffer to bind
|
|
|
+ * @param attributesInfo defines the offsets or attributes information used to determine where data must be stored in the buffer
|
|
|
+ * @param computeStride defines Wether to compute the strides from the info or use the default 0
|
|
|
*/
|
|
|
- applyStates(): void;
|
|
|
+ bindInstancesBuffer(instancesBuffer: DataBuffer, attributesInfo: InstancingAttributeInfo[], computeStride?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Disable the instance attribute corresponding to the name in parameter
|
|
|
+ * @param name defines the name of the attribute to disable
|
|
|
+ */
|
|
|
+ disableInstanceAttributeByName(name: string): void;
|
|
|
+ /**
|
|
|
+ * Disable the instance attribute corresponding to the location in parameter
|
|
|
+ * @param attributeLocation defines the attribute location of the attribute to disable
|
|
|
+ */
|
|
|
+ disableInstanceAttribute(attributeLocation: number): void;
|
|
|
+ /**
|
|
|
+ * Disable the attribute corresponding to the location in parameter
|
|
|
+ * @param attributeLocation defines the attribute location of the attribute to disable
|
|
|
+ */
|
|
|
+ disableAttributeByIndex(attributeLocation: number): void;
|
|
|
/**
|
|
|
* Send a draw order
|
|
|
* @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
|
|
@@ -32079,6 +32117,20 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
*/
|
|
|
setFloat4(uniform: Nullable<WebGLUniformLocation>, x: number, y: number, z: number, w: number): void;
|
|
|
/**
|
|
|
+ * Apply all cached states (depth, culling, stencil and alpha)
|
|
|
+ */
|
|
|
+ applyStates(): void;
|
|
|
+ /**
|
|
|
+ * Enable or disable color writing
|
|
|
+ * @param enable defines the state to set
|
|
|
+ */
|
|
|
+ setColorWrite(enable: boolean): void;
|
|
|
+ /**
|
|
|
+ * Gets a boolean indicating if color writing is enabled
|
|
|
+ * @returns the current color writing state
|
|
|
+ */
|
|
|
+ getColorWrite(): boolean;
|
|
|
+ /**
|
|
|
* Gets the depth culling state manager
|
|
|
*/
|
|
|
readonly depthCullingState: DepthCullingState;
|
|
@@ -32202,12 +32254,22 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
_unpackFlipY(value: boolean): void;
|
|
|
/** @hidden */
|
|
|
_getUnpackAlignement(): number;
|
|
|
+ private _getTextureTarget;
|
|
|
/**
|
|
|
* Update the sampling mode of a given texture
|
|
|
* @param samplingMode defines the required sampling mode
|
|
|
* @param texture defines the texture to update
|
|
|
+ * @param generateMipMaps defines whether to generate mipmaps for the texture
|
|
|
*/
|
|
|
- updateTextureSamplingMode(samplingMode: number, texture: InternalTexture): void;
|
|
|
+ updateTextureSamplingMode(samplingMode: number, texture: InternalTexture, generateMipMaps?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Update the sampling mode of a given texture
|
|
|
+ * @param texture defines the texture to update
|
|
|
+ * @param wrapU defines the texture wrap mode of the u coordinates
|
|
|
+ * @param wrapV defines the texture wrap mode of the v coordinates
|
|
|
+ * @param wrapR defines the texture wrap mode of the r coordinates
|
|
|
+ */
|
|
|
+ updateTextureWrappingMode(texture: InternalTexture, wrapU: Nullable<number>, wrapV?: Nullable<number>, wrapR?: Nullable<number>): void;
|
|
|
/** @hidden */
|
|
|
_setupDepthStencilTexture(internalTexture: InternalTexture, size: number | {
|
|
|
width: number;
|
|
@@ -32223,6 +32285,7 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
private _prepareWebGLTexture;
|
|
|
/** @hidden */
|
|
|
_setupFramebufferDepthAttachments(generateStencilBuffer: boolean, generateDepthBuffer: boolean, width: number, height: number, samples?: number): Nullable<WebGLRenderbuffer>;
|
|
|
+ private _getDepthStencilBuffer;
|
|
|
/** @hidden */
|
|
|
_releaseFramebufferObjects(texture: InternalTexture): void;
|
|
|
/** @hidden */
|
|
@@ -32309,6 +32372,16 @@ declare module "babylonjs/Engines/thinEngine" {
|
|
|
/** @hidden */
|
|
|
_loadFile(url: string, onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void, onProgress?: (data: any) => void, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: (request?: IWebRequest, exception?: any) => void): IFileRequest;
|
|
|
/**
|
|
|
+ * Reads pixels from the current frame buffer. Please note that this function can be slow
|
|
|
+ * @param x defines the x coordinate of the rectangle where pixels must be read
|
|
|
+ * @param y defines the y coordinate of the rectangle where pixels must be read
|
|
|
+ * @param width defines the width of the rectangle where pixels must be read
|
|
|
+ * @param height defines the height of the rectangle where pixels must be read
|
|
|
+ * @param hasAlpha defines wether the output should have alpha or not (defaults to true)
|
|
|
+ * @returns a Uint8Array containing RGBA colors
|
|
|
+ */
|
|
|
+ readPixels(x: number, y: number, width: number, height: number, hasAlpha?: boolean): Uint8Array;
|
|
|
+ /**
|
|
|
* Gets a boolean indicating if the engine can be instanciated (ie. if a webGL context can be found)
|
|
|
* @returns true if the engine can be created
|
|
|
* @ignorenaming
|
|
@@ -33333,6 +33406,43 @@ declare module "babylonjs/Misc/perfCounter" {
|
|
|
private _lastSecValueCount;
|
|
|
}
|
|
|
}
|
|
|
+declare module "babylonjs/Engines/Extensions/engine.alpha" {
|
|
|
+ module "babylonjs/Engines/thinEngine" {
|
|
|
+ interface ThinEngine {
|
|
|
+ /**
|
|
|
+ * Sets alpha constants used by some alpha blending modes
|
|
|
+ * @param r defines the red component
|
|
|
+ * @param g defines the green component
|
|
|
+ * @param b defines the blue component
|
|
|
+ * @param a defines the alpha component
|
|
|
+ */
|
|
|
+ setAlphaConstants(r: number, g: number, b: number, a: number): void;
|
|
|
+ /**
|
|
|
+ * Sets the current alpha mode
|
|
|
+ * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
|
|
|
+ * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
|
|
|
+ * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
|
|
|
+ */
|
|
|
+ setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Gets the current alpha mode
|
|
|
+ * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
|
|
|
+ * @returns the current alpha mode
|
|
|
+ */
|
|
|
+ getAlphaMode(): number;
|
|
|
+ /**
|
|
|
+ * Sets the current alpha equation
|
|
|
+ * @param equation defines the equation to use (one of the Engine.ALPHA_EQUATION_XXX)
|
|
|
+ */
|
|
|
+ setAlphaEquation(equation: number): void;
|
|
|
+ /**
|
|
|
+ * Gets the current alpha equation.
|
|
|
+ * @returns the current alpha equation
|
|
|
+ */
|
|
|
+ getAlphaEquation(): number;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs/Engines/engine" {
|
|
|
import { Observable } from "babylonjs/Misc/observable";
|
|
|
import { Nullable, IndicesArray, DataArray } from "babylonjs/types";
|
|
@@ -33350,6 +33460,7 @@ declare module "babylonjs/Engines/engine" {
|
|
|
import { PerformanceMonitor } from "babylonjs/Misc/performanceMonitor";
|
|
|
import { DataBuffer } from "babylonjs/Meshes/dataBuffer";
|
|
|
import { PerfCounter } from "babylonjs/Misc/perfCounter";
|
|
|
+ import "babylonjs/Engines/Extensions/engine.alpha";
|
|
|
import { Material } from "babylonjs/Materials/material";
|
|
|
import { PostProcess } from "babylonjs/PostProcesses/postProcess";
|
|
|
/**
|
|
@@ -33677,10 +33788,6 @@ declare module "babylonjs/Engines/engine" {
|
|
|
private _pointerLockRequested;
|
|
|
private _dummyFramebuffer;
|
|
|
private _rescalePostProcess;
|
|
|
- /** @hidden */
|
|
|
- protected _alphaMode: number;
|
|
|
- /** @hidden */
|
|
|
- protected _alphaEquation: number;
|
|
|
private _deterministicLockstep;
|
|
|
private _lockstepMaxSteps;
|
|
|
private _timeStep;
|
|
@@ -33799,47 +33906,6 @@ declare module "babylonjs/Engines/engine" {
|
|
|
*/
|
|
|
setDepthWrite(enable: boolean): void;
|
|
|
/**
|
|
|
- * Enable or disable color writing
|
|
|
- * @param enable defines the state to set
|
|
|
- */
|
|
|
- setColorWrite(enable: boolean): void;
|
|
|
- /**
|
|
|
- * Gets a boolean indicating if color writing is enabled
|
|
|
- * @returns the current color writing state
|
|
|
- */
|
|
|
- getColorWrite(): boolean;
|
|
|
- /**
|
|
|
- * Sets alpha constants used by some alpha blending modes
|
|
|
- * @param r defines the red component
|
|
|
- * @param g defines the green component
|
|
|
- * @param b defines the blue component
|
|
|
- * @param a defines the alpha component
|
|
|
- */
|
|
|
- setAlphaConstants(r: number, g: number, b: number, a: number): void;
|
|
|
- /**
|
|
|
- * Sets the current alpha mode
|
|
|
- * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
|
|
|
- * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
|
|
|
- * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
|
|
|
- */
|
|
|
- setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
|
|
|
- /**
|
|
|
- * Gets the current alpha mode
|
|
|
- * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
|
|
|
- * @returns the current alpha mode
|
|
|
- */
|
|
|
- getAlphaMode(): number;
|
|
|
- /**
|
|
|
- * Sets the current alpha equation
|
|
|
- * @param equation defines the equation to use (one of the Engine.ALPHA_EQUATION_XXX)
|
|
|
- */
|
|
|
- setAlphaEquation(equation: number): void;
|
|
|
- /**
|
|
|
- * Gets the current alpha equation.
|
|
|
- * @returns the current alpha equation
|
|
|
- */
|
|
|
- getAlphaEquation(): number;
|
|
|
- /**
|
|
|
* Gets a boolean indicating if stencil buffer is enabled
|
|
|
* @returns the current stencil buffer state
|
|
|
*/
|
|
@@ -34041,15 +34107,6 @@ declare module "babylonjs/Engines/engine" {
|
|
|
*/
|
|
|
getFragmentShaderSource(program: WebGLProgram): Nullable<string>;
|
|
|
/**
|
|
|
- * Reads pixels from the current frame buffer. Please note that this function can be slow
|
|
|
- * @param x defines the x coordinate of the rectangle where pixels must be read
|
|
|
- * @param y defines the y coordinate of the rectangle where pixels must be read
|
|
|
- * @param width defines the width of the rectangle where pixels must be read
|
|
|
- * @param height defines the height of the rectangle where pixels must be read
|
|
|
- * @returns a Uint8Array containing RGBA colors
|
|
|
- */
|
|
|
- readPixels(x: number, y: number, width: number, height: number): Uint8Array;
|
|
|
- /**
|
|
|
* Sets a depth stencil texture from a render target to the according uniform.
|
|
|
* @param channel The texture channel
|
|
|
* @param uniform The uniform to set
|
|
@@ -44458,6 +44515,13 @@ declare module "babylonjs/Cameras/XR/webXRControllerTeleportation" {
|
|
|
private _tmpRay;
|
|
|
private _tmpVector;
|
|
|
/**
|
|
|
+ * when set to true (default) teleportation will wait for thumbstick changes.
|
|
|
+ * When set to false teleportation will be disabled.
|
|
|
+ *
|
|
|
+ * If set to false while teleporting results can be unexpected.
|
|
|
+ */
|
|
|
+ enabled: boolean;
|
|
|
+ /**
|
|
|
* Creates a WebXRControllerTeleportation
|
|
|
* @param input input manager to add teleportation to
|
|
|
* @param floorMeshes floormeshes which can be teleported to
|
|
@@ -47227,6 +47291,7 @@ declare module "babylonjs/Engines/Extensions/engine.views" {
|
|
|
}
|
|
|
}
|
|
|
declare module "babylonjs/Engines/Extensions/index" {
|
|
|
+ export * from "babylonjs/Engines/Extensions/engine.alpha";
|
|
|
export * from "babylonjs/Engines/Extensions/engine.occlusionQuery";
|
|
|
export * from "babylonjs/Engines/Extensions/engine.transformFeedback";
|
|
|
export * from "babylonjs/Engines/Extensions/engine.multiview";
|
|
@@ -69923,56 +69988,61 @@ declare module BABYLON {
|
|
|
export class Constants {
|
|
|
/** Defines that alpha blending is disabled */
|
|
|
static readonly ALPHA_DISABLE: number;
|
|
|
- /** Defines that alpha blending to SRC ALPHA * SRC + DEST */
|
|
|
+ /** Defines that alpha blending is SRC ALPHA * SRC + DEST */
|
|
|
static readonly ALPHA_ADD: number;
|
|
|
- /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
|
|
|
+ /** Defines that alpha blending is SRC ALPHA * SRC + (1 - SRC ALPHA) * DEST */
|
|
|
static readonly ALPHA_COMBINE: number;
|
|
|
- /** Defines that alpha blending to DEST - SRC * DEST */
|
|
|
+ /** Defines that alpha blending is DEST - SRC * DEST */
|
|
|
static readonly ALPHA_SUBTRACT: number;
|
|
|
- /** Defines that alpha blending to SRC * DEST */
|
|
|
+ /** Defines that alpha blending is SRC * DEST */
|
|
|
static readonly ALPHA_MULTIPLY: number;
|
|
|
- /** Defines that alpha blending to SRC ALPHA * SRC + (1 - SRC) * DEST */
|
|
|
+ /** Defines that alpha blending is SRC ALPHA * SRC + (1 - SRC) * DEST */
|
|
|
static readonly ALPHA_MAXIMIZED: number;
|
|
|
- /** Defines that alpha blending to SRC + DEST */
|
|
|
+ /** Defines that alpha blending is SRC + DEST */
|
|
|
static readonly ALPHA_ONEONE: number;
|
|
|
- /** Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST */
|
|
|
+ /** Defines that alpha blending is SRC + (1 - SRC ALPHA) * DEST */
|
|
|
static readonly ALPHA_PREMULTIPLIED: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + (1 - SRC ALPHA) * DEST
|
|
|
+ * Defines that alpha blending is SRC + (1 - SRC ALPHA) * DEST
|
|
|
* Alpha will be set to (1 - SRC ALPHA) * DEST ALPHA
|
|
|
*/
|
|
|
static readonly ALPHA_PREMULTIPLIED_PORTERDUFF: number;
|
|
|
- /** Defines that alpha blending to CST * SRC + (1 - CST) * DEST */
|
|
|
+ /** Defines that alpha blending is CST * SRC + (1 - CST) * DEST */
|
|
|
static readonly ALPHA_INTERPOLATE: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + (1 - SRC) * DEST
|
|
|
+ * Defines that alpha blending is SRC + (1 - SRC) * DEST
|
|
|
* Alpha will be set to SRC ALPHA + (1 - SRC ALPHA) * DEST ALPHA
|
|
|
*/
|
|
|
static readonly ALPHA_SCREENMODE: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + DST
|
|
|
+ * Defines that alpha blending is SRC + DST
|
|
|
* Alpha will be set to SRC ALPHA + DST ALPHA
|
|
|
*/
|
|
|
static readonly ALPHA_ONEONE_ONEONE: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC * DST ALPHA + DST
|
|
|
+ * Defines that alpha blending is SRC * DST ALPHA + DST
|
|
|
* Alpha will be set to 0
|
|
|
*/
|
|
|
static readonly ALPHA_ALPHATOCOLOR: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC * (1 - DST) + DST * (1 - SRC)
|
|
|
+ * Defines that alpha blending is SRC * (1 - DST) + DST * (1 - SRC)
|
|
|
*/
|
|
|
static readonly ALPHA_REVERSEONEMINUS: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + DST * (1 - SRC ALPHA)
|
|
|
+ * Defines that alpha blending is SRC + DST * (1 - SRC ALPHA)
|
|
|
* Alpha will be set to SRC ALPHA + DST ALPHA * (1 - SRC ALPHA)
|
|
|
*/
|
|
|
static readonly ALPHA_SRC_DSTONEMINUSSRCALPHA: number;
|
|
|
/**
|
|
|
- * Defines that alpha blending to SRC + DST
|
|
|
+ * Defines that alpha blending is SRC + DST
|
|
|
* Alpha will be set to SRC ALPHA
|
|
|
*/
|
|
|
static readonly ALPHA_ONEONE_ONEZERO: number;
|
|
|
+ /**
|
|
|
+ * Defines that alpha blending is SRC * (1 - DST) + DST * (1 - SRC)
|
|
|
+ * Alpha will be set to DST ALPHA
|
|
|
+ */
|
|
|
+ static readonly ALPHA_EXCLUSION: number;
|
|
|
/** Defines that alpha blending equation a SUM */
|
|
|
static readonly ALPHA_EQUATION_ADD: number;
|
|
|
/** Defines that alpha blending equation a SUBSTRACTION */
|
|
@@ -98887,6 +98957,7 @@ declare module BABYLON {
|
|
|
private _allFallbacksProcessed;
|
|
|
private _attributesNames;
|
|
|
private _attributes;
|
|
|
+ private _attributeLocationByName;
|
|
|
private _uniforms;
|
|
|
/**
|
|
|
* Key for the effect.
|
|
@@ -99024,7 +99095,7 @@ declare module BABYLON {
|
|
|
* @param texture Texture to bind.
|
|
|
* @hidden
|
|
|
*/
|
|
|
- _bindTexture(channel: string, texture: InternalTexture): void;
|
|
|
+ _bindTexture(channel: string, texture: Nullable<InternalTexture>): void;
|
|
|
/**
|
|
|
* Sets a texture on the engine to be used in the shader.
|
|
|
* @param channel Name of the sampler variable.
|
|
@@ -99509,30 +99580,37 @@ declare module BABYLON {
|
|
|
*/
|
|
|
export interface InstancingAttributeInfo {
|
|
|
/**
|
|
|
+ * Name of the GLSL attribute
|
|
|
+ * if attribute index is not specified, this is used to retrieve the index from the effect
|
|
|
+ */
|
|
|
+ attributeName: string;
|
|
|
+ /**
|
|
|
* Index/offset of the attribute in the vertex shader
|
|
|
+ * if not specified, this will be computes from the name.
|
|
|
*/
|
|
|
- index: number;
|
|
|
+ index?: number;
|
|
|
/**
|
|
|
* size of the attribute, 1, 2, 3 or 4
|
|
|
*/
|
|
|
attributeSize: number;
|
|
|
/**
|
|
|
- * type of the attribute, gl.BYTE, gl.UNSIGNED_BYTE, gl.SHORT, gl.UNSIGNED_SHORT, gl.FIXED, gl.FLOAT.
|
|
|
- * default is FLOAT
|
|
|
+ * Offset of the data in the Vertex Buffer acting as the instancing buffer
|
|
|
*/
|
|
|
- attributeType: number;
|
|
|
+ offset: number;
|
|
|
/**
|
|
|
- * normalization of fixed-point data. behavior unclear, use FALSE, default is FALSE
|
|
|
+ * Modifies the rate at which generic vertex attributes advance when rendering multiple instances
|
|
|
+ * default to 1
|
|
|
*/
|
|
|
- normalized: boolean;
|
|
|
+ divisor?: number;
|
|
|
/**
|
|
|
- * Offset of the data in the Vertex Buffer acting as the instancing buffer
|
|
|
+ * type of the attribute, gl.BYTE, gl.UNSIGNED_BYTE, gl.SHORT, gl.UNSIGNED_SHORT, gl.FIXED, gl.FLOAT.
|
|
|
+ * default is FLOAT
|
|
|
*/
|
|
|
- offset: number;
|
|
|
+ attributeType?: number;
|
|
|
/**
|
|
|
- * Name of the GLSL attribute, for debugging purpose only
|
|
|
+ * normalization of fixed-point data. behavior unclear, use FALSE, default is FALSE
|
|
|
*/
|
|
|
- attributeName: string;
|
|
|
+ normalized?: boolean;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -99842,7 +99920,6 @@ declare module BABYLON {
|
|
|
/** @hidden */
|
|
|
_caps: EngineCapabilities;
|
|
|
private _isStencilEnable;
|
|
|
- protected _colorWrite: boolean;
|
|
|
private _glVersion;
|
|
|
private _glRenderer;
|
|
|
private _glVendor;
|
|
@@ -99873,11 +99950,19 @@ declare module BABYLON {
|
|
|
*/
|
|
|
disableVertexArrayObjects: boolean;
|
|
|
/** @hidden */
|
|
|
+ protected _colorWrite: boolean;
|
|
|
+ /** @hidden */
|
|
|
+ protected _colorWriteChanged: boolean;
|
|
|
+ /** @hidden */
|
|
|
protected _depthCullingState: DepthCullingState;
|
|
|
/** @hidden */
|
|
|
protected _stencilState: StencilState;
|
|
|
/** @hidden */
|
|
|
- protected _alphaState: AlphaState;
|
|
|
+ _alphaState: AlphaState;
|
|
|
+ /** @hidden */
|
|
|
+ _alphaMode: number;
|
|
|
+ /** @hidden */
|
|
|
+ _alphaEquation: number;
|
|
|
/** @hidden */
|
|
|
_internalTexturesCache: InternalTexture[];
|
|
|
/** @hidden */
|
|
@@ -99976,7 +100061,7 @@ declare module BABYLON {
|
|
|
* @param options defines further options to be sent to the getContext() function
|
|
|
* @param adaptToDeviceRatio defines whether to adapt to the device's viewport characteristics (default: false)
|
|
|
*/
|
|
|
- constructor(canvasOrContext: Nullable<HTMLCanvasElement | WebGLRenderingContext>, antialias?: boolean, options?: EngineOptions, adaptToDeviceRatio?: boolean);
|
|
|
+ constructor(canvasOrContext: Nullable<HTMLCanvasElement | WebGLRenderingContext | WebGL2RenderingContext>, antialias?: boolean, options?: EngineOptions, adaptToDeviceRatio?: boolean);
|
|
|
private _rebuildInternalTextures;
|
|
|
private _rebuildEffects;
|
|
|
/**
|
|
@@ -100237,9 +100322,27 @@ declare module BABYLON {
|
|
|
*/
|
|
|
updateAndBindInstancesBuffer(instancesBuffer: DataBuffer, data: Float32Array, offsetLocations: number[] | InstancingAttributeInfo[]): void;
|
|
|
/**
|
|
|
- * Apply all cached states (depth, culling, stencil and alpha)
|
|
|
+ * Bind the content of a webGL buffer used with instanciation
|
|
|
+ * @param instancesBuffer defines the webGL buffer to bind
|
|
|
+ * @param attributesInfo defines the offsets or attributes information used to determine where data must be stored in the buffer
|
|
|
+ * @param computeStride defines Wether to compute the strides from the info or use the default 0
|
|
|
*/
|
|
|
- applyStates(): void;
|
|
|
+ bindInstancesBuffer(instancesBuffer: DataBuffer, attributesInfo: InstancingAttributeInfo[], computeStride?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Disable the instance attribute corresponding to the name in parameter
|
|
|
+ * @param name defines the name of the attribute to disable
|
|
|
+ */
|
|
|
+ disableInstanceAttributeByName(name: string): void;
|
|
|
+ /**
|
|
|
+ * Disable the instance attribute corresponding to the location in parameter
|
|
|
+ * @param attributeLocation defines the attribute location of the attribute to disable
|
|
|
+ */
|
|
|
+ disableInstanceAttribute(attributeLocation: number): void;
|
|
|
+ /**
|
|
|
+ * Disable the attribute corresponding to the location in parameter
|
|
|
+ * @param attributeLocation defines the attribute location of the attribute to disable
|
|
|
+ */
|
|
|
+ disableAttributeByIndex(attributeLocation: number): void;
|
|
|
/**
|
|
|
* Send a draw order
|
|
|
* @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
|
|
@@ -100459,6 +100562,20 @@ declare module BABYLON {
|
|
|
*/
|
|
|
setFloat4(uniform: Nullable<WebGLUniformLocation>, x: number, y: number, z: number, w: number): void;
|
|
|
/**
|
|
|
+ * Apply all cached states (depth, culling, stencil and alpha)
|
|
|
+ */
|
|
|
+ applyStates(): void;
|
|
|
+ /**
|
|
|
+ * Enable or disable color writing
|
|
|
+ * @param enable defines the state to set
|
|
|
+ */
|
|
|
+ setColorWrite(enable: boolean): void;
|
|
|
+ /**
|
|
|
+ * Gets a boolean indicating if color writing is enabled
|
|
|
+ * @returns the current color writing state
|
|
|
+ */
|
|
|
+ getColorWrite(): boolean;
|
|
|
+ /**
|
|
|
* Gets the depth culling state manager
|
|
|
*/
|
|
|
readonly depthCullingState: DepthCullingState;
|
|
@@ -100582,12 +100699,22 @@ declare module BABYLON {
|
|
|
_unpackFlipY(value: boolean): void;
|
|
|
/** @hidden */
|
|
|
_getUnpackAlignement(): number;
|
|
|
+ private _getTextureTarget;
|
|
|
/**
|
|
|
* Update the sampling mode of a given texture
|
|
|
* @param samplingMode defines the required sampling mode
|
|
|
* @param texture defines the texture to update
|
|
|
+ * @param generateMipMaps defines whether to generate mipmaps for the texture
|
|
|
*/
|
|
|
- updateTextureSamplingMode(samplingMode: number, texture: InternalTexture): void;
|
|
|
+ updateTextureSamplingMode(samplingMode: number, texture: InternalTexture, generateMipMaps?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Update the sampling mode of a given texture
|
|
|
+ * @param texture defines the texture to update
|
|
|
+ * @param wrapU defines the texture wrap mode of the u coordinates
|
|
|
+ * @param wrapV defines the texture wrap mode of the v coordinates
|
|
|
+ * @param wrapR defines the texture wrap mode of the r coordinates
|
|
|
+ */
|
|
|
+ updateTextureWrappingMode(texture: InternalTexture, wrapU: Nullable<number>, wrapV?: Nullable<number>, wrapR?: Nullable<number>): void;
|
|
|
/** @hidden */
|
|
|
_setupDepthStencilTexture(internalTexture: InternalTexture, size: number | {
|
|
|
width: number;
|
|
@@ -100603,6 +100730,7 @@ declare module BABYLON {
|
|
|
private _prepareWebGLTexture;
|
|
|
/** @hidden */
|
|
|
_setupFramebufferDepthAttachments(generateStencilBuffer: boolean, generateDepthBuffer: boolean, width: number, height: number, samples?: number): Nullable<WebGLRenderbuffer>;
|
|
|
+ private _getDepthStencilBuffer;
|
|
|
/** @hidden */
|
|
|
_releaseFramebufferObjects(texture: InternalTexture): void;
|
|
|
/** @hidden */
|
|
@@ -100689,6 +100817,16 @@ declare module BABYLON {
|
|
|
/** @hidden */
|
|
|
_loadFile(url: string, onSuccess: (data: string | ArrayBuffer, responseURL?: string) => void, onProgress?: (data: any) => void, offlineProvider?: IOfflineProvider, useArrayBuffer?: boolean, onError?: (request?: IWebRequest, exception?: any) => void): IFileRequest;
|
|
|
/**
|
|
|
+ * Reads pixels from the current frame buffer. Please note that this function can be slow
|
|
|
+ * @param x defines the x coordinate of the rectangle where pixels must be read
|
|
|
+ * @param y defines the y coordinate of the rectangle where pixels must be read
|
|
|
+ * @param width defines the width of the rectangle where pixels must be read
|
|
|
+ * @param height defines the height of the rectangle where pixels must be read
|
|
|
+ * @param hasAlpha defines wether the output should have alpha or not (defaults to true)
|
|
|
+ * @returns a Uint8Array containing RGBA colors
|
|
|
+ */
|
|
|
+ readPixels(x: number, y: number, width: number, height: number, hasAlpha?: boolean): Uint8Array;
|
|
|
+ /**
|
|
|
* Gets a boolean indicating if the engine can be instanciated (ie. if a webGL context can be found)
|
|
|
* @returns true if the engine can be created
|
|
|
* @ignorenaming
|
|
@@ -101702,6 +101840,41 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
+ interface ThinEngine {
|
|
|
+ /**
|
|
|
+ * Sets alpha constants used by some alpha blending modes
|
|
|
+ * @param r defines the red component
|
|
|
+ * @param g defines the green component
|
|
|
+ * @param b defines the blue component
|
|
|
+ * @param a defines the alpha component
|
|
|
+ */
|
|
|
+ setAlphaConstants(r: number, g: number, b: number, a: number): void;
|
|
|
+ /**
|
|
|
+ * Sets the current alpha mode
|
|
|
+ * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
|
|
|
+ * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
|
|
|
+ * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
|
|
|
+ */
|
|
|
+ setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Gets the current alpha mode
|
|
|
+ * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
|
|
|
+ * @returns the current alpha mode
|
|
|
+ */
|
|
|
+ getAlphaMode(): number;
|
|
|
+ /**
|
|
|
+ * Sets the current alpha equation
|
|
|
+ * @param equation defines the equation to use (one of the Engine.ALPHA_EQUATION_XXX)
|
|
|
+ */
|
|
|
+ setAlphaEquation(equation: number): void;
|
|
|
+ /**
|
|
|
+ * Gets the current alpha equation.
|
|
|
+ * @returns the current alpha equation
|
|
|
+ */
|
|
|
+ getAlphaEquation(): number;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
/**
|
|
|
* Defines the interface used by display changed events
|
|
|
*/
|
|
@@ -102027,10 +102200,6 @@ declare module BABYLON {
|
|
|
private _pointerLockRequested;
|
|
|
private _dummyFramebuffer;
|
|
|
private _rescalePostProcess;
|
|
|
- /** @hidden */
|
|
|
- protected _alphaMode: number;
|
|
|
- /** @hidden */
|
|
|
- protected _alphaEquation: number;
|
|
|
private _deterministicLockstep;
|
|
|
private _lockstepMaxSteps;
|
|
|
private _timeStep;
|
|
@@ -102149,47 +102318,6 @@ declare module BABYLON {
|
|
|
*/
|
|
|
setDepthWrite(enable: boolean): void;
|
|
|
/**
|
|
|
- * Enable or disable color writing
|
|
|
- * @param enable defines the state to set
|
|
|
- */
|
|
|
- setColorWrite(enable: boolean): void;
|
|
|
- /**
|
|
|
- * Gets a boolean indicating if color writing is enabled
|
|
|
- * @returns the current color writing state
|
|
|
- */
|
|
|
- getColorWrite(): boolean;
|
|
|
- /**
|
|
|
- * Sets alpha constants used by some alpha blending modes
|
|
|
- * @param r defines the red component
|
|
|
- * @param g defines the green component
|
|
|
- * @param b defines the blue component
|
|
|
- * @param a defines the alpha component
|
|
|
- */
|
|
|
- setAlphaConstants(r: number, g: number, b: number, a: number): void;
|
|
|
- /**
|
|
|
- * Sets the current alpha mode
|
|
|
- * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
|
|
|
- * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
|
|
|
- * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
|
|
|
- */
|
|
|
- setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
|
|
|
- /**
|
|
|
- * Gets the current alpha mode
|
|
|
- * @see http://doc.babylonjs.com/resources/transparency_and_how_meshes_are_rendered
|
|
|
- * @returns the current alpha mode
|
|
|
- */
|
|
|
- getAlphaMode(): number;
|
|
|
- /**
|
|
|
- * Sets the current alpha equation
|
|
|
- * @param equation defines the equation to use (one of the Engine.ALPHA_EQUATION_XXX)
|
|
|
- */
|
|
|
- setAlphaEquation(equation: number): void;
|
|
|
- /**
|
|
|
- * Gets the current alpha equation.
|
|
|
- * @returns the current alpha equation
|
|
|
- */
|
|
|
- getAlphaEquation(): number;
|
|
|
- /**
|
|
|
* Gets a boolean indicating if stencil buffer is enabled
|
|
|
* @returns the current stencil buffer state
|
|
|
*/
|
|
@@ -102391,15 +102519,6 @@ declare module BABYLON {
|
|
|
*/
|
|
|
getFragmentShaderSource(program: WebGLProgram): Nullable<string>;
|
|
|
/**
|
|
|
- * Reads pixels from the current frame buffer. Please note that this function can be slow
|
|
|
- * @param x defines the x coordinate of the rectangle where pixels must be read
|
|
|
- * @param y defines the y coordinate of the rectangle where pixels must be read
|
|
|
- * @param width defines the width of the rectangle where pixels must be read
|
|
|
- * @param height defines the height of the rectangle where pixels must be read
|
|
|
- * @returns a Uint8Array containing RGBA colors
|
|
|
- */
|
|
|
- readPixels(x: number, y: number, width: number, height: number): Uint8Array;
|
|
|
- /**
|
|
|
* Sets a depth stencil texture from a render target to the according uniform.
|
|
|
* @param channel The texture channel
|
|
|
* @param uniform The uniform to set
|
|
@@ -112262,6 +112381,13 @@ declare module BABYLON {
|
|
|
private _tmpRay;
|
|
|
private _tmpVector;
|
|
|
/**
|
|
|
+ * when set to true (default) teleportation will wait for thumbstick changes.
|
|
|
+ * When set to false teleportation will be disabled.
|
|
|
+ *
|
|
|
+ * If set to false while teleporting results can be unexpected.
|
|
|
+ */
|
|
|
+ enabled: boolean;
|
|
|
+ /**
|
|
|
* Creates a WebXRControllerTeleportation
|
|
|
* @param input input manager to add teleportation to
|
|
|
* @param floorMeshes floormeshes which can be teleported to
|