@onerjs/core 8.32.4 → 8.32.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 (40) hide show
  1. package/Engines/Extensions/engine.computeShader.d.ts +2 -3
  2. package/Engines/Extensions/engine.computeShader.js.map +1 -1
  3. package/Engines/ICanvas.d.ts +3 -3
  4. package/Engines/ICanvas.js.map +1 -1
  5. package/Engines/webgpuEngine.js +2 -2
  6. package/Engines/webgpuEngine.js.map +1 -1
  7. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +3 -0
  8. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +29 -14
  9. package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
  10. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.d.ts +12 -41
  11. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js +106 -184
  12. package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.js.map +1 -1
  13. package/FrameGraph/Passes/renderPass.js +3 -1
  14. package/FrameGraph/Passes/renderPass.js.map +1 -1
  15. package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +17 -58
  16. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +112 -122
  17. package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
  18. package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +11 -0
  19. package/FrameGraph/Tasks/Rendering/objectRendererTask.js +62 -26
  20. package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
  21. package/FrameGraph/Tasks/Texture/clearTextureTask.js +18 -8
  22. package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
  23. package/FrameGraph/frameGraphContext.js +2 -2
  24. package/FrameGraph/frameGraphContext.js.map +1 -1
  25. package/FrameGraph/frameGraphRenderContext.js +3 -3
  26. package/FrameGraph/frameGraphRenderContext.js.map +1 -1
  27. package/FrameGraph/frameGraphTask.js +2 -2
  28. package/FrameGraph/frameGraphTask.js.map +1 -1
  29. package/FrameGraph/frameGraphUtils.d.ts +2 -2
  30. package/FrameGraph/frameGraphUtils.js +6 -6
  31. package/FrameGraph/frameGraphUtils.js.map +1 -1
  32. package/Inputs/scene.inputManager.js +2 -0
  33. package/Inputs/scene.inputManager.js.map +1 -1
  34. package/Materials/materialHelper.geometryrendering.d.ts +5 -1
  35. package/Materials/materialHelper.geometryrendering.js +11 -2
  36. package/Materials/materialHelper.geometryrendering.js.map +1 -1
  37. package/Rendering/objectRenderer.d.ts +6 -2
  38. package/Rendering/objectRenderer.js +69 -63
  39. package/Rendering/objectRenderer.js.map +1 -1
  40. package/package.json +1 -1
@@ -1,24 +1,12 @@
1
- import { backbufferDepthStencilTextureHandle } from "../../frameGraphTypes.js";
2
1
  import { Color4 } from "../../../Maths/math.color.js";
3
2
  import { MaterialHelperGeometryRendering } from "../../../Materials/materialHelper.geometryrendering.js";
4
3
 
5
- import { FrameGraphTask } from "../../frameGraphTask.js";
6
- import { ObjectRenderer } from "../../../Rendering/objectRenderer.js";
4
+ import { FrameGraphObjectRendererTask } from "./objectRendererTask.js";
7
5
  const ClearColors = [new Color4(0, 0, 0, 0), new Color4(1, 1, 1, 1), new Color4(0, 0, 0, 0)];
8
6
  /**
9
7
  * Task used to render geometry to a set of textures.
10
8
  */
11
- export class FrameGraphGeometryRendererTask extends FrameGraphTask {
12
- /**
13
- * Gets or sets the camera used for rendering.
14
- */
15
- get camera() {
16
- return this._camera;
17
- }
18
- set camera(camera) {
19
- this._camera = camera;
20
- this._renderer.activeCamera = this.camera;
21
- }
9
+ export class FrameGraphGeometryRendererTask extends FrameGraphObjectRendererTask {
22
10
  /**
23
11
  * Whether to reverse culling (default is false).
24
12
  */
@@ -33,10 +21,16 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
33
21
  }
34
22
  }
35
23
  /**
36
- * The object renderer used by the geometry renderer task.
24
+ * Indicates whether the depth pre-pass is disabled (default is true).
25
+ * Materials that require depth pre-pass (Material.needDepthPrePass == true) don't work with the geometry renderer, that's why this setting is true by default.
26
+ * However, if the geometry renderer doesn't generate any geometry textures but only renders to the main target texture, then depth pre-pass can be enabled.
37
27
  */
38
- get objectRenderer() {
39
- return this._renderer;
28
+ get disableDepthPrePass() {
29
+ return this._disableDepthPrePass;
30
+ }
31
+ set disableDepthPrePass(value) {
32
+ this._disableDepthPrePass = value;
33
+ this._renderer.disableDepthPrePass = value;
40
34
  }
41
35
  /**
42
36
  * Gets or sets the name of the task.
@@ -50,36 +44,16 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
50
44
  this._renderer.name = value;
51
45
  }
52
46
  }
53
- /**
54
- * Force checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined). Default is true.
55
- */
56
- get forceLayerMaskCheck() {
57
- return this._forceLayerMaskCheck;
58
- }
59
- set forceLayerMaskCheck(value) {
60
- if (value === this._forceLayerMaskCheck) {
61
- return;
62
- }
63
- this._forceLayerMaskCheck = value;
64
- this._renderer.forceLayerMaskCheck = value;
65
- }
66
47
  /**
67
48
  * Constructs a new geometry renderer task.
68
49
  * @param name The name of the task.
69
50
  * @param frameGraph The frame graph the task belongs to.
70
51
  * @param scene The scene the frame graph is associated with.
71
52
  * @param options The options of the object renderer.
53
+ * @param existingObjectRenderer An existing object renderer to use (optional). If provided, the options parameter will be ignored.
72
54
  */
73
- constructor(name, frameGraph, scene, options) {
74
- super(name, frameGraph);
75
- /**
76
- * Whether depth testing is enabled (default is true).
77
- */
78
- this.depthTest = true;
79
- /**
80
- * Whether depth writing is enabled (default is true).
81
- */
82
- this.depthWrite = true;
55
+ constructor(name, frameGraph, scene, options, existingObjectRenderer) {
56
+ super(name, frameGraph, scene, options, existingObjectRenderer);
83
57
  /**
84
58
  * The size of the output textures (default is 100% of the back buffer texture size).
85
59
  */
@@ -97,26 +71,15 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
97
71
  * Indicates if a mesh shouldn't be rendered when its material has depth write disabled (default is true).
98
72
  */
99
73
  this.dontRenderWhenMaterialDepthWriteIsDisabled = true;
100
- /**
101
- * If true, the output geometry texture(s) will be resolved at the end of the render pass, if samples is greater than 1 (default: true)
102
- */
103
- this.resolveMSAAColors = true;
104
- /**
105
- * If true, depthTexture will be resolved at the end of the render pass, if this texture is provided and samples is greater than 1 (default: true)
106
- */
107
- this.resolveMSAADepth = false;
74
+ this._disableDepthPrePass = true;
108
75
  /**
109
76
  * The list of texture descriptions used by the geometry renderer task.
110
77
  */
111
78
  this.textureDescriptions = [];
112
- this._forceLayerMaskCheck = true;
113
- this._scene = scene;
114
- this._engine = this._scene.getEngine();
115
- this._renderer = new ObjectRenderer(name, scene, options);
116
- this._renderer.renderSprites = false;
117
- this._renderer.renderParticles = false;
118
- this._renderer.enableBoundingBoxRendering = false;
119
- this._renderer.enableOutlineRendering = false;
79
+ this.renderSprites = false;
80
+ this.renderParticles = false;
81
+ this.enableBoundingBoxRendering = false;
82
+ this.enableOutlineRendering = false;
120
83
  this._renderer.disableDepthPrePass = true;
121
84
  this._renderer.customIsReadyFunction = (mesh, refreshRate, preWarm) => {
122
85
  if (this.dontRenderWhenMaterialDepthWriteIsDisabled && mesh.material && mesh.material.disableDepthWrite) {
@@ -129,10 +92,8 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
129
92
  scene.updateTransformMatrix(true);
130
93
  }
131
94
  });
132
- this.name = name;
133
95
  this._clearAttachmentsLayout = new Map();
134
96
  this._allAttachmentsLayout = [];
135
- this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
136
97
  this.geometryViewDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
137
98
  this.geometryNormViewDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
138
99
  this.geometryScreenDepthTexture = this._frameGraph.textureManager.createDanglingHandle();
@@ -176,34 +137,19 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
176
137
  list.splice(index, 1);
177
138
  }
178
139
  }
179
- isReady() {
180
- return this._renderer.isReadyForRendering(this._textureWidth, this._textureHeight);
181
- }
182
140
  getClassName() {
183
141
  return "FrameGraphGeometryRendererTask";
184
142
  }
185
- record() {
186
- if (this.objectList === undefined) {
187
- throw new Error(`FrameGraphGeometryRendererTask ${this.name}: object list must be provided`);
188
- }
189
- // Make sure the renderList / particleSystemList are set when FrameGraphGeometryRendererTask.isReady() is called!
190
- this._renderer.renderList = this.objectList.meshes;
191
- this._renderer.particleSystemList = this.objectList.particleSystems;
192
- const outputTextureHandle = this._createMultiRenderTargetTexture();
193
- const depthEnabled = this._checkDepthTextureCompatibility();
143
+ record(skipCreationOfDisabledPasses = false, additionalExecute) {
194
144
  this._buildClearAttachmentsLayout();
195
145
  this._registerForRenderPassId(this._renderer.renderPassId);
196
- const outputTextureDescription = outputTextureHandle.length > 0 ? this._frameGraph.textureManager.getTextureDescription(outputTextureHandle[0]) : null;
197
- this._textureWidth = outputTextureDescription?.size.width ?? 0;
198
- this._textureHeight = outputTextureDescription?.size.height ?? 0;
199
- // Create pass
200
146
  MaterialHelperGeometryRendering.MarkAsDirty(this._renderer.renderPassId, this.objectList.meshes || this._scene.meshes);
201
- const pass = this._frameGraph.addRenderPass(this.name);
202
- pass.setRenderTarget(outputTextureHandle);
147
+ const pass = super.record(skipCreationOfDisabledPasses, additionalExecute);
148
+ const outputTextureHandles = pass.renderTarget;
203
149
  let needPreviousWorldMatrices = false;
204
150
  for (let i = 0; i < this.textureDescriptions.length; i++) {
205
151
  const description = this.textureDescriptions[i];
206
- const handle = outputTextureHandle[i];
152
+ const handle = outputTextureHandles[i];
207
153
  const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);
208
154
  const geometryDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index];
209
155
  switch (geometryDescription.type) {
@@ -245,30 +191,55 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
245
191
  }
246
192
  }
247
193
  this._scene.needsPreviousWorldMatrices = needPreviousWorldMatrices;
248
- pass.setRenderTargetDepth(this.depthTexture);
249
- pass.setExecuteFunc((context) => {
250
- this._renderer.renderList = this.objectList.meshes;
251
- this._renderer.particleSystemList = this.objectList.particleSystems;
252
- pass.frameGraphRenderTarget.renderTargetWrapper.resolveMSAAColors = this.resolveMSAAColors;
253
- pass.frameGraphRenderTarget.renderTargetWrapper.resolveMSAADepth = this.resolveMSAADepth;
254
- context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);
255
- this._clearAttachmentsLayout.forEach((layout, clearType) => {
256
- context.clearColorAttachments(ClearColors[clearType], layout);
257
- });
258
- context.bindAttachments(this._allAttachmentsLayout);
259
- context.render(this._renderer, this._textureWidth, this._textureHeight);
260
- });
261
- const passDisabled = this._frameGraph.addRenderPass(this.name + "_disabled", true);
262
- passDisabled.setRenderTarget(outputTextureHandle);
263
- passDisabled.setRenderTargetDepth(this.depthTexture);
264
- passDisabled.setExecuteFunc((_context) => { });
194
+ return pass;
265
195
  }
266
196
  dispose() {
267
197
  MaterialHelperGeometryRendering.DeleteConfiguration(this._renderer.renderPassId);
268
198
  this._renderer.dispose();
269
199
  super.dispose();
270
200
  }
271
- _createMultiRenderTargetTexture() {
201
+ _resolveDanglingHandles(_targetTextures) {
202
+ if (this.targetTexture !== undefined) {
203
+ this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, Array.isArray(this.targetTexture) ? this.targetTexture[0] : this.targetTexture);
204
+ }
205
+ if (this.depthTexture !== undefined) {
206
+ this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
207
+ }
208
+ }
209
+ _checkParameters() {
210
+ if (this.objectList === undefined || this.camera === undefined) {
211
+ throw new Error(`FrameGraphGeometryRendererTask ${this.name}: object list and camera must be provided`);
212
+ }
213
+ }
214
+ _checkTextureCompatibility(targetTextures) {
215
+ let depthEnabled = false;
216
+ let dimensions = null;
217
+ if (this.targetTexture !== undefined) {
218
+ const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(Array.isArray(this.targetTexture) ? this.targetTexture[0] : this.targetTexture);
219
+ if (this.samples !== outputTextureDescription.options.samples) {
220
+ throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the target texture and the output geometry textures must have the same number of samples`);
221
+ }
222
+ dimensions = outputTextureDescription.size;
223
+ }
224
+ if (this.depthTexture !== undefined) {
225
+ const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);
226
+ if (depthTextureDescription.options.samples !== this.samples && this.textureDescriptions.length > 0) {
227
+ throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth texture and the output geometry textures must have the same number of samples`);
228
+ }
229
+ this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
230
+ depthEnabled = true;
231
+ dimensions = depthTextureDescription.size;
232
+ }
233
+ const geomTextureDimensions = this.sizeIsPercentage ? this._frameGraph.textureManager.getAbsoluteDimensions(this.size) : this.size;
234
+ if (dimensions !== null) {
235
+ if (geomTextureDimensions.width !== dimensions.width || geomTextureDimensions.height !== dimensions.height) {
236
+ throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the geometry textures (size: ${geomTextureDimensions.width}x${geomTextureDimensions.height}) and the target/depth texture (size: ${dimensions.width}x${dimensions.height}) must have the same dimensions.`);
237
+ }
238
+ }
239
+ depthEnabled = depthEnabled || super._checkTextureCompatibility(targetTextures);
240
+ return depthEnabled;
241
+ }
242
+ _getTargetHandles() {
272
243
  const types = [];
273
244
  const formats = [];
274
245
  const labels = [];
@@ -284,38 +255,40 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
284
255
  labels[i] = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index].name;
285
256
  useSRGBBuffers[i] = false;
286
257
  }
287
- const baseHandle = this._frameGraph.textureManager.createRenderTargetTexture(this.name, {
288
- size: this.size,
289
- sizeIsPercentage: this.sizeIsPercentage,
290
- options: {
291
- createMipMaps: false,
292
- samples: this.samples,
293
- types,
294
- formats,
295
- useSRGBBuffers,
296
- labels,
297
- },
298
- });
299
258
  const handles = [];
300
- for (let i = 0; i < this.textureDescriptions.length; i++) {
301
- handles.push(baseHandle + i);
259
+ if (this.textureDescriptions.length > 0) {
260
+ const baseHandle = this._frameGraph.textureManager.createRenderTargetTexture(this.name, {
261
+ size: this.size,
262
+ sizeIsPercentage: this.sizeIsPercentage,
263
+ options: {
264
+ createMipMaps: false,
265
+ samples: this.samples,
266
+ types,
267
+ formats,
268
+ useSRGBBuffers,
269
+ labels,
270
+ },
271
+ });
272
+ for (let i = 0; i < this.textureDescriptions.length; i++) {
273
+ handles.push(baseHandle + i);
274
+ }
302
275
  }
303
- return handles;
304
- }
305
- _checkDepthTextureCompatibility() {
306
- let depthEnabled = false;
307
- if (this.depthTexture !== undefined) {
308
- if (this.depthTexture === backbufferDepthStencilTextureHandle) {
309
- throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth/stencil back buffer is not allowed as a depth texture`);
276
+ if (this.targetTexture !== undefined) {
277
+ if (Array.isArray(this.targetTexture)) {
278
+ handles.push(...this.targetTexture);
310
279
  }
311
- const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);
312
- if (depthTextureDescription.options.samples !== this.samples && this.textureDescriptions.length > 0) {
313
- throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);
280
+ else {
281
+ handles.push(this.targetTexture);
314
282
  }
315
- this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);
316
- depthEnabled = true;
317
283
  }
318
- return depthEnabled;
284
+ return handles;
285
+ }
286
+ _prepareRendering(context, depthEnabled) {
287
+ context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);
288
+ this._clearAttachmentsLayout.forEach((layout, clearType) => {
289
+ context.clearColorAttachments(ClearColors[clearType], layout);
290
+ });
291
+ context.bindAttachments(this._allAttachmentsLayout);
319
292
  }
320
293
  _buildClearAttachmentsLayout() {
321
294
  const clearAttachmentsLayout = new Map();
@@ -337,6 +310,20 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
337
310
  });
338
311
  allAttachmentsLayout.push(true);
339
312
  }
313
+ if (this.targetTexture !== undefined) {
314
+ let layout = clearAttachmentsLayout.get(0 /* GeometryRenderingTextureClearType.Zero */);
315
+ if (layout === undefined) {
316
+ layout = [];
317
+ clearAttachmentsLayout.set(0 /* GeometryRenderingTextureClearType.Zero */, layout);
318
+ for (let j = 0; j < this.textureDescriptions.length - 1; j++) {
319
+ layout[j] = false;
320
+ }
321
+ }
322
+ clearAttachmentsLayout.forEach((layout) => {
323
+ layout.push(false);
324
+ });
325
+ allAttachmentsLayout.push(true);
326
+ }
340
327
  this._clearAttachmentsLayout = new Map();
341
328
  clearAttachmentsLayout.forEach((layout, clearType) => {
342
329
  this._clearAttachmentsLayout.set(clearType, this._engine.buildTextureLayout(layout));
@@ -351,6 +338,9 @@ export class FrameGraphGeometryRendererTask extends FrameGraphTask {
351
338
  const geometryDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index];
352
339
  configuration.defines[geometryDescription.defineIndex] = i;
353
340
  }
341
+ if (this.targetTexture !== undefined) {
342
+ configuration.defines["PREPASS_COLOR_INDEX"] = this.textureDescriptions.length;
343
+ }
354
344
  configuration.reverseCulling = this.reverseCulling;
355
345
  }
356
346
  }
@@ -1 +1 @@
1
- {"version":3,"file":"geometryRendererTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Rendering/geometryRendererTask.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,mCAAmC,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,qCAA8B;AAC/C,OAAO,EAAE,+BAA+B,EAAE,+DAAwD;AAClG,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM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AAG,CAAC,CAAC;QAC/D,CAAC;QAED,aAAa,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IACvD,CAAC;CACJ","sourcesContent":["import type {\r\n FrameGraphTextureHandle,\r\n Scene,\r\n Camera,\r\n AbstractEngine,\r\n FrameGraph,\r\n GeometryRenderingTextureClearType,\r\n FrameGraphObjectList,\r\n AbstractMesh,\r\n ObjectRendererOptions,\r\n} from \"core/index\";\r\nimport { backbufferDepthStencilTextureHandle } from \"../../frameGraphTypes\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { MaterialHelperGeometryRendering } from \"core/Materials/materialHelper.geometryrendering\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphTask } from \"../../frameGraphTask\";\r\nimport { ObjectRenderer } from \"../../../Rendering/objectRenderer\";\r\n\r\n/**\r\n * Description of a texture used by the geometry renderer task.\r\n */\r\nexport interface IFrameGraphGeometryRendererTextureDescription {\r\n /**\r\n * The type of the texture.\r\n * The value should be one of the Constants.PREPASS_XXX_TEXTURE_TYPE values.\r\n */\r\n type: number;\r\n\r\n /**\r\n * The type of the texture.\r\n */\r\n textureType: number;\r\n\r\n /**\r\n * The format of the texture.\r\n */\r\n textureFormat: number;\r\n}\r\n\r\nconst ClearColors: Color4[] = [new Color4(0, 0, 0, 0), new Color4(1, 1, 1, 1), new Color4(0, 0, 0, 0)];\r\n\r\n/**\r\n * Task used to render geometry to a set of textures.\r\n */\r\nexport class FrameGraphGeometryRendererTask extends FrameGraphTask {\r\n /**\r\n * The depth texture attachment to use for rendering (optional).\r\n */\r\n public depthTexture?: FrameGraphTextureHandle;\r\n\r\n private _camera: Camera;\r\n\r\n /**\r\n * Gets or sets the camera used for rendering.\r\n */\r\n public get camera() {\r\n return this._camera;\r\n }\r\n\r\n public set camera(camera: Camera) {\r\n this._camera = camera;\r\n this._renderer.activeCamera = this.camera;\r\n }\r\n\r\n /**\r\n * The object list used for rendering.\r\n */\r\n public objectList: FrameGraphObjectList;\r\n\r\n /**\r\n * Whether depth testing is enabled (default is true).\r\n */\r\n public depthTest = true;\r\n\r\n /**\r\n * Whether depth writing is enabled (default is true).\r\n */\r\n public depthWrite = true;\r\n\r\n /**\r\n * The size of the output textures (default is 100% of the back buffer texture size).\r\n */\r\n public size: { width: number; height: number } = { width: 100, height: 100 };\r\n\r\n /**\r\n * Whether the size is a percentage of the back buffer size (default is true).\r\n */\r\n public sizeIsPercentage = true;\r\n\r\n /**\r\n * The number of samples to use for the output textures (default is 1).\r\n */\r\n public samples = 1;\r\n\r\n private _reverseCulling = false;\r\n\r\n /**\r\n * Whether to reverse culling (default is false).\r\n */\r\n public get reverseCulling() {\r\n return this._reverseCulling;\r\n }\r\n\r\n public set reverseCulling(value: boolean) {\r\n this._reverseCulling = value;\r\n\r\n const configuration = MaterialHelperGeometryRendering.GetConfiguration(this._renderer.renderPassId);\r\n if (configuration) {\r\n configuration.reverseCulling = value;\r\n }\r\n }\r\n\r\n /**\r\n * Indicates if a mesh shouldn't be rendered when its material has depth write disabled (default is true).\r\n */\r\n public dontRenderWhenMaterialDepthWriteIsDisabled = true;\r\n\r\n /**\r\n * If true, the output geometry texture(s) will be resolved at the end of the render pass, if samples is greater than 1 (default: true)\r\n */\r\n public resolveMSAAColors = true;\r\n\r\n /**\r\n * If true, depthTexture will be resolved at the end of the render pass, if this texture is provided and samples is greater than 1 (default: true)\r\n */\r\n public resolveMSAADepth = false;\r\n\r\n /**\r\n * The list of texture descriptions used by the geometry renderer task.\r\n */\r\n public textureDescriptions: IFrameGraphGeometryRendererTextureDescription[] = [];\r\n\r\n /**\r\n * The output depth texture attachment texture.\r\n * This texture will point to the same texture than the depthTexture property if it is set.\r\n * Note, however, that the handle itself will be different!\r\n */\r\n public readonly outputDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryViewDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The normalized depth (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n * The normalization is (d - near) / (far - near), where d is the depth value in view space and near and far are the near and far planes of the camera.\r\n */\r\n public readonly geometryNormViewDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth (in screen space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryScreenDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The normal (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryViewNormalTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The normal (in world space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryWorldNormalTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The position (in local space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryLocalPositionTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The position (in world space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryWorldPositionTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The albedo output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryAlbedoTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The reflectivity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryReflectivityTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The velocity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryVelocityTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The linear velocity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryLinearVelocityTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The object renderer used by the geometry renderer task.\r\n */\r\n public get objectRenderer() {\r\n return this._renderer;\r\n }\r\n\r\n /**\r\n * Gets or sets the name of the task.\r\n */\r\n public override get name() {\r\n return this._name;\r\n }\r\n\r\n public override set name(value: string) {\r\n this._name = value;\r\n if (this._renderer) {\r\n this._renderer.name = value;\r\n }\r\n }\r\n\r\n private _forceLayerMaskCheck = true;\r\n /**\r\n * Force checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined). Default is true.\r\n */\r\n public get forceLayerMaskCheck() {\r\n return this._forceLayerMaskCheck;\r\n }\r\n\r\n public set forceLayerMaskCheck(value: boolean) {\r\n if (value === this._forceLayerMaskCheck) {\r\n return;\r\n }\r\n\r\n this._forceLayerMaskCheck = value;\r\n this._renderer.forceLayerMaskCheck = value;\r\n }\r\n\r\n private readonly _engine: AbstractEngine;\r\n private readonly _scene: Scene;\r\n private readonly _renderer: ObjectRenderer;\r\n private _textureWidth: number;\r\n private _textureHeight: number;\r\n private _clearAttachmentsLayout: Map<GeometryRenderingTextureClearType, number[]>;\r\n private _allAttachmentsLayout: number[];\r\n\r\n /**\r\n * Constructs a new geometry renderer task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the frame graph is associated with.\r\n * @param options The options of the object renderer.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene, options?: ObjectRendererOptions) {\r\n super(name, frameGraph);\r\n\r\n this._scene = scene;\r\n this._engine = this._scene.getEngine();\r\n\r\n this._renderer = new ObjectRenderer(name, scene, options);\r\n this._renderer.renderSprites = false;\r\n this._renderer.renderParticles = false;\r\n this._renderer.enableBoundingBoxRendering = false;\r\n this._renderer.enableOutlineRendering = false;\r\n this._renderer.disableDepthPrePass = true;\r\n\r\n this._renderer.customIsReadyFunction = (mesh: AbstractMesh, refreshRate: number, preWarm?: boolean) => {\r\n if (this.dontRenderWhenMaterialDepthWriteIsDisabled && mesh.material && mesh.material.disableDepthWrite) {\r\n return !!preWarm;\r\n }\r\n\r\n return mesh.isReady(refreshRate === 0);\r\n };\r\n\r\n this._renderer.onBeforeRenderingManagerRenderObservable.add(() => {\r\n if (!this._renderer.options.doNotChangeAspectRatio) {\r\n scene.updateTransformMatrix(true);\r\n }\r\n });\r\n\r\n this.name = name;\r\n this._clearAttachmentsLayout = new Map();\r\n this._allAttachmentsLayout = [];\r\n\r\n this.outputDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryViewDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryNormViewDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryScreenDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryViewNormalTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryWorldNormalTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryLocalPositionTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryWorldPositionTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryAlbedoTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryReflectivityTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryVelocityTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryLinearVelocityTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n /**\r\n * Gets the list of excluded meshes from the velocity texture.\r\n */\r\n public get excludedSkinnedMeshFromVelocityTexture(): AbstractMesh[] {\r\n return MaterialHelperGeometryRendering.GetConfiguration(this._renderer.renderPassId).excludedSkinnedMesh;\r\n }\r\n\r\n /**\r\n * Excludes the given skinned mesh from computing bones velocities.\r\n * Computing bones velocities can have a cost. The cost can be saved by calling this function and by passing the skinned mesh to ignore.\r\n * @param skinnedMesh The mesh containing the skeleton to ignore when computing the velocity map.\r\n */\r\n public excludeSkinnedMeshFromVelocityTexture(skinnedMesh: AbstractMesh): void {\r\n if (skinnedMesh.skeleton) {\r\n const list = this.excludedSkinnedMeshFromVelocityTexture;\r\n if (list.indexOf(skinnedMesh) === -1) {\r\n list.push(skinnedMesh);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Removes the given skinned mesh from the excluded meshes to integrate bones velocities while rendering the velocity map.\r\n * @param skinnedMesh The mesh containing the skeleton that has been ignored previously.\r\n * @see excludeSkinnedMesh to exclude a skinned mesh from bones velocity computation.\r\n */\r\n public removeExcludedSkinnedMeshFromVelocityTexture(skinnedMesh: AbstractMesh): void {\r\n const list = this.excludedSkinnedMeshFromVelocityTexture;\r\n const index = list.indexOf(skinnedMesh);\r\n if (index !== -1) {\r\n list.splice(index, 1);\r\n }\r\n }\r\n\r\n public override isReady() {\r\n return this._renderer.isReadyForRendering(this._textureWidth, this._textureHeight);\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphGeometryRendererTask\";\r\n }\r\n\r\n public record() {\r\n if (this.objectList === undefined) {\r\n throw new Error(`FrameGraphGeometryRendererTask ${this.name}: object list must be provided`);\r\n }\r\n\r\n // Make sure the renderList / particleSystemList are set when FrameGraphGeometryRendererTask.isReady() is called!\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n const outputTextureHandle = this._createMultiRenderTargetTexture();\r\n\r\n const depthEnabled = this._checkDepthTextureCompatibility();\r\n\r\n this._buildClearAttachmentsLayout();\r\n\r\n this._registerForRenderPassId(this._renderer.renderPassId);\r\n\r\n const outputTextureDescription = outputTextureHandle.length > 0 ? this._frameGraph.textureManager.getTextureDescription(outputTextureHandle[0]) : null;\r\n\r\n this._textureWidth = outputTextureDescription?.size.width ?? 0;\r\n this._textureHeight = outputTextureDescription?.size.height ?? 0;\r\n\r\n // Create pass\r\n MaterialHelperGeometryRendering.MarkAsDirty(this._renderer.renderPassId, this.objectList.meshes || this._scene.meshes);\r\n\r\n const pass = this._frameGraph.addRenderPass(this.name);\r\n\r\n pass.setRenderTarget(outputTextureHandle);\r\n\r\n let needPreviousWorldMatrices = false;\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n const description = this.textureDescriptions[i];\r\n const handle = outputTextureHandle[i];\r\n const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);\r\n const geometryDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index];\r\n\r\n switch (geometryDescription.type) {\r\n case Constants.PREPASS_DEPTH_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryViewDepthTexture, handle);\r\n break;\r\n case Constants.PREPASS_NORMALIZED_VIEW_DEPTH_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryNormViewDepthTexture, handle);\r\n break;\r\n case Constants.PREPASS_SCREENSPACE_DEPTH_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryScreenDepthTexture, handle);\r\n break;\r\n case Constants.PREPASS_NORMAL_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryViewNormalTexture, handle);\r\n break;\r\n case Constants.PREPASS_WORLD_NORMAL_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryWorldNormalTexture, handle);\r\n break;\r\n case Constants.PREPASS_LOCAL_POSITION_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryLocalPositionTexture, handle);\r\n break;\r\n case Constants.PREPASS_POSITION_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryWorldPositionTexture, handle);\r\n break;\r\n case Constants.PREPASS_ALBEDO_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryAlbedoTexture, handle);\r\n break;\r\n case Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryReflectivityTexture, handle);\r\n break;\r\n case Constants.PREPASS_VELOCITY_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryVelocityTexture, handle);\r\n needPreviousWorldMatrices = true;\r\n break;\r\n case Constants.PREPASS_VELOCITY_LINEAR_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryLinearVelocityTexture, handle);\r\n needPreviousWorldMatrices = true;\r\n break;\r\n }\r\n }\r\n\r\n this._scene.needsPreviousWorldMatrices = needPreviousWorldMatrices;\r\n\r\n pass.setRenderTargetDepth(this.depthTexture);\r\n\r\n pass.setExecuteFunc((context) => {\r\n this._renderer.renderList = this.objectList.meshes;\r\n this._renderer.particleSystemList = this.objectList.particleSystems;\r\n\r\n pass.frameGraphRenderTarget!.renderTargetWrapper!.resolveMSAAColors = this.resolveMSAAColors;\r\n pass.frameGraphRenderTarget!.renderTargetWrapper!.resolveMSAADepth = this.resolveMSAADepth;\r\n\r\n context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);\r\n\r\n this._clearAttachmentsLayout.forEach((layout, clearType) => {\r\n context.clearColorAttachments(ClearColors[clearType], layout);\r\n });\r\n\r\n context.bindAttachments(this._allAttachmentsLayout);\r\n\r\n context.render(this._renderer, this._textureWidth, this._textureHeight);\r\n });\r\n\r\n const passDisabled = this._frameGraph.addRenderPass(this.name + \"_disabled\", true);\r\n\r\n passDisabled.setRenderTarget(outputTextureHandle);\r\n passDisabled.setRenderTargetDepth(this.depthTexture);\r\n passDisabled.setExecuteFunc((_context) => {});\r\n }\r\n\r\n public override dispose(): void {\r\n MaterialHelperGeometryRendering.DeleteConfiguration(this._renderer.renderPassId);\r\n this._renderer.dispose();\r\n super.dispose();\r\n }\r\n\r\n private _createMultiRenderTargetTexture(): FrameGraphTextureHandle[] {\r\n const types: number[] = [];\r\n const formats: number[] = [];\r\n const labels: string[] = [];\r\n const useSRGBBuffers: boolean[] = [];\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n const description = this.textureDescriptions[i];\r\n const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);\r\n\r\n if (index === -1) {\r\n throw new Error(`FrameGraphGeometryRendererTask ${this.name}: unknown texture type ${description.type}`);\r\n }\r\n\r\n types[i] = description.textureType;\r\n formats[i] = description.textureFormat;\r\n labels[i] = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index].name;\r\n useSRGBBuffers[i] = false;\r\n }\r\n\r\n const baseHandle = this._frameGraph.textureManager.createRenderTargetTexture(this.name, {\r\n size: this.size,\r\n sizeIsPercentage: this.sizeIsPercentage,\r\n options: {\r\n createMipMaps: false,\r\n samples: this.samples,\r\n types,\r\n formats,\r\n useSRGBBuffers,\r\n labels,\r\n },\r\n });\r\n\r\n const handles: FrameGraphTextureHandle[] = [];\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n handles.push(baseHandle + i);\r\n }\r\n\r\n return handles;\r\n }\r\n\r\n private _checkDepthTextureCompatibility(): boolean {\r\n let depthEnabled = false;\r\n\r\n if (this.depthTexture !== undefined) {\r\n if (this.depthTexture === backbufferDepthStencilTextureHandle) {\r\n throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth/stencil back buffer is not allowed as a depth texture`);\r\n }\r\n\r\n const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);\r\n if (depthTextureDescription.options.samples !== this.samples && this.textureDescriptions.length > 0) {\r\n throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth texture and the output texture must have the same number of samples`);\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n\r\n depthEnabled = true;\r\n }\r\n\r\n return depthEnabled;\r\n }\r\n\r\n private _buildClearAttachmentsLayout() {\r\n const clearAttachmentsLayout = new Map<GeometryRenderingTextureClearType, boolean[]>();\r\n const allAttachmentsLayout: boolean[] = [];\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n const description = this.textureDescriptions[i];\r\n const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);\r\n const geometryDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index];\r\n\r\n let layout = clearAttachmentsLayout.get(geometryDescription.clearType);\r\n if (layout === undefined) {\r\n layout = [];\r\n clearAttachmentsLayout.set(geometryDescription.clearType, layout);\r\n for (let j = 0; j < i; j++) {\r\n layout[j] = false;\r\n }\r\n }\r\n\r\n clearAttachmentsLayout.forEach((layout, clearType) => {\r\n layout.push(clearType === geometryDescription.clearType);\r\n });\r\n\r\n allAttachmentsLayout.push(true);\r\n }\r\n\r\n this._clearAttachmentsLayout = new Map();\r\n\r\n clearAttachmentsLayout.forEach((layout, clearType) => {\r\n this._clearAttachmentsLayout.set(clearType, this._engine.buildTextureLayout(layout));\r\n });\r\n\r\n this._allAttachmentsLayout = this._engine.buildTextureLayout(allAttachmentsLayout);\r\n }\r\n\r\n private _registerForRenderPassId(renderPassId: number) {\r\n const configuration = MaterialHelperGeometryRendering.CreateConfiguration(renderPassId);\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n const description = this.textureDescriptions[i];\r\n const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);\r\n const geometryDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index];\r\n\r\n configuration.defines[geometryDescription.defineIndex] = i;\r\n }\r\n\r\n configuration.reverseCulling = this.reverseCulling;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"geometryRendererTask.js","sourceRoot":"","sources":["../../../../../../dev/core/src/FrameGraph/Tasks/Rendering/geometryRendererTask.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,qCAA8B;AAC/C,OAAO,EAAE,+BAA+B,EAAqC,+DAAwD;AACrI,OAAO,EAAE,SAAS,EAAE,sCAA+B;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAuBpE,MAAM,WAAW,GAAa,CAAC,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE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AAG,+BAA+B,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC;YAE/F,aAAa,CAAC,OAAO,CAAC,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC/D,CAAC;QAED,IAAI,IAAI,CAAC,aAAa,KAAK,SAAS,EAAE,CAAC;YACnC,aAAa,CAAC,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC;QACnF,CAAC;QAED,aAAa,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IACvD,CAAC;CACJ","sourcesContent":["import type { FrameGraphTextureHandle, Scene, FrameGraph, AbstractMesh, ObjectRendererOptions, FrameGraphRenderContext, FrameGraphRenderPass, ObjectRenderer } from \"core/index\";\r\nimport { Color4 } from \"core/Maths/math.color\";\r\nimport { MaterialHelperGeometryRendering, GeometryRenderingTextureClearType } from \"core/Materials/materialHelper.geometryrendering\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { FrameGraphObjectRendererTask } from \"./objectRendererTask\";\r\n\r\n/**\r\n * Description of a texture used by the geometry renderer task.\r\n */\r\nexport interface IFrameGraphGeometryRendererTextureDescription {\r\n /**\r\n * The type of the texture.\r\n * The value should be one of the Constants.PREPASS_XXX_TEXTURE_TYPE values.\r\n */\r\n type: number;\r\n\r\n /**\r\n * The type of the texture.\r\n */\r\n textureType: number;\r\n\r\n /**\r\n * The format of the texture.\r\n */\r\n textureFormat: number;\r\n}\r\n\r\nconst ClearColors: Color4[] = [new Color4(0, 0, 0, 0), new Color4(1, 1, 1, 1), new Color4(0, 0, 0, 0)];\r\n\r\n/**\r\n * Task used to render geometry to a set of textures.\r\n */\r\nexport class FrameGraphGeometryRendererTask extends FrameGraphObjectRendererTask {\r\n /**\r\n * The size of the output textures (default is 100% of the back buffer texture size).\r\n */\r\n public size: { width: number; height: number } = { width: 100, height: 100 };\r\n\r\n /**\r\n * Whether the size is a percentage of the back buffer size (default is true).\r\n */\r\n public sizeIsPercentage = true;\r\n\r\n /**\r\n * The number of samples to use for the output textures (default is 1).\r\n */\r\n public samples = 1;\r\n\r\n private _reverseCulling = false;\r\n\r\n /**\r\n * Whether to reverse culling (default is false).\r\n */\r\n public get reverseCulling() {\r\n return this._reverseCulling;\r\n }\r\n\r\n public set reverseCulling(value: boolean) {\r\n this._reverseCulling = value;\r\n\r\n const configuration = MaterialHelperGeometryRendering.GetConfiguration(this._renderer.renderPassId);\r\n if (configuration) {\r\n configuration.reverseCulling = value;\r\n }\r\n }\r\n\r\n /**\r\n * Indicates if a mesh shouldn't be rendered when its material has depth write disabled (default is true).\r\n */\r\n public dontRenderWhenMaterialDepthWriteIsDisabled = true;\r\n\r\n private _disableDepthPrePass = true;\r\n /**\r\n * Indicates whether the depth pre-pass is disabled (default is true).\r\n * Materials that require depth pre-pass (Material.needDepthPrePass == true) don't work with the geometry renderer, that's why this setting is true by default.\r\n * However, if the geometry renderer doesn't generate any geometry textures but only renders to the main target texture, then depth pre-pass can be enabled.\r\n */\r\n public get disableDepthPrePass() {\r\n return this._disableDepthPrePass;\r\n }\r\n\r\n public set disableDepthPrePass(value: boolean) {\r\n this._disableDepthPrePass = value;\r\n this._renderer.disableDepthPrePass = value;\r\n }\r\n\r\n /**\r\n * The list of texture descriptions used by the geometry renderer task.\r\n */\r\n public textureDescriptions: IFrameGraphGeometryRendererTextureDescription[] = [];\r\n\r\n /**\r\n * The depth (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryViewDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The normalized depth (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n * The normalization is (d - near) / (far - near), where d is the depth value in view space and near and far are the near and far planes of the camera.\r\n */\r\n public readonly geometryNormViewDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The depth (in screen space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryScreenDepthTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The normal (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryViewNormalTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The normal (in world space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryWorldNormalTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The position (in local space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryLocalPositionTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The position (in world space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryWorldPositionTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The albedo output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryAlbedoTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The reflectivity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryReflectivityTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The velocity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryVelocityTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * The linear velocity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!\r\n */\r\n public readonly geometryLinearVelocityTexture: FrameGraphTextureHandle;\r\n\r\n /**\r\n * Gets or sets the name of the task.\r\n */\r\n public override get name() {\r\n return this._name;\r\n }\r\n\r\n public override set name(value: string) {\r\n this._name = value;\r\n if (this._renderer) {\r\n this._renderer.name = value;\r\n }\r\n }\r\n\r\n private _clearAttachmentsLayout: Map<GeometryRenderingTextureClearType, number[]>;\r\n private _allAttachmentsLayout: number[];\r\n\r\n /**\r\n * Constructs a new geometry renderer task.\r\n * @param name The name of the task.\r\n * @param frameGraph The frame graph the task belongs to.\r\n * @param scene The scene the frame graph is associated with.\r\n * @param options The options of the object renderer.\r\n * @param existingObjectRenderer An existing object renderer to use (optional). If provided, the options parameter will be ignored.\r\n */\r\n constructor(name: string, frameGraph: FrameGraph, scene: Scene, options?: ObjectRendererOptions, existingObjectRenderer?: ObjectRenderer) {\r\n super(name, frameGraph, scene, options, existingObjectRenderer);\r\n\r\n this.renderSprites = false;\r\n this.renderParticles = false;\r\n this.enableBoundingBoxRendering = false;\r\n this.enableOutlineRendering = false;\r\n this._renderer.disableDepthPrePass = true;\r\n\r\n this._renderer.customIsReadyFunction = (mesh: AbstractMesh, refreshRate: number, preWarm?: boolean) => {\r\n if (this.dontRenderWhenMaterialDepthWriteIsDisabled && mesh.material && mesh.material.disableDepthWrite) {\r\n return !!preWarm;\r\n }\r\n\r\n return mesh.isReady(refreshRate === 0);\r\n };\r\n\r\n this._renderer.onBeforeRenderingManagerRenderObservable.add(() => {\r\n if (!this._renderer.options.doNotChangeAspectRatio) {\r\n scene.updateTransformMatrix(true);\r\n }\r\n });\r\n\r\n this._clearAttachmentsLayout = new Map();\r\n this._allAttachmentsLayout = [];\r\n\r\n this.geometryViewDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryNormViewDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryScreenDepthTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryViewNormalTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryWorldNormalTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryLocalPositionTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryWorldPositionTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryAlbedoTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryReflectivityTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryVelocityTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n this.geometryLinearVelocityTexture = this._frameGraph.textureManager.createDanglingHandle();\r\n }\r\n\r\n /**\r\n * Gets the list of excluded meshes from the velocity texture.\r\n */\r\n public get excludedSkinnedMeshFromVelocityTexture(): AbstractMesh[] {\r\n return MaterialHelperGeometryRendering.GetConfiguration(this._renderer.renderPassId).excludedSkinnedMesh;\r\n }\r\n\r\n /**\r\n * Excludes the given skinned mesh from computing bones velocities.\r\n * Computing bones velocities can have a cost. The cost can be saved by calling this function and by passing the skinned mesh to ignore.\r\n * @param skinnedMesh The mesh containing the skeleton to ignore when computing the velocity map.\r\n */\r\n public excludeSkinnedMeshFromVelocityTexture(skinnedMesh: AbstractMesh): void {\r\n if (skinnedMesh.skeleton) {\r\n const list = this.excludedSkinnedMeshFromVelocityTexture;\r\n if (list.indexOf(skinnedMesh) === -1) {\r\n list.push(skinnedMesh);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Removes the given skinned mesh from the excluded meshes to integrate bones velocities while rendering the velocity map.\r\n * @param skinnedMesh The mesh containing the skeleton that has been ignored previously.\r\n * @see excludeSkinnedMesh to exclude a skinned mesh from bones velocity computation.\r\n */\r\n public removeExcludedSkinnedMeshFromVelocityTexture(skinnedMesh: AbstractMesh): void {\r\n const list = this.excludedSkinnedMeshFromVelocityTexture;\r\n const index = list.indexOf(skinnedMesh);\r\n if (index !== -1) {\r\n list.splice(index, 1);\r\n }\r\n }\r\n\r\n public override getClassName(): string {\r\n return \"FrameGraphGeometryRendererTask\";\r\n }\r\n\r\n public override record(skipCreationOfDisabledPasses = false, additionalExecute?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass {\r\n this._buildClearAttachmentsLayout();\r\n\r\n this._registerForRenderPassId(this._renderer.renderPassId);\r\n\r\n MaterialHelperGeometryRendering.MarkAsDirty(this._renderer.renderPassId, this.objectList.meshes || this._scene.meshes);\r\n\r\n const pass = super.record(skipCreationOfDisabledPasses, additionalExecute) as FrameGraphRenderPass;\r\n\r\n const outputTextureHandles = pass.renderTarget as FrameGraphTextureHandle[];\r\n\r\n let needPreviousWorldMatrices = false;\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n const description = this.textureDescriptions[i];\r\n const handle = outputTextureHandles[i];\r\n const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);\r\n const geometryDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index];\r\n\r\n switch (geometryDescription.type) {\r\n case Constants.PREPASS_DEPTH_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryViewDepthTexture, handle);\r\n break;\r\n case Constants.PREPASS_NORMALIZED_VIEW_DEPTH_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryNormViewDepthTexture, handle);\r\n break;\r\n case Constants.PREPASS_SCREENSPACE_DEPTH_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryScreenDepthTexture, handle);\r\n break;\r\n case Constants.PREPASS_NORMAL_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryViewNormalTexture, handle);\r\n break;\r\n case Constants.PREPASS_WORLD_NORMAL_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryWorldNormalTexture, handle);\r\n break;\r\n case Constants.PREPASS_LOCAL_POSITION_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryLocalPositionTexture, handle);\r\n break;\r\n case Constants.PREPASS_POSITION_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryWorldPositionTexture, handle);\r\n break;\r\n case Constants.PREPASS_ALBEDO_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryAlbedoTexture, handle);\r\n break;\r\n case Constants.PREPASS_REFLECTIVITY_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryReflectivityTexture, handle);\r\n break;\r\n case Constants.PREPASS_VELOCITY_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryVelocityTexture, handle);\r\n needPreviousWorldMatrices = true;\r\n break;\r\n case Constants.PREPASS_VELOCITY_LINEAR_TEXTURE_TYPE:\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.geometryLinearVelocityTexture, handle);\r\n needPreviousWorldMatrices = true;\r\n break;\r\n }\r\n }\r\n\r\n this._scene.needsPreviousWorldMatrices = needPreviousWorldMatrices;\r\n\r\n return pass;\r\n }\r\n\r\n public override dispose(): void {\r\n MaterialHelperGeometryRendering.DeleteConfiguration(this._renderer.renderPassId);\r\n this._renderer.dispose();\r\n super.dispose();\r\n }\r\n\r\n protected override _resolveDanglingHandles(_targetTextures: FrameGraphTextureHandle[]) {\r\n if (this.targetTexture !== undefined) {\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputTexture, Array.isArray(this.targetTexture) ? this.targetTexture[0] : this.targetTexture);\r\n }\r\n\r\n if (this.depthTexture !== undefined) {\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n }\r\n }\r\n\r\n protected override _checkParameters() {\r\n if (this.objectList === undefined || this.camera === undefined) {\r\n throw new Error(`FrameGraphGeometryRendererTask ${this.name}: object list and camera must be provided`);\r\n }\r\n }\r\n\r\n protected override _checkTextureCompatibility(targetTextures: FrameGraphTextureHandle[]): boolean {\r\n let depthEnabled = false;\r\n\r\n let dimensions: { width: number; height: number } | null = null;\r\n\r\n if (this.targetTexture !== undefined) {\r\n const outputTextureDescription = this._frameGraph.textureManager.getTextureDescription(Array.isArray(this.targetTexture) ? this.targetTexture[0] : this.targetTexture);\r\n if (this.samples !== outputTextureDescription.options.samples) {\r\n throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the target texture and the output geometry textures must have the same number of samples`);\r\n }\r\n dimensions = outputTextureDescription.size;\r\n }\r\n\r\n if (this.depthTexture !== undefined) {\r\n const depthTextureDescription = this._frameGraph.textureManager.getTextureDescription(this.depthTexture);\r\n if (depthTextureDescription.options.samples !== this.samples && this.textureDescriptions.length > 0) {\r\n throw new Error(`FrameGraphGeometryRendererTask ${this.name}: the depth texture and the output geometry textures must have the same number of samples`);\r\n }\r\n\r\n this._frameGraph.textureManager.resolveDanglingHandle(this.outputDepthTexture, this.depthTexture);\r\n\r\n depthEnabled = true;\r\n dimensions = depthTextureDescription.size;\r\n }\r\n\r\n const geomTextureDimensions = this.sizeIsPercentage ? this._frameGraph.textureManager.getAbsoluteDimensions(this.size) : this.size;\r\n if (dimensions !== null) {\r\n if (geomTextureDimensions.width !== dimensions.width || geomTextureDimensions.height !== dimensions.height) {\r\n throw new Error(\r\n `FrameGraphGeometryRendererTask ${this.name}: the geometry textures (size: ${geomTextureDimensions.width}x${geomTextureDimensions.height}) and the target/depth texture (size: ${dimensions.width}x${dimensions.height}) must have the same dimensions.`\r\n );\r\n }\r\n }\r\n\r\n depthEnabled = depthEnabled || super._checkTextureCompatibility(targetTextures);\r\n\r\n return depthEnabled;\r\n }\r\n\r\n protected override _getTargetHandles(): FrameGraphTextureHandle[] {\r\n const types: number[] = [];\r\n const formats: number[] = [];\r\n const labels: string[] = [];\r\n const useSRGBBuffers: boolean[] = [];\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n const description = this.textureDescriptions[i];\r\n const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);\r\n\r\n if (index === -1) {\r\n throw new Error(`FrameGraphGeometryRendererTask ${this.name}: unknown texture type ${description.type}`);\r\n }\r\n\r\n types[i] = description.textureType;\r\n formats[i] = description.textureFormat;\r\n labels[i] = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index].name;\r\n useSRGBBuffers[i] = false;\r\n }\r\n\r\n const handles: FrameGraphTextureHandle[] = [];\r\n\r\n if (this.textureDescriptions.length > 0) {\r\n const baseHandle = this._frameGraph.textureManager.createRenderTargetTexture(this.name, {\r\n size: this.size,\r\n sizeIsPercentage: this.sizeIsPercentage,\r\n options: {\r\n createMipMaps: false,\r\n samples: this.samples,\r\n types,\r\n formats,\r\n useSRGBBuffers,\r\n labels,\r\n },\r\n });\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n handles.push(baseHandle + i);\r\n }\r\n }\r\n\r\n if (this.targetTexture !== undefined) {\r\n if (Array.isArray(this.targetTexture)) {\r\n handles.push(...this.targetTexture);\r\n } else {\r\n handles.push(this.targetTexture);\r\n }\r\n }\r\n\r\n return handles;\r\n }\r\n\r\n protected override _prepareRendering(context: FrameGraphRenderContext, depthEnabled: boolean) {\r\n context.setDepthStates(this.depthTest && depthEnabled, this.depthWrite && depthEnabled);\r\n\r\n this._clearAttachmentsLayout.forEach((layout, clearType) => {\r\n context.clearColorAttachments(ClearColors[clearType], layout);\r\n });\r\n\r\n context.bindAttachments(this._allAttachmentsLayout);\r\n }\r\n\r\n private _buildClearAttachmentsLayout() {\r\n const clearAttachmentsLayout = new Map<GeometryRenderingTextureClearType, boolean[]>();\r\n const allAttachmentsLayout: boolean[] = [];\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n const description = this.textureDescriptions[i];\r\n const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);\r\n const geometryDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index];\r\n\r\n let layout = clearAttachmentsLayout.get(geometryDescription.clearType);\r\n if (layout === undefined) {\r\n layout = [];\r\n clearAttachmentsLayout.set(geometryDescription.clearType, layout);\r\n for (let j = 0; j < i; j++) {\r\n layout[j] = false;\r\n }\r\n }\r\n\r\n clearAttachmentsLayout.forEach((layout, clearType) => {\r\n layout.push(clearType === geometryDescription.clearType);\r\n });\r\n\r\n allAttachmentsLayout.push(true);\r\n }\r\n\r\n if (this.targetTexture !== undefined) {\r\n let layout = clearAttachmentsLayout.get(GeometryRenderingTextureClearType.Zero);\r\n if (layout === undefined) {\r\n layout = [];\r\n clearAttachmentsLayout.set(GeometryRenderingTextureClearType.Zero, layout);\r\n for (let j = 0; j < this.textureDescriptions.length - 1; j++) {\r\n layout[j] = false;\r\n }\r\n }\r\n\r\n clearAttachmentsLayout.forEach((layout) => {\r\n layout.push(false);\r\n });\r\n\r\n allAttachmentsLayout.push(true);\r\n }\r\n\r\n this._clearAttachmentsLayout = new Map();\r\n\r\n clearAttachmentsLayout.forEach((layout, clearType) => {\r\n this._clearAttachmentsLayout.set(clearType, this._engine.buildTextureLayout(layout));\r\n });\r\n\r\n this._allAttachmentsLayout = this._engine.buildTextureLayout(allAttachmentsLayout);\r\n }\r\n\r\n private _registerForRenderPassId(renderPassId: number) {\r\n const configuration = MaterialHelperGeometryRendering.CreateConfiguration(renderPassId);\r\n\r\n for (let i = 0; i < this.textureDescriptions.length; i++) {\r\n const description = this.textureDescriptions[i];\r\n const index = MaterialHelperGeometryRendering.GeometryTextureDescriptions.findIndex((f) => f.type === description.type);\r\n const geometryDescription = MaterialHelperGeometryRendering.GeometryTextureDescriptions[index];\r\n\r\n configuration.defines[geometryDescription.defineIndex] = i;\r\n }\r\n\r\n if (this.targetTexture !== undefined) {\r\n configuration.defines[\"PREPASS_COLOR_INDEX\"] = this.textureDescriptions.length;\r\n }\r\n\r\n configuration.reverseCulling = this.reverseCulling;\r\n }\r\n}\r\n"]}
@@ -53,6 +53,12 @@ export declare class FrameGraphObjectRendererTask extends FrameGraphTask {
53
53
  * It is also used to determine the main camera used by the frame graph: this is the camera used by the main object renderer.
54
54
  */
55
55
  isMainObjectRenderer: boolean;
56
+ private _renderMeshes;
57
+ /**
58
+ * Defines if meshes should be rendered (default is true).
59
+ */
60
+ get renderMeshes(): boolean;
61
+ set renderMeshes(value: boolean);
56
62
  private _renderParticles;
57
63
  /**
58
64
  * Defines if particles should be rendered (default is true).
@@ -130,5 +136,10 @@ export declare class FrameGraphObjectRendererTask extends FrameGraphTask {
130
136
  getClassName(): string;
131
137
  record(skipCreationOfDisabledPasses?: boolean, additionalExecute?: (context: FrameGraphRenderContext) => void): FrameGraphRenderPass;
132
138
  dispose(): void;
139
+ protected _resolveDanglingHandles(targetTextures: FrameGraphTextureHandle[]): void;
140
+ protected _checkParameters(): void;
141
+ protected _checkTextureCompatibility(targetTextures: FrameGraphTextureHandle[]): boolean;
142
+ protected _getTargetHandles(): FrameGraphTextureHandle[];
143
+ protected _prepareRendering(context: FrameGraphRenderContext, depthEnabled: boolean): void;
133
144
  protected _setLightsForShadow(): void;
134
145
  }