Skip to content

Commit e81fbab

Browse files
authored
Remove Blur node implementation (AcademySoftwareFoundation#2411)
I'm submitting this PR - because I think it's the best we can do for now. I looked in to trying to find a portable robust implementation for this, and couldn't really come up with anything. I think it's better to be explicitly do nothing, than to do something that is confusing. MDL currently just passes through the `in` input as the output, so I'm using that as the template for the others as it seems like a reasonable fallback - implemented as a nodegraph that is now shared across all languages.
1 parent 24cf7fc commit e81fbab

27 files changed

Lines changed: 67 additions & 858 deletions

libraries/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ This folder contains the standard data libraries for MaterialX, providing declar
7676
- Shader generation does not currently support:
7777
- `displacementshader` and `volumeshader` nodes for hardware shading targets (GLSL, MSL).
7878
- `hextiledimage` and `hextilednormalmap` for OSL and MDL.
79+
- `blur` the implementation passes through `in` unmodified in all shading languages.

libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -725,14 +725,6 @@
725725
<!-- Convolution nodes -->
726726
<!-- ======================================================================== -->
727727

728-
<!-- <blur> -->
729-
<implementation name="IM_blur_float_genglsl" nodedef="ND_blur_float" target="genglsl" />
730-
<implementation name="IM_blur_color3_genglsl" nodedef="ND_blur_color3" target="genglsl" />
731-
<implementation name="IM_blur_color4_genglsl" nodedef="ND_blur_color4" target="genglsl" />
732-
<implementation name="IM_blur_vector2_genglsl" nodedef="ND_blur_vector2" target="genglsl" />
733-
<implementation name="IM_blur_vector3_genglsl" nodedef="ND_blur_vector3" target="genglsl" />
734-
<implementation name="IM_blur_vector4_genglsl" nodedef="ND_blur_vector4" target="genglsl" />
735-
736728
<!-- <heighttonormal> -->
737729
<implementation name="IM_heighttonormal_vector3_genglsl" nodedef="ND_heighttonormal_vector3" file="mx_heighttonormal_vector3.glsl" function="mx_heighttonormal_vector3" target="genglsl" />
738730

libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -737,14 +737,6 @@
737737
<!-- Convolution nodes -->
738738
<!-- ======================================================================== -->
739739

740-
<!-- <blur> -->
741-
<implementation name="IM_blur_float_genmdl" nodedef="ND_blur_float" target="genmdl" />
742-
<implementation name="IM_blur_color3_genmdl" nodedef="ND_blur_color3" target="genmdl" />
743-
<implementation name="IM_blur_color4_genmdl" nodedef="ND_blur_color4" target="genmdl" />
744-
<implementation name="IM_blur_vector2_genmdl" nodedef="ND_blur_vector2" target="genmdl" />
745-
<implementation name="IM_blur_vector3_genmdl" nodedef="ND_blur_vector3" target="genmdl" />
746-
<implementation name="IM_blur_vector4_genmdl" nodedef="ND_blur_vector4" target="genmdl" />
747-
748740
<!-- <heighttonormal> -->
749741
<implementation name="IM_heighttonormal_vector3_genmdl" nodedef="ND_heighttonormal_vector3" target="genmdl" />
750742

libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,6 @@
138138
<!-- Convolution nodes -->
139139
<!-- ======================================================================== -->
140140

141-
<!-- <blur> -->
142-
<implementation name="IM_blur_float_genmsl" nodedef="ND_blur_float" target="genmsl" />
143-
<implementation name="IM_blur_color3_genmsl" nodedef="ND_blur_color3" target="genmsl" />
144-
<implementation name="IM_blur_color4_genmsl" nodedef="ND_blur_color4" target="genmsl" />
145-
<implementation name="IM_blur_vector2_genmsl" nodedef="ND_blur_vector2" target="genmsl" />
146-
<implementation name="IM_blur_vector3_genmsl" nodedef="ND_blur_vector3" target="genmsl" />
147-
<implementation name="IM_blur_vector4_genmsl" nodedef="ND_blur_vector4" target="genmsl" />
148-
149141
<!-- ======================================================================== -->
150142
<!-- Logical operator nodes -->
151143
<!-- ======================================================================== -->

libraries/stdlib/genosl/stdlib_genosl_impl.mtlx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -715,14 +715,6 @@
715715
<!-- Convolution nodes -->
716716
<!-- ======================================================================== -->
717717

718-
<!-- <blur> -->
719-
<implementation name="IM_blur_float_genosl" nodedef="ND_blur_float" target="genosl" />
720-
<implementation name="IM_blur_color3_genosl" nodedef="ND_blur_color3" target="genosl" />
721-
<implementation name="IM_blur_color4_genosl" nodedef="ND_blur_color4" target="genosl" />
722-
<implementation name="IM_blur_vector2_genosl" nodedef="ND_blur_vector2" target="genosl" />
723-
<implementation name="IM_blur_vector3_genosl" nodedef="ND_blur_vector3" target="genosl" />
724-
<implementation name="IM_blur_vector4_genosl" nodedef="ND_blur_vector4" target="genosl" />
725-
726718
<!-- <heighttonormal> -->
727719
<implementation name="IM_heighttonormal_vector3_genosl" nodedef="ND_heighttonormal_vector3" file="mx_heighttonormal_vector3.osl" function="mx_heighttonormal_vector3" target="genosl" />
728720

libraries/stdlib/stdlib_ng.mtlx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6381,4 +6381,44 @@
63816381
<output name="out" type="boolean" nodename="or" />
63826382
</nodegraph>
63836383

6384+
<!-- Node: <blur>
6385+
NOTE : this implementation is a pass-thru, and does not implement the specification
6386+
-->
6387+
<nodegraph name="NG_blur_float" nodedef="ND_blur_float">
6388+
<constant name="const" type="float">
6389+
<input name="value" type="float" interfacename="in"/>
6390+
</constant>
6391+
<output name="out" type="float" nodename="const" />
6392+
</nodegraph>
6393+
<nodegraph name="NG_blur_color3" nodedef="ND_blur_color3">
6394+
<constant name="const" type="color3">
6395+
<input name="value" type="color3" interfacename="in"/>
6396+
</constant>
6397+
<output name="out" type="color3" nodename="const" />
6398+
</nodegraph>
6399+
<nodegraph name="NG_blur_color4" nodedef="ND_blur_color4">
6400+
<constant name="const" type="color4">
6401+
<input name="value" type="color4" interfacename="in"/>
6402+
</constant>
6403+
<output name="out" type="color4" nodename="const" />
6404+
</nodegraph>
6405+
<nodegraph name="NG_blur_vector2" nodedef="ND_blur_vector2">
6406+
<constant name="const" type="vector2">
6407+
<input name="value" type="vector2" interfacename="in"/>
6408+
</constant>
6409+
<output name="out" type="vector2" nodename="const" />
6410+
</nodegraph>
6411+
<nodegraph name="NG_blur_vector3" nodedef="ND_blur_vector3">
6412+
<constant name="const" type="vector3">
6413+
<input name="value" type="vector3" interfacename="in"/>
6414+
</constant>
6415+
<output name="out" type="vector3" nodename="const" />
6416+
</nodegraph>
6417+
<nodegraph name="NG_blur_vector4" nodedef="ND_blur_vector4">
6418+
<constant name="const" type="vector4">
6419+
<input name="value" type="vector4" interfacename="in"/>
6420+
</constant>
6421+
<output name="out" type="vector4" nodename="const" />
6422+
</nodegraph>
6423+
63846424
</materialx>

source/MaterialXGenGlsl/GlslShaderGenerator.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <MaterialXGenGlsl/Nodes/NumLightsNodeGlsl.h>
1515

1616
#include <MaterialXGenShader/Nodes/MaterialNode.h>
17-
#include <MaterialXGenShader/Nodes/HwBlurNode.h>
1817
#include <MaterialXGenShader/Nodes/HwImageNode.h>
1918
#include <MaterialXGenShader/Nodes/HwGeomColorNode.h>
2019
#include <MaterialXGenShader/Nodes/HwGeomPropValueNode.h>
@@ -97,17 +96,6 @@ GlslShaderGenerator::GlslShaderGenerator(TypeSystemPtr typeSystem) :
9796
// <!-- <spot_light> -->
9897
registerImplementation("IM_spot_light_" + GlslShaderGenerator::TARGET, LightShaderNodeGlsl::create);
9998

100-
// <!-- <blur> -->
101-
elementNames = {
102-
"IM_blur_float_" + GlslShaderGenerator::TARGET,
103-
"IM_blur_color3_" + GlslShaderGenerator::TARGET,
104-
"IM_blur_color4_" + GlslShaderGenerator::TARGET,
105-
"IM_blur_vector2_" + GlslShaderGenerator::TARGET,
106-
"IM_blur_vector3_" + GlslShaderGenerator::TARGET,
107-
"IM_blur_vector4_" + GlslShaderGenerator::TARGET,
108-
};
109-
registerImplementation(elementNames, []() -> ShaderNodeImplPtr { return HwBlurNode::create(GlslSamplingIncludeFilename);});
110-
11199
// <!-- <ND_transformpoint> ->
112100
registerImplementation("IM_transformpoint_vector3_" + GlslShaderGenerator::TARGET, HwTransformPointNode::create);
113101

source/MaterialXGenMdl/MdlShaderGenerator.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <MaterialXGenMdl/Nodes/MaterialNodeMdl.h>
1212
#include <MaterialXGenMdl/Nodes/SurfaceNodeMdl.h>
1313
#include <MaterialXGenMdl/Nodes/HeightToNormalNodeMdl.h>
14-
#include <MaterialXGenMdl/Nodes/BlurNodeMdl.h>
1514
#include <MaterialXGenMdl/Nodes/ClosureLayerNodeMdl.h>
1615
#include <MaterialXGenMdl/Nodes/ClosureCompoundNodeMdl.h>
1716
#include <MaterialXGenMdl/Nodes/CustomNodeMdl.h>
@@ -100,14 +99,6 @@ MdlShaderGenerator::MdlShaderGenerator(TypeSystemPtr typeSystem) :
10099
// <!-- <surface> -->
101100
registerImplementation("IM_surface_" + MdlShaderGenerator::TARGET, SurfaceNodeMdl::create);
102101

103-
// <!-- <blur> -->
104-
registerImplementation("IM_blur_float_" + MdlShaderGenerator::TARGET, BlurNodeMdl::create);
105-
registerImplementation("IM_blur_color3_" + MdlShaderGenerator::TARGET, BlurNodeMdl::create);
106-
registerImplementation("IM_blur_color4_" + MdlShaderGenerator::TARGET, BlurNodeMdl::create);
107-
registerImplementation("IM_blur_vector2_" + MdlShaderGenerator::TARGET, BlurNodeMdl::create);
108-
registerImplementation("IM_blur_vector3_" + MdlShaderGenerator::TARGET, BlurNodeMdl::create);
109-
registerImplementation("IM_blur_vector4_" + MdlShaderGenerator::TARGET, BlurNodeMdl::create);
110-
111102
// <!-- <heighttonormal> -->
112103
registerImplementation("IM_heighttonormal_vector3_" + MdlShaderGenerator::TARGET, HeightToNormalNodeMdl::create);
113104

source/MaterialXGenMdl/Nodes/BlurNodeMdl.cpp

Lines changed: 0 additions & 193 deletions
This file was deleted.

source/MaterialXGenMdl/Nodes/BlurNodeMdl.h

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)