@babylonjs/core 7.44.0 → 7.45.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.
- package/Debug/debugLayer.d.ts +4 -0
- package/Debug/debugLayer.js +9 -0
- package/Debug/debugLayer.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +2 -4
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -4
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/abstractEngine.d.ts +19 -1
- package/Engines/abstractEngine.js +48 -9
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +1 -1
- package/Engines/engine.js +2 -20
- package/Engines/engine.js.map +1 -1
- package/Engines/renderTargetWrapper.js +2 -2
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.js +1 -5
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.d.ts +16 -12
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js +63 -27
- package/FrameGraph/Node/Blocks/Layers/glowLayerBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.d.ts +72 -0
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js +197 -0
- package/FrameGraph/Node/Blocks/Layers/highlightLayerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.d.ts +4 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +9 -0
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +1 -0
- package/FrameGraph/Node/Blocks/index.js +1 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +2 -0
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +3 -2
- package/FrameGraph/Node/nodeRenderGraph.js +4 -3
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlock.js +4 -4
- package/FrameGraph/Node/nodeRenderGraphBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.d.ts +8 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +10 -0
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.d.ts +21 -0
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js +31 -0
- package/FrameGraph/Node/nodeRenderGraphConnectionPointCustomObject.js.map +1 -0
- package/FrameGraph/Passes/pass.d.ts +1 -0
- package/FrameGraph/Passes/pass.js +4 -1
- package/FrameGraph/Passes/pass.js.map +1 -1
- package/FrameGraph/Tasks/Layers/baseLayerTask.d.ts +81 -0
- package/FrameGraph/Tasks/Layers/baseLayerTask.js +304 -0
- package/FrameGraph/Tasks/Layers/baseLayerTask.js.map +1 -0
- package/FrameGraph/Tasks/Layers/glowLayerTask.d.ts +3 -40
- package/FrameGraph/Tasks/Layers/glowLayerTask.js +4 -158
- package/FrameGraph/Tasks/Layers/glowLayerTask.js.map +1 -1
- package/FrameGraph/Tasks/Layers/highlightLayerTask.d.ts +21 -0
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js +32 -0
- package/FrameGraph/Tasks/Layers/highlightLayerTask.js.map +1 -0
- package/FrameGraph/Tasks/Misc/executeTask.d.ts +2 -2
- package/FrameGraph/Tasks/Misc/executeTask.js +1 -0
- package/FrameGraph/Tasks/Misc/executeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js +5 -4
- package/FrameGraph/Tasks/PostProcesses/circleOfConfusionTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js +5 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldBlurTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +2 -4
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +4 -2
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +1 -0
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.d.ts +2 -2
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +1 -0
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +2 -2
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +1 -0
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +8 -2
- package/FrameGraph/frameGraph.js +31 -5
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +10 -0
- package/FrameGraph/frameGraphRenderContext.js +14 -0
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +3 -2
- package/FrameGraph/frameGraphTask.js +12 -2
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +4 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/Helpers/environmentHelper.js +7 -6
- package/Helpers/environmentHelper.js.map +1 -1
- package/Layers/effectLayer.d.ts +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +2 -14
- package/Layers/glowLayer.js +34 -36
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +13 -74
- package/Layers/highlightLayer.js +123 -309
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/index.d.ts +1 -0
- package/Layers/index.js +1 -0
- package/Layers/index.js.map +1 -1
- package/Layers/thinEffectLayer.d.ts +55 -2
- package/Layers/thinEffectLayer.js +66 -0
- package/Layers/thinEffectLayer.js.map +1 -1
- package/Layers/thinGlowLayer.d.ts +3 -6
- package/Layers/thinGlowLayer.js +4 -1
- package/Layers/thinGlowLayer.js.map +1 -1
- package/Layers/thinHighlightLayer.d.ts +197 -0
- package/Layers/thinHighlightLayer.js +417 -0
- package/Layers/thinHighlightLayer.js.map +1 -0
- package/Materials/Node/nodeMaterial.js +2 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/PBR/pbrBRDFConfiguration.d.ts +14 -0
- package/Materials/PBR/pbrBRDFConfiguration.js +19 -0
- package/Materials/PBR/pbrBRDFConfiguration.js.map +1 -1
- package/Materials/effect.d.ts +5 -0
- package/Materials/effect.js +15 -0
- package/Materials/effect.js.map +1 -1
- package/Meshes/Compression/dracoCompression.d.ts +4 -2
- package/Meshes/Compression/dracoCompression.js +24 -11
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/Compression/dracoCompressionWorker.js +4 -4
- package/Meshes/Compression/dracoCompressionWorker.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.d.ts +5 -1
- package/Meshes/Compression/dracoEncoder.js +23 -17
- package/Meshes/Compression/dracoEncoder.js.map +1 -1
- package/Meshes/Compression/dracoEncoder.types.d.ts +4 -4
- package/Meshes/Compression/dracoEncoder.types.js.map +1 -1
- package/Meshes/Compression/meshoptCompression.js +17 -2
- package/Meshes/Compression/meshoptCompression.js.map +1 -1
- package/Meshes/Compression/test/integration/draco.test.d.ts +1 -0
- package/Meshes/Compression/test/integration/draco.test.js +30 -0
- package/Meshes/Compression/test/integration/draco.test.js.map +1 -0
- package/Meshes/csg.js +4 -0
- package/Meshes/csg.js.map +1 -1
- package/Meshes/transformNode.d.ts +4 -1
- package/Meshes/transformNode.js +4 -1
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/copyTextureToTexture.js +1 -1
- package/Misc/copyTextureToTexture.js.map +1 -1
- package/Misc/error.d.ts +6 -0
- package/Misc/error.js +10 -0
- package/Misc/error.js.map +1 -1
- package/Misc/screenshotTools.js +58 -5
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/tools.d.ts +21 -1
- package/Misc/tools.js +33 -0
- package/Misc/tools.js.map +1 -1
- package/Particles/particleHelper.js +2 -1
- package/Particles/particleHelper.js.map +1 -1
- package/Particles/particleSystemSet.d.ts +1 -0
- package/Particles/particleSystemSet.js +1 -0
- package/Particles/particleSystemSet.js.map +1 -1
- package/Particles/webgl2ParticleSystem.d.ts +1 -1
- package/Particles/webgl2ParticleSystem.js +1 -2
- package/Particles/webgl2ParticleSystem.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/Rendering/depthRenderer.js +1 -1
- package/Rendering/depthRenderer.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +5 -3
- package/Rendering/objectRenderer.js +5 -3
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/renderingManager.d.ts +4 -0
- package/Rendering/renderingManager.js +1 -0
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/intersectionFunctions.d.ts +5 -0
- package/Shaders/ShadersInclude/intersectionFunctions.js +14 -0
- package/Shaders/ShadersInclude/intersectionFunctions.js.map +1 -0
- package/Shaders/ShadersInclude/pbrBlockReflection.js +7 -1
- package/Shaders/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/Shaders/background.fragment.d.ts +1 -0
- package/Shaders/background.fragment.js +3 -5
- package/Shaders/background.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.d.ts +1 -0
- package/Shaders/gaussianSplatting.vertex.js +3 -1
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.js +14 -0
- package/ShadersWGSL/ShadersInclude/intersectionFunctions.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js +7 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockReflection.js.map +1 -1
- package/ShadersWGSL/background.fragment.d.ts +1 -0
- package/ShadersWGSL/background.fragment.js +3 -5
- package/ShadersWGSL/background.fragment.js.map +1 -1
- package/ShadersWGSL/glowMapGeneration.fragment.js +1 -2
- package/ShadersWGSL/glowMapGeneration.fragment.js.map +1 -1
- package/ShadersWGSL/layer.fragment.js +1 -2
- package/ShadersWGSL/layer.fragment.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +8 -7
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +4 -0
- package/types.js.map +1 -1
|
@@ -16,12 +16,24 @@ export declare class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock
|
|
|
16
16
|
* @param frameGraph defines the hosting frame graph
|
|
17
17
|
* @param scene defines the hosting scene
|
|
18
18
|
* @param ldrMerge Forces the merge step to be done in ldr (clamp values > 1). Default: false
|
|
19
|
+
* @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)
|
|
20
|
+
* @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)
|
|
21
|
+
* @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)
|
|
19
22
|
*/
|
|
20
|
-
constructor(name: string, frameGraph: FrameGraph, scene: Scene, ldrMerge?: boolean);
|
|
23
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene, ldrMerge?: boolean, layerTextureRatio?: number, layerTextureFixedSize?: number, layerTextureType?: number);
|
|
21
24
|
private _createTask;
|
|
22
25
|
/** Forces the merge step to be done in ldr (clamp values > 1). Default: false */
|
|
23
26
|
get ldrMerge(): boolean;
|
|
24
27
|
set ldrMerge(value: boolean);
|
|
28
|
+
/** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */
|
|
29
|
+
get layerTextureRatio(): number;
|
|
30
|
+
set layerTextureRatio(value: number);
|
|
31
|
+
/** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */
|
|
32
|
+
get layerTextureFixedSize(): number;
|
|
33
|
+
set layerTextureFixedSize(value: number);
|
|
34
|
+
/** Defines the type of the layer texture */
|
|
35
|
+
get layerTextureType(): number;
|
|
36
|
+
set layerTextureType(value: number);
|
|
25
37
|
/** How big is the kernel of the blur texture */
|
|
26
38
|
get blurKernelSize(): number;
|
|
27
39
|
set blurKernelSize(value: number);
|
|
@@ -38,21 +50,13 @@ export declare class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock
|
|
|
38
50
|
*/
|
|
39
51
|
get destination(): NodeRenderGraphConnectionPoint;
|
|
40
52
|
/**
|
|
41
|
-
* Gets the
|
|
53
|
+
* Gets the layer texture input component
|
|
42
54
|
*/
|
|
43
55
|
get layer(): NodeRenderGraphConnectionPoint;
|
|
44
56
|
/**
|
|
45
|
-
* Gets the
|
|
57
|
+
* Gets the objectRenderer input component
|
|
46
58
|
*/
|
|
47
|
-
get
|
|
48
|
-
/**
|
|
49
|
-
* Gets the objects input component
|
|
50
|
-
*/
|
|
51
|
-
get objects(): NodeRenderGraphConnectionPoint;
|
|
52
|
-
/**
|
|
53
|
-
* Gets the dependencies input component
|
|
54
|
-
*/
|
|
55
|
-
get dependencies(): NodeRenderGraphConnectionPoint;
|
|
59
|
+
get objectRenderer(): NodeRenderGraphConnectionPoint;
|
|
56
60
|
/**
|
|
57
61
|
* Gets the output component
|
|
58
62
|
*/
|
|
@@ -4,6 +4,9 @@ import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
|
4
4
|
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
5
5
|
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
6
|
import { FrameGraphGlowLayerTask } from "../../../Tasks/Layers/glowLayerTask.js";
|
|
7
|
+
|
|
8
|
+
import { NodeRenderGraphConnectionPointCustomObject } from "../../nodeRenderGraphConnectionPointCustomObject.js";
|
|
9
|
+
import { NodeRenderGraphBaseObjectRendererBlock } from "../Rendering/baseObjectRendererBlock.js";
|
|
7
10
|
/**
|
|
8
11
|
* Block that implements the glow layer
|
|
9
12
|
*/
|
|
@@ -20,36 +23,73 @@ export class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock {
|
|
|
20
23
|
* @param frameGraph defines the hosting frame graph
|
|
21
24
|
* @param scene defines the hosting scene
|
|
22
25
|
* @param ldrMerge Forces the merge step to be done in ldr (clamp values > 1). Default: false
|
|
26
|
+
* @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)
|
|
27
|
+
* @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)
|
|
28
|
+
* @param layerTextureType defines the type of the layer texture (default: 0)
|
|
23
29
|
*/
|
|
24
|
-
constructor(name, frameGraph, scene, ldrMerge = false) {
|
|
30
|
+
constructor(name, frameGraph, scene, ldrMerge = false, layerTextureRatio = 0.5, layerTextureFixedSize, layerTextureType = 0) {
|
|
25
31
|
super(name, frameGraph, scene);
|
|
26
|
-
this._additionalConstructionParameters = [ldrMerge];
|
|
32
|
+
this._additionalConstructionParameters = [ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType];
|
|
27
33
|
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
28
34
|
this.registerInput("layer", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
29
|
-
this.registerInput("
|
|
30
|
-
this.registerInput("objects", NodeRenderGraphBlockConnectionPointTypes.ObjectList);
|
|
35
|
+
this.registerInput("objectRenderer", NodeRenderGraphBlockConnectionPointTypes.Object, true, new NodeRenderGraphConnectionPointCustomObject("objectRenderer", this, 0 /* NodeRenderGraphConnectionPointDirection.Input */, NodeRenderGraphBaseObjectRendererBlock, "NodeRenderGraphBaseObjectRendererBlock"));
|
|
31
36
|
this._addDependenciesInput();
|
|
32
37
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
33
38
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);
|
|
34
39
|
this.layer.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
35
40
|
this.output._typeConnectionSource = this.destination;
|
|
36
|
-
this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {
|
|
42
|
+
ldrMerge,
|
|
43
|
+
mainTextureRatio: layerTextureRatio,
|
|
44
|
+
mainTextureFixedSize: layerTextureFixedSize,
|
|
45
|
+
mainTextureType: layerTextureType,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
_createTask(ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType) {
|
|
39
49
|
const blurKernelSize = this.blurKernelSize;
|
|
40
50
|
const intensity = this.intensity;
|
|
41
51
|
this._frameGraphTask?.dispose();
|
|
42
|
-
this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {
|
|
52
|
+
this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {
|
|
53
|
+
ldrMerge,
|
|
54
|
+
mainTextureRatio: layerTextureRatio,
|
|
55
|
+
mainTextureFixedSize: layerTextureFixedSize,
|
|
56
|
+
mainTextureType: layerTextureType,
|
|
57
|
+
});
|
|
43
58
|
this.blurKernelSize = blurKernelSize;
|
|
44
59
|
this.intensity = intensity;
|
|
45
|
-
this._additionalConstructionParameters = [ldrMerge];
|
|
60
|
+
this._additionalConstructionParameters = [ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType];
|
|
46
61
|
}
|
|
47
62
|
/** Forces the merge step to be done in ldr (clamp values > 1). Default: false */
|
|
48
63
|
get ldrMerge() {
|
|
49
64
|
return this._frameGraphTask.layer.ldrMerge;
|
|
50
65
|
}
|
|
51
66
|
set ldrMerge(value) {
|
|
52
|
-
this.
|
|
67
|
+
const options = this._frameGraphTask.layer._options;
|
|
68
|
+
this._createTask(value, options.mainTextureRatio, options.mainTextureFixedSize, options.mainTextureType);
|
|
69
|
+
}
|
|
70
|
+
/** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */
|
|
71
|
+
get layerTextureRatio() {
|
|
72
|
+
return this._frameGraphTask.layer._options.mainTextureRatio;
|
|
73
|
+
}
|
|
74
|
+
set layerTextureRatio(value) {
|
|
75
|
+
const options = this._frameGraphTask.layer._options;
|
|
76
|
+
this._createTask(options.ldrMerge, value, options.mainTextureFixedSize, options.mainTextureType);
|
|
77
|
+
}
|
|
78
|
+
/** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */
|
|
79
|
+
get layerTextureFixedSize() {
|
|
80
|
+
return this._frameGraphTask.layer._options.mainTextureFixedSize;
|
|
81
|
+
}
|
|
82
|
+
set layerTextureFixedSize(value) {
|
|
83
|
+
const options = this._frameGraphTask.layer._options;
|
|
84
|
+
this._createTask(options.ldrMerge, options.mainTextureRatio, value, options.mainTextureType);
|
|
85
|
+
}
|
|
86
|
+
/** Defines the type of the layer texture */
|
|
87
|
+
get layerTextureType() {
|
|
88
|
+
return this._frameGraphTask.layer._options.mainTextureType;
|
|
89
|
+
}
|
|
90
|
+
set layerTextureType(value) {
|
|
91
|
+
const options = this._frameGraphTask.layer._options;
|
|
92
|
+
this._createTask(options.ldrMerge, options.mainTextureRatio, options.mainTextureFixedSize, value);
|
|
53
93
|
}
|
|
54
94
|
/** How big is the kernel of the blur texture */
|
|
55
95
|
get blurKernelSize() {
|
|
@@ -79,29 +119,17 @@ export class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock {
|
|
|
79
119
|
return this._inputs[0];
|
|
80
120
|
}
|
|
81
121
|
/**
|
|
82
|
-
* Gets the
|
|
122
|
+
* Gets the layer texture input component
|
|
83
123
|
*/
|
|
84
124
|
get layer() {
|
|
85
125
|
return this._inputs[1];
|
|
86
126
|
}
|
|
87
127
|
/**
|
|
88
|
-
* Gets the
|
|
128
|
+
* Gets the objectRenderer input component
|
|
89
129
|
*/
|
|
90
|
-
get
|
|
130
|
+
get objectRenderer() {
|
|
91
131
|
return this._inputs[2];
|
|
92
132
|
}
|
|
93
|
-
/**
|
|
94
|
-
* Gets the objects input component
|
|
95
|
-
*/
|
|
96
|
-
get objects() {
|
|
97
|
-
return this._inputs[3];
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Gets the dependencies input component
|
|
101
|
-
*/
|
|
102
|
-
get dependencies() {
|
|
103
|
-
return this._inputs[4];
|
|
104
|
-
}
|
|
105
133
|
/**
|
|
106
134
|
* Gets the output component
|
|
107
135
|
*/
|
|
@@ -113,8 +141,7 @@ export class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock {
|
|
|
113
141
|
this.output.value = this._frameGraphTask.outputTexture;
|
|
114
142
|
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
115
143
|
this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value;
|
|
116
|
-
this._frameGraphTask.
|
|
117
|
-
this._frameGraphTask.objectList = this.objects.connectedPoint?.value;
|
|
144
|
+
this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value;
|
|
118
145
|
}
|
|
119
146
|
_dumpPropertiesCode() {
|
|
120
147
|
const codes = [];
|
|
@@ -137,6 +164,15 @@ export class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock {
|
|
|
137
164
|
__decorate([
|
|
138
165
|
editableInPropertyPage("LDR merge", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
|
|
139
166
|
], NodeRenderGraphGlowLayerBlock.prototype, "ldrMerge", null);
|
|
167
|
+
__decorate([
|
|
168
|
+
editableInPropertyPage("Layer texture ratio", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
|
|
169
|
+
], NodeRenderGraphGlowLayerBlock.prototype, "layerTextureRatio", null);
|
|
170
|
+
__decorate([
|
|
171
|
+
editableInPropertyPage("Layer texture fixed size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
|
|
172
|
+
], NodeRenderGraphGlowLayerBlock.prototype, "layerTextureFixedSize", null);
|
|
173
|
+
__decorate([
|
|
174
|
+
editableInPropertyPage("Layer texture type", 8 /* PropertyTypeForEdition.TextureType */, "PROPERTIES")
|
|
175
|
+
], NodeRenderGraphGlowLayerBlock.prototype, "layerTextureType", null);
|
|
140
176
|
__decorate([
|
|
141
177
|
editableInPropertyPage("Blur kernel size", 2 /* PropertyTypeForEdition.Int */, "PROPERTIES", { min: 1, max: 256 })
|
|
142
178
|
], NodeRenderGraphGlowLayerBlock.prototype, "blurKernelSize", null);
|
|
@@ -1 +1 @@
|
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a,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import type {\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n FrameGraphObjectList,\r\n Camera,\r\n NodeRenderGraphConnectionPoint,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphGlowLayerTask } from \"core/FrameGraph/Tasks/Layers/glowLayerTask\";\r\n\r\n/**\r\n * Block that implements the glow layer\r\n */\r\nexport class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphGlowLayerTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphGlowLayerBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param ldrMerge Forces the merge step to be done in ldr (clamp values > 1). Default: false\r\n */\r\n public constructor(name: string, frameGraph: FrameGraph, scene: Scene, ldrMerge = false) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [ldrMerge];\r\n\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\"camera\", NodeRenderGraphBlockConnectionPointTypes.Camera);\r\n this.registerInput(\"objects\", NodeRenderGraphBlockConnectionPointTypes.ObjectList);\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n\r\n this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, { ldrMerge });\r\n }\r\n\r\n private _createTask(ldrMerge: boolean) {\r\n const blurKernelSize = this.blurKernelSize;\r\n const intensity = this.intensity;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, { ldrMerge });\r\n\r\n this.blurKernelSize = blurKernelSize;\r\n this.intensity = intensity;\r\n\r\n this._additionalConstructionParameters = [ldrMerge];\r\n }\r\n\r\n /** Forces the merge step to be done in ldr (clamp values > 1). Default: false */\r\n @editableInPropertyPage(\"LDR merge\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get ldrMerge() {\r\n return this._frameGraphTask.layer.ldrMerge;\r\n }\r\n\r\n public set ldrMerge(value: boolean) {\r\n this._createTask(value);\r\n }\r\n\r\n /** How big is the kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur kernel size\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get blurKernelSize() {\r\n return this._frameGraphTask.layer.blurKernelSize;\r\n }\r\n\r\n public set blurKernelSize(value: number) {\r\n this._frameGraphTask.layer.blurKernelSize = value;\r\n }\r\n\r\n /** The intensity of the glow */\r\n @editableInPropertyPage(\"Intensity\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 5 })\r\n public get intensity() {\r\n return this._frameGraphTask.layer.intensity;\r\n }\r\n\r\n public set intensity(value: number) {\r\n this._frameGraphTask.layer.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphGlowLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the depth texture input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the camera input component\r\n */\r\n public get camera(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the objects input component\r\n */\r\n public get objects(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the dependencies input component\r\n */\r\n public get dependencies(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[4];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.camera = this.camera.connectedPoint?.value as Camera;\r\n this._frameGraphTask.objectList = this.objects.connectedPoint?.value as FrameGraphObjectList;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurKernelSize = ${this.blurKernelSize};`);\r\n codes.push(`${this._codeVariableName}.intensity = ${this.intensity};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.blurKernelSize = this.blurKernelSize;\r\n serializationObject.intensity = this.intensity;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurKernelSize = serializationObject.blurKernelSize;\r\n this.intensity = serializationObject.intensity;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphGlowLayerBlock\", NodeRenderGraphGlowLayerBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"glowLayerBlock.js","sourceRoot":"","sources":["../../../../../../../dev/core/src/FrameGraph/Node/Blocks/Layers/glowLayerBlock.ts"],"names":[],"mappings":";AASA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,wCAAwC,EAA2C,MAAM,kCAAkC,CAAC;AACrI,OAAO,EAAE,sBAAsB,EAA0B,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,+CAAmD;AACrF,OAAO,EAAE,SAAS,EAAE,yCAA+B;AACnD,OAAO,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAC9G,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAE9F;;GAEG;AACH,MAAM,OAAO,6BAA8B,SAAQ,oBAAoB;IAGnE;;OAEG;IACH,IAAoB,IAAI;QACpB,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;;;OASG;IACH,YACI,IAAY,EACZ,UAAsB,EACtB,KAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,iBAAiB,GAAG,GAAG,EACvB,qBAA8B,EAC9B,gBAAgB,GAAG,SAAS,CAAC,yBAAyB;QAEtD,KAAK,CAAC,IAAI,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;QAE/B,IAAI,CAAC,iCAAiC,GAAG,CAAC,QAAQ,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;QAEhH,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,wCAAwC,CAAC,OAAO,CAAC,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CAAC,CAAC;QACxC,IAAI,CAAC,cAAc,GAAG,mBAAmB,CAAC,cAAc,CAAC;QACzD,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;IACnD,CAAC;CACJ;AAnIG;IADC,sBAAsB,CAAC,WAAW,0CAAkC,YAAY,CAAC;6DAGjF;AAUD;IADC,sBAAsB,CAAC,qBAAqB,wCAAgC,YAAY,CAAC;sEAGzF;AAUD;IADC,sBAAsB,CAAC,0BAA0B,wCAAgC,YAAY,CAAC;0EAG9F;AAUD;IADC,sBAAsB,CAAC,oBAAoB,8CAAsC,YAAY,CAAC;qEAG9F;AAUD;IADC,sBAAsB,CAAC,kBAAkB,sCAA8B,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;mEAG1G;AAQD;IADC,sBAAsB,CAAC,WAAW,wCAAgC,YAAY,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;8DAGnG;AAyEL,aAAa,CAAC,uCAAuC,EAAE,6BAA6B,CAAC,CAAC","sourcesContent":["import type {\r\n Scene,\r\n NodeRenderGraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n NodeRenderGraphConnectionPoint,\r\n FrameGraphObjectRendererTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphGlowLayerTask } from \"core/FrameGraph/Tasks/Layers/glowLayerTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"../Rendering/baseObjectRendererBlock\";\r\n\r\n/**\r\n * Block that implements the glow layer\r\n */\r\nexport class NodeRenderGraphGlowLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphGlowLayerTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphGlowLayerBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param ldrMerge Forces the merge step to be done in ldr (clamp values > 1). Default: false\r\n * @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)\r\n * @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)\r\n * @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n ldrMerge = false,\r\n layerTextureRatio = 0.5,\r\n layerTextureFixedSize?: number,\r\n layerTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType];\r\n\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n true,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Input,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n\r\n this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {\r\n ldrMerge,\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n mainTextureType: layerTextureType,\r\n });\r\n }\r\n\r\n private _createTask(ldrMerge: boolean, layerTextureRatio: number, layerTextureFixedSize: number, layerTextureType: number) {\r\n const blurKernelSize = this.blurKernelSize;\r\n const intensity = this.intensity;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphGlowLayerTask(this.name, this._frameGraph, this._scene, {\r\n ldrMerge,\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n mainTextureType: layerTextureType,\r\n });\r\n\r\n this.blurKernelSize = blurKernelSize;\r\n this.intensity = intensity;\r\n\r\n this._additionalConstructionParameters = [ldrMerge, layerTextureRatio, layerTextureFixedSize, layerTextureType];\r\n }\r\n\r\n /** Forces the merge step to be done in ldr (clamp values > 1). Default: false */\r\n @editableInPropertyPage(\"LDR merge\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get ldrMerge() {\r\n return this._frameGraphTask.layer.ldrMerge;\r\n }\r\n\r\n public set ldrMerge(value: boolean) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(value, options.mainTextureRatio, options.mainTextureFixedSize, options.mainTextureType);\r\n }\r\n\r\n /** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */\r\n @editableInPropertyPage(\"Layer texture ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureRatio() {\r\n return this._frameGraphTask.layer._options.mainTextureRatio;\r\n }\r\n\r\n public set layerTextureRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, value, options.mainTextureFixedSize, options.mainTextureType);\r\n }\r\n\r\n /** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */\r\n @editableInPropertyPage(\"Layer texture fixed size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureFixedSize() {\r\n return this._frameGraphTask.layer._options.mainTextureFixedSize;\r\n }\r\n\r\n public set layerTextureFixedSize(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, options.mainTextureRatio, value, options.mainTextureType);\r\n }\r\n\r\n /** Defines the type of the layer texture */\r\n @editableInPropertyPage(\"Layer texture type\", PropertyTypeForEdition.TextureType, \"PROPERTIES\")\r\n public get layerTextureType() {\r\n return this._frameGraphTask.layer._options.mainTextureType;\r\n }\r\n\r\n public set layerTextureType(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.ldrMerge, options.mainTextureRatio, options.mainTextureFixedSize, value);\r\n }\r\n\r\n /** How big is the kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur kernel size\", PropertyTypeForEdition.Int, \"PROPERTIES\", { min: 1, max: 256 })\r\n public get blurKernelSize() {\r\n return this._frameGraphTask.layer.blurKernelSize;\r\n }\r\n\r\n public set blurKernelSize(value: number) {\r\n this._frameGraphTask.layer.blurKernelSize = value;\r\n }\r\n\r\n /** The intensity of the glow */\r\n @editableInPropertyPage(\"Intensity\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 5 })\r\n public get intensity() {\r\n return this._frameGraphTask.layer.intensity;\r\n }\r\n\r\n public set intensity(value: number) {\r\n this._frameGraphTask.layer.intensity = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphGlowLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the layer texture input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer input component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value as FrameGraphObjectRendererTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurKernelSize = ${this.blurKernelSize};`);\r\n codes.push(`${this._codeVariableName}.intensity = ${this.intensity};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.blurKernelSize = this.blurKernelSize;\r\n serializationObject.intensity = this.intensity;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurKernelSize = serializationObject.blurKernelSize;\r\n this.intensity = serializationObject.intensity;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphGlowLayerBlock\", NodeRenderGraphGlowLayerBlock);\r\n"]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Scene, NodeRenderGraphBuildState, FrameGraph, NodeRenderGraphConnectionPoint } from "../../../../index.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock";
|
|
3
|
+
import { FrameGraphHighlightLayerTask } from "../../../Tasks/Layers/highlightLayerTask.js";
|
|
4
|
+
/**
|
|
5
|
+
* Block that implements the highlight layer
|
|
6
|
+
*/
|
|
7
|
+
export declare class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {
|
|
8
|
+
protected _frameGraphTask: FrameGraphHighlightLayerTask;
|
|
9
|
+
/**
|
|
10
|
+
* Gets the frame graph task associated with this block
|
|
11
|
+
*/
|
|
12
|
+
get task(): FrameGraphHighlightLayerTask;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new NodeRenderGraphHighlightLayerBlock
|
|
15
|
+
* @param name defines the block name
|
|
16
|
+
* @param frameGraph defines the hosting frame graph
|
|
17
|
+
* @param scene defines the hosting scene
|
|
18
|
+
* @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)
|
|
19
|
+
* @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)
|
|
20
|
+
* @param blurTextureSizeRatio defines the factor to apply to the layer texture size to create the blur textures (default: 0.5)
|
|
21
|
+
* @param isStroke should we display highlight as a solid stroke? (default: false)
|
|
22
|
+
* @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)
|
|
23
|
+
*/
|
|
24
|
+
constructor(name: string, frameGraph: FrameGraph, scene: Scene, layerTextureRatio?: number, layerTextureFixedSize?: number, blurTextureSizeRatio?: number, isStroke?: boolean, layerTextureType?: number);
|
|
25
|
+
private _createTask;
|
|
26
|
+
/** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */
|
|
27
|
+
get layerTextureRatio(): number;
|
|
28
|
+
set layerTextureRatio(value: number);
|
|
29
|
+
/** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */
|
|
30
|
+
get layerTextureFixedSize(): number;
|
|
31
|
+
set layerTextureFixedSize(value: number);
|
|
32
|
+
/** Defines the factor to apply to the layer texture size to create the blur textures */
|
|
33
|
+
get blurTextureSizeRatio(): number;
|
|
34
|
+
set blurTextureSizeRatio(value: number);
|
|
35
|
+
/** Should we display highlight as a solid stroke? */
|
|
36
|
+
get isStroke(): boolean;
|
|
37
|
+
set isStroke(value: boolean);
|
|
38
|
+
/** Defines the type of the layer texture */
|
|
39
|
+
get layerTextureType(): number;
|
|
40
|
+
set layerTextureType(value: number);
|
|
41
|
+
/** How big is the horizontal kernel of the blur texture */
|
|
42
|
+
get blurHorizontalSize(): number;
|
|
43
|
+
set blurHorizontalSize(value: number);
|
|
44
|
+
/** How big is the vertical kernel of the blur texture */
|
|
45
|
+
get blurVerticalSize(): number;
|
|
46
|
+
set blurVerticalSize(value: number);
|
|
47
|
+
/**
|
|
48
|
+
* Gets the current class name
|
|
49
|
+
* @returns the class name
|
|
50
|
+
*/
|
|
51
|
+
getClassName(): string;
|
|
52
|
+
/**
|
|
53
|
+
* Gets the destination texture input component
|
|
54
|
+
*/
|
|
55
|
+
get destination(): NodeRenderGraphConnectionPoint;
|
|
56
|
+
/**
|
|
57
|
+
* Gets the layer input component
|
|
58
|
+
*/
|
|
59
|
+
get layer(): NodeRenderGraphConnectionPoint;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the objectRenderer input component
|
|
62
|
+
*/
|
|
63
|
+
get objectRenderer(): NodeRenderGraphConnectionPoint;
|
|
64
|
+
/**
|
|
65
|
+
* Gets the output component
|
|
66
|
+
*/
|
|
67
|
+
get output(): NodeRenderGraphConnectionPoint;
|
|
68
|
+
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
69
|
+
protected _dumpPropertiesCode(): string;
|
|
70
|
+
serialize(): any;
|
|
71
|
+
_deserialize(serializationObject: any): void;
|
|
72
|
+
}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { __decorate } from "../../../../tslib.es6.js";
|
|
2
|
+
import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
3
|
+
import { RegisterClass } from "../../../../Misc/typeStore.js";
|
|
4
|
+
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
5
|
+
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
6
|
+
import { FrameGraphHighlightLayerTask } from "../../../Tasks/Layers/highlightLayerTask.js";
|
|
7
|
+
|
|
8
|
+
import { NodeRenderGraphConnectionPointCustomObject } from "../../nodeRenderGraphConnectionPointCustomObject.js";
|
|
9
|
+
import { NodeRenderGraphBaseObjectRendererBlock } from "../Rendering/baseObjectRendererBlock.js";
|
|
10
|
+
/**
|
|
11
|
+
* Block that implements the highlight layer
|
|
12
|
+
*/
|
|
13
|
+
export class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {
|
|
14
|
+
/**
|
|
15
|
+
* Gets the frame graph task associated with this block
|
|
16
|
+
*/
|
|
17
|
+
get task() {
|
|
18
|
+
return this._frameGraphTask;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a new NodeRenderGraphHighlightLayerBlock
|
|
22
|
+
* @param name defines the block name
|
|
23
|
+
* @param frameGraph defines the hosting frame graph
|
|
24
|
+
* @param scene defines the hosting scene
|
|
25
|
+
* @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)
|
|
26
|
+
* @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)
|
|
27
|
+
* @param blurTextureSizeRatio defines the factor to apply to the layer texture size to create the blur textures (default: 0.5)
|
|
28
|
+
* @param isStroke should we display highlight as a solid stroke? (default: false)
|
|
29
|
+
* @param layerTextureType defines the type of the layer texture (default: 0)
|
|
30
|
+
*/
|
|
31
|
+
constructor(name, frameGraph, scene, layerTextureRatio = 0.5, layerTextureFixedSize, blurTextureSizeRatio = 0.5, isStroke = false, layerTextureType = 0) {
|
|
32
|
+
super(name, frameGraph, scene);
|
|
33
|
+
this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];
|
|
34
|
+
this.registerInput("destination", NodeRenderGraphBlockConnectionPointTypes.Texture);
|
|
35
|
+
this.registerInput("layer", NodeRenderGraphBlockConnectionPointTypes.Texture, true);
|
|
36
|
+
this.registerInput("objectRenderer", NodeRenderGraphBlockConnectionPointTypes.Object, true, new NodeRenderGraphConnectionPointCustomObject("objectRenderer", this, 0 /* NodeRenderGraphConnectionPointDirection.Input */, NodeRenderGraphBaseObjectRendererBlock, "NodeRenderGraphBaseObjectRendererBlock"));
|
|
37
|
+
this._addDependenciesInput();
|
|
38
|
+
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
39
|
+
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);
|
|
40
|
+
this.layer.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);
|
|
41
|
+
this.output._typeConnectionSource = this.destination;
|
|
42
|
+
this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {
|
|
43
|
+
mainTextureRatio: layerTextureRatio,
|
|
44
|
+
mainTextureFixedSize: layerTextureFixedSize,
|
|
45
|
+
blurTextureSizeRatio,
|
|
46
|
+
isStroke,
|
|
47
|
+
mainTextureType: layerTextureType,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
_createTask(layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType) {
|
|
51
|
+
const blurHorizontalSize = this.blurHorizontalSize;
|
|
52
|
+
const blurVerticalSize = this.blurVerticalSize;
|
|
53
|
+
this._frameGraphTask?.dispose();
|
|
54
|
+
this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {
|
|
55
|
+
mainTextureRatio: layerTextureRatio,
|
|
56
|
+
mainTextureFixedSize: layerTextureFixedSize,
|
|
57
|
+
blurTextureSizeRatio,
|
|
58
|
+
isStroke,
|
|
59
|
+
mainTextureType: layerTextureType,
|
|
60
|
+
});
|
|
61
|
+
this.blurHorizontalSize = blurHorizontalSize;
|
|
62
|
+
this.blurVerticalSize = blurVerticalSize;
|
|
63
|
+
this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];
|
|
64
|
+
}
|
|
65
|
+
/** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */
|
|
66
|
+
get layerTextureRatio() {
|
|
67
|
+
return this._frameGraphTask.layer._options.mainTextureRatio;
|
|
68
|
+
}
|
|
69
|
+
set layerTextureRatio(value) {
|
|
70
|
+
const options = this._frameGraphTask.layer._options;
|
|
71
|
+
this._createTask(value, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);
|
|
72
|
+
}
|
|
73
|
+
/** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */
|
|
74
|
+
get layerTextureFixedSize() {
|
|
75
|
+
return this._frameGraphTask.layer._options.mainTextureFixedSize;
|
|
76
|
+
}
|
|
77
|
+
set layerTextureFixedSize(value) {
|
|
78
|
+
const options = this._frameGraphTask.layer._options;
|
|
79
|
+
this._createTask(options.mainTextureRatio, value, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);
|
|
80
|
+
}
|
|
81
|
+
/** Defines the factor to apply to the layer texture size to create the blur textures */
|
|
82
|
+
get blurTextureSizeRatio() {
|
|
83
|
+
return this._frameGraphTask.layer._options.blurTextureSizeRatio;
|
|
84
|
+
}
|
|
85
|
+
set blurTextureSizeRatio(value) {
|
|
86
|
+
const options = this._frameGraphTask.layer._options;
|
|
87
|
+
this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, value, options.isStroke, options.mainTextureType);
|
|
88
|
+
}
|
|
89
|
+
/** Should we display highlight as a solid stroke? */
|
|
90
|
+
get isStroke() {
|
|
91
|
+
return this._frameGraphTask.layer._options.isStroke;
|
|
92
|
+
}
|
|
93
|
+
set isStroke(value) {
|
|
94
|
+
const options = this._frameGraphTask.layer._options;
|
|
95
|
+
this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, value, options.mainTextureType);
|
|
96
|
+
}
|
|
97
|
+
/** Defines the type of the layer texture */
|
|
98
|
+
get layerTextureType() {
|
|
99
|
+
return this._frameGraphTask.layer._options.mainTextureType;
|
|
100
|
+
}
|
|
101
|
+
set layerTextureType(value) {
|
|
102
|
+
const options = this._frameGraphTask.layer._options;
|
|
103
|
+
this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, value);
|
|
104
|
+
}
|
|
105
|
+
/** How big is the horizontal kernel of the blur texture */
|
|
106
|
+
get blurHorizontalSize() {
|
|
107
|
+
return this._frameGraphTask.layer.blurHorizontalSize;
|
|
108
|
+
}
|
|
109
|
+
set blurHorizontalSize(value) {
|
|
110
|
+
this._frameGraphTask.layer.blurHorizontalSize = value;
|
|
111
|
+
}
|
|
112
|
+
/** How big is the vertical kernel of the blur texture */
|
|
113
|
+
get blurVerticalSize() {
|
|
114
|
+
return this._frameGraphTask.layer.blurVerticalSize;
|
|
115
|
+
}
|
|
116
|
+
set blurVerticalSize(value) {
|
|
117
|
+
this._frameGraphTask.layer.blurVerticalSize = value;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Gets the current class name
|
|
121
|
+
* @returns the class name
|
|
122
|
+
*/
|
|
123
|
+
getClassName() {
|
|
124
|
+
return "NodeRenderGraphHighlightLayerBlock";
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Gets the destination texture input component
|
|
128
|
+
*/
|
|
129
|
+
get destination() {
|
|
130
|
+
return this._inputs[0];
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Gets the layer input component
|
|
134
|
+
*/
|
|
135
|
+
get layer() {
|
|
136
|
+
return this._inputs[1];
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Gets the objectRenderer input component
|
|
140
|
+
*/
|
|
141
|
+
get objectRenderer() {
|
|
142
|
+
return this._inputs[2];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Gets the output component
|
|
146
|
+
*/
|
|
147
|
+
get output() {
|
|
148
|
+
return this._outputs[0];
|
|
149
|
+
}
|
|
150
|
+
_buildBlock(state) {
|
|
151
|
+
super._buildBlock(state);
|
|
152
|
+
this.output.value = this._frameGraphTask.outputTexture;
|
|
153
|
+
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
154
|
+
this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value;
|
|
155
|
+
this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value;
|
|
156
|
+
}
|
|
157
|
+
_dumpPropertiesCode() {
|
|
158
|
+
const codes = [];
|
|
159
|
+
codes.push(`${this._codeVariableName}.blurHorizontalSize = ${this.blurHorizontalSize};`);
|
|
160
|
+
codes.push(`${this._codeVariableName}.blurVerticalSize = ${this.blurVerticalSize};`);
|
|
161
|
+
return super._dumpPropertiesCode() + codes.join("\n");
|
|
162
|
+
}
|
|
163
|
+
serialize() {
|
|
164
|
+
const serializationObject = super.serialize();
|
|
165
|
+
serializationObject.blurHorizontalSize = this.blurHorizontalSize;
|
|
166
|
+
serializationObject.blurVerticalSize = this.blurVerticalSize;
|
|
167
|
+
return serializationObject;
|
|
168
|
+
}
|
|
169
|
+
_deserialize(serializationObject) {
|
|
170
|
+
super._deserialize(serializationObject);
|
|
171
|
+
this.blurHorizontalSize = serializationObject.blurHorizontalSize;
|
|
172
|
+
this.blurVerticalSize = serializationObject.blurVerticalSize;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
__decorate([
|
|
176
|
+
editableInPropertyPage("Layer texture ratio", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
|
|
177
|
+
], NodeRenderGraphHighlightLayerBlock.prototype, "layerTextureRatio", null);
|
|
178
|
+
__decorate([
|
|
179
|
+
editableInPropertyPage("Layer texture fixed size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
|
|
180
|
+
], NodeRenderGraphHighlightLayerBlock.prototype, "layerTextureFixedSize", null);
|
|
181
|
+
__decorate([
|
|
182
|
+
editableInPropertyPage("Blur texture size ratio", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES")
|
|
183
|
+
], NodeRenderGraphHighlightLayerBlock.prototype, "blurTextureSizeRatio", null);
|
|
184
|
+
__decorate([
|
|
185
|
+
editableInPropertyPage("Is stroke", 0 /* PropertyTypeForEdition.Boolean */, "PROPERTIES")
|
|
186
|
+
], NodeRenderGraphHighlightLayerBlock.prototype, "isStroke", null);
|
|
187
|
+
__decorate([
|
|
188
|
+
editableInPropertyPage("Layer texture type", 8 /* PropertyTypeForEdition.TextureType */, "PROPERTIES")
|
|
189
|
+
], NodeRenderGraphHighlightLayerBlock.prototype, "layerTextureType", null);
|
|
190
|
+
__decorate([
|
|
191
|
+
editableInPropertyPage("Blur horizontal size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 4 })
|
|
192
|
+
], NodeRenderGraphHighlightLayerBlock.prototype, "blurHorizontalSize", null);
|
|
193
|
+
__decorate([
|
|
194
|
+
editableInPropertyPage("Blur vertical size", 1 /* PropertyTypeForEdition.Float */, "PROPERTIES", { min: 0, max: 4 })
|
|
195
|
+
], NodeRenderGraphHighlightLayerBlock.prototype, "blurVerticalSize", null);
|
|
196
|
+
RegisterClass("BABYLON.NodeRenderGraphHighlightLayerBlock", NodeRenderGraphHighlightLayerBlock);
|
|
197
|
+
//# sourceMappingURL=highlightLayerBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"highlightLayerBlock.js","sourceRoot":"","sources":["../../../../../../../dev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GraphBuildState,\r\n FrameGraph,\r\n FrameGraphTextureHandle,\r\n NodeRenderGraphConnectionPoint,\r\n FrameGraphObjectRendererTask,\r\n // eslint-disable-next-line import/no-internal-modules\r\n} from \"core/index\";\r\nimport { NodeRenderGraphBlock } from \"../../nodeRenderGraphBlock\";\r\nimport { RegisterClass } from \"../../../../Misc/typeStore\";\r\nimport { NodeRenderGraphBlockConnectionPointTypes, NodeRenderGraphConnectionPointDirection } from \"../../Types/nodeRenderGraphTypes\";\r\nimport { editableInPropertyPage, PropertyTypeForEdition } from \"../../../../Decorators/nodeDecorator\";\r\nimport { FrameGraphHighlightLayerTask } from \"core/FrameGraph/Tasks/Layers/highlightLayerTask\";\r\nimport { Constants } from \"core/Engines/constants\";\r\nimport { NodeRenderGraphConnectionPointCustomObject } from \"../../nodeRenderGraphConnectionPointCustomObject\";\r\nimport { NodeRenderGraphBaseObjectRendererBlock } from \"../Rendering/baseObjectRendererBlock\";\r\n\r\n/**\r\n * Block that implements the highlight layer\r\n */\r\nexport class NodeRenderGraphHighlightLayerBlock extends NodeRenderGraphBlock {\r\n protected override _frameGraphTask: FrameGraphHighlightLayerTask;\r\n\r\n /**\r\n * Gets the frame graph task associated with this block\r\n */\r\n public override get task() {\r\n return this._frameGraphTask;\r\n }\r\n\r\n /**\r\n * Create a new NodeRenderGraphHighlightLayerBlock\r\n * @param name defines the block name\r\n * @param frameGraph defines the hosting frame graph\r\n * @param scene defines the hosting scene\r\n * @param layerTextureRatio multiplication factor applied to the main texture size to compute the size of the layer render target texture (default: 0.5)\r\n * @param layerTextureFixedSize defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided (default: undefined)\r\n * @param blurTextureSizeRatio defines the factor to apply to the layer texture size to create the blur textures (default: 0.5)\r\n * @param isStroke should we display highlight as a solid stroke? (default: false)\r\n * @param layerTextureType defines the type of the layer texture (default: Constants.TEXTURETYPE_UNSIGNED_BYTE)\r\n */\r\n public constructor(\r\n name: string,\r\n frameGraph: FrameGraph,\r\n scene: Scene,\r\n layerTextureRatio = 0.5,\r\n layerTextureFixedSize?: number,\r\n blurTextureSizeRatio = 0.5,\r\n isStroke = false,\r\n layerTextureType = Constants.TEXTURETYPE_UNSIGNED_BYTE\r\n ) {\r\n super(name, frameGraph, scene);\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n\r\n this.registerInput(\"destination\", NodeRenderGraphBlockConnectionPointTypes.Texture);\r\n this.registerInput(\"layer\", NodeRenderGraphBlockConnectionPointTypes.Texture, true);\r\n this.registerInput(\r\n \"objectRenderer\",\r\n NodeRenderGraphBlockConnectionPointTypes.Object,\r\n true,\r\n new NodeRenderGraphConnectionPointCustomObject(\r\n \"objectRenderer\",\r\n this,\r\n NodeRenderGraphConnectionPointDirection.Input,\r\n NodeRenderGraphBaseObjectRendererBlock,\r\n \"NodeRenderGraphBaseObjectRendererBlock\"\r\n )\r\n );\r\n this._addDependenciesInput();\r\n\r\n this.registerOutput(\"output\", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);\r\n this.layer.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBuffer);\r\n\r\n this.output._typeConnectionSource = this.destination;\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n }\r\n\r\n private _createTask(layerTextureRatio: number, layerTextureFixedSize: number, blurTextureSizeRatio: number, isStroke: boolean, layerTextureType: number) {\r\n const blurHorizontalSize = this.blurHorizontalSize;\r\n const blurVerticalSize = this.blurVerticalSize;\r\n\r\n this._frameGraphTask?.dispose();\r\n\r\n this._frameGraphTask = new FrameGraphHighlightLayerTask(this.name, this._frameGraph, this._scene, {\r\n mainTextureRatio: layerTextureRatio,\r\n mainTextureFixedSize: layerTextureFixedSize,\r\n blurTextureSizeRatio,\r\n isStroke,\r\n mainTextureType: layerTextureType,\r\n });\r\n\r\n this.blurHorizontalSize = blurHorizontalSize;\r\n this.blurVerticalSize = blurVerticalSize;\r\n\r\n this._additionalConstructionParameters = [layerTextureRatio, layerTextureFixedSize, blurTextureSizeRatio, isStroke, layerTextureType];\r\n }\r\n\r\n /** Multiplication factor applied to the main texture size to compute the size of the layer render target texture */\r\n @editableInPropertyPage(\"Layer texture ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureRatio() {\r\n return this._frameGraphTask.layer._options.mainTextureRatio;\r\n }\r\n\r\n public set layerTextureRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(value, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the fixed size of the layer render target texture. Takes precedence over layerTextureRatio if provided */\r\n @editableInPropertyPage(\"Layer texture fixed size\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get layerTextureFixedSize() {\r\n return this._frameGraphTask.layer._options.mainTextureFixedSize;\r\n }\r\n\r\n public set layerTextureFixedSize(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, value, options.blurTextureSizeRatio, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Defines the factor to apply to the layer texture size to create the blur textures */\r\n @editableInPropertyPage(\"Blur texture size ratio\", PropertyTypeForEdition.Float, \"PROPERTIES\")\r\n public get blurTextureSizeRatio() {\r\n return this._frameGraphTask.layer._options.blurTextureSizeRatio;\r\n }\r\n\r\n public set blurTextureSizeRatio(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, value, options.isStroke, options.mainTextureType);\r\n }\r\n\r\n /** Should we display highlight as a solid stroke? */\r\n @editableInPropertyPage(\"Is stroke\", PropertyTypeForEdition.Boolean, \"PROPERTIES\")\r\n public get isStroke() {\r\n return this._frameGraphTask.layer._options.isStroke;\r\n }\r\n\r\n public set isStroke(value: boolean) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, value, options.mainTextureType);\r\n }\r\n\r\n /** Defines the type of the layer texture */\r\n @editableInPropertyPage(\"Layer texture type\", PropertyTypeForEdition.TextureType, \"PROPERTIES\")\r\n public get layerTextureType() {\r\n return this._frameGraphTask.layer._options.mainTextureType;\r\n }\r\n\r\n public set layerTextureType(value: number) {\r\n const options = this._frameGraphTask.layer._options;\r\n\r\n this._createTask(options.mainTextureRatio, options.mainTextureFixedSize, options.blurTextureSizeRatio, options.isStroke, value);\r\n }\r\n\r\n /** How big is the horizontal kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur horizontal size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurHorizontalSize() {\r\n return this._frameGraphTask.layer.blurHorizontalSize;\r\n }\r\n\r\n public set blurHorizontalSize(value: number) {\r\n this._frameGraphTask.layer.blurHorizontalSize = value;\r\n }\r\n\r\n /** How big is the vertical kernel of the blur texture */\r\n @editableInPropertyPage(\"Blur vertical size\", PropertyTypeForEdition.Float, \"PROPERTIES\", { min: 0, max: 4 })\r\n public get blurVerticalSize() {\r\n return this._frameGraphTask.layer.blurVerticalSize;\r\n }\r\n\r\n public set blurVerticalSize(value: number) {\r\n this._frameGraphTask.layer.blurVerticalSize = value;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"NodeRenderGraphHighlightLayerBlock\";\r\n }\r\n\r\n /**\r\n * Gets the destination texture input component\r\n */\r\n public get destination(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the layer input component\r\n */\r\n public get layer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the objectRenderer input component\r\n */\r\n public get objectRenderer(): NodeRenderGraphConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeRenderGraphConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected override _buildBlock(state: NodeRenderGraphBuildState) {\r\n super._buildBlock(state);\r\n\r\n this.output.value = this._frameGraphTask.outputTexture;\r\n\r\n this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.layerTexture = this.layer.connectedPoint?.value as FrameGraphTextureHandle;\r\n this._frameGraphTask.objectRendererTask = this.objectRenderer.connectedPoint?.value as FrameGraphObjectRendererTask;\r\n }\r\n\r\n protected override _dumpPropertiesCode() {\r\n const codes: string[] = [];\r\n codes.push(`${this._codeVariableName}.blurHorizontalSize = ${this.blurHorizontalSize};`);\r\n codes.push(`${this._codeVariableName}.blurVerticalSize = ${this.blurVerticalSize};`);\r\n return super._dumpPropertiesCode() + codes.join(\"\\n\");\r\n }\r\n\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n serializationObject.blurHorizontalSize = this.blurHorizontalSize;\r\n serializationObject.blurVerticalSize = this.blurVerticalSize;\r\n return serializationObject;\r\n }\r\n\r\n public override _deserialize(serializationObject: any) {\r\n super._deserialize(serializationObject);\r\n this.blurHorizontalSize = serializationObject.blurHorizontalSize;\r\n this.blurVerticalSize = serializationObject.blurVerticalSize;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.NodeRenderGraphHighlightLayerBlock\", NodeRenderGraphHighlightLayerBlock);\r\n"]}
|
|
@@ -60,6 +60,10 @@ export declare class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGr
|
|
|
60
60
|
* Gets the output depth component
|
|
61
61
|
*/
|
|
62
62
|
get outputDepth(): NodeRenderGraphConnectionPoint;
|
|
63
|
+
/**
|
|
64
|
+
* Gets the objectRenderer component
|
|
65
|
+
*/
|
|
66
|
+
get objectRenderer(): NodeRenderGraphConnectionPoint;
|
|
63
67
|
protected _buildBlock(state: NodeRenderGraphBuildState): void;
|
|
64
68
|
protected _dumpPropertiesCode(): string;
|
|
65
69
|
serialize(): any;
|
|
@@ -3,6 +3,7 @@ import { NodeRenderGraphBlock } from "../../nodeRenderGraphBlock.js";
|
|
|
3
3
|
import { NodeRenderGraphBlockConnectionPointTypes } from "../../Types/nodeRenderGraphTypes.js";
|
|
4
4
|
import { editableInPropertyPage } from "../../../../Decorators/nodeDecorator.js";
|
|
5
5
|
import { NodeRenderGraphConnectionPoint } from "../../nodeRenderGraphBlockConnectionPoint.js";
|
|
6
|
+
import { NodeRenderGraphConnectionPointCustomObject } from "../../nodeRenderGraphConnectionPointCustomObject.js";
|
|
6
7
|
/**
|
|
7
8
|
* @internal
|
|
8
9
|
*/
|
|
@@ -29,6 +30,7 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
29
30
|
this.registerInput("shadowGenerators", NodeRenderGraphBlockConnectionPointTypes.ShadowGenerator, true);
|
|
30
31
|
this.registerOutput("output", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
31
32
|
this.registerOutput("outputDepth", NodeRenderGraphBlockConnectionPointTypes.BasedOnInput);
|
|
33
|
+
this.registerOutput("objectRenderer", NodeRenderGraphBlockConnectionPointTypes.Object, new NodeRenderGraphConnectionPointCustomObject("objectRenderer", this, 1 /* NodeRenderGraphConnectionPointDirection.Output */, NodeRenderGraphBaseObjectRendererBlock, "NodeRenderGraphBaseObjectRendererBlock"));
|
|
32
34
|
this.destination.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureAllButBackBufferDepthStencil);
|
|
33
35
|
this.depth.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.TextureDepthStencilAttachment);
|
|
34
36
|
this.shadowGenerators.addAcceptedConnectionPointTypes(NodeRenderGraphBlockConnectionPointTypes.ResourceContainer);
|
|
@@ -104,10 +106,17 @@ export class NodeRenderGraphBaseObjectRendererBlock extends NodeRenderGraphBlock
|
|
|
104
106
|
get outputDepth() {
|
|
105
107
|
return this._outputs[1];
|
|
106
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Gets the objectRenderer component
|
|
111
|
+
*/
|
|
112
|
+
get objectRenderer() {
|
|
113
|
+
return this._outputs[2];
|
|
114
|
+
}
|
|
107
115
|
_buildBlock(state) {
|
|
108
116
|
super._buildBlock(state);
|
|
109
117
|
this.output.value = this._frameGraphTask.outputTexture; // the value of the output connection point is the "output" texture of the task
|
|
110
118
|
this.outputDepth.value = this._frameGraphTask.outputDepthTexture; // the value of the outputDepth connection point is the "outputDepth" texture of the task
|
|
119
|
+
this.objectRenderer.value = this._frameGraphTask; // the value of the objectRenderer connection point is the task itself
|
|
111
120
|
this._frameGraphTask.destinationTexture = this.destination.connectedPoint?.value;
|
|
112
121
|
this._frameGraphTask.depthTexture = this.depth.connectedPoint?.value;
|
|
113
122
|
this._frameGraphTask.camera = this.camera.connectedPoint?.value;
|