nullEngine.d.ts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519
  1. import type { Nullable, FloatArray, IndicesArray } from "../types";
  2. import { Engine } from "../Engines/engine";
  3. import type { RenderTargetCreationOptions } from "../Materials/Textures/textureCreationOptions";
  4. import type { VertexBuffer } from "../Buffers/buffer";
  5. import { InternalTexture } from "../Materials/Textures/internalTexture";
  6. import type { Effect } from "../Materials/effect";
  7. import type { IPipelineContext } from "./IPipelineContext";
  8. import { DataBuffer } from "../Buffers/dataBuffer";
  9. import type { IColor4Like, IViewportLike } from "../Maths/math.like";
  10. import type { ISceneLike } from "./abstractEngine";
  11. import type { DrawWrapper } from "../Materials/drawWrapper";
  12. import { RenderTargetWrapper } from "./renderTargetWrapper";
  13. import type { IStencilState } from "../States/IStencilState";
  14. /**
  15. * Options to create the null engine
  16. */
  17. export declare class NullEngineOptions {
  18. /**
  19. * Render width (Default: 512)
  20. */
  21. renderWidth: number;
  22. /**
  23. * Render height (Default: 256)
  24. */
  25. renderHeight: number;
  26. /**
  27. * Texture size (Default: 512)
  28. */
  29. textureSize: number;
  30. /**
  31. * If delta time between frames should be constant
  32. * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
  33. */
  34. deterministicLockstep: boolean;
  35. /** Defines the seconds between each deterministic lock step */
  36. timeStep?: number;
  37. /**
  38. * Maximum about of steps between frames (Default: 4)
  39. * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
  40. */
  41. lockstepMaxSteps: number;
  42. /**
  43. * Make the matrix computations to be performed in 64 bits instead of 32 bits. False by default
  44. */
  45. useHighPrecisionMatrix?: boolean;
  46. }
  47. /**
  48. * The null engine class provides support for headless version of babylon.js.
  49. * This can be used in server side scenario or for testing purposes
  50. */
  51. export declare class NullEngine extends Engine {
  52. private _options;
  53. /**
  54. * Gets a boolean indicating that the engine is running in deterministic lock step mode
  55. * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
  56. * @returns true if engine is in deterministic lock step mode
  57. */
  58. isDeterministicLockStep(): boolean;
  59. /**
  60. * Gets the max steps when engine is running in deterministic lock step
  61. * @see https://doc.babylonjs.com/features/featuresDeepDive/animation/advanced_animations#deterministic-lockstep
  62. * @returns the max steps
  63. */
  64. getLockstepMaxSteps(): number;
  65. /**
  66. * Gets the current hardware scaling level.
  67. * By default the hardware scaling level is computed from the window device ratio.
  68. * if level = 1 then the engine will render at the exact resolution of the canvas. If level = 0.5 then the engine will render at twice the size of the canvas.
  69. * @returns a number indicating the current hardware scaling level
  70. */
  71. getHardwareScalingLevel(): number;
  72. constructor(options?: NullEngineOptions);
  73. /**
  74. * Creates a vertex buffer
  75. * @param vertices the data for the vertex buffer
  76. * @returns the new WebGL static buffer
  77. */
  78. createVertexBuffer(vertices: FloatArray): DataBuffer;
  79. /**
  80. * Creates a new index buffer
  81. * @param indices defines the content of the index buffer
  82. * @returns a new webGL buffer
  83. */
  84. createIndexBuffer(indices: IndicesArray): DataBuffer;
  85. /**
  86. * Clear the current render buffer or the current render target (if any is set up)
  87. * @param color defines the color to use
  88. * @param backBuffer defines if the back buffer must be cleared
  89. * @param depth defines if the depth buffer must be cleared
  90. * @param stencil defines if the stencil buffer must be cleared
  91. */
  92. clear(color: IColor4Like, backBuffer: boolean, depth: boolean, stencil?: boolean): void;
  93. /**
  94. * Gets the current render width
  95. * @param useScreen defines if screen size must be used (or the current render target if any)
  96. * @returns a number defining the current render width
  97. */
  98. getRenderWidth(useScreen?: boolean): number;
  99. /**
  100. * Gets the current render height
  101. * @param useScreen defines if screen size must be used (or the current render target if any)
  102. * @returns a number defining the current render height
  103. */
  104. getRenderHeight(useScreen?: boolean): number;
  105. /**
  106. * Set the WebGL's viewport
  107. * @param viewport defines the viewport element to be used
  108. * @param requiredWidth defines the width required for rendering. If not provided the rendering canvas' width is used
  109. * @param requiredHeight defines the height required for rendering. If not provided the rendering canvas' height is used
  110. */
  111. setViewport(viewport: IViewportLike, requiredWidth?: number, requiredHeight?: number): void;
  112. createShaderProgram(pipelineContext: IPipelineContext, vertexCode: string, fragmentCode: string, defines: string, context?: WebGLRenderingContext): WebGLProgram;
  113. /**
  114. * Gets the list of webGL uniform locations associated with a specific program based on a list of uniform names
  115. * @param pipelineContext defines the pipeline context to use
  116. * @param uniformsNames defines the list of uniform names
  117. * @returns an array of webGL uniform locations
  118. */
  119. getUniforms(pipelineContext: IPipelineContext, uniformsNames: string[]): Nullable<WebGLUniformLocation>[];
  120. /**
  121. * Gets the lsit of active attributes for a given webGL program
  122. * @param pipelineContext defines the pipeline context to use
  123. * @param attributesNames defines the list of attribute names to get
  124. * @returns an array of indices indicating the offset of each attribute
  125. */
  126. getAttributes(pipelineContext: IPipelineContext, attributesNames: string[]): number[];
  127. /**
  128. * Binds an effect to the webGL context
  129. * @param effect defines the effect to bind
  130. */
  131. bindSamplers(effect: Effect): void;
  132. /**
  133. * Activates an effect, making it the current one (ie. the one used for rendering)
  134. * @param effect defines the effect to activate
  135. */
  136. enableEffect(effect: Nullable<Effect | DrawWrapper>): void;
  137. /**
  138. * Set various states to the webGL context
  139. * @param culling defines culling state: true to enable culling, false to disable it
  140. * @param zOffset defines the value to apply to zOffset (0 by default)
  141. * @param force defines if states must be applied even if cache is up to date
  142. * @param reverseSide defines if culling must be reversed (CCW if false, CW if true)
  143. * @param cullBackFaces true to cull back faces, false to cull front faces (if culling is enabled)
  144. * @param stencil stencil states to set
  145. * @param zOffsetUnits defines the value to apply to zOffsetUnits (0 by default)
  146. */
  147. setState(culling: boolean, zOffset?: number, force?: boolean, reverseSide?: boolean, cullBackFaces?: boolean, stencil?: IStencilState, zOffsetUnits?: number): void;
  148. /**
  149. * Set the value of an uniform to an array of int32
  150. * @param uniform defines the webGL uniform location where to store the value
  151. * @param array defines the array of int32 to store
  152. * @returns true if value was set
  153. */
  154. setIntArray(uniform: WebGLUniformLocation, array: Int32Array): boolean;
  155. /**
  156. * Set the value of an uniform to an array of int32 (stored as vec2)
  157. * @param uniform defines the webGL uniform location where to store the value
  158. * @param array defines the array of int32 to store
  159. * @returns true if value was set
  160. */
  161. setIntArray2(uniform: WebGLUniformLocation, array: Int32Array): boolean;
  162. /**
  163. * Set the value of an uniform to an array of int32 (stored as vec3)
  164. * @param uniform defines the webGL uniform location where to store the value
  165. * @param array defines the array of int32 to store
  166. * @returns true if value was set
  167. */
  168. setIntArray3(uniform: WebGLUniformLocation, array: Int32Array): boolean;
  169. /**
  170. * Set the value of an uniform to an array of int32 (stored as vec4)
  171. * @param uniform defines the webGL uniform location where to store the value
  172. * @param array defines the array of int32 to store
  173. * @returns true if value was set
  174. */
  175. setIntArray4(uniform: WebGLUniformLocation, array: Int32Array): boolean;
  176. /**
  177. * Set the value of an uniform to an array of float32
  178. * @param uniform defines the webGL uniform location where to store the value
  179. * @param array defines the array of float32 to store
  180. * @returns true if value was set
  181. */
  182. setFloatArray(uniform: WebGLUniformLocation, array: Float32Array): boolean;
  183. /**
  184. * Set the value of an uniform to an array of float32 (stored as vec2)
  185. * @param uniform defines the webGL uniform location where to store the value
  186. * @param array defines the array of float32 to store
  187. * @returns true if value was set
  188. */
  189. setFloatArray2(uniform: WebGLUniformLocation, array: Float32Array): boolean;
  190. /**
  191. * Set the value of an uniform to an array of float32 (stored as vec3)
  192. * @param uniform defines the webGL uniform location where to store the value
  193. * @param array defines the array of float32 to store
  194. * @returns true if value was set
  195. */
  196. setFloatArray3(uniform: WebGLUniformLocation, array: Float32Array): boolean;
  197. /**
  198. * Set the value of an uniform to an array of float32 (stored as vec4)
  199. * @param uniform defines the webGL uniform location where to store the value
  200. * @param array defines the array of float32 to store
  201. * @returns true if value was set
  202. */
  203. setFloatArray4(uniform: WebGLUniformLocation, array: Float32Array): boolean;
  204. /**
  205. * Set the value of an uniform to an array of number
  206. * @param uniform defines the webGL uniform location where to store the value
  207. * @param array defines the array of number to store
  208. * @returns true if value was set
  209. */
  210. setArray(uniform: WebGLUniformLocation, array: number[]): boolean;
  211. /**
  212. * Set the value of an uniform to an array of number (stored as vec2)
  213. * @param uniform defines the webGL uniform location where to store the value
  214. * @param array defines the array of number to store
  215. * @returns true if value was set
  216. */
  217. setArray2(uniform: WebGLUniformLocation, array: number[]): boolean;
  218. /**
  219. * Set the value of an uniform to an array of number (stored as vec3)
  220. * @param uniform defines the webGL uniform location where to store the value
  221. * @param array defines the array of number to store
  222. * @returns true if value was set
  223. */
  224. setArray3(uniform: WebGLUniformLocation, array: number[]): boolean;
  225. /**
  226. * Set the value of an uniform to an array of number (stored as vec4)
  227. * @param uniform defines the webGL uniform location where to store the value
  228. * @param array defines the array of number to store
  229. * @returns true if value was set
  230. */
  231. setArray4(uniform: WebGLUniformLocation, array: number[]): boolean;
  232. /**
  233. * Set the value of an uniform to an array of float32 (stored as matrices)
  234. * @param uniform defines the webGL uniform location where to store the value
  235. * @param matrices defines the array of float32 to store
  236. * @returns true if value was set
  237. */
  238. setMatrices(uniform: WebGLUniformLocation, matrices: Float32Array): boolean;
  239. /**
  240. * Set the value of an uniform to a matrix (3x3)
  241. * @param uniform defines the webGL uniform location where to store the value
  242. * @param matrix defines the Float32Array representing the 3x3 matrix to store
  243. * @returns true if value was set
  244. */
  245. setMatrix3x3(uniform: WebGLUniformLocation, matrix: Float32Array): boolean;
  246. /**
  247. * Set the value of an uniform to a matrix (2x2)
  248. * @param uniform defines the webGL uniform location where to store the value
  249. * @param matrix defines the Float32Array representing the 2x2 matrix to store
  250. * @returns true if value was set
  251. */
  252. setMatrix2x2(uniform: WebGLUniformLocation, matrix: Float32Array): boolean;
  253. /**
  254. * Set the value of an uniform to a number (float)
  255. * @param uniform defines the webGL uniform location where to store the value
  256. * @param value defines the float number to store
  257. * @returns true if value was set
  258. */
  259. setFloat(uniform: WebGLUniformLocation, value: number): boolean;
  260. /**
  261. * Set the value of an uniform to a vec2
  262. * @param uniform defines the webGL uniform location where to store the value
  263. * @param x defines the 1st component of the value
  264. * @param y defines the 2nd component of the value
  265. * @returns true if value was set
  266. */
  267. setFloat2(uniform: WebGLUniformLocation, x: number, y: number): boolean;
  268. /**
  269. * Set the value of an uniform to a vec3
  270. * @param uniform defines the webGL uniform location where to store the value
  271. * @param x defines the 1st component of the value
  272. * @param y defines the 2nd component of the value
  273. * @param z defines the 3rd component of the value
  274. * @returns true if value was set
  275. */
  276. setFloat3(uniform: WebGLUniformLocation, x: number, y: number, z: number): boolean;
  277. /**
  278. * Set the value of an uniform to a boolean
  279. * @param uniform defines the webGL uniform location where to store the value
  280. * @param bool defines the boolean to store
  281. * @returns true if value was set
  282. */
  283. setBool(uniform: WebGLUniformLocation, bool: number): boolean;
  284. /**
  285. * Set the value of an uniform to a vec4
  286. * @param uniform defines the webGL uniform location where to store the value
  287. * @param x defines the 1st component of the value
  288. * @param y defines the 2nd component of the value
  289. * @param z defines the 3rd component of the value
  290. * @param w defines the 4th component of the value
  291. * @returns true if value was set
  292. */
  293. setFloat4(uniform: WebGLUniformLocation, x: number, y: number, z: number, w: number): boolean;
  294. /**
  295. * Sets the current alpha mode
  296. * @param mode defines the mode to use (one of the Engine.ALPHA_XXX)
  297. * @param noDepthWriteChange defines if depth writing state should remains unchanged (false by default)
  298. * @see https://doc.babylonjs.com/features/featuresDeepDive/materials/advanced/transparent_rendering
  299. */
  300. setAlphaMode(mode: number, noDepthWriteChange?: boolean): void;
  301. /**
  302. * Bind webGl buffers directly to the webGL context
  303. * @param vertexBuffers defines the vertex buffer to bind
  304. * @param indexBuffer defines the index buffer to bind
  305. * @param effect defines the effect associated with the vertex buffer
  306. */
  307. bindBuffers(vertexBuffers: {
  308. [key: string]: VertexBuffer;
  309. }, indexBuffer: DataBuffer, effect: Effect): void;
  310. /**
  311. * Force the entire cache to be cleared
  312. * You should not have to use this function unless your engine needs to share the webGL context with another engine
  313. * @param bruteForce defines a boolean to force clearing ALL caches (including stencil, detoh and alpha states)
  314. */
  315. wipeCaches(bruteForce?: boolean): void;
  316. /**
  317. * Send a draw order
  318. * @param useTriangles defines if triangles must be used to draw (else wireframe will be used)
  319. * @param indexStart defines the starting index
  320. * @param indexCount defines the number of index to draw
  321. * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
  322. */
  323. draw(useTriangles: boolean, indexStart: number, indexCount: number, instancesCount?: number): void;
  324. /**
  325. * Draw a list of indexed primitives
  326. * @param fillMode defines the primitive to use
  327. * @param indexStart defines the starting index
  328. * @param indexCount defines the number of index to draw
  329. * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
  330. */
  331. drawElementsType(fillMode: number, indexStart: number, indexCount: number, instancesCount?: number): void;
  332. /**
  333. * Draw a list of unindexed primitives
  334. * @param fillMode defines the primitive to use
  335. * @param verticesStart defines the index of first vertex to draw
  336. * @param verticesCount defines the count of vertices to draw
  337. * @param instancesCount defines the number of instances to draw (if instantiation is enabled)
  338. */
  339. drawArraysType(fillMode: number, verticesStart: number, verticesCount: number, instancesCount?: number): void;
  340. /** @internal */
  341. protected _createTexture(): WebGLTexture;
  342. /**
  343. * @internal
  344. */
  345. _releaseTexture(texture: InternalTexture): void;
  346. /**
  347. * Usually called from Texture.ts.
  348. * Passed information to create a WebGLTexture
  349. * @param urlArg defines a value which contains one of the following:
  350. * * A conventional http URL, e.g. 'http://...' or 'file://...'
  351. * * A base64 string of in-line texture data, e.g. 'data:image/jpg;base64,/...'
  352. * * An indicator that data being passed using the buffer parameter, e.g. 'data:mytexture.jpg'
  353. * @param noMipmap defines a boolean indicating that no mipmaps shall be generated. Ignored for compressed textures. They must be in the file
  354. * @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)
  355. * @param scene needed for loading to the correct scene
  356. * @param samplingMode mode with should be used sample / access the texture (Default: Texture.TRILINEAR_SAMPLINGMODE)
  357. * @param onLoad optional callback to be called upon successful completion
  358. * @param onError optional callback to be called upon failure
  359. * @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
  360. * @param fallback an internal argument in case the function must be called again, due to etc1 not having alpha capabilities
  361. * @param format internal format. Default: RGB when extension is '.jpg' else RGBA. Ignored for compressed textures
  362. * @param forcedExtension defines the extension to use to pick the right loader
  363. * @param mimeType defines an optional mime type
  364. * @returns a InternalTexture for assignment back into BABYLON.Texture
  365. */
  366. createTexture(urlArg: 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): InternalTexture;
  367. /**
  368. * @internal
  369. */
  370. _createHardwareRenderTargetWrapper(isMulti: boolean, isCube: boolean, size: number | {
  371. width: number;
  372. height: number;
  373. depth?: number;
  374. layers?: number;
  375. }): RenderTargetWrapper;
  376. /**
  377. * Creates a new render target wrapper
  378. * @param size defines the size of the texture
  379. * @param options defines the options used to create the texture
  380. * @returns a new render target wrapper
  381. */
  382. createRenderTargetTexture(size: any, options: boolean | RenderTargetCreationOptions): RenderTargetWrapper;
  383. /**
  384. * Creates a new render target wrapper
  385. * @param size defines the size of the texture
  386. * @param options defines the options used to create the texture
  387. * @returns a new render target wrapper
  388. */
  389. createRenderTargetCubeTexture(size: number, options?: RenderTargetCreationOptions): RenderTargetWrapper;
  390. /**
  391. * Update the sampling mode of a given texture
  392. * @param samplingMode defines the required sampling mode
  393. * @param texture defines the texture to update
  394. */
  395. updateTextureSamplingMode(samplingMode: number, texture: InternalTexture): void;
  396. /**
  397. * Creates a raw texture
  398. * @param data defines the data to store in the texture
  399. * @param width defines the width of the texture
  400. * @param height defines the height of the texture
  401. * @param format defines the format of the data
  402. * @param generateMipMaps defines if the engine should generate the mip levels
  403. * @param invertY defines if data must be stored with Y axis inverted
  404. * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
  405. * @param compression defines the compression used (null by default)
  406. * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
  407. * @param creationFlags specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg)
  408. * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
  409. * @returns the raw texture inside an InternalTexture
  410. */
  411. 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;
  412. /**
  413. * Update a raw texture
  414. * @param texture defines the texture to update
  415. * @param data defines the data to store in the texture
  416. * @param format defines the format of the data
  417. * @param invertY defines if data must be stored with Y axis inverted
  418. * @param compression defines the compression used (null by default)
  419. * @param type defines the type fo the data (Engine.TEXTURETYPE_UNSIGNED_INT by default)
  420. * @param useSRGBBuffer defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU).
  421. */
  422. updateRawTexture(texture: Nullable<InternalTexture>, data: Nullable<ArrayBufferView>, format: number, invertY: boolean, compression?: Nullable<string>, type?: number, useSRGBBuffer?: boolean): void;
  423. /**
  424. * Binds the frame buffer to the specified texture.
  425. * @param rtWrapper The render target wrapper to render to
  426. * @param faceIndex The face of the texture to render to in case of cube texture
  427. * @param requiredWidth The width of the target to render to
  428. * @param requiredHeight The height of the target to render to
  429. * @param forceFullscreenViewport Forces the viewport to be the entire texture/screen if true
  430. */
  431. bindFramebuffer(rtWrapper: RenderTargetWrapper, faceIndex?: number, requiredWidth?: number, requiredHeight?: number, forceFullscreenViewport?: boolean): void;
  432. /**
  433. * Unbind the current render target texture from the webGL context
  434. * @param rtWrapper defines the render target wrapper to unbind
  435. * @param disableGenerateMipMaps defines a boolean indicating that mipmaps must not be generated
  436. * @param onBeforeUnbind defines a function which will be called before the effective unbind
  437. */
  438. unBindFramebuffer(rtWrapper: RenderTargetWrapper, disableGenerateMipMaps?: boolean, onBeforeUnbind?: () => void): void;
  439. /**
  440. * Creates a dynamic vertex buffer
  441. * @param vertices the data for the dynamic vertex buffer
  442. * @returns the new WebGL dynamic buffer
  443. */
  444. createDynamicVertexBuffer(vertices: FloatArray): DataBuffer;
  445. /**
  446. * Update the content of a dynamic texture
  447. * @param texture defines the texture to update
  448. * @param canvas defines the canvas containing the source
  449. * @param invertY defines if data must be stored with Y axis inverted
  450. * @param premulAlpha defines if alpha is stored as premultiplied
  451. * @param format defines the format of the data
  452. */
  453. updateDynamicTexture(texture: Nullable<InternalTexture>, canvas: HTMLCanvasElement, invertY: boolean, premulAlpha?: boolean, format?: number): void;
  454. /**
  455. * Gets a boolean indicating if all created effects are ready
  456. * @returns true if all effects are ready
  457. */
  458. areAllEffectsReady(): boolean;
  459. /**
  460. * @internal
  461. * Get the current error code of the webGL context
  462. * @returns the error code
  463. * @see https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getError
  464. */
  465. getError(): number;
  466. /** @internal */
  467. _getUnpackAlignement(): number;
  468. /**
  469. * @internal
  470. */
  471. _unpackFlipY(value: boolean): void;
  472. /**
  473. * Update a dynamic index buffer
  474. * @param indexBuffer defines the target index buffer
  475. * @param indices defines the data to update
  476. * @param offset defines the offset in the target index buffer where update should start
  477. */
  478. updateDynamicIndexBuffer(indexBuffer: WebGLBuffer, indices: IndicesArray, offset?: number): void;
  479. /**
  480. * Updates a dynamic vertex buffer.
  481. * @param vertexBuffer the vertex buffer to update
  482. * @param vertices the data used to update the vertex buffer
  483. * @param byteOffset the byte offset of the data (optional)
  484. * @param byteLength the byte length of the data (optional)
  485. */
  486. updateDynamicVertexBuffer(vertexBuffer: WebGLBuffer, vertices: FloatArray, byteOffset?: number, byteLength?: number): void;
  487. /**
  488. * @internal
  489. */
  490. _bindTextureDirectly(target: number, texture: InternalTexture): boolean;
  491. /**
  492. * @internal
  493. */
  494. _bindTexture(channel: number, texture: InternalTexture): void;
  495. protected _deleteBuffer(buffer: WebGLBuffer): void;
  496. /**
  497. * Force the engine to release all cached effects. This means that next effect compilation will have to be done completely even if a similar effect was already compiled
  498. */
  499. releaseEffects(): void;
  500. displayLoadingUI(): void;
  501. hideLoadingUI(): void;
  502. set loadingUIText(_: string);
  503. /**
  504. * @internal
  505. */
  506. _uploadCompressedDataToTextureDirectly(texture: InternalTexture, internalFormat: number, width: number, height: number, data: ArrayBufferView, faceIndex?: number, lod?: number): void;
  507. /**
  508. * @internal
  509. */
  510. _uploadDataToTextureDirectly(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
  511. /**
  512. * @internal
  513. */
  514. _uploadArrayBufferViewToTexture(texture: InternalTexture, imageData: ArrayBufferView, faceIndex?: number, lod?: number): void;
  515. /**
  516. * @internal
  517. */
  518. _uploadImageToTexture(texture: InternalTexture, image: HTMLImageElement, faceIndex?: number, lod?: number): void;
  519. }