|
@@ -278,6 +278,11 @@ declare module BABYLON {
|
|
|
*/
|
|
|
static IsWindowObjectExist(): boolean;
|
|
|
/**
|
|
|
+ * Checks if the navigator object exists
|
|
|
+ * @returns true if the navigator object exists
|
|
|
+ */
|
|
|
+ static IsNavigatorAvailable(): boolean;
|
|
|
+ /**
|
|
|
* Extracts text content from a DOM element hierarchy
|
|
|
* @param element defines the root element
|
|
|
* @returns a string
|
|
@@ -4731,7 +4736,7 @@ declare module BABYLON {
|
|
|
* @param offlineProvider offline provider for caching
|
|
|
* @returns the HTMLImageElement of the loaded image
|
|
|
*/
|
|
|
- static LoadImage(input: string | ArrayBuffer | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement;
|
|
|
+ static LoadImage(input: string | ArrayBuffer | ArrayBufferView | Blob, onLoad: (img: HTMLImageElement) => void, onError: (message?: string, exception?: any) => void, offlineProvider: Nullable<IOfflineProvider>): HTMLImageElement;
|
|
|
/**
|
|
|
* Loads a file
|
|
|
* @param fileToLoad defines the file to load
|
|
@@ -15493,7 +15498,7 @@ declare module BABYLON {
|
|
|
private _cachedCoordinatesMode;
|
|
|
/** @hidden */
|
|
|
protected _initialSamplingMode: number;
|
|
|
- /** @hidden */
private _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>;
|
|
|
+ /** @hidden */
private _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob>;
|
|
|
private _deleteBuffer;
|
|
|
protected _format: Nullable<number>;
|
|
|
private _delayedOnLoad;
|
|
@@ -15531,14 +15536,14 @@ declare module BABYLON {
|
|
|
* @param deleteBuffer define if the buffer we are loading the texture from should be deleted after load
|
|
|
* @param format define the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...)
|
|
|
*/
|
|
|
- constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message?: string, exception?: any) => void>, buffer?: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>, deleteBuffer?: boolean, format?: number);
|
|
|
+ constructor(url: Nullable<string>, sceneOrEngine: Nullable<Scene | Engine>, noMipmap?: boolean, invertY?: boolean, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message?: string, exception?: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob>, deleteBuffer?: boolean, format?: number);
|
|
|
/**
|
|
|
* Update the url (and optional buffer) of this texture if url was null during construction.
|
|
|
* @param url the url of the texture
|
|
|
* @param buffer the buffer of the texture (defaults to null)
|
|
|
* @param onLoad callback called when the texture is loaded (defaults to null)
|
|
|
*/
|
|
|
- updateURL(url: string, buffer?: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>, onLoad?: () => void): void;
|
|
|
+ updateURL(url: string, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob>, onLoad?: () => void): void;
|
|
|
/**
|
|
|
* Finish the loading sequence of a texture flagged as delayed load.
|
|
|
* @hidden
|
|
@@ -27549,7 +27554,7 @@ declare module BABYLON {
|
|
|
/** @hidden */
private _invertVScale: boolean;
|
|
|
/** @hidden */
private _associatedChannel: number;
|
|
|
/** @hidden */
private _dataSource: number;
|
|
|
- /** @hidden */
private _buffer: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>;
|
|
|
+ /** @hidden */
private _buffer: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob>;
|
|
|
/** @hidden */
private _bufferView: Nullable<ArrayBufferView>;
|
|
|
/** @hidden */
private _bufferViewArray: Nullable<ArrayBufferView[]>;
|
|
|
/** @hidden */
private _bufferViewArrayArray: Nullable<ArrayBufferView[][]>;
|
|
@@ -29556,7 +29561,7 @@ declare module BABYLON {
|
|
|
/** @hidden */
private _gl: WebGLRenderingContext;
|
|
|
private _renderingCanvas;
|
|
|
private _windowIsBackground;
|
|
|
- private _webGLVersion;
|
|
|
+ protected _webGLVersion: number;
|
|
|
protected _highPrecisionShadersAllowed: boolean;
|
|
|
/** @hidden */
protected readonly _shouldUseHighPrecisionShader: boolean;
|
|
|
/**
|
|
@@ -29593,7 +29598,7 @@ declare module BABYLON {
|
|
|
/** @hidden */
private _caps: EngineCapabilities;
|
|
|
private _pointerLockRequested;
|
|
|
private _isStencilEnable;
|
|
|
- private _colorWrite;
|
|
|
+ protected _colorWrite: boolean;
|
|
|
private _loadingScreen;
|
|
|
/** @hidden */
private _drawCalls: PerfCounter;
|
|
|
private _glVersion;
|
|
@@ -30006,6 +30011,11 @@ declare module BABYLON {
|
|
|
stopRenderLoop(renderFunction?: () => void): void;
|
|
|
/** @hidden */
private _renderLoop(): void;
|
|
|
/**
|
|
|
+ * Can be used to override the current requestAnimationFrame requester.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
+ protected _queueNewFrame(bindedRenderFunction: any, requester?: any): number;
|
|
|
+ /**
|
|
|
* Register and execute a render loop. The engine can have more than one render function
|
|
|
* @param renderFunction defines the function to continuously execute
|
|
|
*/
|
|
@@ -30188,6 +30198,7 @@ declare module BABYLON {
|
|
|
* @returns a new webGL buffer
|
|
|
*/
|
|
|
createIndexBuffer(indices: IndicesArray, updatable?: boolean): DataBuffer;
|
|
|
+ protected _normalizeIndexData(indices: IndicesArray): Uint16Array | Uint32Array;
|
|
|
/**
|
|
|
* Bind a webGL buffer to the webGL context
|
|
|
* @param buffer defines the buffer to bind
|
|
@@ -30268,6 +30279,7 @@ declare module BABYLON {
|
|
|
*/
|
|
|
releaseVertexArrayObject(vao: WebGLVertexArrayObject): void;
|
|
|
/** @hidden */
private _releaseBuffer(buffer: DataBuffer): boolean;
|
|
|
+ protected _deleteBuffer(buffer: DataBuffer): void;
|
|
|
/**
|
|
|
* Creates a webGL buffer to use with instanciation
|
|
|
* @param capacity defines the size of the buffer
|
|
@@ -30346,6 +30358,7 @@ declare module BABYLON {
|
|
|
* @returns the new Effect
|
|
|
*/
|
|
|
createEffect(baseName: any, attributesNamesOrOptions: string[] | EffectCreationOptions, uniformsNamesOrEngine: string[] | Engine, samplers?: string[], defines?: string, fallbacks?: EffectFallbacks, onCompiled?: Nullable<(effect: Effect) => void>, onError?: Nullable<(effect: Effect, errors: string) => void>, indexParameters?: any): Effect;
|
|
|
+ protected static _concatenateShader(source: string, defines: Nullable<string>, shaderVersion?: string): string;
|
|
|
private _compileShader;
|
|
|
private _compileRawShader;
|
|
|
/**
|
|
@@ -30373,7 +30386,7 @@ declare module BABYLON {
|
|
|
* Creates a new pipeline context
|
|
|
* @returns the new pipeline
|
|
|
*/
|
|
|
- createPipelineContext(): WebGLPipelineContext;
|
|
|
+ createPipelineContext(): IPipelineContext;
|
|
|
private _createShaderProgram;
|
|
|
private _finalizePipelineContext;
|
|
|
/** @hidden */
private _preparePipelineContext(pipelineContext: IPipelineContext, vertexSourceCode: string, fragmentSourceCode: string, createAsRaw: boolean, rebuildRebind: any, defines: Nullable<string>, transformFeedbackVaryings: Nullable<string[]>): void;
|
|
@@ -30657,7 +30670,7 @@ declare module BABYLON {
|
|
|
* @param excludeLoaders array of texture loaders that should be excluded when picking a loader for the texture (default: empty array)
|
|
|
* @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
|
*/
|
|
|
- createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | HTMLImageElement | Blob>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, excludeLoaders?: Array<IInternalTextureLoader>): InternalTexture;
|
|
|
+ createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, excludeLoaders?: Array<IInternalTextureLoader>): InternalTexture;
|
|
|
/**
|
|
|
* @hidden
|
|
|
* Rescales a texture
|
|
@@ -30770,13 +30783,16 @@ declare module BABYLON {
|
|
|
/**
|
|
|
* @hidden
|
|
|
*/
private _setCubeMapTextureParams(loadMipmap: boolean): void;
|
|
|
- private _prepareWebGLTextureContinuation;
|
|
|
+ protected _prepareWebGLTextureContinuation(texture: InternalTexture, scene: Nullable<Scene>, noMipmap: boolean, isCompressed: boolean, samplingMode: number): void;
|
|
|
private _prepareWebGLTexture;
|
|
|
/** @hidden */
private _convertRGBtoRGBATextureData(rgbData: any, width: number, height: number, textureType: number): ArrayBufferView;
|
|
|
/** @hidden */
private _releaseFramebufferObjects(texture: InternalTexture): void;
|
|
|
/** @hidden */
private _releaseTexture(texture: InternalTexture): void;
|
|
|
- private setProgram;
|
|
|
- private _boundUniforms;
|
|
|
+ protected _deleteTexture(texture: Nullable<WebGLTexture>): void;
|
|
|
+ protected _setProgram(program: WebGLProgram): void;
|
|
|
+ protected _boundUniforms: {
|
|
|
+ [key: number]: WebGLUniformLocation;
|
|
|
+ };
|
|
|
/**
|
|
|
* Binds an effect to the webGL context
|
|
|
* @param effect defines the effect to bind
|
|
@@ -30817,7 +30833,7 @@ declare module BABYLON {
|
|
|
setDepthStencilTexture(channel: number, uniform: Nullable<WebGLUniformLocation>, texture: Nullable<RenderTargetTexture>): void;
|
|
|
private _bindSamplerUniformToChannel;
|
|
|
private _getTextureWrapMode;
|
|
|
- private _setTexture;
|
|
|
+ protected _setTexture(channel: number, texture: Nullable<BaseTexture>, isPartOfTextureArray?: boolean, depthStencilTexture?: boolean): boolean;
|
|
|
/**
|
|
|
* Sets an array of texture to the webGL context
|
|
|
* @param channel defines the channel where the texture array must be set
|
|
@@ -42752,7 +42768,7 @@ declare module BABYLON {
|
|
|
*/
|
|
|
updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: FloatArray, byteOffset?: number, byteLength?: number): void;
private _bindTextureDirectly(target: number, texture: InternalTexture): boolean;
|
|
|
/** @hidden */
private _bindTexture(channel: number, texture: InternalTexture): void;
|
|
|
- /** @hidden */
private _releaseBuffer(buffer: DataBuffer): boolean;
|
|
|
+ protected _deleteBuffer(buffer: WebGLBuffer): void;
|
|
|
releaseEffects(): void;
|
|
|
displayLoadingUI(): void;
|
|
|
hideLoadingUI(): void;
|
|
@@ -43060,6 +43076,412 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var rgbdEncodePixelShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export var rgbdDecodePixelShader: {
|
|
|
+ name: string;
|
|
|
+ shader: string;
|
|
|
+ };
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Raw texture data and descriptor sufficient for WebGL texture upload
|
|
|
+ */
|
|
|
+ export interface EnvironmentTextureInfo {
|
|
|
+ /**
|
|
|
+ * Version of the environment map
|
|
|
+ */
|
|
|
+ version: number;
|
|
|
+ /**
|
|
|
+ * Width of image
|
|
|
+ */
|
|
|
+ width: number;
|
|
|
+ /**
|
|
|
+ * Irradiance information stored in the file.
|
|
|
+ */
|
|
|
+ irradiance: any;
|
|
|
+ /**
|
|
|
+ * Specular information stored in the file.
|
|
|
+ */
|
|
|
+ specular: any;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Defines One Image in the file. It requires only the position in the file
|
|
|
+ * as well as the length.
|
|
|
+ */
|
|
|
+ interface BufferImageData {
|
|
|
+ /**
|
|
|
+ * Length of the image data.
|
|
|
+ */
|
|
|
+ length: number;
|
|
|
+ /**
|
|
|
+ * Position of the data from the null terminator delimiting the end of the JSON.
|
|
|
+ */
|
|
|
+ position: number;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Defines the specular data enclosed in the file.
|
|
|
+ * This corresponds to the version 1 of the data.
|
|
|
+ */
|
|
|
+ export interface EnvironmentTextureSpecularInfoV1 {
|
|
|
+ /**
|
|
|
+ * Defines where the specular Payload is located. It is a runtime value only not stored in the file.
|
|
|
+ */
|
|
|
+ specularDataPosition?: number;
|
|
|
+ /**
|
|
|
+ * This contains all the images data needed to reconstruct the cubemap.
|
|
|
+ */
|
|
|
+ mipmaps: Array<BufferImageData>;
|
|
|
+ /**
|
|
|
+ * Defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness.
|
|
|
+ */
|
|
|
+ lodGenerationScale: number;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Sets of helpers addressing the serialization and deserialization of environment texture
|
|
|
+ * stored in a BabylonJS env file.
|
|
|
+ * Those files are usually stored as .env files.
|
|
|
+ */
|
|
|
+ export class EnvironmentTextureTools {
|
|
|
+ /**
|
|
|
+ * Magic number identifying the env file.
|
|
|
+ */
|
|
|
+ private static _MagicBytes;
|
|
|
+ /**
|
|
|
+ * Gets the environment info from an env file.
|
|
|
+ * @param data The array buffer containing the .env bytes.
|
|
|
+ * @returns the environment file info (the json header) if successfully parsed.
|
|
|
+ */
|
|
|
+ static GetEnvInfo(data: ArrayBuffer): Nullable<EnvironmentTextureInfo>;
|
|
|
+ /**
|
|
|
+ * Creates an environment texture from a loaded cube texture.
|
|
|
+ * @param texture defines the cube texture to convert in env file
|
|
|
+ * @return a promise containing the environment data if succesfull.
|
|
|
+ */
|
|
|
+ static CreateEnvTextureAsync(texture: CubeTexture): Promise<ArrayBuffer>;
|
|
|
+ /**
|
|
|
+ * Creates a JSON representation of the spherical data.
|
|
|
+ * @param texture defines the texture containing the polynomials
|
|
|
+ * @return the JSON representation of the spherical info
|
|
|
+ */
|
|
|
+ private static _CreateEnvTextureIrradiance;
|
|
|
+ /**
|
|
|
+ * Creates the ArrayBufferViews used for initializing environment texture image data.
|
|
|
+ * @param arrayBuffer the underlying ArrayBuffer to which the views refer
|
|
|
+ * @param info parameters that determine what views will be created for accessing the underlying buffer
|
|
|
+ * @return the views described by info providing access to the underlying buffer
|
|
|
+ */
|
|
|
+ static CreateImageDataArrayBufferViews(arrayBuffer: any, info: EnvironmentTextureInfo): Array<Array<ArrayBufferView>>;
|
|
|
+ /**
|
|
|
+ * Uploads the texture info contained in the env file to the GPU.
|
|
|
+ * @param texture defines the internal texture to upload to
|
|
|
+ * @param arrayBuffer defines the buffer cotaining the data to load
|
|
|
+ * @param info defines the texture info retrieved through the GetEnvInfo method
|
|
|
+ * @returns a promise
|
|
|
+ */
|
|
|
+ static UploadEnvLevelsAsync(texture: InternalTexture, arrayBuffer: any, info: EnvironmentTextureInfo): Promise<void>;
|
|
|
+ /**
|
|
|
+ * Uploads the levels of image data to the GPU.
|
|
|
+ * @param texture defines the internal texture to upload to
|
|
|
+ * @param imageData defines the array buffer views of image data [mipmap][face]
|
|
|
+ * @returns a promise
|
|
|
+ */
|
|
|
+ static UploadLevelsAsync(texture: InternalTexture, imageData: ArrayBufferView[][]): Promise<void>;
|
|
|
+ /**
|
|
|
+ * Uploads spherical polynomials information to the texture.
|
|
|
+ * @param texture defines the texture we are trying to upload the information to
|
|
|
+ * @param info defines the environment texture info retrieved through the GetEnvInfo method
|
|
|
+ */
|
|
|
+ static UploadEnvSpherical(texture: InternalTexture, info: EnvironmentTextureInfo): void;
|
|
|
+ /** @hidden */
private static _UpdateRGBDAsync(internalTexture: InternalTexture, data: ArrayBufferView[][], sphericalPolynomial: Nullable<SphericalPolynomial>, lodScale: number, lodOffset: number): Promise<void>;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Contains position and normal vectors for a vertex
|
|
|
+ */
|
|
|
+ export class PositionNormalVertex {
|
|
|
+ /** the position of the vertex (defaut: 0,0,0) */
|
|
|
+ position: Vector3;
|
|
|
+ /** the normal of the vertex (defaut: 0,1,0) */
|
|
|
+ normal: Vector3;
|
|
|
+ /**
|
|
|
+ * Creates a PositionNormalVertex
|
|
|
+ * @param position the position of the vertex (defaut: 0,0,0)
|
|
|
+ * @param normal the normal of the vertex (defaut: 0,1,0)
|
|
|
+ */
|
|
|
+ constructor(
|
|
|
+ /** the position of the vertex (defaut: 0,0,0) */
|
|
|
+ position?: Vector3,
|
|
|
+ /** the normal of the vertex (defaut: 0,1,0) */
|
|
|
+ normal?: Vector3);
|
|
|
+ /**
|
|
|
+ * Clones the PositionNormalVertex
|
|
|
+ * @returns the cloned PositionNormalVertex
|
|
|
+ */
|
|
|
+ clone(): PositionNormalVertex;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Contains position, normal and uv vectors for a vertex
|
|
|
+ */
|
|
|
+ export class PositionNormalTextureVertex {
|
|
|
+ /** the position of the vertex (defaut: 0,0,0) */
|
|
|
+ position: Vector3;
|
|
|
+ /** the normal of the vertex (defaut: 0,1,0) */
|
|
|
+ normal: Vector3;
|
|
|
+ /** the uv of the vertex (default: 0,0) */
|
|
|
+ uv: Vector2;
|
|
|
+ /**
|
|
|
+ * Creates a PositionNormalTextureVertex
|
|
|
+ * @param position the position of the vertex (defaut: 0,0,0)
|
|
|
+ * @param normal the normal of the vertex (defaut: 0,1,0)
|
|
|
+ * @param uv the uv of the vertex (default: 0,0)
|
|
|
+ */
|
|
|
+ constructor(
|
|
|
+ /** the position of the vertex (defaut: 0,0,0) */
|
|
|
+ position?: Vector3,
|
|
|
+ /** the normal of the vertex (defaut: 0,1,0) */
|
|
|
+ normal?: Vector3,
|
|
|
+ /** the uv of the vertex (default: 0,0) */
|
|
|
+ uv?: Vector2);
|
|
|
+ /**
|
|
|
+ * Clones the PositionNormalTextureVertex
|
|
|
+ * @returns the cloned PositionNormalTextureVertex
|
|
|
+ */
|
|
|
+ clone(): PositionNormalTextureVertex;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /** @hidden */
|
|
|
+ export class NativeShaderProcessor extends WebGL2ShaderProcessor {
|
|
|
+ private _genericAttributeLocation;
|
|
|
+ private _varyingLocationCount;
|
|
|
+ private _varyingLocationMap;
|
|
|
+ private _replacements;
|
|
|
+ private _textureCount;
|
|
|
+ private _uniforms;
|
|
|
+ lineProcessor(line: string): string;
|
|
|
+ attributeProcessor(attribute: string): string;
|
|
|
+ varyingProcessor(varying: string, isFragment: boolean): string;
|
|
|
+ uniformProcessor(uniform: string): string;
|
|
|
+ preProcessor(code: string, defines: string[], isFragment: boolean): string;
|
|
|
+ postProcessor(code: string, defines: string[], isFragment: boolean): string;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
+ * Container for accessors for natively-stored mesh data buffers.
|
|
|
+ */
|
|
|
+ class NativeDataBuffer extends DataBuffer {
|
|
|
+ /**
|
|
|
+ * Accessor value used to identify/retrieve a natively-stored index buffer.
|
|
|
+ */
|
|
|
+ nativeIndexBuffer?: any;
|
|
|
+ /**
|
|
|
+ * Accessor value used to identify/retrieve a natively-stored vertex buffer.
|
|
|
+ */
|
|
|
+ nativeVertexBuffer?: any;
|
|
|
+ }
|
|
|
+ /** @hidden */
|
|
|
+ export class NativeEngine extends Engine {
|
|
|
+ private readonly _native;
|
|
|
+ getHardwareScalingLevel(): number;
|
|
|
+ constructor();
|
|
|
+ /**
|
|
|
+ * Can be used to override the current requestAnimationFrame requester.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
+ protected _queueNewFrame(bindedRenderFunction: any, requester: any): number;
|
|
|
+ clear(color: Color4, backBuffer: boolean, depth: boolean, stencil?: boolean): void;
|
|
|
+ createIndexBuffer(indices: IndicesArray): NativeDataBuffer;
|
|
|
+ createVertexBuffer(data: DataArray): NativeDataBuffer;
|
|
|
+ recordVertexArrayObject(vertexBuffers: {
|
|
|
+ [key: string]: VertexBuffer;
|
|
|
+ }, indexBuffer: Nullable<NativeDataBuffer>, effect: Effect): WebGLVertexArrayObject;
|
|
|
+ bindVertexArrayObject(vertexArray: WebGLVertexArrayObject): void;
|
|
|
+ releaseVertexArrayObject(vertexArray: WebGLVertexArrayObject): void;
|
|
|
+ getAttributes(pipelineContext: IPipelineContext, attributesNames: string[]): number[];
|
|
|
+ /**
|
|
|
+ * Draw a list of indexed primitives
|
|
|
+ * @param fillMode defines the primitive to use
|
|
|
+ * @param indexStart defines the starting index
|
|
|
+ * @param indexCount defines the number of index to draw
|
|
|
+ * @param instancesCount defines the number of instances to draw (if instanciation is enabled)
|
|
|
+ */
|
|
|
+ drawElementsType(fillMode: number, indexStart: number, indexCount: number, instancesCount?: number): void;
|
|
|
+ /**
|
|
|
+ * Draw a list of unindexed primitives
|
|
|
+ * @param fillMode defines the primitive to use
|
|
|
+ * @param verticesStart defines the index of first vertex to draw
|
|
|
+ * @param verticesCount defines the count of vertices to draw
|
|
|
+ * @param instancesCount defines the number of instances to draw (if instanciation is enabled)
|
|
|
+ */
|
|
|
+ drawArraysType(fillMode: number, verticesStart: number, verticesCount: number, instancesCount?: number): void;
|
|
|
+ createPipelineContext(): IPipelineContext;
private _preparePipelineContext(pipelineContext: IPipelineContext, vertexSourceCode: string, fragmentSourceCode: string, createAsRaw: boolean, rebuildRebind: any, defines: Nullable<string>, transformFeedbackVaryings: Nullable<string[]>): void;
|
|
|
+ /** @hidden */
private _isRenderingStateCompiled(pipelineContext: IPipelineContext): boolean;
|
|
|
+ /** @hidden */
private _executeWhenRenderingStateIsCompiled(pipelineContext: IPipelineContext, action: () => void): void;
|
|
|
+ createRawShaderProgram(pipelineContext: IPipelineContext, vertexCode: string, fragmentCode: string, context?: WebGLRenderingContext, transformFeedbackVaryings?: Nullable<string[]>): any;
|
|
|
+ createShaderProgram(pipelineContext: IPipelineContext, vertexCode: string, fragmentCode: string, defines: Nullable<string>, context?: WebGLRenderingContext, transformFeedbackVaryings?: Nullable<string[]>): any;
|
|
|
+ protected _setProgram(program: WebGLProgram): void;
private _releaseEffect(effect: Effect): void;
private _deletePipelineContext(pipelineContext: IPipelineContext): void;
|
|
|
+ getUniforms(pipelineContext: IPipelineContext, uniformsNames: string[]): WebGLUniformLocation[];
|
|
|
+ bindUniformBlock(pipelineContext: IPipelineContext, blockName: string, index: number): void;
|
|
|
+ bindSamplers(effect: Effect): void;
|
|
|
+ setMatrix(uniform: WebGLUniformLocation, matrix: Matrix): void;
|
|
|
+ getRenderWidth(useScreen?: boolean): number;
|
|
|
+ getRenderHeight(useScreen?: boolean): number;
|
|
|
+ setViewport(viewport: Viewport, requiredWidth?: number, requiredHeight?: number): void;
|
|
|
+ setState(culling: boolean, zOffset?: number, force?: boolean, reverseSide?: boolean): void;
|
|
|
+ /**
|
|
|
+ * Set the z offset to apply to current rendering
|
|
|
+ * @param value defines the offset to apply
|
|
|
+ */
|
|
|
+ setZOffset(value: number): void;
|
|
|
+ /**
|
|
|
+ * Gets the current value of the zOffset
|
|
|
+ * @returns the current zOffset state
|
|
|
+ */
|
|
|
+ getZOffset(): number;
|
|
|
+ /**
|
|
|
+ * Enable or disable depth buffering
|
|
|
+ * @param enable defines the state to set
|
|
|
+ */
|
|
|
+ setDepthBuffer(enable: boolean): void;
|
|
|
+ /**
|
|
|
+ * Gets a boolean indicating if depth writing is enabled
|
|
|
+ * @returns the current depth writing state
|
|
|
+ */
|
|
|
+ getDepthWrite(): boolean;
|
|
|
+ /**
|
|
|
+ * Enable or disable depth writing
|
|
|
+ * @param enable defines the state to set
|
|
|
+ */
|
|
|
+ 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 BABYLON.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;
|
|
|
+ setIntArray(uniform: WebGLUniformLocation, array: Int32Array): void;
|
|
|
+ setIntArray2(uniform: WebGLUniformLocation, array: Int32Array): void;
|
|
|
+ setIntArray3(uniform: WebGLUniformLocation, array: Int32Array): void;
|
|
|
+ setIntArray4(uniform: WebGLUniformLocation, array: Int32Array): void;
|
|
|
+ setFloatArray(uniform: WebGLUniformLocation, array: Float32Array): void;
|
|
|
+ setFloatArray2(uniform: WebGLUniformLocation, array: Float32Array): void;
|
|
|
+ setFloatArray3(uniform: WebGLUniformLocation, array: Float32Array): void;
|
|
|
+ setFloatArray4(uniform: WebGLUniformLocation, array: Float32Array): void;
|
|
|
+ setArray(uniform: WebGLUniformLocation, array: number[]): void;
|
|
|
+ setArray2(uniform: WebGLUniformLocation, array: number[]): void;
|
|
|
+ setArray3(uniform: WebGLUniformLocation, array: number[]): void;
|
|
|
+ setArray4(uniform: WebGLUniformLocation, array: number[]): void;
|
|
|
+ setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): void;
|
|
|
+ setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): void;
|
|
|
+ setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): void;
|
|
|
+ setFloat(uniform: WebGLUniformLocation, value: number): void;
|
|
|
+ setFloat2(uniform: WebGLUniformLocation, x: number, y: number): void;
|
|
|
+ setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): void;
|
|
|
+ setBool(uniform: WebGLUniformLocation, bool: number): void;
|
|
|
+ setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): void;
|
|
|
+ setColor3(uniform: WebGLUniformLocation, color3: Color3): void;
|
|
|
+ setColor4(uniform: WebGLUniformLocation, color3: Color3, alpha: number): void;
|
|
|
+ wipeCaches(bruteForce?: boolean): void;
private _createTexture(): WebGLTexture;
|
|
|
+ protected _deleteTexture(texture: Nullable<WebGLTexture>): void;
|
|
|
+ /**
|
|
|
+ * Usually called from BABYLON.Texture.ts.
|
|
|
+ * Passed information to create a WebGLTexture
|
|
|
+ * @param urlArg defines a value which contains one of the following:
|
|
|
+ * * A conventional http URL, e.g. 'http://...' or 'file://...'
|
|
|
+ * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
|
|
|
+ * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
|
|
|
+ * @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file
|
|
|
+ * @param invertY when true, image is flipped when loaded. You probably want true. Ignored for compressed textures. Must be flipped in the file
|
|
|
+ * @param scene needed for loading to the correct scene
|
|
|
+ * @param samplingMode mode with should be used sample / access the texture (Default: BABYLON.Texture.TRILINEAR_SAMPLINGMODE)
|
|
|
+ * @param onLoad optional callback to be called upon successful completion
|
|
|
+ * @param onError optional callback to be called upon failure
|
|
|
+ * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), or a Blob
|
|
|
+ * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
|
|
|
+ * @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures
|
|
|
+ * @param forcedExtension defines the extension to use to pick the right loader
|
|
|
+ * @returns a InternalTexture for assignment back into BABYLON.Texture
|
|
|
+ */
|
|
|
+ createTexture(urlArg: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<Scene>, samplingMode?: number, onLoad?: Nullable<() => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | Blob>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>): InternalTexture;
|
|
|
+ /**
|
|
|
+ * Creates a cube texture
|
|
|
+ * @param rootUrl defines the url where the files to load is located
|
|
|
+ * @param scene defines the current scene
|
|
|
+ * @param files defines the list of files to load (1 per face)
|
|
|
+ * @param noMipmap defines a boolean indicating that no mipmaps shall be generated (false by default)
|
|
|
+ * @param onLoad defines an optional callback raised when the texture is loaded
|
|
|
+ * @param onError defines an optional callback raised if there is an issue to load the texture
|
|
|
+ * @param format defines the format of the data
|
|
|
+ * @param forcedExtension defines the extension to use to pick the right loader
|
|
|
+ * @param createPolynomials if a polynomial sphere should be created for the cube texture
|
|
|
+ * @param lodScale defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness
|
|
|
+ * @param lodOffset defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness
|
|
|
+ * @param fallback defines texture to use while falling back when (compressed) texture file not found.
|
|
|
+ * @returns the cube texture as an InternalTexture
|
|
|
+ */
|
|
|
+ createCubeTexture(rootUrl: string, scene: Nullable<Scene>, files: Nullable<string[]>, noMipmap?: boolean, onLoad?: Nullable<(data?: any) => void>, onError?: Nullable<(message?: string, exception?: any) => void>, format?: number, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number, fallback?: Nullable<InternalTexture>): InternalTexture;
|
|
|
+ private _getSamplingFilter;
|
|
|
+ createRenderTargetTexture(size: any, options: boolean | RenderTargetCreationOptions): InternalTexture;
|
|
|
+ updateTextureSamplingMode(samplingMode: number, texture: InternalTexture): void;
|
|
|
+ bindFramebuffer(texture: InternalTexture, faceIndex?: number, requiredWidth?: number, requiredHeight?: number, forceFullscreenViewport?: boolean): void;
|
|
|
+ unBindFramebuffer(texture: InternalTexture, disableGenerateMipMaps?: boolean, onBeforeUnbind?: () => void): void;
|
|
|
+ createDynamicVertexBuffer(data: DataArray): DataBuffer;
|
|
|
+ updateDynamicIndexBuffer(indexBuffer: DataBuffer, indices: IndicesArray, offset?: number): void;
|
|
|
+ /**
|
|
|
+ * Updates a dynamic vertex buffer.
|
|
|
+ * @param vertexBuffer the vertex buffer to update
|
|
|
+ * @param data the data used to update the vertex buffer
|
|
|
+ * @param byteOffset the byte offset of the data (optional)
|
|
|
+ * @param byteLength the byte length of the data (optional)
|
|
|
+ */
|
|
|
+ updateDynamicVertexBuffer(vertexBuffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;
|
|
|
+ protected _setTexture(channel: number, texture: Nullable<BaseTexture>, isPartOfTextureArray?: boolean, depthStencilTexture?: boolean): boolean;
|
|
|
+ private _updateAnisotropicLevel;
|
|
|
+ private _getAddressMode;
|
|
|
+ /** @hidden */
private _bindTexture(channel: number, texture: InternalTexture): void;
|
|
|
+ protected _deleteBuffer(buffer: NativeDataBuffer): void;
|
|
|
+ releaseEffects(): void;
|
|
|
+ /** @hidden */
private _uploadCompressedDataToTextureDirectly(texture: InternalTexture, internalFormat: number, width: number, height: number, data: ArrayBufferView, faceIndex?: number, lod?: number): void;
|
|
|
+ /** @hidden */
private _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
|
|
|
+ /** @hidden */
private _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
|
|
|
+ /** @hidden */
private _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex?: number, lod?: number): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
/**
|
|
|
* Gather the list of clipboard event types as constants.
|
|
|
*/
|
|
@@ -44689,13 +45111,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
- export var rgbdDecodePixelShader: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
/**
|
|
|
* Class used to host texture specific utilities
|
|
|
*/
|
|
@@ -46846,87 +47261,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
- /** @hidden */
|
|
|
- export var rgbdEncodePixelShader: {
|
|
|
- name: string;
|
|
|
- shader: string;
|
|
|
- };
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
- * Raw texture data and descriptor sufficient for WebGL texture upload
|
|
|
- */
|
|
|
- export interface EnvironmentTextureInfo {
|
|
|
- /**
|
|
|
- * Version of the environment map
|
|
|
- */
|
|
|
- version: number;
|
|
|
- /**
|
|
|
- * Width of image
|
|
|
- */
|
|
|
- width: number;
|
|
|
- /**
|
|
|
- * Irradiance information stored in the file.
|
|
|
- */
|
|
|
- irradiance: any;
|
|
|
- /**
|
|
|
- * Specular information stored in the file.
|
|
|
- */
|
|
|
- specular: any;
|
|
|
- }
|
|
|
- /**
|
|
|
- * Sets of helpers addressing the serialization and deserialization of environment texture
|
|
|
- * stored in a BabylonJS env file.
|
|
|
- * Those files are usually stored as .env files.
|
|
|
- */
|
|
|
- export class EnvironmentTextureTools {
|
|
|
- /**
|
|
|
- * Magic number identifying the env file.
|
|
|
- */
|
|
|
- private static _MagicBytes;
|
|
|
- /**
|
|
|
- * Gets the environment info from an env file.
|
|
|
- * @param data The array buffer containing the .env bytes.
|
|
|
- * @returns the environment file info (the json header) if successfully parsed.
|
|
|
- */
|
|
|
- static GetEnvInfo(data: ArrayBuffer): Nullable<EnvironmentTextureInfo>;
|
|
|
- /**
|
|
|
- * Creates an environment texture from a loaded cube texture.
|
|
|
- * @param texture defines the cube texture to convert in env file
|
|
|
- * @return a promise containing the environment data if succesfull.
|
|
|
- */
|
|
|
- static CreateEnvTextureAsync(texture: CubeTexture): Promise<ArrayBuffer>;
|
|
|
- /**
|
|
|
- * Creates a JSON representation of the spherical data.
|
|
|
- * @param texture defines the texture containing the polynomials
|
|
|
- * @return the JSON representation of the spherical info
|
|
|
- */
|
|
|
- private static _CreateEnvTextureIrradiance;
|
|
|
- /**
|
|
|
- * Uploads the texture info contained in the env file to the GPU.
|
|
|
- * @param texture defines the internal texture to upload to
|
|
|
- * @param arrayBuffer defines the buffer cotaining the data to load
|
|
|
- * @param info defines the texture info retrieved through the GetEnvInfo method
|
|
|
- * @returns a promise
|
|
|
- */
|
|
|
- static UploadEnvLevelsAsync(texture: InternalTexture, arrayBuffer: any, info: EnvironmentTextureInfo): Promise<void>;
|
|
|
- /**
|
|
|
- * Uploads the levels of image data to the GPU.
|
|
|
- * @param texture defines the internal texture to upload to
|
|
|
- * @param imageData defines the array buffer views of image data [mipmap][face]
|
|
|
- * @returns a promise
|
|
|
- */
|
|
|
- static UploadLevelsAsync(texture: InternalTexture, imageData: ArrayBufferView[][]): Promise<void>;
|
|
|
- /**
|
|
|
- * Uploads spherical polynomials information to the texture.
|
|
|
- * @param texture defines the texture we are trying to upload the information to
|
|
|
- * @param info defines the environment texture info retrieved through the GetEnvInfo method
|
|
|
- */
|
|
|
- static UploadEnvSpherical(texture: InternalTexture, info: EnvironmentTextureInfo): void;
|
|
|
- /** @hidden */
private static _UpdateRGBDAsync(internalTexture: InternalTexture, data: ArrayBufferView[][], sphericalPolynomial: Nullable<SphericalPolynomial>, lodScale: number, lodOffset: number): Promise<void>;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
/**
|
|
|
* Implementation of the ENV Texture Loader.
|
|
|
* @hidden
|
|
@@ -47236,61 +47570,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
- * Contains position and normal vectors for a vertex
|
|
|
- */
|
|
|
- export class PositionNormalVertex {
|
|
|
- /** the position of the vertex (defaut: 0,0,0) */
|
|
|
- position: Vector3;
|
|
|
- /** the normal of the vertex (defaut: 0,1,0) */
|
|
|
- normal: Vector3;
|
|
|
- /**
|
|
|
- * Creates a PositionNormalVertex
|
|
|
- * @param position the position of the vertex (defaut: 0,0,0)
|
|
|
- * @param normal the normal of the vertex (defaut: 0,1,0)
|
|
|
- */
|
|
|
- constructor(
|
|
|
- /** the position of the vertex (defaut: 0,0,0) */
|
|
|
- position?: Vector3,
|
|
|
- /** the normal of the vertex (defaut: 0,1,0) */
|
|
|
- normal?: Vector3);
|
|
|
- /**
|
|
|
- * Clones the PositionNormalVertex
|
|
|
- * @returns the cloned PositionNormalVertex
|
|
|
- */
|
|
|
- clone(): PositionNormalVertex;
|
|
|
- }
|
|
|
- /**
|
|
|
- * Contains position, normal and uv vectors for a vertex
|
|
|
- */
|
|
|
- export class PositionNormalTextureVertex {
|
|
|
- /** the position of the vertex (defaut: 0,0,0) */
|
|
|
- position: Vector3;
|
|
|
- /** the normal of the vertex (defaut: 0,1,0) */
|
|
|
- normal: Vector3;
|
|
|
- /** the uv of the vertex (default: 0,0) */
|
|
|
- uv: Vector2;
|
|
|
- /**
|
|
|
- * Creates a PositionNormalTextureVertex
|
|
|
- * @param position the position of the vertex (defaut: 0,0,0)
|
|
|
- * @param normal the normal of the vertex (defaut: 0,1,0)
|
|
|
- * @param uv the uv of the vertex (default: 0,0)
|
|
|
- */
|
|
|
- constructor(
|
|
|
- /** the position of the vertex (defaut: 0,0,0) */
|
|
|
- position?: Vector3,
|
|
|
- /** the normal of the vertex (defaut: 0,1,0) */
|
|
|
- normal?: Vector3,
|
|
|
- /** the uv of the vertex (default: 0,0) */
|
|
|
- uv?: Vector2);
|
|
|
- /**
|
|
|
- * Clones the PositionNormalTextureVertex
|
|
|
- * @returns the cloned PositionNormalTextureVertex
|
|
|
- */
|
|
|
- clone(): PositionNormalTextureVertex;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module BABYLON {
|
|
|
- /**
|
|
|
* Display a 360/180 degree video on an approximately spherical surface, useful for VR applications or skyboxes.
|
|
|
* As a subclass of TransformNode, this allow parenting to the camera or multiple videos with different locations in the scene.
|
|
|
* This class achieves its effect with a VideoTexture and a correctly configured BackgroundMaterial on an inverted sphere.
|