@babylonjs/core 8.45.4 → 8.45.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/AudioV2/webAudio/components/webAudioParameterComponent.js +5 -1
  2. package/AudioV2/webAudio/components/webAudioParameterComponent.js.map +1 -1
  3. package/Engines/AbstractEngine/abstractEngine.loadFile.d.ts +11 -0
  4. package/Engines/AbstractEngine/abstractEngine.loadFile.js +12 -0
  5. package/Engines/AbstractEngine/abstractEngine.loadFile.js.map +1 -0
  6. package/Engines/AbstractEngine/abstractEngine.textureLoaders.d.ts +1 -0
  7. package/Engines/AbstractEngine/abstractEngine.textureLoaders.js +4 -0
  8. package/Engines/AbstractEngine/abstractEngine.textureLoaders.js.map +1 -0
  9. package/Engines/AbstractEngine/index.d.ts +2 -0
  10. package/Engines/AbstractEngine/index.js +2 -0
  11. package/Engines/AbstractEngine/index.js.map +1 -1
  12. package/Engines/Native/Extensions/index.d.ts +1 -0
  13. package/Engines/Native/Extensions/index.js +2 -0
  14. package/Engines/Native/Extensions/index.js.map +1 -0
  15. package/Engines/Native/Extensions/nativeEngine.cubeTexture.d.ts +27 -0
  16. package/Engines/Native/Extensions/nativeEngine.cubeTexture.js +96 -0
  17. package/Engines/Native/Extensions/nativeEngine.cubeTexture.js.map +1 -0
  18. package/Engines/Native/nativePipelineContext.d.ts +2 -2
  19. package/Engines/Native/nativePipelineContext.js.map +1 -1
  20. package/Engines/Native/nativeRenderTargetWrapper.d.ts +3 -3
  21. package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
  22. package/Engines/Native/validatedNativeDataStream.js +2 -2
  23. package/Engines/Native/validatedNativeDataStream.js.map +1 -1
  24. package/Engines/abstractEngine.d.ts +9 -0
  25. package/Engines/abstractEngine.js +13 -4
  26. package/Engines/abstractEngine.js.map +1 -1
  27. package/Engines/engine.d.ts +2 -6
  28. package/Engines/engine.js +2 -13
  29. package/Engines/engine.js.map +1 -1
  30. package/Engines/index.d.ts +1 -0
  31. package/Engines/index.js +1 -0
  32. package/Engines/index.js.map +1 -1
  33. package/Engines/nativeEngine.d.ts +19 -536
  34. package/Engines/nativeEngine.js +27 -2127
  35. package/Engines/nativeEngine.js.map +1 -1
  36. package/Engines/nullEngine.d.ts +2 -0
  37. package/Engines/nullEngine.js +2 -0
  38. package/Engines/nullEngine.js.map +1 -1
  39. package/Engines/thinNativeEngine.d.ts +537 -0
  40. package/Engines/thinNativeEngine.js +2033 -0
  41. package/Engines/thinNativeEngine.js.map +1 -0
  42. package/Engines/webgpuEngine.d.ts +2 -0
  43. package/Engines/webgpuEngine.js +2 -0
  44. package/Engines/webgpuEngine.js.map +1 -1
  45. package/Misc/tools.d.ts +3 -1
  46. package/Misc/tools.js +76 -59
  47. package/Misc/tools.js.map +1 -1
  48. package/Particles/Node/Blocks/index.d.ts +2 -0
  49. package/Particles/Node/Blocks/index.js +2 -0
  50. package/Particles/Node/Blocks/index.js.map +1 -1
  51. package/Particles/Node/Blocks/particleClampBlock.d.ts +42 -0
  52. package/Particles/Node/Blocks/particleClampBlock.js +114 -0
  53. package/Particles/Node/Blocks/particleClampBlock.js.map +1 -0
  54. package/XR/native/nativeXRFrame.js +1 -1
  55. package/XR/native/nativeXRFrame.js.map +1 -1
  56. package/package.json +1 -1
@@ -0,0 +1,537 @@
1
+ import type { Nullable, IndicesArray, DataArray, FloatArray, DeepImmutable, int } from "../types.js";
2
+ import type { VertexBuffer } from "../Buffers/buffer.js";
3
+ import { InternalTexture, InternalTextureSource } from "../Materials/Textures/internalTexture.js";
4
+ import type { BaseTexture } from "../Materials/Textures/baseTexture.js";
5
+ import type { Effect } from "../Materials/effect.js";
6
+ import { DataBuffer } from "../Buffers/dataBuffer.js";
7
+ import type { RenderTargetCreationOptions, TextureSize, DepthTextureCreationOptions, InternalTextureCreationOptions } from "../Materials/Textures/textureCreationOptions.js";
8
+ import type { IPipelineContext } from "./IPipelineContext.js";
9
+ import type { IColor3Like, IColor4Like, IViewportLike } from "../Maths/math.like.js";
10
+ import { type ISceneLike } from "./abstractEngine.js";
11
+ import { ThinEngine } from "./thinEngine.js";
12
+ import type { IMaterialContext } from "./IMaterialContext.js";
13
+ import type { IDrawContext } from "./IDrawContext.js";
14
+ import type { ICanvas, IImage, IPath2D } from "./ICanvas.js";
15
+ import type { IStencilState } from "../States/IStencilState.js";
16
+ import type { RenderTargetWrapper } from "./renderTargetWrapper.js";
17
+ import type { NativeData } from "./Native/nativeDataStream.js";
18
+ import { NativeDataStream } from "./Native/nativeDataStream.js";
19
+ import type { INative, INativeEngine, NativeFramebuffer, NativeTexture } from "./Native/nativeInterfaces.js";
20
+ import type { IHardwareTextureWrapper } from "../Materials/Textures/hardwareTextureWrapper.js";
21
+ import type { _IShaderProcessingContext } from "./Processors/shaderProcessingOptions.js";
22
+ import type { ShaderLanguage } from "../Materials/shaderLanguage.js";
23
+ import type { WebGLHardwareTexture } from "./WebGL/webGLHardwareTexture.js";
24
+ import "../Buffers/buffer.align.js";
25
+ import { _TimeToken } from "../Instrumentation/timeToken.js";
26
+ declare module "../Materials/effect.js" {
27
+ /** internal */
28
+ interface Effect {
29
+ /** internal */
30
+ _checkedNonFloatVertexBuffers?: boolean;
31
+ }
32
+ }
33
+ /**
34
+ * Returns _native only after it has been defined by BabylonNative.
35
+ * @internal
36
+ */
37
+ export declare function AcquireNativeObjectAsync(): Promise<INative>;
38
+ /**
39
+ * Registers a constructor on the _native object. See NativeXRFrame for an example.
40
+ * @internal
41
+ */
42
+ export declare function RegisterNativeTypeAsync<Type>(typeName: string, constructor: Type): Promise<void>;
43
+ /**
44
+ * Container for accessors for natively-stored mesh data buffers.
45
+ */
46
+ declare class NativeDataBuffer extends DataBuffer {
47
+ /**
48
+ * Accessor value used to identify/retrieve a natively-stored index buffer.
49
+ */
50
+ nativeIndexBuffer?: NativeData;
51
+ /**
52
+ * Accessor value used to identify/retrieve a natively-stored vertex buffer.
53
+ */
54
+ nativeVertexBuffer?: NativeData;
55
+ }
56
+ /**
57
+ * Options to create the Native engine
58
+ */
59
+ export interface ThinNativeEngineOptions {
60
+ /**
61
+ * defines whether to adapt to the device's viewport characteristics (default: false)
62
+ */
63
+ adaptToDeviceRatio?: boolean;
64
+ }
65
+ /** @internal */
66
+ export declare class ThinNativeEngine extends ThinEngine {
67
+ private static readonly PROTOCOL_VERSION;
68
+ /** @internal */
69
+ static _createNativeDataStream(): NativeDataStream;
70
+ protected _engine: INativeEngine;
71
+ private _camera;
72
+ private _commandBufferEncoder;
73
+ private _frameStats;
74
+ private _boundBuffersVertexArray;
75
+ private _currentDepthTest;
76
+ private _stencilTest;
77
+ private _stencilMask;
78
+ private _stencilFunc;
79
+ private _stencilFuncRef;
80
+ private _stencilFuncMask;
81
+ private _stencilOpStencilFail;
82
+ private _stencilOpDepthFail;
83
+ private _stencilOpStencilDepthPass;
84
+ private _zOffset;
85
+ private _zOffsetUnits;
86
+ private _depthWrite;
87
+ private _fillModeWarningDisplayed;
88
+ constructor(options?: ThinNativeEngineOptions);
89
+ /**
90
+ * Keeps as a separate function to use in NativeEngine
91
+ * @internal
92
+ */
93
+ protected _initializeNativeEngine(adaptToDeviceRatio: boolean): void;
94
+ setHardwareScalingLevel(level: number): void;
95
+ dispose(): void;
96
+ /**
97
+ * Enable scissor test on a specific rectangle (ie. render will only be executed on a specific portion of the screen)
98
+ * @param x defines the x-coordinate of the bottom left corner of the clear rectangle
99
+ * @param y defines the y-coordinate of the corner of the clear rectangle
100
+ * @param width defines the width of the clear rectangle
101
+ * @param height defines the height of the clear rectangle
102
+ */
103
+ enableScissor(x: number, y: number, width: number, height: number): void;
104
+ /**
105
+ * Disable previously set scissor test rectangle
106
+ */
107
+ disableScissor(): void;
108
+ /**
109
+ * Can be used to override the current requestAnimationFrame requester.
110
+ * @internal
111
+ */
112
+ protected _queueNewFrame(bindedRenderFunction: any, requester?: any): number;
113
+ protected _restoreEngineAfterContextLost(): void;
114
+ /**
115
+ * Override default engine behavior.
116
+ * @param framebuffer
117
+ */
118
+ _bindUnboundFramebuffer(framebuffer: Nullable<WebGLFramebuffer>): void;
119
+ /**
120
+ * Gets host document
121
+ * @returns the host document object
122
+ */
123
+ getHostDocument(): Nullable<Document>;
124
+ clear(color: Nullable<IColor4Like>, backBuffer: boolean, depth: boolean, stencil?: boolean, stencilClearValue?: number): void;
125
+ createIndexBuffer(indices: IndicesArray, updateable?: boolean, _label?: string): NativeDataBuffer;
126
+ createVertexBuffer(vertices: DataArray, updateable?: boolean, _label?: string): NativeDataBuffer;
127
+ private _recordVertexArrayObject;
128
+ bindBuffers(vertexBuffers: {
129
+ [key: string]: VertexBuffer;
130
+ }, indexBuffer: Nullable<NativeDataBuffer>, effect: Effect): void;
131
+ recordVertexArrayObject(vertexBuffers: {
132
+ [key: string]: VertexBuffer;
133
+ }, indexBuffer: Nullable<NativeDataBuffer>, effect: Effect, overrideVertexBuffers?: {
134
+ [kind: string]: Nullable<VertexBuffer>;
135
+ }): WebGLVertexArrayObject;
136
+ private _deleteVertexArray;
137
+ bindVertexArrayObject(vertexArray: WebGLVertexArrayObject): void;
138
+ releaseVertexArrayObject(vertexArray: WebGLVertexArrayObject): void;
139
+ getAttributes(pipelineContext: IPipelineContext, attributesNames: string[]): number[];
140
+ /**
141
+ * Triangle Fan and Line Loop are not supported by modern rendering API
142
+ * @param fillMode defines the primitive to use
143
+ * @returns true if supported
144
+ */
145
+ private _checkSupportedFillMode;
146
+ /**
147
+ * Draw a list of indexed primitives
148
+ * @param fillMode defines the primitive to use
149
+ * @param indexStart defines the starting index
150
+ * @param indexCount defines the number of index to draw
151
+ * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
152
+ */
153
+ drawElementsType(fillMode: number, indexStart: number, indexCount: number, instancesCount?: number): void;
154
+ /**
155
+ * Draw a list of unindexed primitives
156
+ * @param fillMode defines the primitive to use
157
+ * @param verticesStart defines the index of first vertex to draw
158
+ * @param verticesCount defines the count of vertices to draw
159
+ * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
160
+ */
161
+ drawArraysType(fillMode: number, verticesStart: number, verticesCount: number, instancesCount?: number): void;
162
+ createPipelineContext(shaderProcessingContext: Nullable<_IShaderProcessingContext>): IPipelineContext;
163
+ createMaterialContext(): IMaterialContext | undefined;
164
+ createDrawContext(): IDrawContext | undefined;
165
+ /**
166
+ * Function is not technically Async
167
+ * @internal
168
+ */
169
+ _preparePipelineContextAsync(pipelineContext: IPipelineContext, vertexSourceCode: string, fragmentSourceCode: string, createAsRaw: boolean, _rawVertexSourceCode: string, _rawFragmentSourceCode: string, _rebuildRebind: any, defines: Nullable<string>, _transformFeedbackVaryings: Nullable<string[]>, _key: string, onReady: () => void): void;
170
+ /**
171
+ * @internal
172
+ */
173
+ _getShaderProcessingContext(_shaderLanguage: ShaderLanguage): Nullable<_IShaderProcessingContext>;
174
+ /**
175
+ * @internal
176
+ */
177
+ _executeWhenRenderingStateIsCompiled(pipelineContext: IPipelineContext, action: () => void): void;
178
+ createRawShaderProgram(): WebGLProgram;
179
+ createShaderProgram(pipelineContext: IPipelineContext, vertexCode: string, fragmentCode: string, defines: Nullable<string>): WebGLProgram;
180
+ /**
181
+ * Inline functions in shader code that are marked to be inlined
182
+ * @param code code to inline
183
+ * @returns inlined code
184
+ */
185
+ inlineShaderCode(code: string): string;
186
+ protected _setProgram(program: WebGLProgram): void;
187
+ _deletePipelineContext(pipelineContext: IPipelineContext): void;
188
+ getUniforms(pipelineContext: IPipelineContext, uniformsNames: string[]): WebGLUniformLocation[];
189
+ bindUniformBlock(pipelineContext: IPipelineContext, blockName: string, index: number): void;
190
+ bindSamplers(effect: Effect): void;
191
+ getRenderWidth(useScreen?: boolean): number;
192
+ getRenderHeight(useScreen?: boolean): number;
193
+ setViewport(viewport: IViewportLike, requiredWidth?: number, requiredHeight?: number): void;
194
+ setStateCullFaceType(_cullBackFaces?: boolean, _force?: boolean): void;
195
+ setState(culling: boolean, zOffset?: number, force?: boolean, reverseSide?: boolean, cullBackFaces?: boolean, stencil?: IStencilState, zOffsetUnits?: number): void;
196
+ /**
197
+ * Gets the client rect of native canvas. Needed for InputManager.
198
+ * @returns a client rectangle
199
+ */
200
+ getInputElementClientRect(): Nullable<DOMRect>;
201
+ /**
202
+ * Set the z offset Factor to apply to current rendering
203
+ * @param value defines the offset to apply
204
+ */
205
+ setZOffset(value: number): void;
206
+ /**
207
+ * Gets the current value of the zOffset Factor
208
+ * @returns the current zOffset Factor state
209
+ */
210
+ getZOffset(): number;
211
+ /**
212
+ * Set the z offset Units to apply to current rendering
213
+ * @param value defines the offset to apply
214
+ */
215
+ setZOffsetUnits(value: number): void;
216
+ /**
217
+ * Gets the current value of the zOffset Units
218
+ * @returns the current zOffset Units state
219
+ */
220
+ getZOffsetUnits(): number;
221
+ /**
222
+ * Enable or disable depth buffering
223
+ * @param enable defines the state to set
224
+ */
225
+ setDepthBuffer(enable: boolean): void;
226
+ /**
227
+ * Gets a boolean indicating if depth writing is enabled
228
+ * @returns the current depth writing state
229
+ */
230
+ getDepthWrite(): boolean;
231
+ getDepthFunction(): Nullable<number>;
232
+ setDepthFunction(depthFunc: number): void;
233
+ /**
234
+ * Enable or disable depth writing
235
+ * @param enable defines the state to set
236
+ */
237
+ setDepthWrite(enable: boolean): void;
238
+ /**
239
+ * Enable or disable color writing
240
+ * @param enable defines the state to set
241
+ */
242
+ setColorWrite(enable: boolean): void;
243
+ /**
244
+ * Gets a boolean indicating if color writing is enabled
245
+ * @returns the current color writing state
246
+ */
247
+ getColorWrite(): boolean;
248
+ private applyStencil;
249
+ private _setStencil;
250
+ /**
251
+ * Enable or disable the stencil buffer
252
+ * @param enable defines if the stencil buffer must be enabled or disabled
253
+ */
254
+ setStencilBuffer(enable: boolean): void;
255
+ /**
256
+ * Gets a boolean indicating if stencil buffer is enabled
257
+ * @returns the current stencil buffer state
258
+ */
259
+ getStencilBuffer(): boolean;
260
+ /**
261
+ * Gets the current stencil operation when stencil passes
262
+ * @returns a number defining stencil operation to use when stencil passes
263
+ */
264
+ getStencilOperationPass(): number;
265
+ /**
266
+ * Sets the stencil operation to use when stencil passes
267
+ * @param operation defines the stencil operation to use when stencil passes
268
+ */
269
+ setStencilOperationPass(operation: number): void;
270
+ /**
271
+ * Sets the current stencil mask
272
+ * @param mask defines the new stencil mask to use
273
+ */
274
+ setStencilMask(mask: number): void;
275
+ /**
276
+ * Sets the current stencil function
277
+ * @param stencilFunc defines the new stencil function to use
278
+ */
279
+ setStencilFunction(stencilFunc: number): void;
280
+ /**
281
+ * Sets the current stencil reference
282
+ * @param reference defines the new stencil reference to use
283
+ */
284
+ setStencilFunctionReference(reference: number): void;
285
+ /**
286
+ * Sets the current stencil mask
287
+ * @param mask defines the new stencil mask to use
288
+ */
289
+ setStencilFunctionMask(mask: number): void;
290
+ /**
291
+ * Sets the stencil operation to use when stencil fails
292
+ * @param operation defines the stencil operation to use when stencil fails
293
+ */
294
+ setStencilOperationFail(operation: number): void;
295
+ /**
296
+ * Sets the stencil operation to use when depth fails
297
+ * @param operation defines the stencil operation to use when depth fails
298
+ */
299
+ setStencilOperationDepthFail(operation: number): void;
300
+ /**
301
+ * Gets the current stencil mask
302
+ * @returns a number defining the new stencil mask to use
303
+ */
304
+ getStencilMask(): number;
305
+ /**
306
+ * Gets the current stencil function
307
+ * @returns a number defining the stencil function to use
308
+ */
309
+ getStencilFunction(): number;
310
+ /**
311
+ * Gets the current stencil reference value
312
+ * @returns a number defining the stencil reference value to use
313
+ */
314
+ getStencilFunctionReference(): number;
315
+ /**
316
+ * Gets the current stencil mask
317
+ * @returns a number defining the stencil mask to use
318
+ */
319
+ getStencilFunctionMask(): number;
320
+ /**
321
+ * Gets the current stencil operation when stencil fails
322
+ * @returns a number defining stencil operation to use when stencil fails
323
+ */
324
+ getStencilOperationFail(): number;
325
+ /**
326
+ * Gets the current stencil operation when depth fails
327
+ * @returns a number defining stencil operation to use when depth fails
328
+ */
329
+ getStencilOperationDepthFail(): number;
330
+ /**
331
+ * Sets alpha constants used by some alpha blending modes
332
+ * @param r defines the red component
333
+ * @param g defines the green component
334
+ * @param b defines the blue component
335
+ * @param a defines the alpha component
336
+ */
337
+ setAlphaConstants(r: number, g: number, b: number, a: number): void;
338
+ /**
339
+ * Sets the current alpha mode
340
+ * @param mode defines the mode to use (one of the BABYLON.Constants.ALPHA_XXX)
341
+ * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
342
+ * @param targetIndex defines the index of the target to set the alpha mode for (default is 0)
343
+ * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
344
+ */
345
+ setAlphaMode(mode: number, noDepthWriteChange?: boolean, targetIndex?: number): void;
346
+ setInt(uniform: WebGLUniformLocation, int: number): boolean;
347
+ setIntArray(uniform: WebGLUniformLocation, array: Int32Array): boolean;
348
+ setIntArray2(uniform: WebGLUniformLocation, array: Int32Array): boolean;
349
+ setIntArray3(uniform: WebGLUniformLocation, array: Int32Array): boolean;
350
+ setIntArray4(uniform: WebGLUniformLocation, array: Int32Array): boolean;
351
+ setFloatArray(uniform: WebGLUniformLocation, array: Float32Array): boolean;
352
+ setFloatArray2(uniform: WebGLUniformLocation, array: Float32Array): boolean;
353
+ setFloatArray3(uniform: WebGLUniformLocation, array: Float32Array): boolean;
354
+ setFloatArray4(uniform: WebGLUniformLocation, array: Float32Array): boolean;
355
+ setArray(uniform: WebGLUniformLocation, array: number[]): boolean;
356
+ setArray2(uniform: WebGLUniformLocation, array: number[]): boolean;
357
+ setArray3(uniform: WebGLUniformLocation, array: number[]): boolean;
358
+ setArray4(uniform: WebGLUniformLocation, array: number[]): boolean;
359
+ setMatrices(uniform: WebGLUniformLocation, matrices: DeepImmutable<FloatArray>): boolean;
360
+ setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): boolean;
361
+ setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): boolean;
362
+ setFloat(uniform: WebGLUniformLocation, value: number): boolean;
363
+ setFloat2(uniform: WebGLUniformLocation, x: number, y: number): boolean;
364
+ setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): boolean;
365
+ setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): boolean;
366
+ setColor3(uniform: WebGLUniformLocation, color3: IColor3Like): boolean;
367
+ setColor4(uniform: WebGLUniformLocation, color3: IColor3Like, alpha: number): boolean;
368
+ wipeCaches(bruteForce?: boolean): void;
369
+ protected _createTexture(): WebGLTexture;
370
+ protected _deleteTexture(texture: Nullable<WebGLHardwareTexture>): void;
371
+ /**
372
+ * Update the content of a dynamic texture
373
+ * @param texture defines the texture to update
374
+ * @param canvas defines the canvas containing the source
375
+ * @param invertY defines if data must be stored with Y axis inverted
376
+ * @param premulAlpha defines if alpha is stored as premultiplied
377
+ * @param format defines the format of the data
378
+ */
379
+ updateDynamicTexture(texture: Nullable<InternalTexture>, canvas: any, invertY: boolean, premulAlpha?: boolean, format?: number): void;
380
+ createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
381
+ createVideoElement(constraints: MediaTrackConstraints): any;
382
+ updateVideoTexture(texture: Nullable<InternalTexture>, video: HTMLVideoElement, invertY: boolean): void;
383
+ createRawTexture(data: Nullable<ArrayBufferView>, width: number, height: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, type?: number, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
384
+ createRawTexture2DArray(data: Nullable<ArrayBufferView>, width: number, height: number, depth: number, format: number, generateMipMaps: boolean, invertY: boolean, samplingMode: number, compression?: Nullable<string>, textureType?: number): InternalTexture;
385
+ updateRawTexture(texture: Nullable<InternalTexture>, bufferView: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number, useSRGBBuffer?: boolean): void;
386
+ /**
387
+ * Usually called from Texture.ts.
388
+ * Passed information to create a NativeTexture
389
+ * @param url defines a value which contains one of the following:
390
+ * * A conventional http URL, e.g. 'http://...' or 'file://...'
391
+ * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
392
+ * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
393
+ * @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file
394
+ * @param invertY when true, image is flipped when loaded. You probably want true. Certain compressed textures may invert this if their default is inverted (eg. ktx)
395
+ * @param scene needed for loading to the correct scene
396
+ * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
397
+ * @param onLoad optional callback to be called upon successful completion
398
+ * @param onError optional callback to be called upon failure
399
+ * @param buffer a source of a file previously fetched as either a base64 string, an ArrayBuffer (compressed or image format), HTMLImageElement (image format), or a Blob
400
+ * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
401
+ * @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures
402
+ * @param forcedExtension defines the extension to use to pick the right loader
403
+ * @param mimeType defines an optional mime type
404
+ * @param loaderOptions options to be passed to the loader
405
+ * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
406
+ * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
407
+ * @returns a InternalTexture for assignment back into BABYLON.Texture
408
+ */
409
+ createTexture(url: Nullable<string>, noMipmap: boolean, invertY: boolean, scene: Nullable<ISceneLike>, samplingMode?: number, onLoad?: Nullable<(texture: InternalTexture) => void>, onError?: Nullable<(message: string, exception: any) => void>, buffer?: Nullable<string | ArrayBuffer | ArrayBufferView | HTMLImageElement | Blob | ImageBitmap>, fallback?: Nullable<InternalTexture>, format?: Nullable<number>, forcedExtension?: Nullable<string>, mimeType?: string, loaderOptions?: any, creationFlags?: number, useSRGBBuffer?: boolean): InternalTexture;
410
+ /**
411
+ * Wraps an external native texture in a Babylon texture.
412
+ * @param texture defines the external texture
413
+ * @param hasMipMaps defines whether the external texture has mip maps
414
+ * @param samplingMode defines the sampling mode for the external texture (default: Constants.TEXTURE_TRILINEAR_SAMPLINGMODE)
415
+ * @returns the babylon internal texture
416
+ */
417
+ wrapNativeTexture(texture: NativeTexture, hasMipMaps?: boolean, samplingMode?: number): InternalTexture;
418
+ _createDepthStencilTexture(size: TextureSize, options: DepthTextureCreationOptions, rtWrapper: RenderTargetWrapper): InternalTexture;
419
+ /**
420
+ * @internal
421
+ */
422
+ _releaseFramebufferObjects(framebuffer: Nullable<NativeFramebuffer>): void;
423
+ /**
424
+ * @internal Engine abstraction for loading and creating an image bitmap from a given source string.
425
+ * @param imageSource source to load the image from.
426
+ * @param _options An object that sets options for the image's extraction.
427
+ * @returns ImageBitmap
428
+ */
429
+ _createImageBitmapFromSource(imageSource: string, _options?: ImageBitmapOptions): Promise<ImageBitmap>;
430
+ /**
431
+ * Engine abstraction for createImageBitmap
432
+ * @param image source for image
433
+ * @param options An object that sets options for the image's extraction.
434
+ * @returns ImageBitmap
435
+ */
436
+ createImageBitmap(image: ImageBitmapSource, options?: ImageBitmapOptions): Promise<ImageBitmap>;
437
+ /**
438
+ * Resize an image and returns the image data as an uint8array
439
+ * @param image image to resize
440
+ * @param bufferWidth destination buffer width
441
+ * @param bufferHeight destination buffer height
442
+ * @returns an uint8array containing RGBA values of bufferWidth * bufferHeight size
443
+ */
444
+ resizeImageBitmap(image: ImageBitmap, bufferWidth: number, bufferHeight: number): Uint8Array;
445
+ /** @internal */
446
+ _createHardwareTexture(): IHardwareTextureWrapper;
447
+ /** @internal */
448
+ _createHardwareRenderTargetWrapper(isMulti: boolean, isCube: boolean, size: TextureSize): RenderTargetWrapper;
449
+ /** @internal */
450
+ _createInternalTexture(size: TextureSize, options: boolean | InternalTextureCreationOptions, _delayGPUTextureCreation?: boolean, source?: InternalTextureSource): InternalTexture;
451
+ createRenderTargetTexture(size: number | {
452
+ width: number;
453
+ height: number;
454
+ depth: number;
455
+ }, options: boolean | RenderTargetCreationOptions): RenderTargetWrapper;
456
+ updateRenderTargetTextureSampleCount(rtWrapper: RenderTargetWrapper, samples: number): number;
457
+ updateTextureSamplingMode(samplingMode: number, texture: InternalTexture): void;
458
+ bindFramebuffer(texture: RenderTargetWrapper, faceIndex?: number, requiredWidth?: number, requiredHeight?: number, forceFullscreenViewport?: boolean): void;
459
+ unBindFramebuffer(texture: RenderTargetWrapper, disableGenerateMipMaps?: boolean, onBeforeUnbind?: () => void): void;
460
+ createDynamicVertexBuffer(data: DataArray): DataBuffer;
461
+ updateDynamicIndexBuffer(indexBuffer: DataBuffer, indices: IndicesArray, offset?: number): void;
462
+ updateDynamicVertexBuffer(vertexBuffer: DataBuffer, data: DataArray, byteOffset?: number, byteLength?: number): void;
463
+ /**
464
+ * @internal
465
+ */
466
+ _setTexture(channel: number, texture: Nullable<BaseTexture>, isPartOfTextureArray?: boolean, depthStencilTexture?: boolean): boolean;
467
+ private _setTextureSampling;
468
+ private _setTextureWrapMode;
469
+ private _setNativeTexture;
470
+ private _unsetNativeTexture;
471
+ private _updateAnisotropicLevel;
472
+ /**
473
+ * @internal
474
+ */
475
+ _bindTexture(channel: number, texture: Nullable<InternalTexture>): void;
476
+ /**
477
+ * Unbind all textures
478
+ */
479
+ unbindAllTextures(): void;
480
+ protected _deleteBuffer(buffer: NativeDataBuffer): void;
481
+ /**
482
+ * Create a canvas
483
+ * @param width width
484
+ * @param height height
485
+ * @returns ICanvas interface
486
+ */
487
+ createCanvas(width: number, height: number): ICanvas;
488
+ /**
489
+ * Create an image to use with canvas
490
+ * @returns IImage interface
491
+ */
492
+ createCanvasImage(): IImage;
493
+ /**
494
+ * Create a 2D path to use with canvas
495
+ * @returns IPath2D interface
496
+ * @param d SVG path string
497
+ */
498
+ createCanvasPath2D(d?: string): IPath2D;
499
+ /**
500
+ * Update a portion of an internal texture
501
+ * @param texture defines the texture to update
502
+ * @param imageData defines the data to store into the texture
503
+ * @param xOffset defines the x coordinates of the update rectangle
504
+ * @param yOffset defines the y coordinates of the update rectangle
505
+ * @param width defines the width of the update rectangle
506
+ * @param height defines the height of the update rectangle
507
+ * @param faceIndex defines the face index if texture is a cube (0 by default)
508
+ * @param lod defines the lod level to update (0 by default)
509
+ * @param generateMipMaps defines whether to generate mipmaps or not
510
+ */
511
+ updateTextureData(texture: InternalTexture, imageData: ArrayBufferView, xOffset: number, yOffset: number, width: number, height: number, faceIndex?: number, lod?: number, generateMipMaps?: boolean): void;
512
+ /**
513
+ * @internal
514
+ */
515
+ _uploadCompressedDataToTextureDirectly(texture: InternalTexture, internalFormat: number, width: number, height: number, data: ArrayBufferView, faceIndex?: number, lod?: number): void;
516
+ /**
517
+ * @internal
518
+ */
519
+ _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
520
+ /**
521
+ * @internal
522
+ */
523
+ _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
524
+ getFontOffset(font: string): {
525
+ ascent: number;
526
+ height: number;
527
+ descent: number;
528
+ };
529
+ /**
530
+ * No equivalent for native. Do nothing.
531
+ */
532
+ flushFramebuffer(): void;
533
+ _readTexturePixels(texture: InternalTexture, width: number, height: number, faceIndex?: number, level?: number, buffer?: Nullable<ArrayBufferView<ArrayBuffer>>, _flushRenderer?: boolean, _noDataConversion?: boolean, x?: number, y?: number): Promise<ArrayBufferView>;
534
+ startTimeQuery(): Nullable<_TimeToken>;
535
+ endTimeQuery(token: _TimeToken): int;
536
+ }
537
+ export {};