@babylonjs/core 7.35.1 → 7.36.0

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 (180) hide show
  1. package/Engines/Extensions/engine.multiRender.d.ts +11 -0
  2. package/Engines/Extensions/engine.multiRender.js +71 -32
  3. package/Engines/Extensions/engine.multiRender.js.map +1 -1
  4. package/Engines/Extensions/engine.prefilteredCubeTexture.js +3 -2
  5. package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
  6. package/Engines/Extensions/engine.renderTarget.js +1 -13
  7. package/Engines/Extensions/engine.renderTarget.js.map +1 -1
  8. package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +2 -0
  9. package/Engines/WebGL/webGLRenderTargetWrapper.js +37 -7
  10. package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
  11. package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +11 -0
  12. package/Engines/WebGPU/Extensions/engine.multiRender.js +30 -11
  13. package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
  14. package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -5
  15. package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
  16. package/Engines/WebGPU/webgpuCacheRenderPipeline.js +3 -2
  17. package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
  18. package/Engines/WebGPU/webgpuHardwareTexture.d.ts +3 -1
  19. package/Engines/WebGPU/webgpuHardwareTexture.js +5 -4
  20. package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
  21. package/Engines/WebGPU/webgpuTextureManager.js +2 -2
  22. package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
  23. package/Engines/abstractEngine.d.ts +11 -0
  24. package/Engines/abstractEngine.js +2 -2
  25. package/Engines/abstractEngine.js.map +1 -1
  26. package/Engines/renderTargetWrapper.d.ts +33 -1
  27. package/Engines/renderTargetWrapper.js +64 -4
  28. package/Engines/renderTargetWrapper.js.map +1 -1
  29. package/Engines/thinEngine.d.ts +13 -1
  30. package/Engines/thinEngine.js +115 -24
  31. package/Engines/thinEngine.js.map +1 -1
  32. package/Engines/thinWebGPUEngine.d.ts +2 -0
  33. package/Engines/thinWebGPUEngine.js +7 -0
  34. package/Engines/thinWebGPUEngine.js.map +1 -1
  35. package/Engines/webgpuEngine.d.ts +12 -3
  36. package/Engines/webgpuEngine.js +39 -9
  37. package/Engines/webgpuEngine.js.map +1 -1
  38. package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +8 -0
  39. package/FrameGraph/Node/Blocks/Textures/clearBlock.js +22 -1
  40. package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
  41. package/FrameGraph/Node/Blocks/inputBlock.d.ts +4 -9
  42. package/FrameGraph/Node/Blocks/inputBlock.js +15 -25
  43. package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
  44. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +10 -2
  45. package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
  46. package/FrameGraph/Passes/renderPass.d.ts +10 -10
  47. package/FrameGraph/Passes/renderPass.js +10 -10
  48. package/FrameGraph/Passes/renderPass.js.map +1 -1
  49. package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +10 -5
  50. package/FrameGraph/Tasks/PostProcesses/bloomTask.js +29 -14
  51. package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
  52. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +4 -0
  53. package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
  54. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +11 -6
  55. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +30 -13
  56. package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
  57. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +4 -6
  58. package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
  59. package/FrameGraph/Tasks/Rendering/cullObjectsTask.d.ts +1 -1
  60. package/FrameGraph/Tasks/Rendering/cullObjectsTask.js.map +1 -1
  61. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +3 -3
  62. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +33 -32
  63. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  64. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +4 -2
  65. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +8 -12
  66. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  67. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +13 -18
  68. package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
  69. package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +15 -2
  70. package/FrameGraph/Tasks/Texture/clearTextureTask.js +17 -4
  71. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  72. package/FrameGraph/Tasks/Texture/copyToTextureTask.js +2 -2
  73. package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
  74. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +3 -3
  75. package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
  76. package/FrameGraph/frameGraph.d.ts +11 -74
  77. package/FrameGraph/frameGraph.js +12 -126
  78. package/FrameGraph/frameGraph.js.map +1 -1
  79. package/FrameGraph/frameGraphRenderContext.d.ts +17 -8
  80. package/FrameGraph/frameGraphRenderContext.js +55 -43
  81. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  82. package/FrameGraph/frameGraphRenderTarget.d.ts +16 -0
  83. package/FrameGraph/frameGraphRenderTarget.js +67 -0
  84. package/FrameGraph/frameGraphRenderTarget.js.map +1 -0
  85. package/FrameGraph/frameGraphTask.d.ts +4 -3
  86. package/FrameGraph/frameGraphTask.js +41 -8
  87. package/FrameGraph/frameGraphTask.js.map +1 -1
  88. package/FrameGraph/frameGraphTextureManager.d.ts +130 -22
  89. package/FrameGraph/frameGraphTextureManager.js +312 -130
  90. package/FrameGraph/frameGraphTextureManager.js.map +1 -1
  91. package/FrameGraph/frameGraphTypes.d.ts +28 -13
  92. package/FrameGraph/frameGraphTypes.js.map +1 -1
  93. package/FrameGraph/index.d.ts +1 -0
  94. package/FrameGraph/index.js +1 -0
  95. package/FrameGraph/index.js.map +1 -1
  96. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +3 -2
  97. package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
  98. package/Materials/Node/Blocks/conditionalBlock.d.ts +2 -0
  99. package/Materials/Node/Blocks/conditionalBlock.js +13 -0
  100. package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
  101. package/Materials/Node/nodeMaterialBlock.js +4 -1
  102. package/Materials/Node/nodeMaterialBlock.js.map +1 -1
  103. package/Materials/Node/nodeMaterialBlockConnectionPoint.js +12 -4
  104. package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
  105. package/Materials/Textures/equiRectangularCubeTexture.js +14 -4
  106. package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
  107. package/Materials/Textures/internalTexture.d.ts +20 -0
  108. package/Materials/Textures/internalTexture.js +48 -0
  109. package/Materials/Textures/internalTexture.js.map +1 -1
  110. package/Materials/Textures/multiRenderTarget.d.ts +5 -0
  111. package/Materials/Textures/multiRenderTarget.js.map +1 -1
  112. package/Materials/Textures/textureCreationOptions.d.ts +6 -6
  113. package/Materials/Textures/textureCreationOptions.js.map +1 -1
  114. package/Materials/drawWrapper.js +4 -0
  115. package/Materials/drawWrapper.js.map +1 -1
  116. package/Materials/effect.js +2 -2
  117. package/Materials/effect.js.map +1 -1
  118. package/Materials/material.d.ts +2 -2
  119. package/Materials/material.js +5 -5
  120. package/Materials/material.js.map +1 -1
  121. package/Maths/math.color.d.ts +16 -0
  122. package/Maths/math.color.js +16 -0
  123. package/Maths/math.color.js.map +1 -1
  124. package/Maths/math.vector.d.ts +32 -0
  125. package/Maths/math.vector.js +32 -0
  126. package/Maths/math.vector.js.map +1 -1
  127. package/Meshes/Compression/dracoCompression.d.ts +3 -1
  128. package/Meshes/Compression/dracoCompression.js +5 -2
  129. package/Meshes/Compression/dracoCompression.js.map +1 -1
  130. package/Meshes/Node/Blocks/Matrices/rotationXBlock.d.ts +0 -1
  131. package/Meshes/Node/Blocks/Matrices/rotationXBlock.js +1 -9
  132. package/Meshes/Node/Blocks/Matrices/rotationXBlock.js.map +1 -1
  133. package/Meshes/Node/Blocks/Matrices/rotationYBlock.d.ts +0 -1
  134. package/Meshes/Node/Blocks/Matrices/rotationYBlock.js +1 -9
  135. package/Meshes/Node/Blocks/Matrices/rotationYBlock.js.map +1 -1
  136. package/Meshes/Node/Blocks/Matrices/rotationZBlock.d.ts +0 -1
  137. package/Meshes/Node/Blocks/Matrices/rotationZBlock.js +1 -9
  138. package/Meshes/Node/Blocks/Matrices/rotationZBlock.js.map +1 -1
  139. package/Meshes/Node/Blocks/Set/latticeBlock.js +3 -1
  140. package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -1
  141. package/Meshes/Node/Blocks/conditionBlock.d.ts +2 -0
  142. package/Meshes/Node/Blocks/conditionBlock.js +15 -0
  143. package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
  144. package/Meshes/Node/Blocks/geometryClampBlock.d.ts +4 -4
  145. package/Meshes/Node/Blocks/geometryClampBlock.js +16 -25
  146. package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
  147. package/Meshes/Node/Blocks/geometryLerpBlock.js +2 -2
  148. package/Meshes/Node/Blocks/geometryLerpBlock.js.map +1 -1
  149. package/Meshes/Node/Blocks/geometryNLerpBlock.js +2 -2
  150. package/Meshes/Node/Blocks/geometryNLerpBlock.js.map +1 -1
  151. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js +2 -2
  152. package/Meshes/Node/Blocks/geometryReplaceColorBlock.js.map +1 -1
  153. package/Meshes/Node/Blocks/geometryRotate2dBlock.js +2 -2
  154. package/Meshes/Node/Blocks/geometryRotate2dBlock.js.map +1 -1
  155. package/Meshes/Node/Blocks/geometrySmoothStepBlock.js +3 -3
  156. package/Meshes/Node/Blocks/geometrySmoothStepBlock.js.map +1 -1
  157. package/Meshes/Node/Blocks/geometryStepBlock.js +2 -2
  158. package/Meshes/Node/Blocks/geometryStepBlock.js.map +1 -1
  159. package/Meshes/Node/nodeGeometry.js +1 -1
  160. package/Meshes/Node/nodeGeometry.js.map +1 -1
  161. package/Meshes/Node/nodeGeometryBlock.d.ts +3 -1
  162. package/Meshes/Node/nodeGeometryBlock.js +2 -1
  163. package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
  164. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +10 -2
  165. package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
  166. package/Meshes/abstractMesh.js +1 -1
  167. package/Meshes/abstractMesh.js.map +1 -1
  168. package/Meshes/lattice.material.d.ts +1 -1
  169. package/Meshes/lattice.material.js +3 -3
  170. package/Meshes/lattice.material.js.map +1 -1
  171. package/Misc/observable.d.ts +3 -1
  172. package/Misc/observable.js +7 -2
  173. package/Misc/observable.js.map +1 -1
  174. package/ShadersWGSL/glowMapGeneration.fragment.js +4 -3
  175. package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
  176. package/ShadersWGSL/pbr.fragment.js +4 -3
  177. package/ShadersWGSL/pbr.fragment.js.map +1 -1
  178. package/package.json +1 -1
  179. package/scene.js +6 -6
  180. package/scene.js.map +1 -1
@@ -1,19 +1,22 @@
1
- import type { Scene, AbstractEngine, RenderTargetWrapper, TextureSize, Nullable, FrameGraphTextureCreationOptions, FrameGraphTextureHandle } from "../index.js";
1
+ import type { Scene, AbstractEngine, TextureSize, Nullable, FrameGraphTextureCreationOptions, FrameGraphTextureHandle, InternalTexture, FrameGraphTextureDescription, RenderTargetWrapper } from "../index.js";
2
2
  import { Texture } from "../Materials/Textures/texture";
3
+ import { FrameGraphRenderTarget } from "./frameGraphRenderTarget";
3
4
  type HistoryTexture = {
4
- textures: Array<Nullable<RenderTargetWrapper>>;
5
+ textures: Array<Nullable<InternalTexture>>;
5
6
  handles: Array<FrameGraphTextureHandle>;
6
7
  index: number;
7
- refHandles: Array<FrameGraphTextureHandle>;
8
+ references: Array<{
9
+ renderTargetWrapper: RenderTargetWrapper;
10
+ textureIndex: number;
11
+ }>;
8
12
  };
9
13
  type TextureEntry = {
10
- texture: Nullable<RenderTargetWrapper>;
14
+ texture: Nullable<InternalTexture>;
11
15
  name: string;
12
16
  creationOptions: FrameGraphTextureCreationOptions;
13
17
  namespace: FrameGraphTextureNamespace;
18
+ textureIndex?: number;
14
19
  debug?: Texture;
15
- parentHandle?: FrameGraphTextureHandle;
16
- parentTextureIndex?: number;
17
20
  refHandle?: FrameGraphTextureHandle;
18
21
  };
19
22
  declare enum FrameGraphTextureNamespace {
@@ -22,37 +25,142 @@ declare enum FrameGraphTextureNamespace {
22
25
  External = 2
23
26
  }
24
27
  /**
28
+ * Manages the textures used by a frame graph
25
29
  * @experimental
26
- * @internal
27
30
  */
28
31
  export declare class FrameGraphTextureManager {
29
- private _engine;
30
- private _debugTextures;
31
- private _scene?;
32
+ readonly engine: AbstractEngine;
33
+ private readonly _debugTextures;
34
+ private readonly _scene;
32
35
  private static _Counter;
33
- _textures: Map<FrameGraphTextureHandle, TextureEntry>;
34
- _historyTextures: Map<FrameGraphTextureHandle, HistoryTexture>;
35
- constructor(_engine: AbstractEngine, _debugTextures?: boolean, _scene?: Scene | undefined);
36
+ /** @internal */
37
+ readonly _textures: Map<FrameGraphTextureHandle, TextureEntry>;
38
+ /** @internal */
39
+ readonly _historyTextures: Map<FrameGraphTextureHandle, HistoryTexture>;
40
+ /** @internal */
41
+ _isRecordingTask: boolean;
42
+ /**
43
+ * Constructs a new instance of the texture manager
44
+ * @param engine The engine to use
45
+ * @param _debugTextures If true, debug textures will be created so that they are visible in the inspector
46
+ * @param _scene The scene the manager belongs to
47
+ */
48
+ constructor(engine: AbstractEngine, _debugTextures: boolean, _scene: Scene);
49
+ /**
50
+ * Checks if a handle is a backbuffer handle (color or depth/stencil)
51
+ * @param handle The handle to check
52
+ * @returns True if the handle is a backbuffer handle
53
+ */
36
54
  isBackbuffer(handle: FrameGraphTextureHandle): boolean;
55
+ /**
56
+ * Checks if a handle is a backbuffer color handle
57
+ * @param handle The handle to check
58
+ * @returns True if the handle is a backbuffer color handle
59
+ */
37
60
  isBackbufferColor(handle: FrameGraphTextureHandle): boolean;
61
+ /**
62
+ * Checks if a handle is a backbuffer depth/stencil handle
63
+ * @param handle The handle to check
64
+ * @returns True if the handle is a backbuffer depth/stencil handle
65
+ */
38
66
  isBackbufferDepthStencil(handle: FrameGraphTextureHandle): boolean;
67
+ /**
68
+ * Checks if a handle is a history texture (or points to a history texture, for a dangling handle)
69
+ * @param handle The handle to check
70
+ * @returns True if the handle is a history texture, otherwise false
71
+ */
72
+ isHistoryTexture(handle: FrameGraphTextureHandle): boolean;
73
+ /**
74
+ * Gets the creation options of a texture
75
+ * @param handle Handle of the texture
76
+ * @returns The creation options of the texture
77
+ */
39
78
  getTextureCreationOptions(handle: FrameGraphTextureHandle): FrameGraphTextureCreationOptions;
40
- getTextureFromHandle(handle: FrameGraphTextureHandle): Nullable<RenderTargetWrapper>;
41
- importTexture(name: string, texture: RenderTargetWrapper, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle;
42
- createRenderTargetTexture(name: string, taskNamespace: boolean, creationOptions: FrameGraphTextureCreationOptions, multiTargetMode?: boolean, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle;
79
+ /**
80
+ * Gets the description of a texture
81
+ * @param handle Handle of the texture
82
+ * @returns The description of the texture
83
+ */
84
+ getTextureDescription(handle: FrameGraphTextureHandle): FrameGraphTextureDescription;
85
+ /**
86
+ * Gets a texture handle or creates a new texture if the handle is not provided.
87
+ * If handle is not provided, newTextureName and creationOptions must be provided.
88
+ * @param handle If provided, will simply return the handle
89
+ * @param newTextureName Name of the new texture to create
90
+ * @param creationOptions Options to use when creating the new texture
91
+ * @returns The handle to the texture.
92
+ */
93
+ getTextureHandleOrCreateTexture(handle?: FrameGraphTextureHandle, newTextureName?: string, creationOptions?: FrameGraphTextureCreationOptions): FrameGraphTextureHandle;
94
+ /**
95
+ * Gets a texture from a handle.
96
+ * Note that if the texture is a history texture, the read texture for the current frame will be returned.
97
+ * @param handle The handle of the texture
98
+ * @returns The texture or null if not found
99
+ */
100
+ getTextureFromHandle(handle: FrameGraphTextureHandle): Nullable<InternalTexture>;
101
+ /**
102
+ * Imports a texture into the texture manager
103
+ * @param name Name of the texture
104
+ * @param texture Texture to import
105
+ * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.
106
+ * @returns The handle to the texture
107
+ */
108
+ importTexture(name: string, texture: InternalTexture, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle;
109
+ /**
110
+ * Creates a new render target texture
111
+ * If multiple textures are described in FrameGraphTextureCreationOptions, the handle of the first texture is returned, handle+1 is the handle of the second texture, etc.
112
+ * @param name Name of the texture
113
+ * @param creationOptions Options to use when creating the texture
114
+ * @param handle Existing handle to use for the texture. If not provided (default), a new handle will be created.
115
+ * @returns The handle to the texture
116
+ */
117
+ createRenderTargetTexture(name: string, creationOptions: FrameGraphTextureCreationOptions, handle?: FrameGraphTextureHandle): FrameGraphTextureHandle;
118
+ /**
119
+ * Creates a (frame graph) render target wrapper
120
+ * Note that renderTargets or renderTargetDepth can be undefined, but not both at the same time!
121
+ * @param name Name of the render target wrapper
122
+ * @param renderTargets Render target handles (textures) to use
123
+ * @param renderTargetDepth Render target depth handle (texture) to use
124
+ * @returns The created render target wrapper
125
+ */
126
+ createRenderTarget(name: string, renderTargets?: FrameGraphTextureHandle | FrameGraphTextureHandle[], renderTargetDepth?: FrameGraphTextureHandle): FrameGraphRenderTarget;
127
+ /**
128
+ * Creates a handle which is not associated with any texture.
129
+ * Call resolveDanglingHandle to associate the handle with a valid texture handle.
130
+ * @returns The dangling handle
131
+ */
132
+ createDanglingHandle(): number;
133
+ /**
134
+ * Associates a texture with a dangling handle
135
+ * @param danglingHandle The dangling handle
136
+ * @param handle The handle to associate with the dangling handle (if not provided, a new texture handle will be created, using the newTextureName and creationOptions parameters)
137
+ * @param newTextureName The name of the new texture to create (if handle is not provided)
138
+ * @param creationOptions The options to use when creating the new texture (if handle is not provided)
139
+ */
140
+ resolveDanglingHandle(danglingHandle: FrameGraphTextureHandle, handle?: FrameGraphTextureHandle, newTextureName?: string, creationOptions?: FrameGraphTextureCreationOptions): void;
141
+ /**
142
+ * Gets the absolute dimensions of a texture.
143
+ * @param size The size of the texture. Width and height must be expressed as a percentage of the screen size (100=100%)!
144
+ * @param screenWidth The width of the screen (default: the width of the rendering canvas)
145
+ * @param screenHeight The height of the screen (default: the height of the rendering canvas)
146
+ * @returns The absolute dimensions of the texture
147
+ */
43
148
  getAbsoluteDimensions(size: TextureSize, screenWidth?: number, screenHeight?: number): {
44
149
  width: number;
45
150
  height: number;
46
151
  };
47
- updateHistoryTextures(): void;
48
- dispose(): void;
49
- allocateTextures(): void;
50
- createDanglingHandle(): number;
51
- resolveDanglingHandle(danglingHandle: FrameGraphTextureHandle, handle: FrameGraphTextureHandle): void;
52
- releaseTextures(releaseAll?: boolean): void;
152
+ /** @internal */
153
+ _dispose(): void;
154
+ /** @internal */
155
+ _allocateTextures(): void;
156
+ /** @internal */
157
+ _releaseTextures(releaseAll?: boolean): void;
158
+ /** @internal */
159
+ _updateHistoryTextures(): void;
53
160
  private _addSystemTextures;
54
161
  private _createDebugTexture;
55
162
  private _freeEntry;
56
163
  private _createHandleForTexture;
164
+ private _cloneTextureOptions;
57
165
  }
58
166
  export {};