|
27 | 27 | <input name="thickness" uniform="false" type="float" value="0" uimin="0" uiname="Thickness" uifolder="Volume" /> |
28 | 28 | <input name="attenuation_distance" uniform="true" type="float" uimin="0" uiname="Attenuation Distance" uifolder="Volume" /> |
29 | 29 | <input name="attenuation_color" uniform="true" type="color3" value="1, 1, 1" uimin="0, 0, 0" uimax="1, 1, 1" uiname="Attenuation Color" uifolder="Volume" /> |
| 30 | + <input name="anisotropy_strength" type="float" value="0" uimin="0" uimax="1" uiname="Anisotropy Strength" uifolder="Anisotropy" /> |
| 31 | + <input name="anisotropy_rotation" type="float" value="0" uimin="0" uimax="6.283185" uiname="Anisotropy Rotation" uifolder="Anisotropy" /> |
30 | 32 | <output name="out" type="surfaceshader" /> |
31 | 33 | </nodedef> |
32 | 34 |
|
|
104 | 106 |
|
105 | 107 | <!-- Roughness --> |
106 | 108 |
|
107 | | - <roughness_anisotropy name="roughness_uv" type="vector2"> |
108 | | - <input name="roughness" type="float" interfacename="roughness" /> |
109 | | - </roughness_anisotropy> |
| 109 | + <combine2 name="roughness_uv" type="vector2"> |
| 110 | + <input name="in1" type="float" nodename="clamped_at" /> |
| 111 | + <input name="in2" type="float" nodename="clamped_ab" /> |
| 112 | + </combine2> |
| 113 | + <clamp name="clamped_at" type="float"> |
| 114 | + <input name="in" type="float" nodename="at" /> |
| 115 | + <input name="low" type="float" value="0.00001" /> |
| 116 | + <input name="high" type="float" value="1.0" /> |
| 117 | + </clamp> |
| 118 | + <clamp name="clamped_ab" type="float"> |
| 119 | + <input name="in" type="float" nodename="alpha_roughness" /> |
| 120 | + <input name="low" type="float" value="0.00001" /> |
| 121 | + <input name="high" type="float" value="1.0" /> |
| 122 | + </clamp> |
| 123 | + <multiply name="alpha_roughness" type="float"> |
| 124 | + <input name="in1" type="float" interfacename="roughness" /> |
| 125 | + <input name="in2" type="float" interfacename="roughness" /> |
| 126 | + </multiply> |
| 127 | + <multiply name="strength_2" type="float"> |
| 128 | + <input name="in1" type="float" interfacename="anisotropy_strength" /> |
| 129 | + <input name="in2" type="float" interfacename="anisotropy_strength" /> |
| 130 | + </multiply> |
| 131 | + <mix name="at" type="float"> |
| 132 | + <input name="fg" type="float" value="1" /> |
| 133 | + <input name="bg" type="float" nodename="alpha_roughness" /> |
| 134 | + <input name="mix" type="float" nodename="strength_2" /> |
| 135 | + </mix> |
110 | 136 |
|
111 | 137 | <!-- Dielectric --> |
112 | 138 |
|
|
121 | 147 | <input name="ior" type="float" interfacename="ior" /> |
122 | 148 | <input name="roughness" type="vector2" nodename="roughness_uv" /> |
123 | 149 | <input name="normal" type="vector3" interfacename="normal" /> |
124 | | - <input name="tangent" type="vector3" interfacename="tangent" /> |
| 150 | + <input name="tangent" type="vector3" nodename="selected_tangent" /> |
125 | 151 | <input name="scatter_mode" type="string" value="T" /> |
126 | 152 | </dielectric_bsdf> |
127 | 153 |
|
|
130 | 156 | <input name="color90" type="color3" nodename="dielectric_f90" /> |
131 | 157 | <input name="roughness" type="vector2" nodename="roughness_uv" /> |
132 | 158 | <input name="normal" type="vector3" interfacename="normal" /> |
133 | | - <input name="tangent" type="vector3" interfacename="tangent" /> |
| 159 | + <input name="tangent" type="vector3" nodename="selected_tangent" /> |
134 | 160 | <input name="scatter_mode" type="string" value="R" /> |
135 | 161 | </generalized_schlick_bsdf> |
136 | 162 |
|
|
153 | 179 | <input name="color90" type="color3" nodename="dielectric_f90" /> |
154 | 180 | <input name="roughness" type="vector2" nodename="roughness_uv" /> |
155 | 181 | <input name="normal" type="vector3" interfacename="normal" /> |
156 | | - <input name="tangent" type="vector3" interfacename="tangent" /> |
| 182 | + <input name="tangent" type="vector3" nodename="selected_tangent" /> |
157 | 183 | <input name="scatter_mode" type="string" value="R" /> |
158 | 184 | <input name="thinfilm_thickness" type="float" interfacename="iridescence_thickness" /> |
159 | 185 | <input name="thinfilm_ior" type="float" interfacename="iridescence_ior" /> |
|
178 | 204 | <input name="color90" type="color3" value="1, 1, 1" /> |
179 | 205 | <input name="roughness" type="vector2" nodename="roughness_uv" /> |
180 | 206 | <input name="normal" type="vector3" interfacename="normal" /> |
181 | | - <input name="tangent" type="vector3" interfacename="tangent" /> |
| 207 | + <input name="tangent" type="vector3" nodename="selected_tangent" /> |
182 | 208 | </generalized_schlick_bsdf> |
183 | 209 |
|
184 | 210 | <!-- Thin-film + Metal |
|
189 | 215 | <input name="color90" type="color3" value="1, 1, 1" /> |
190 | 216 | <input name="roughness" type="vector2" nodename="roughness_uv" /> |
191 | 217 | <input name="normal" type="vector3" interfacename="normal" /> |
192 | | - <input name="tangent" type="vector3" interfacename="tangent" /> |
| 218 | + <input name="tangent" type="vector3" nodename="selected_tangent" /> |
193 | 219 | <input name="thinfilm_thickness" type="float" interfacename="iridescence_thickness" /> |
194 | 220 | <input name="thinfilm_ior" type="float" interfacename="iridescence_ior" /> |
195 | 221 | </generalized_schlick_bsdf> |
|
311 | 337 | <input name="in2" type="float" nodename="opacity_mask" /> |
312 | 338 | </ifequal> |
313 | 339 |
|
| 340 | + <!-- Anisotropy --> |
| 341 | + |
| 342 | + <multiply name="rad_2_deg" type="float"> |
| 343 | + <input name="in1" type="float" interfacename="anisotropy_rotation" /> |
| 344 | + <input name="in2" type="float" value="-57.295780" /> |
| 345 | + </multiply> |
| 346 | + <rotate3d name="rotate_tangent" type="vector3"> |
| 347 | + <input name="in" type="vector3" interfacename="tangent" /> |
| 348 | + <input name="amount" type="float" nodename="rad_2_deg" /> |
| 349 | + <input name="axis" type="vector3" interfacename="normal" /> |
| 350 | + </rotate3d> |
| 351 | + <normalize name="normalize_tangent" type="vector3"> |
| 352 | + <input name="in" type="vector3" nodename="rotate_tangent" /> |
| 353 | + </normalize> |
| 354 | + <absval name="abs_anisotropy_rotation" type="float"> |
| 355 | + <input name="in" type="float" interfacename="anisotropy_rotation"/> |
| 356 | + </absval> |
| 357 | + <ifgreater name="selected_tangent" type="vector3"> |
| 358 | + <input name="value1" type="float" nodename="abs_anisotropy_rotation" /> |
| 359 | + <input name="value2" type="float" value="0.0" /> |
| 360 | + <input name="in1" type="vector3" nodename="normalize_tangent" /> |
| 361 | + <input name="in2" type="vector3" interfacename="tangent" /> |
| 362 | + </ifgreater> |
| 363 | + |
314 | 364 | <!-- Surface --> |
315 | 365 |
|
316 | 366 | <surface name="shader_constructor" type="surfaceshader"> |
|
380 | 430 | <output name="outa" type="float" nodename="separate_alpha" /> |
381 | 431 | </nodegraph> |
382 | 432 |
|
383 | | - <!--- |
384 | | - Node: <gltf_image> |
| 433 | + <!--- |
| 434 | + Node: <gltf_image> |
385 | 435 | color3 image lookup which matches glTF |
386 | 436 | --> |
387 | 437 | <nodedef name="ND_gltf_image_color3_color3_1_0" node="gltf_image" version="1.0" isdefaultversion="true" nodegroup="texture2d"> |
|
435 | 485 | <output name="out" type="color3" nodename="scale_image" /> |
436 | 486 | </nodegraph> |
437 | 487 |
|
438 | | - <!--- |
439 | | - Node: <gltf_image> |
| 488 | + <!--- |
| 489 | + Node: <gltf_image> |
440 | 490 | color4 image lookup which matches glTF |
441 | 491 | --> |
442 | 492 | <nodedef name="ND_gltf_image_color4_color4_1_0" node="gltf_image" version="1.0" isdefaultversion="true" nodegroup="texture2d"> |
|
490 | 540 | <output name="out" type="color4" nodename="scale_image" /> |
491 | 541 | </nodegraph> |
492 | 542 |
|
493 | | - <!--- |
494 | | - Node: <gltf_image> |
| 543 | + <!--- |
| 544 | + Node: <gltf_image> |
495 | 545 | float image lookup which matches glTF |
496 | 546 | --> |
497 | 547 | <nodedef name="ND_gltf_image_float_float_1_0" node="gltf_image" version="1.0" isdefaultversion="true" nodegroup="texture2d"> |
|
545 | 595 | <output name="out" type="float" nodename="scale_image" /> |
546 | 596 | </nodegraph> |
547 | 597 |
|
548 | | - <!--- |
549 | | - Node: <gltf_image> |
| 598 | + <!--- |
| 599 | + Node: <gltf_image> |
550 | 600 | vector3 image lookup which matches glTF |
551 | 601 | --> |
552 | 602 | <nodedef name="ND_gltf_image_vector3_vector3_1_0" node="gltf_image" version="1.0" isdefaultversion="true" nodegroup="texture2d"> |
|
595 | 645 | <output name="out" type="vector3" nodename="image" /> |
596 | 646 | </nodegraph> |
597 | 647 |
|
598 | | - <!--- |
599 | | - Node: <gltf_normalmap> |
| 648 | + <!--- |
| 649 | + Node: <gltf_normalmap> |
600 | 650 | normalmap image lookup which matches glTF |
601 | 651 | --> |
602 | 652 | <nodedef name="ND_gltf_normalmap_vector3_1_0" node="gltf_normalmap" version="1.0" isdefaultversion="true" nodegroup="texture2d"> |
|
649 | 699 | </nodegraph> |
650 | 700 |
|
651 | 701 | <!-- |
652 | | - Node: <gltf_iridescence> |
653 | | - normalmap image lookup which matches glTF |
| 702 | + Node: <gltf_iridescence> |
| 703 | + normalmap image lookup which matches glTF |
654 | 704 | --> |
655 | 705 | <nodedef name="ND_gltf_iridescence_thickness_float_1_0" node="gltf_iridescence_thickness" version="1.0" isdefaultversion="true" nodegroup="texture2d"> |
656 | 706 | <input name="file" type="filename" uniform="true" value="" uifolder="Image" /> |
|
692 | 742 | <output name="out" type="float" nodename="mixThickness" /> |
693 | 743 | </nodegraph> |
694 | 744 |
|
| 745 | + <!-- |
| 746 | + Node: <gltf_anisotropy_image> |
| 747 | + --> |
| 748 | + <nodedef name="ND_gltf_anisotropy_image" node="gltf_anisotropy_image" version="1.0" isdefaultversion="true" nodegroup="texture2d"> |
| 749 | + <input name="file" type="filename" uniform="true" value="" uifolder="Image" /> |
| 750 | + <input name="default" type="vector3" value="1.0, 0.5, 1" uifolder="Image" /> |
| 751 | + <input name="texcoord" type="vector2" defaultgeomprop="UV0" uifolder="Image" /> |
| 752 | + <input name="pivot" type="vector2" value="0, 1" uifolder="Image" /> |
| 753 | + <input name="scale" type="vector2" value="1, 1" uifolder="Image" /> |
| 754 | + <input name="rotate" type="float" value="0" unit="degree" unittype="angle" uimin="0" uimax="360" uifolder="Image" /> |
| 755 | + <input name="offset" type="vector2" value="0, 0" uifolder="Image" /> |
| 756 | + <input name="operationorder" type="integer" value="0" uifolder="Image" /> |
| 757 | + <input name="uaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" uifolder="Image" /> |
| 758 | + <input name="vaddressmode" type="string" uniform="true" value="periodic" enum="constant,clamp,periodic,mirror" uifolder="Image" /> |
| 759 | + <input name="filtertype" type="string" uniform="true" value="linear" enum="closest,linear,cubic" uifolder="Image" /> |
| 760 | + <input name="anisotropy_strength" type="float" value="1" uimin="0" uimax="1" uifolder="Anisotropy" uiname="Anisotropy Strength" /> |
| 761 | + <input name="anisotropy_rotation" type="float" value="0" uimin="0" uimax="6.283185" uifolder="Anisotropy" uiname="Anisotropy Rotation" /> |
| 762 | + <output name="anisotropy_strength_out" type="float" value="0" /> |
| 763 | + <output name="anisotropy_rotation_out" type="float" value="0" /> |
| 764 | + </nodedef> |
| 765 | + |
| 766 | + <nodegraph name="NG_gltf_anisotropy_image_1_0" nodedef="ND_gltf_anisotropy_image"> |
| 767 | + <gltf_image name="gltf_anisotropy_image_src" type="vector3" nodedef="ND_gltf_image_vector3_vector3_1_0"> |
| 768 | + <input name="file" type="filename" uniform="true" interfacename="file" /> |
| 769 | + <input name="default" type="vector3" interfacename="default" /> |
| 770 | + <input name="texcoord" type="vector2" interfacename="texcoord" /> |
| 771 | + <input name="pivot" type="vector2" interfacename="pivot" /> |
| 772 | + <input name="scale" type="vector2" interfacename="scale" /> |
| 773 | + <input name="rotate" type="float" interfacename="rotate" /> |
| 774 | + <input name="offset" type="vector2" interfacename="offset" /> |
| 775 | + <input name="operationorder" type="integer" value="0" /> |
| 776 | + <input name="uaddressmode" type="string" uniform="true" value="periodic" /> |
| 777 | + <input name="vaddressmode" type="string" uniform="true" value="periodic" /> |
| 778 | + <input name="filtertype" type="string" uniform="true" interfacename="filtertype" /> |
| 779 | + </gltf_image> |
| 780 | + <separate3 name="separate3" type="multioutput"> |
| 781 | + <input name="in" type="vector3" nodename="gltf_anisotropy_image_src" /> |
| 782 | + </separate3> |
| 783 | + <multiply name="strength_multiply" type="float"> |
| 784 | + <input name="in1" type="float" interfacename="anisotropy_strength" /> |
| 785 | + <input name="in2" type="float" nodename="separate3" output="outz" /> |
| 786 | + </multiply> |
| 787 | + <atan2 name="direction_to_rotation" type="float"> |
| 788 | + <input name="iny" type="float" nodename="subtract_y" /> |
| 789 | + <input name="inx" type="float" nodename="subtract_x" /> |
| 790 | + </atan2> |
| 791 | + <add name="rotation_add" type="float"> |
| 792 | + <input name="in1" type="float" interfacename="anisotropy_rotation" /> |
| 793 | + <input name="in2" type="float" nodename="direction_to_rotation" /> |
| 794 | + </add> |
| 795 | + <multiply name="multiply_x" type="float"> |
| 796 | + <input name="in1" type="float" nodename="separate3" output="outx" /> |
| 797 | + <input name="in2" type="float" value="2.0" /> |
| 798 | + </multiply> |
| 799 | + <subtract name="subtract_x" type="float"> |
| 800 | + <input name="in1" type="float" nodename="multiply_x" /> |
| 801 | + <input name="in2" type="float" value="1.0" /> |
| 802 | + </subtract> |
| 803 | + <subtract name="subtract_y" type="float"> |
| 804 | + <input name="in1" type="float" nodename="multiply_y" /> |
| 805 | + <input name="in2" type="float" value="1.0" /> |
| 806 | + </subtract> |
| 807 | + <multiply name="multiply_y" type="float"> |
| 808 | + <input name="in1" type="float" nodename="separate3" output="outy" /> |
| 809 | + <input name="in2" type="float" value="2.0" /> |
| 810 | + </multiply> |
| 811 | + <output name="anisotropy_strength_out" type="float" nodename="strength_multiply" /> |
| 812 | + <output name="anisotropy_rotation_out" type="float" nodename="rotation_add" /> |
| 813 | + </nodegraph> |
| 814 | + |
695 | 815 | </materialx> |
0 commit comments