Skip to content

Commit b612f3d

Browse files
committed
Add UsdUVTexture v2.3 variant with vector4 scale and bias
Introduces ND_UsdUVTexture_23_vector4 nodedef and IMP_UsdUVTexture_23_vector4 nodegraph implementation, where the `scale` and `bias` inputs are typed as vector4 instead of the original color4-derived behavior. The prior variant is retained for now and may be removed in a future MaterialX release via an upgrade function.
1 parent 9ebe5f1 commit b612f3d

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

libraries/bxdf/usd_preview_surface.mtlx

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,23 @@
5050
<output name="rgb" type="color3" />
5151
</nodedef>
5252

53+
<!-- adding variant with scale and bias defined as vector4 type - we may decide to remove the original version
54+
in a future MaterialX version with an upgrade function -->
55+
<nodedef name="ND_UsdUVTexture_23_vector4" node="UsdUVTexture" nodegroup="texture2d" version="2.3">
56+
<input name="file" type="filename" value="" uniform="true" />
57+
<input name="st" type="vector2" defaultgeomprop="UV0" />
58+
<input name="wrapS" type="string" value="periodic" enum="black,clamp,periodic,mirror" uniform="true" />
59+
<input name="wrapT" type="string" value="periodic" enum="black,clamp,periodic,mirror" uniform="true" />
60+
<input name="fallback" type="color4" value="0, 0, 0, 1" />
61+
<input name="scale" type="vector4" value="1, 1, 1, 1" uniform="true" />
62+
<input name="bias" type="vector4" value="0, 0, 0, 0" uniform="true" />
63+
<output name="r" type="float" />
64+
<output name="g" type="float" />
65+
<output name="b" type="float" />
66+
<output name="a" type="float" />
67+
<output name="rgb" type="color3" />
68+
</nodedef>
69+
5370
<!-- Node: UsdPrimvarReader -->
5471
<nodedef name="ND_UsdPrimvarReader_integer" nodegroup="geometric" node="UsdPrimvarReader">
5572
<input name="varname" type="string" value="" uniform="true" />
@@ -371,6 +388,41 @@
371388
<output name="rgb" type="color3" nodename="image_bias_color3" />
372389
</nodegraph>
373390

391+
<nodegraph name="IMP_UsdUVTexture_23_vector4" nodedef="ND_UsdUVTexture_23_vector4">
392+
<image name="image_reader" type="color4">
393+
<input name="file" type="filename" interfacename="file" />
394+
<input name="default" type="color4" interfacename="fallback" />
395+
<input name="texcoord" type="vector2" interfacename="st" />
396+
<input name="uaddressmode" type="string" interfacename="wrapS" />
397+
<input name="vaddressmode" type="string" interfacename="wrapT" />
398+
</image>
399+
<convert name="convert_vector4" type="vector4">
400+
<input name="in" type="color4" nodename="image_reader" />
401+
</convert>
402+
<multiply name="image_scale" type="vector4">
403+
<input name="in1" type="vector4" nodename="convert_vector4" />
404+
<input name="in2" type="vector4" interfacename="scale" />
405+
</multiply>
406+
<add name="image_bias" type="vector4">
407+
<input name="in1" type="vector4" nodename="image_scale" />
408+
<input name="in2" type="vector4" interfacename="bias" />
409+
</add>
410+
<convert name="comvert_color4" type="color4">
411+
<input name="in" type="vector4" nodename="image_bias" />
412+
</convert>
413+
<separate4 name="image_bias_separate" type="multioutput" nodedef="ND_separate4_color4">
414+
<input name="in" type="color4" nodename="comvert_color4" />
415+
</separate4>
416+
<convert name="image_bias_color3" type="color3">
417+
<input name="in" type="color4" nodename="comvert_color4" />
418+
</convert>
419+
<output name="r" type="float" nodename="image_bias_separate" output="outr" />
420+
<output name="g" type="float" nodename="image_bias_separate" output="outg" />
421+
<output name="b" type="float" nodename="image_bias_separate" output="outb" />
422+
<output name="a" type="float" nodename="image_bias_separate" output="outa" />
423+
<output name="rgb" type="color3" nodename="image_bias_color3" />
424+
</nodegraph>
425+
374426
<!-- Node: UsdPrimvarReader -->
375427
<nodegraph name="IMP_UsdPrimvarReader_integer" nodedef="ND_UsdPrimvarReader_integer">
376428
<geompropvalue name="primvar" type="integer">

0 commit comments

Comments
 (0)