diff --git a/documents/about.html b/documents/about.html index 74bf0a51..33f7f52f 100644 --- a/documents/about.html +++ b/documents/about.html @@ -51,7 +51,7 @@ - + diff --git a/documents/css/style.css b/documents/css/style.css index 14588ba3..79649306 100644 --- a/documents/css/style.css +++ b/documents/css/style.css @@ -50,12 +50,11 @@ body, background-color: rgb(255, 253, 245); } -.custom_colorbox -{ - min-width: 1em; - min-height: 1em; - width: 2.5em; - height: 2.5em; +.custom_colorbox { + min-width: 1em; + min-height: 1em; + width: 2.5em; + height: 2.5em; } @font-face { @@ -143,10 +142,10 @@ aa .text-shadow-2 { /* Model viewer */ model-viewer { - width: 100%; - height: 100%; - min-height: 256; - background-color: #7d7d7d; + width: 100%; + height: 100%; + min-height: 256; + background-color: #7d7d7d; } @@ -178,50 +177,68 @@ model-viewer { } - /* Custom styles for input range thumb */ - input[type="range"]::-webkit-slider-thumb { - background-color: #7d7d7d; /* Change thumb color in Webkit browsers (Chrome, Safari) */ - width: 16px; /* Set the width of the thumb */ - height: 16px; /* Set the height of the thumb */ - transform: translateY(0%); - } +/* Custom styles for input range thumb */ +input[type="range"]::-webkit-slider-thumb { + background-color: #7d7d7d; + /* Change thumb color in Webkit browsers (Chrome, Safari) */ + width: 16px; + /* Set the width of the thumb */ + height: 16px; + /* Set the height of the thumb */ + transform: translateY(0%); +} - - input[type="range"]::-webkit-slider-runnable-track { - background-color: #ccc; /* Track color in Webkit browsers */ - } - input[type="range"]::-moz-range-thumb { - background-color: #7d7d7d; /* Change thumb color in Mozilla Firefox */ - width: 16px; /* Set the width of the thumb */ - height: 16px; /* Set the height of the thumb */ - transform: translateY(0%); - } +input[type="range"]::-webkit-slider-runnable-track { + background-color: #ccc; + /* Track color in Webkit browsers */ +} - input[type="range"]::-moz-range-track { - background-color: #ccc; /* Track color in Mozilla Firefox */ - } +input[type="range"]::-moz-range-thumb { + background-color: #7d7d7d; + /* Change thumb color in Mozilla Firefox */ + width: 16px; + /* Set the width of the thumb */ + height: 16px; + /* Set the height of the thumb */ + transform: translateY(0%); +} + +input[type="range"]::-moz-range-track { + background-color: #ccc; + /* Track color in Mozilla Firefox */ +} - input[type="range"]:active::-ms-thumb { - background-color: #7d7d7d; /* Change thumb color in Microsoft Edge */ - width: 16px; /* Set the width of the thumb */ - height: 16px; /* Set the height of the thumb */ - transform: translateY(0%); - } +input[type="range"]:active::-ms-thumb { + background-color: #7d7d7d; + /* Change thumb color in Microsoft Edge */ + width: 16px; + /* Set the width of the thumb */ + height: 16px; + /* Set the height of the thumb */ + transform: translateY(0%); +} - input[type="range"]::-ms-track { - background-color: #ccc; /* Track color in Microsoft Edge */ - } +input[type="range"]::-ms-track { + background-color: #ccc; + /* Track color in Microsoft Edge */ +} - input[type="range"]:active::-webkit-slider-thumb { - background-color: #7d7d7d; /* Change thumb color in Webkit browsers (Chrome, Safari) */ - } +input[type="range"]:active::-webkit-slider-thumb { + background-color: #7d7d7d; + /* Change thumb color in Webkit browsers (Chrome, Safari) */ +} - input[type="range"]::-moz-range-thumb { - background-color: #7d7d7d; /* Change thumb color in Mozilla Firefox */ - } +input[type="range"]::-moz-range-thumb { + background-color: #7d7d7d; + /* Change thumb color in Mozilla Firefox */ +} - input[type="range"]:active::-ms-thumb { - background-color: #7d7d7d; /* Change thumb color in Microsoft Edge */ - } +input[type="range"]:active::-ms-thumb { + background-color: #7d7d7d; + /* Change thumb color in Microsoft Edge */ +} +.inverted-svg { + filter: invert(1); +} \ No newline at end of file diff --git a/documents/definitions/LamaAdd.html b/documents/definitions/LamaAdd.html index 667df3c8..30eb925d 100644 --- a/documents/definitions/LamaAdd.html +++ b/documents/definitions/LamaAdd.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/LamaConductor.html b/documents/definitions/LamaConductor.html index 29606f5b..7ce2fda8 100644 --- a/documents/definitions/LamaConductor.html +++ b/documents/definitions/LamaConductor.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -1340,8 +1338,6 @@
MaterialX LearnMaterialX Learn IMPL_lama_conductor_conductor_bsdf IMPL_lama_conductor_iridescenceIOR --"in1"--> IMPL_lama_conductor_iridescence_relative_ior IMPL_lama_conductor_exteriorIOR --"in2"--> IMPL_lama_conductor_iridescence_relative_ior - IMPL_lama_conductor_iridescenceThickness --"thickness"--> IMPL_lama_conductor_thin_film_bsdf - IMPL_lama_conductor_iridescence_relative_ior --"ior"--> IMPL_lama_conductor_thin_film_bsdf - IMPL_lama_conductor_thin_film_bsdf --"top"--> IMPL_lama_conductor_thin_film_conductor_bsdf - IMPL_lama_conductor_conductor_bsdf --"base"--> IMPL_lama_conductor_thin_film_conductor_bsdf IMPL_lama_conductor_conductor_bsdf --"in1"--> IMPL_lama_conductor_tinted_bsdf IMPL_lama_conductor_tint --"in2"--> IMPL_lama_conductor_tinted_bsdf IMPL_lama_conductor_tinted_bsdf --> IMPL_lama_conductor_out diff --git a/documents/definitions/LamaDielectric.html b/documents/definitions/LamaDielectric.html index 2bb4afdd..2d15cf3a 100644 --- a/documents/definitions/LamaDielectric.html +++ b/documents/definitions/LamaDielectric.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -1355,6 +1353,7 @@
MaterialX LearnMaterialX Learn IMPL_lama_dielectric_reflectivity_color IMPL_lama_dielectric_reflectivity_color --"reflectivity"--> IMPL_lama_dielectric_artistic_ior + IMPL_lama_dielectric_artistic_ior --"ior-->in"--> IMPL_lama_dielectric_swizzle IMPL_lama_dielectric_IOR --"in1"--> IMPL_lama_dielectric_fresnel_mode_switch - IMPL_lama_dielectric_artistic_ior --"ior-->in2"--> IMPL_lama_dielectric_fresnel_mode_switch + IMPL_lama_dielectric_swizzle --"in2"--> IMPL_lama_dielectric_fresnel_mode_switch IMPL_lama_dielectric_fresnelMode --"which"--> IMPL_lama_dielectric_fresnel_mode_switch IMPL_lama_dielectric_fresnel_mode_switch --"in1"--> IMPL_lama_dielectric_relative_ior IMPL_lama_dielectric_exteriorIOR --"in2"--> IMPL_lama_dielectric_relative_ior diff --git a/documents/definitions/LamaDiffuse.html b/documents/definitions/LamaDiffuse.html index 6063b41c..0889acd9 100644 --- a/documents/definitions/LamaDiffuse.html +++ b/documents/definitions/LamaDiffuse.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/LamaEmission.html b/documents/definitions/LamaEmission.html index 67cd3328..e8db7440 100644 --- a/documents/definitions/LamaEmission.html +++ b/documents/definitions/LamaEmission.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/LamaLayer.html b/documents/definitions/LamaLayer.html index 69c7da82..8ca96300 100644 --- a/documents/definitions/LamaLayer.html +++ b/documents/definitions/LamaLayer.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/LamaMix.html b/documents/definitions/LamaMix.html index 56207f5d..7dc0f9cf 100644 --- a/documents/definitions/LamaMix.html +++ b/documents/definitions/LamaMix.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/LamaSSS.html b/documents/definitions/LamaSSS.html index 8c5232c3..6d5a83c4 100644 --- a/documents/definitions/LamaSSS.html +++ b/documents/definitions/LamaSSS.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/LamaSheen.html b/documents/definitions/LamaSheen.html index 8a067dad..2a74b6f8 100644 --- a/documents/definitions/LamaSheen.html +++ b/documents/definitions/LamaSheen.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/LamaTranslucent.html b/documents/definitions/LamaTranslucent.html index e67fdf98..199fcbf5 100644 --- a/documents/definitions/LamaTranslucent.html +++ b/documents/definitions/LamaTranslucent.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/UsdPreviewSurface.html b/documents/definitions/UsdPreviewSurface.html index 2a12efe5..900feeee 100644 --- a/documents/definitions/UsdPreviewSurface.html +++ b/documents/definitions/UsdPreviewSurface.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/UsdPrimvarReader.html b/documents/definitions/UsdPrimvarReader.html index d6873c79..7e607b9b 100644 --- a/documents/definitions/UsdPrimvarReader.html +++ b/documents/definitions/UsdPrimvarReader.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/UsdTransform2d.html b/documents/definitions/UsdTransform2d.html index 3d28d614..83fb325a 100644 --- a/documents/definitions/UsdTransform2d.html +++ b/documents/definitions/UsdTransform2d.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/UsdUVTexture.html b/documents/definitions/UsdUVTexture.html index ef7c1230..4490acc8 100644 --- a/documents/definitions/UsdUVTexture.html +++ b/documents/definitions/UsdUVTexture.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -751,14 +749,19 @@
MaterialX LearnMaterialX Learn IMP_UsdUVTexture_22_image_scale IMP_UsdUVTexture_22_image_scale --"in1"--> IMP_UsdUVTexture_22_image_bias IMP_UsdUVTexture_22_bias --"in2"--> IMP_UsdUVTexture_22_image_bias - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_r - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_g - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_b - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_a - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_rgb + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle + IMP_UsdUVTexture_22_swizzle --> IMP_UsdUVTexture_22_r + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle2 + IMP_UsdUVTexture_22_swizzle2 --> IMP_UsdUVTexture_22_g + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle3 + IMP_UsdUVTexture_22_swizzle3 --> IMP_UsdUVTexture_22_b + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle4 + IMP_UsdUVTexture_22_swizzle4 --> IMP_UsdUVTexture_22_a + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle5 + IMP_UsdUVTexture_22_swizzle5 --> IMP_UsdUVTexture_22_rgb IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_rgba @@ -1152,14 +1160,19 @@
MaterialX LearnMaterialX Learn IMP_UsdUVTexture_23_image_scale IMP_UsdUVTexture_23_image_scale --"in1"--> IMP_UsdUVTexture_23_image_bias IMP_UsdUVTexture_23_bias --"in2"--> IMP_UsdUVTexture_23_image_bias - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_r - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_g - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_b - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_a - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_rgb + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle + IMP_UsdUVTexture_23_swizzle --> IMP_UsdUVTexture_23_r + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle2 + IMP_UsdUVTexture_23_swizzle2 --> IMP_UsdUVTexture_23_g + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle3 + IMP_UsdUVTexture_23_swizzle3 --> IMP_UsdUVTexture_23_b + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle4 + IMP_UsdUVTexture_23_swizzle4 --> IMP_UsdUVTexture_23_a + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle5 + IMP_UsdUVTexture_23_swizzle5 --> IMP_UsdUVTexture_23_rgb
diff --git a/documents/definitions/absorption_vdf.html b/documents/definitions/absorption_vdf.html index 88f6fa70..4ec2df4c 100644 --- a/documents/definitions/absorption_vdf.html +++ b/documents/definitions/absorption_vdf.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/absval.html b/documents/definitions/absval.html index d5b436a6..af3bbe9b 100644 --- a/documents/definitions/absval.html +++ b/documents/definitions/absval.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/acescg_to_lin_rec709.html b/documents/definitions/acescg_to_lin_rec709.html index 918657f5..77f61b39 100644 --- a/documents/definitions/acescg_to_lin_rec709.html +++ b/documents/definitions/acescg_to_lin_rec709.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -794,6 +792,10 @@
MaterialX LearnMaterialX Learn NG_acescg_to_lin_rec709_color4_asColor3 NG_acescg_to_lin_rec709_color4_asColor3 --"in"--> NG_acescg_to_lin_rec709_color4_transform - NG_acescg_to_lin_rec709_color4_transform --"in1"--> NG_acescg_to_lin_rec709_color4_asColor4 - NG_acescg_to_lin_rec709_color4_transform --"in2"--> NG_acescg_to_lin_rec709_color4_asColor4 - NG_acescg_to_lin_rec709_color4_transform --"in3"--> NG_acescg_to_lin_rec709_color4_asColor4 - NG_acescg_to_lin_rec709_color4_in --"in4"--> NG_acescg_to_lin_rec709_color4_asColor4 + NG_acescg_to_lin_rec709_color4_transform --"in"--> NG_acescg_to_lin_rec709_color4_swizzle + NG_acescg_to_lin_rec709_color4_transform --"in"--> NG_acescg_to_lin_rec709_color4_swizzle2 + NG_acescg_to_lin_rec709_color4_transform --"in"--> NG_acescg_to_lin_rec709_color4_swizzle3 + NG_acescg_to_lin_rec709_color4_in --"in"--> NG_acescg_to_lin_rec709_color4_swizzle4 + NG_acescg_to_lin_rec709_color4_swizzle --"in1"--> NG_acescg_to_lin_rec709_color4_asColor4 + NG_acescg_to_lin_rec709_color4_swizzle2 --"in2"--> NG_acescg_to_lin_rec709_color4_asColor4 + NG_acescg_to_lin_rec709_color4_swizzle3 --"in3"--> NG_acescg_to_lin_rec709_color4_asColor4 + NG_acescg_to_lin_rec709_color4_swizzle4 --"in4"--> NG_acescg_to_lin_rec709_color4_asColor4 NG_acescg_to_lin_rec709_color4_asColor4 --> NG_acescg_to_lin_rec709_color4_out diff --git a/documents/definitions/acos.html b/documents/definitions/acos.html index 0c56de4f..e9fdfb67 100644 --- a/documents/definitions/acos.html +++ b/documents/definitions/acos.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/add.html b/documents/definitions/add.html index fa7b207b..81e4c26b 100644 --- a/documents/definitions/add.html +++ b/documents/definitions/add.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -737,8 +735,9 @@
MaterialX Learn
-
- +
+

@@ -883,8 +882,9 @@
MaterialX Learn
-
- +
+

@@ -1157,6 +1157,161 @@
MaterialX Learn
+
ND_add_integer +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+../resources/mtlx/nodedef_materials/material_add_integer_out_genglsl.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+

+

Code Implementation + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

+
+
+
+
+
ND_add_color3
diff --git a/documents/definitions/adobergb_to_lin_rec709.html b/documents/definitions/adobergb_to_lin_rec709.html index 6164bb94..a2f5f200 100644 --- a/documents/definitions/adobergb_to_lin_rec709.html +++ b/documents/definitions/adobergb_to_lin_rec709.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -793,6 +791,10 @@
MaterialX LearnMaterialX Learn NG_adobergb_to_lin_rec709_color4_asColor3 NG_adobergb_to_lin_rec709_color4_asColor3 --"in"--> NG_adobergb_to_lin_rec709_color4_transform - NG_adobergb_to_lin_rec709_color4_transform --"in1"--> NG_adobergb_to_lin_rec709_color4_asColor4 - NG_adobergb_to_lin_rec709_color4_transform --"in2"--> NG_adobergb_to_lin_rec709_color4_asColor4 - NG_adobergb_to_lin_rec709_color4_transform --"in3"--> NG_adobergb_to_lin_rec709_color4_asColor4 - NG_adobergb_to_lin_rec709_color4_in --"in4"--> NG_adobergb_to_lin_rec709_color4_asColor4 + NG_adobergb_to_lin_rec709_color4_transform --"in"--> NG_adobergb_to_lin_rec709_color4_swizzle + NG_adobergb_to_lin_rec709_color4_transform --"in"--> NG_adobergb_to_lin_rec709_color4_swizzle2 + NG_adobergb_to_lin_rec709_color4_transform --"in"--> NG_adobergb_to_lin_rec709_color4_swizzle3 + NG_adobergb_to_lin_rec709_color4_in --"in"--> NG_adobergb_to_lin_rec709_color4_swizzle4 + NG_adobergb_to_lin_rec709_color4_swizzle --"in1"--> NG_adobergb_to_lin_rec709_color4_asColor4 + NG_adobergb_to_lin_rec709_color4_swizzle2 --"in2"--> NG_adobergb_to_lin_rec709_color4_asColor4 + NG_adobergb_to_lin_rec709_color4_swizzle3 --"in3"--> NG_adobergb_to_lin_rec709_color4_asColor4 + NG_adobergb_to_lin_rec709_color4_swizzle4 --"in4"--> NG_adobergb_to_lin_rec709_color4_asColor4 NG_adobergb_to_lin_rec709_color4_asColor4 --> NG_adobergb_to_lin_rec709_color4_out diff --git a/documents/definitions/all_definitions.html b/documents/definitions/all_definitions.html index 4c8a97e3..2631ac45 100644 --- a/documents/definitions/all_definitions.html +++ b/documents/definitions/all_definitions.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -2603,13 +2601,9 @@
MaterialX LearnMaterialX Learn IMPL_gltf_pbr_surfaceshader_tf_transmission_mix IMPL_gltf_pbr_surfaceshader_tf_reflection_bsdf --"top"--> IMPL_gltf_pbr_surfaceshader_tf_dielectric_bsdf IMPL_gltf_pbr_surfaceshader_tf_transmission_mix --"base"--> IMPL_gltf_pbr_surfaceshader_tf_dielectric_bsdf - IMPL_gltf_pbr_surfaceshader_iridescence_thickness --"thickness"--> IMPL_gltf_pbr_surfaceshader_dielectric_thinfilm_bsdf - IMPL_gltf_pbr_surfaceshader_iridescence_ior --"ior"--> IMPL_gltf_pbr_surfaceshader_dielectric_thinfilm_bsdf - IMPL_gltf_pbr_surfaceshader_dielectric_thinfilm_bsdf --"top"--> IMPL_gltf_pbr_surfaceshader_iridescent_dielectric_bsdf - IMPL_gltf_pbr_surfaceshader_tf_dielectric_bsdf --"base"--> IMPL_gltf_pbr_surfaceshader_iridescent_dielectric_bsdf IMPL_gltf_pbr_surfaceshader_dielectric_bsdf --"bg"--> IMPL_gltf_pbr_surfaceshader_mix_iridescent_dielectric_bsdf IMPL_gltf_pbr_surfaceshader_tf_dielectric_bsdf --"fg"--> IMPL_gltf_pbr_surfaceshader_mix_iridescent_dielectric_bsdf IMPL_gltf_pbr_surfaceshader_iridescence --"mix"--> IMPL_gltf_pbr_surfaceshader_mix_iridescent_dielectric_bsdf @@ -2756,10 +2746,6 @@
MaterialX Learn IMPL_gltf_pbr_surfaceshader_tf_metal_bsdf IMPL_gltf_pbr_surfaceshader_iridescence_thickness --"thinfilm_thickness"--> IMPL_gltf_pbr_surfaceshader_tf_metal_bsdf IMPL_gltf_pbr_surfaceshader_iridescence_ior --"thinfilm_ior"--> IMPL_gltf_pbr_surfaceshader_tf_metal_bsdf - IMPL_gltf_pbr_surfaceshader_iridescence_thickness --"thickness"--> IMPL_gltf_pbr_surfaceshader_metal_thinfilm_bsdf - IMPL_gltf_pbr_surfaceshader_iridescence_ior --"ior"--> IMPL_gltf_pbr_surfaceshader_metal_thinfilm_bsdf - IMPL_gltf_pbr_surfaceshader_metal_thinfilm_bsdf --"top"--> IMPL_gltf_pbr_surfaceshader_iridescent_metal_bsdf - IMPL_gltf_pbr_surfaceshader_tf_metal_bsdf --"base"--> IMPL_gltf_pbr_surfaceshader_iridescent_metal_bsdf IMPL_gltf_pbr_surfaceshader_metal_bsdf --"bg"--> IMPL_gltf_pbr_surfaceshader_mix_iridescent_metal_bsdf IMPL_gltf_pbr_surfaceshader_tf_metal_bsdf --"fg"--> IMPL_gltf_pbr_surfaceshader_mix_iridescent_metal_bsdf IMPL_gltf_pbr_surfaceshader_iridescence --"mix"--> IMPL_gltf_pbr_surfaceshader_mix_iridescent_metal_bsdf @@ -8445,8 +8431,6 @@
MaterialX LearnMaterialX LearnMaterialX Learn NG_open_pbr_surface_surfaceshader_base_substrate NG_open_pbr_surface_surfaceshader_dielectric_base --"bg"--> NG_open_pbr_surface_surfaceshader_base_substrate NG_open_pbr_surface_surfaceshader_base_metalness --"mix"--> NG_open_pbr_surface_surfaceshader_base_substrate - NG_open_pbr_surface_surfaceshader_thin_film_thickness --"thickness"--> NG_open_pbr_surface_surfaceshader_thin_film_bsdf - NG_open_pbr_surface_surfaceshader_thin_film_ior --"ior"--> NG_open_pbr_surface_surfaceshader_thin_film_bsdf - NG_open_pbr_surface_surfaceshader_thin_film_bsdf --"top"--> NG_open_pbr_surface_surfaceshader_thin_film_layer - NG_open_pbr_surface_surfaceshader_base_substrate --"base"--> NG_open_pbr_surface_surfaceshader_thin_film_layer NG_open_pbr_surface_surfaceshader_coat_ior_to_F0 --"in2"--> NG_open_pbr_surface_surfaceshader_half_over_coat_F0 NG_open_pbr_surface_surfaceshader_half_over_coat_F0 --"in2"--> NG_open_pbr_surface_surfaceshader_coat_ior_level_upper_bound NG_open_pbr_surface_surfaceshader_coat_ior_level --"in"--> NG_open_pbr_surface_surfaceshader_coat_ior_level_clamped @@ -8731,15 +8713,17 @@
MaterialX Learn NG_open_pbr_surface_surfaceshader_coat_tinted_emission_edf NG_open_pbr_surface_surfaceshader_coat_color --"in2"--> NG_open_pbr_surface_surfaceshader_coat_tinted_emission_edf NG_open_pbr_surface_surfaceshader_coat_ior_to_F0 --"in2"--> NG_open_pbr_surface_surfaceshader_one_minus_coat_F0 - NG_open_pbr_surface_surfaceshader_one_minus_coat_F0 --"color0"--> NG_open_pbr_surface_surfaceshader_coated_emission_edf + NG_open_pbr_surface_surfaceshader_one_minus_coat_F0 --"in"--> NG_open_pbr_surface_surfaceshader_swizzle + NG_open_pbr_surface_surfaceshader_swizzle --"color0"--> NG_open_pbr_surface_surfaceshader_coated_emission_edf NG_open_pbr_surface_surfaceshader_coat_tinted_emission_edf --"base"--> NG_open_pbr_surface_surfaceshader_coated_emission_edf NG_open_pbr_surface_surfaceshader_coated_emission_edf --"fg"--> NG_open_pbr_surface_surfaceshader_emission_edf NG_open_pbr_surface_surfaceshader_uncoated_emission_edf --"bg"--> NG_open_pbr_surface_surfaceshader_emission_edf NG_open_pbr_surface_surfaceshader_coat_weight --"mix"--> NG_open_pbr_surface_surfaceshader_emission_edf NG_open_pbr_surface_surfaceshader_geometry_opacity --"in"--> NG_open_pbr_surface_surfaceshader_opacity_luminance + NG_open_pbr_surface_surfaceshader_opacity_luminance --"in"--> NG_open_pbr_surface_surfaceshader_swizzle2 NG_open_pbr_surface_surfaceshader_fuzz_layer --"bsdf"--> NG_open_pbr_surface_surfaceshader_shader_constructor NG_open_pbr_surface_surfaceshader_emission_edf --"edf"--> NG_open_pbr_surface_surfaceshader_shader_constructor - NG_open_pbr_surface_surfaceshader_opacity_luminance --"opacity"--> NG_open_pbr_surface_surfaceshader_shader_constructor + NG_open_pbr_surface_surfaceshader_swizzle2 --"opacity"--> NG_open_pbr_surface_surfaceshader_shader_constructor NG_open_pbr_surface_surfaceshader_shader_constructor --> NG_open_pbr_surface_surfaceshader_out @@ -8949,8 +8933,6 @@
MaterialX LearnMaterialX LearnMaterialX Learn NG_standard_surface_surfaceshader_100_metalness_mix NG_standard_surface_surfaceshader_100_specular_layer --"bg"--> NG_standard_surface_surfaceshader_100_metalness_mix NG_standard_surface_surfaceshader_100_metalness --"mix"--> NG_standard_surface_surfaceshader_100_metalness_mix - NG_standard_surface_surfaceshader_100_thin_film_thickness --"thickness"--> NG_standard_surface_surfaceshader_100_thin_film_bsdf - NG_standard_surface_surfaceshader_100_thin_film_IOR --"ior"--> NG_standard_surface_surfaceshader_100_thin_film_bsdf - NG_standard_surface_surfaceshader_100_thin_film_bsdf --"top"--> NG_standard_surface_surfaceshader_100_thin_film_layer - NG_standard_surface_surfaceshader_100_metalness_mix --"base"--> NG_standard_surface_surfaceshader_100_thin_film_layer NG_standard_surface_surfaceshader_100_coat_color --"fg"--> NG_standard_surface_surfaceshader_100_coat_attenuation NG_standard_surface_surfaceshader_100_coat --"mix"--> NG_standard_surface_surfaceshader_100_coat_attenuation NG_standard_surface_surfaceshader_100_metalness_mix --"in1"--> NG_standard_surface_surfaceshader_100_thin_film_layer_attenuated @@ -9179,15 +9159,17 @@
MaterialX Learn NG_standard_surface_surfaceshader_100_emission_edf NG_standard_surface_surfaceshader_100_emission_edf --"in1"--> NG_standard_surface_surfaceshader_100_coat_tinted_emission_edf NG_standard_surface_surfaceshader_100_coat_color --"in2"--> NG_standard_surface_surfaceshader_100_coat_tinted_emission_edf - NG_standard_surface_surfaceshader_100_one_minus_coat_ior_to_F0 --"color0"--> NG_standard_surface_surfaceshader_100_coat_emission_edf + NG_standard_surface_surfaceshader_100_one_minus_coat_ior_to_F0 --"in"--> NG_standard_surface_surfaceshader_100_swizzle + NG_standard_surface_surfaceshader_100_swizzle --"color0"--> NG_standard_surface_surfaceshader_100_coat_emission_edf NG_standard_surface_surfaceshader_100_coat_tinted_emission_edf --"base"--> NG_standard_surface_surfaceshader_100_coat_emission_edf NG_standard_surface_surfaceshader_100_coat_emission_edf --"fg"--> NG_standard_surface_surfaceshader_100_blended_coat_emission_edf NG_standard_surface_surfaceshader_100_emission_edf --"bg"--> NG_standard_surface_surfaceshader_100_blended_coat_emission_edf NG_standard_surface_surfaceshader_100_coat --"mix"--> NG_standard_surface_surfaceshader_100_blended_coat_emission_edf NG_standard_surface_surfaceshader_100_opacity --"in"--> NG_standard_surface_surfaceshader_100_opacity_luminance + NG_standard_surface_surfaceshader_100_opacity_luminance --"in"--> NG_standard_surface_surfaceshader_100_swizzle2 NG_standard_surface_surfaceshader_100_coat_layer --"bsdf"--> NG_standard_surface_surfaceshader_100_shader_constructor NG_standard_surface_surfaceshader_100_blended_coat_emission_edf --"edf"--> NG_standard_surface_surfaceshader_100_shader_constructor - NG_standard_surface_surfaceshader_100_opacity_luminance --"opacity"--> NG_standard_surface_surfaceshader_100_shader_constructor + NG_standard_surface_surfaceshader_100_swizzle2 --"opacity"--> NG_standard_surface_surfaceshader_100_shader_constructor NG_standard_surface_surfaceshader_100_shader_constructor --> NG_standard_surface_surfaceshader_100_out @@ -11469,8 +11451,6 @@
MaterialX LearnMaterialX LearnMaterialX Learn NG_standard_surface_surfaceshader_100_metalness_mix NG_standard_surface_surfaceshader_100_specular_layer --"bg"--> NG_standard_surface_surfaceshader_100_metalness_mix NG_standard_surface_surfaceshader_100_metalness --"mix"--> NG_standard_surface_surfaceshader_100_metalness_mix - NG_standard_surface_surfaceshader_100_thin_film_thickness --"thickness"--> NG_standard_surface_surfaceshader_100_thin_film_bsdf - NG_standard_surface_surfaceshader_100_thin_film_IOR --"ior"--> NG_standard_surface_surfaceshader_100_thin_film_bsdf - NG_standard_surface_surfaceshader_100_thin_film_bsdf --"top"--> NG_standard_surface_surfaceshader_100_thin_film_layer - NG_standard_surface_surfaceshader_100_metalness_mix --"base"--> NG_standard_surface_surfaceshader_100_thin_film_layer NG_standard_surface_surfaceshader_100_coat_color --"fg"--> NG_standard_surface_surfaceshader_100_coat_attenuation NG_standard_surface_surfaceshader_100_coat --"mix"--> NG_standard_surface_surfaceshader_100_coat_attenuation NG_standard_surface_surfaceshader_100_metalness_mix --"in1"--> NG_standard_surface_surfaceshader_100_thin_film_layer_attenuated @@ -11699,15 +11677,17 @@
MaterialX Learn NG_standard_surface_surfaceshader_100_emission_edf NG_standard_surface_surfaceshader_100_emission_edf --"in1"--> NG_standard_surface_surfaceshader_100_coat_tinted_emission_edf NG_standard_surface_surfaceshader_100_coat_color --"in2"--> NG_standard_surface_surfaceshader_100_coat_tinted_emission_edf - NG_standard_surface_surfaceshader_100_one_minus_coat_ior_to_F0 --"color0"--> NG_standard_surface_surfaceshader_100_coat_emission_edf + NG_standard_surface_surfaceshader_100_one_minus_coat_ior_to_F0 --"in"--> NG_standard_surface_surfaceshader_100_swizzle + NG_standard_surface_surfaceshader_100_swizzle --"color0"--> NG_standard_surface_surfaceshader_100_coat_emission_edf NG_standard_surface_surfaceshader_100_coat_tinted_emission_edf --"base"--> NG_standard_surface_surfaceshader_100_coat_emission_edf NG_standard_surface_surfaceshader_100_coat_emission_edf --"fg"--> NG_standard_surface_surfaceshader_100_blended_coat_emission_edf NG_standard_surface_surfaceshader_100_emission_edf --"bg"--> NG_standard_surface_surfaceshader_100_blended_coat_emission_edf NG_standard_surface_surfaceshader_100_coat --"mix"--> NG_standard_surface_surfaceshader_100_blended_coat_emission_edf NG_standard_surface_surfaceshader_100_opacity --"in"--> NG_standard_surface_surfaceshader_100_opacity_luminance + NG_standard_surface_surfaceshader_100_opacity_luminance --"in"--> NG_standard_surface_surfaceshader_100_swizzle2 NG_standard_surface_surfaceshader_100_coat_layer --"bsdf"--> NG_standard_surface_surfaceshader_100_shader_constructor NG_standard_surface_surfaceshader_100_blended_coat_emission_edf --"edf"--> NG_standard_surface_surfaceshader_100_shader_constructor - NG_standard_surface_surfaceshader_100_opacity_luminance --"opacity"--> NG_standard_surface_surfaceshader_100_shader_constructor + NG_standard_surface_surfaceshader_100_swizzle2 --"opacity"--> NG_standard_surface_surfaceshader_100_shader_constructor NG_standard_surface_surfaceshader_100_shader_constructor --> NG_standard_surface_surfaceshader_100_out @@ -12534,14 +12514,19 @@
MaterialX LearnMaterialX Learn IMP_UsdUVTexture_22_image_scale IMP_UsdUVTexture_22_image_scale --"in1"--> IMP_UsdUVTexture_22_image_bias IMP_UsdUVTexture_22_bias --"in2"--> IMP_UsdUVTexture_22_image_bias - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_r - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_g - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_b - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_a - IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_rgb + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle + IMP_UsdUVTexture_22_swizzle --> IMP_UsdUVTexture_22_r + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle2 + IMP_UsdUVTexture_22_swizzle2 --> IMP_UsdUVTexture_22_g + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle3 + IMP_UsdUVTexture_22_swizzle3 --> IMP_UsdUVTexture_22_b + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle4 + IMP_UsdUVTexture_22_swizzle4 --> IMP_UsdUVTexture_22_a + IMP_UsdUVTexture_22_image_bias --"in"--> IMP_UsdUVTexture_22_swizzle5 + IMP_UsdUVTexture_22_swizzle5 --> IMP_UsdUVTexture_22_rgb IMP_UsdUVTexture_22_image_bias --> IMP_UsdUVTexture_22_rgba @@ -12935,14 +12925,19 @@
MaterialX LearnMaterialX Learn IMP_UsdUVTexture_23_image_scale IMP_UsdUVTexture_23_image_scale --"in1"--> IMP_UsdUVTexture_23_image_bias IMP_UsdUVTexture_23_bias --"in2"--> IMP_UsdUVTexture_23_image_bias - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_r - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_g - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_b - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_a - IMP_UsdUVTexture_23_image_bias --> IMP_UsdUVTexture_23_rgb + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle + IMP_UsdUVTexture_23_swizzle --> IMP_UsdUVTexture_23_r + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle2 + IMP_UsdUVTexture_23_swizzle2 --> IMP_UsdUVTexture_23_g + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle3 + IMP_UsdUVTexture_23_swizzle3 --> IMP_UsdUVTexture_23_b + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle4 + IMP_UsdUVTexture_23_swizzle4 --> IMP_UsdUVTexture_23_a + IMP_UsdUVTexture_23_image_bias --"in"--> IMP_UsdUVTexture_23_swizzle5 + IMP_UsdUVTexture_23_swizzle5 --> IMP_UsdUVTexture_23_rgb
@@ -15256,8 +15256,6 @@
MaterialX LearnMaterialX Learn IMPL_lama_conductor_conductor_bsdf IMPL_lama_conductor_iridescenceIOR --"in1"--> IMPL_lama_conductor_iridescence_relative_ior IMPL_lama_conductor_exteriorIOR --"in2"--> IMPL_lama_conductor_iridescence_relative_ior - IMPL_lama_conductor_iridescenceThickness --"thickness"--> IMPL_lama_conductor_thin_film_bsdf - IMPL_lama_conductor_iridescence_relative_ior --"ior"--> IMPL_lama_conductor_thin_film_bsdf - IMPL_lama_conductor_thin_film_bsdf --"top"--> IMPL_lama_conductor_thin_film_conductor_bsdf - IMPL_lama_conductor_conductor_bsdf --"base"--> IMPL_lama_conductor_thin_film_conductor_bsdf IMPL_lama_conductor_conductor_bsdf --"in1"--> IMPL_lama_conductor_tinted_bsdf IMPL_lama_conductor_tint --"in2"--> IMPL_lama_conductor_tinted_bsdf IMPL_lama_conductor_tinted_bsdf --> IMPL_lama_conductor_out @@ -16109,6 +16103,7 @@
MaterialX LearnMaterialX Learn IMPL_lama_dielectric_reflectivity_color IMPL_lama_dielectric_reflectivity_color --"reflectivity"--> IMPL_lama_dielectric_artistic_ior + IMPL_lama_dielectric_artistic_ior --"ior-->in"--> IMPL_lama_dielectric_swizzle IMPL_lama_dielectric_IOR --"in1"--> IMPL_lama_dielectric_fresnel_mode_switch - IMPL_lama_dielectric_artistic_ior --"ior-->in2"--> IMPL_lama_dielectric_fresnel_mode_switch + IMPL_lama_dielectric_swizzle --"in2"--> IMPL_lama_dielectric_fresnel_mode_switch IMPL_lama_dielectric_fresnelMode --"which"--> IMPL_lama_dielectric_fresnel_mode_switch IMPL_lama_dielectric_fresnel_mode_switch --"in1"--> IMPL_lama_dielectric_relative_ior IMPL_lama_dielectric_exteriorIOR --"in2"--> IMPL_lama_dielectric_relative_ior @@ -18983,10 +18979,6 @@
MaterialX Learn
emissive_out
-
-../resources/mtlx/nodedef_materials/material_standard_surface_to_gltf_pbr_normal_out_genglsl.png -
normal_out
-
@@ -19025,8 +19017,6 @@
MaterialX Learnemission - - @@ -19365,29 +19353,6 @@
MaterialX Learn -
-
-
- -
- -
-
- -
-
- -
-
-
- -
- -
-
-
-
@@ -19509,17 +19474,6 @@
MaterialX Learn
-
-
-
- -
- -
-
-
-

@@ -19534,23 +19488,25 @@

graph TB subgraph NG_standard_surface_to_gltf_pbr + NG_standard_surface_to_gltf_pbr_swizzle[swizzle] NG_standard_surface_to_gltf_pbr_has_coat_color[has_coat_color] NG_standard_surface_to_gltf_pbr_scaledBaseColor[scaledBaseColor] NG_standard_surface_to_gltf_pbr_coatAttenuation[coatAttenuation] NG_standard_surface_to_gltf_pbr_mixedBaseColor[mixedBaseColor] NG_standard_surface_to_gltf_pbr_constantOneThird[constantOneThird] NG_standard_surface_to_gltf_pbr_coatColor[coatColor] + NG_standard_surface_to_gltf_pbr_swizzle2[swizzle2] + NG_standard_surface_to_gltf_pbr_swizzle3[swizzle3] NG_standard_surface_to_gltf_pbr_weightedCoat[weightedCoat] style NG_standard_surface_to_gltf_pbr_base_color fill:#C72, color:#FFF NG_standard_surface_to_gltf_pbr_base_color{base_color} NG_standard_surface_to_gltf_pbr_metallic[metallic] NG_standard_surface_to_gltf_pbr_roughness[roughness] - NG_standard_surface_to_gltf_pbr_normal[normal] NG_standard_surface_to_gltf_pbr_transmission[transmission] NG_standard_surface_to_gltf_pbr_thickness[thickness] NG_standard_surface_to_gltf_pbr_attenuation_color[attenuation_color] NG_standard_surface_to_gltf_pbr_sheen_color[sheen_color] - NG_standard_surface_to_gltf_pbr_sheen_roughness1[sheen_roughness1] + NG_standard_surface_to_gltf_pbr_sheen_roughness[sheen_roughness] style NG_standard_surface_to_gltf_pbr_clearcoat fill:#C72, color:#FFF NG_standard_surface_to_gltf_pbr_clearcoat{clearcoat} NG_standard_surface_to_gltf_pbr_clearcoat_roughness[clearcoat_roughness] @@ -19577,8 +19533,6 @@
MaterialX LearnMaterialX LearnMaterialX LearnMaterialX Learn NG_standard_surface_to_gltf_pbr_has_coat_color + NG_standard_surface_to_gltf_pbr_coat_color --"in"--> NG_standard_surface_to_gltf_pbr_swizzle + NG_standard_surface_to_gltf_pbr_swizzle --"in1"--> NG_standard_surface_to_gltf_pbr_has_coat_color NG_standard_surface_to_gltf_pbr_base_color --"in1"--> NG_standard_surface_to_gltf_pbr_scaledBaseColor NG_standard_surface_to_gltf_pbr_base --"in2"--> NG_standard_surface_to_gltf_pbr_scaledBaseColor NG_standard_surface_to_gltf_pbr_coat_color --"fg"--> NG_standard_surface_to_gltf_pbr_coatAttenuation @@ -19619,21 +19572,22 @@
MaterialX Learn NG_standard_surface_to_gltf_pbr_mixedBaseColor NG_standard_surface_to_gltf_pbr_coat_color --"in1"--> NG_standard_surface_to_gltf_pbr_coatColor NG_standard_surface_to_gltf_pbr_coat --"in2"--> NG_standard_surface_to_gltf_pbr_coatColor - NG_standard_surface_to_gltf_pbr_coatColor --"in1"--> NG_standard_surface_to_gltf_pbr_weightedCoat - NG_standard_surface_to_gltf_pbr_constantOneThird --"in2"--> NG_standard_surface_to_gltf_pbr_weightedCoat + NG_standard_surface_to_gltf_pbr_coatColor --"in"--> NG_standard_surface_to_gltf_pbr_swizzle2 + NG_standard_surface_to_gltf_pbr_constantOneThird --"in"--> NG_standard_surface_to_gltf_pbr_swizzle3 + NG_standard_surface_to_gltf_pbr_swizzle2 --"in1"--> NG_standard_surface_to_gltf_pbr_weightedCoat + NG_standard_surface_to_gltf_pbr_swizzle3 --"in2"--> NG_standard_surface_to_gltf_pbr_weightedCoat NG_standard_surface_to_gltf_pbr_has_coat_color --"value1"--> NG_standard_surface_to_gltf_pbr_base_color NG_standard_surface_to_gltf_pbr_scaledBaseColor --"in1"--> NG_standard_surface_to_gltf_pbr_base_color NG_standard_surface_to_gltf_pbr_mixedBaseColor --"in2"--> NG_standard_surface_to_gltf_pbr_base_color NG_standard_surface_to_gltf_pbr_metalness --"in"--> NG_standard_surface_to_gltf_pbr_metallic NG_standard_surface_to_gltf_pbr_specular_roughness --"in"--> NG_standard_surface_to_gltf_pbr_roughness - NG_standard_surface_to_gltf_pbr_normal:in --"in"--> NG_standard_surface_to_gltf_pbr_normal NG_standard_surface_to_gltf_pbr_transmission:in --"in"--> NG_standard_surface_to_gltf_pbr_transmission NG_standard_surface_to_gltf_pbr_transmission_depth --"in"--> NG_standard_surface_to_gltf_pbr_thickness NG_standard_surface_to_gltf_pbr_transmission_color --"in"--> NG_standard_surface_to_gltf_pbr_attenuation_color NG_standard_surface_to_gltf_pbr_sheen_color:in --"in1"--> NG_standard_surface_to_gltf_pbr_sheen_color NG_standard_surface_to_gltf_pbr_sheen --"in2"--> NG_standard_surface_to_gltf_pbr_sheen_color - NG_standard_surface_to_gltf_pbr_sheen --"value1"--> NG_standard_surface_to_gltf_pbr_sheen_roughness1 - NG_standard_surface_to_gltf_pbr_sheen_roughness --"in1"--> NG_standard_surface_to_gltf_pbr_sheen_roughness1 + NG_standard_surface_to_gltf_pbr_sheen --"value1"--> NG_standard_surface_to_gltf_pbr_sheen_roughness + NG_standard_surface_to_gltf_pbr_sheen_roughness:in --"in1"--> NG_standard_surface_to_gltf_pbr_sheen_roughness NG_standard_surface_to_gltf_pbr_has_coat_color --"value1"--> NG_standard_surface_to_gltf_pbr_clearcoat NG_standard_surface_to_gltf_pbr_coat --"in1"--> NG_standard_surface_to_gltf_pbr_clearcoat NG_standard_surface_to_gltf_pbr_weightedCoat --"in2"--> NG_standard_surface_to_gltf_pbr_clearcoat @@ -19647,11 +19601,10 @@
MaterialX Learn NG_standard_surface_to_gltf_pbr_thickness_out NG_standard_surface_to_gltf_pbr_attenuation_color --> NG_standard_surface_to_gltf_pbr_attenuation_color_out NG_standard_surface_to_gltf_pbr_sheen_color --> NG_standard_surface_to_gltf_pbr_sheen_color_out - NG_standard_surface_to_gltf_pbr_sheen_roughness1 --> NG_standard_surface_to_gltf_pbr_sheen_roughness_out + NG_standard_surface_to_gltf_pbr_sheen_roughness --> NG_standard_surface_to_gltf_pbr_sheen_roughness_out NG_standard_surface_to_gltf_pbr_clearcoat --> NG_standard_surface_to_gltf_pbr_clearcoat_out NG_standard_surface_to_gltf_pbr_clearcoat_roughness --> NG_standard_surface_to_gltf_pbr_clearcoat_roughness_out NG_standard_surface_to_gltf_pbr_emissive --> NG_standard_surface_to_gltf_pbr_emissive_out - NG_standard_surface_to_gltf_pbr_normal --> NG_standard_surface_to_gltf_pbr_normal_out @@ -20197,9 +20150,13 @@
MaterialX LearnMaterialX Learn NG_standard_surface_to_UsdPreviewSurface_metallic NG_standard_surface_to_UsdPreviewSurface_base_color --"in1"--> NG_standard_surface_to_UsdPreviewSurface_scaledBaseColor @@ -20255,13 +20210,17 @@
MaterialX Learn NG_standard_surface_to_UsdPreviewSurface_ior NG_standard_surface_to_UsdPreviewSurface_coat_color --"in1"--> NG_standard_surface_to_UsdPreviewSurface_coatColor NG_standard_surface_to_UsdPreviewSurface_coat --"in2"--> NG_standard_surface_to_UsdPreviewSurface_coatColor - NG_standard_surface_to_UsdPreviewSurface_coatColor --"in1"--> NG_standard_surface_to_UsdPreviewSurface_clearcoat - NG_standard_surface_to_UsdPreviewSurface_constantOneThird --"in2"--> NG_standard_surface_to_UsdPreviewSurface_clearcoat + NG_standard_surface_to_UsdPreviewSurface_coatColor --"in"--> NG_standard_surface_to_UsdPreviewSurface_swizzle + NG_standard_surface_to_UsdPreviewSurface_constantOneThird --"in"--> NG_standard_surface_to_UsdPreviewSurface_swizzle2 + NG_standard_surface_to_UsdPreviewSurface_swizzle --"in1"--> NG_standard_surface_to_UsdPreviewSurface_clearcoat + NG_standard_surface_to_UsdPreviewSurface_swizzle2 --"in2"--> NG_standard_surface_to_UsdPreviewSurface_clearcoat NG_standard_surface_to_UsdPreviewSurface_coat_roughness --"in"--> NG_standard_surface_to_UsdPreviewSurface_clearcoatRoughness NG_standard_surface_to_UsdPreviewSurface_emission_color --"in1"--> NG_standard_surface_to_UsdPreviewSurface_emissiveColor NG_standard_surface_to_UsdPreviewSurface_emission --"in2"--> NG_standard_surface_to_UsdPreviewSurface_emissiveColor - NG_standard_surface_to_UsdPreviewSurface_opacity:in --"in1"--> NG_standard_surface_to_UsdPreviewSurface_opacity - NG_standard_surface_to_UsdPreviewSurface_constantOneThird --"in2"--> NG_standard_surface_to_UsdPreviewSurface_opacity + NG_standard_surface_to_UsdPreviewSurface_opacity --"in"--> NG_standard_surface_to_UsdPreviewSurface_swizzle3 + NG_standard_surface_to_UsdPreviewSurface_constantOneThird --"in"--> NG_standard_surface_to_UsdPreviewSurface_swizzle4 + NG_standard_surface_to_UsdPreviewSurface_swizzle3 --"in1"--> NG_standard_surface_to_UsdPreviewSurface_opacity + NG_standard_surface_to_UsdPreviewSurface_swizzle4 --"in2"--> NG_standard_surface_to_UsdPreviewSurface_opacity NG_standard_surface_to_UsdPreviewSurface_normal --"in1"--> NG_standard_surface_to_UsdPreviewSurface_biasNormal NG_standard_surface_to_UsdPreviewSurface_biasNormal --"in1"--> NG_standard_surface_to_UsdPreviewSurface_normal NG_standard_surface_to_UsdPreviewSurface_diffuseColor --> NG_standard_surface_to_UsdPreviewSurface_diffuseColor_out @@ -20475,6 +20434,10 @@
MaterialX LearnMaterialX Learn NG_g18_rec709_to_lin_rec709_color4_asColor3 NG_g18_rec709_to_lin_rec709_color4_asColor3 --"in"--> NG_g18_rec709_to_lin_rec709_color4_transform - NG_g18_rec709_to_lin_rec709_color4_transform --"in1"--> NG_g18_rec709_to_lin_rec709_color4_asColor4 - NG_g18_rec709_to_lin_rec709_color4_transform --"in2"--> NG_g18_rec709_to_lin_rec709_color4_asColor4 - NG_g18_rec709_to_lin_rec709_color4_transform --"in3"--> NG_g18_rec709_to_lin_rec709_color4_asColor4 - NG_g18_rec709_to_lin_rec709_color4_in --"in4"--> NG_g18_rec709_to_lin_rec709_color4_asColor4 + NG_g18_rec709_to_lin_rec709_color4_transform --"in"--> NG_g18_rec709_to_lin_rec709_color4_swizzle + NG_g18_rec709_to_lin_rec709_color4_transform --"in"--> NG_g18_rec709_to_lin_rec709_color4_swizzle2 + NG_g18_rec709_to_lin_rec709_color4_transform --"in"--> NG_g18_rec709_to_lin_rec709_color4_swizzle3 + NG_g18_rec709_to_lin_rec709_color4_in --"in"--> NG_g18_rec709_to_lin_rec709_color4_swizzle4 + NG_g18_rec709_to_lin_rec709_color4_swizzle --"in1"--> NG_g18_rec709_to_lin_rec709_color4_asColor4 + NG_g18_rec709_to_lin_rec709_color4_swizzle2 --"in2"--> NG_g18_rec709_to_lin_rec709_color4_asColor4 + NG_g18_rec709_to_lin_rec709_color4_swizzle3 --"in3"--> NG_g18_rec709_to_lin_rec709_color4_asColor4 + NG_g18_rec709_to_lin_rec709_color4_swizzle4 --"in4"--> NG_g18_rec709_to_lin_rec709_color4_asColor4 NG_g18_rec709_to_lin_rec709_color4_asColor4 --> NG_g18_rec709_to_lin_rec709_color4_out @@ -20690,6 +20657,10 @@
MaterialX LearnMaterialX Learn NG_g22_rec709_to_lin_rec709_color4_asColor3 NG_g22_rec709_to_lin_rec709_color4_asColor3 --"in"--> NG_g22_rec709_to_lin_rec709_color4_transform - NG_g22_rec709_to_lin_rec709_color4_transform --"in1"--> NG_g22_rec709_to_lin_rec709_color4_asColor4 - NG_g22_rec709_to_lin_rec709_color4_transform --"in2"--> NG_g22_rec709_to_lin_rec709_color4_asColor4 - NG_g22_rec709_to_lin_rec709_color4_transform --"in3"--> NG_g22_rec709_to_lin_rec709_color4_asColor4 - NG_g22_rec709_to_lin_rec709_color4_in --"in4"--> NG_g22_rec709_to_lin_rec709_color4_asColor4 + NG_g22_rec709_to_lin_rec709_color4_transform --"in"--> NG_g22_rec709_to_lin_rec709_color4_swizzle + NG_g22_rec709_to_lin_rec709_color4_transform --"in"--> NG_g22_rec709_to_lin_rec709_color4_swizzle2 + NG_g22_rec709_to_lin_rec709_color4_transform --"in"--> NG_g22_rec709_to_lin_rec709_color4_swizzle3 + NG_g22_rec709_to_lin_rec709_color4_in --"in"--> NG_g22_rec709_to_lin_rec709_color4_swizzle4 + NG_g22_rec709_to_lin_rec709_color4_swizzle --"in1"--> NG_g22_rec709_to_lin_rec709_color4_asColor4 + NG_g22_rec709_to_lin_rec709_color4_swizzle2 --"in2"--> NG_g22_rec709_to_lin_rec709_color4_asColor4 + NG_g22_rec709_to_lin_rec709_color4_swizzle3 --"in3"--> NG_g22_rec709_to_lin_rec709_color4_asColor4 + NG_g22_rec709_to_lin_rec709_color4_swizzle4 --"in4"--> NG_g22_rec709_to_lin_rec709_color4_asColor4 NG_g22_rec709_to_lin_rec709_color4_asColor4 --> NG_g22_rec709_to_lin_rec709_color4_out @@ -20905,6 +20880,10 @@
MaterialX LearnMaterialX Learn NG_rec709_display_to_lin_rec709_color4_asColor3 NG_rec709_display_to_lin_rec709_color4_asColor3 --"in"--> NG_rec709_display_to_lin_rec709_color4_transform - NG_rec709_display_to_lin_rec709_color4_transform --"in1"--> NG_rec709_display_to_lin_rec709_color4_asColor4 - NG_rec709_display_to_lin_rec709_color4_transform --"in2"--> NG_rec709_display_to_lin_rec709_color4_asColor4 - NG_rec709_display_to_lin_rec709_color4_transform --"in3"--> NG_rec709_display_to_lin_rec709_color4_asColor4 - NG_rec709_display_to_lin_rec709_color4_in --"in4"--> NG_rec709_display_to_lin_rec709_color4_asColor4 + NG_rec709_display_to_lin_rec709_color4_transform --"in"--> NG_rec709_display_to_lin_rec709_color4_swizzle + NG_rec709_display_to_lin_rec709_color4_transform --"in"--> NG_rec709_display_to_lin_rec709_color4_swizzle2 + NG_rec709_display_to_lin_rec709_color4_transform --"in"--> NG_rec709_display_to_lin_rec709_color4_swizzle3 + NG_rec709_display_to_lin_rec709_color4_in --"in"--> NG_rec709_display_to_lin_rec709_color4_swizzle4 + NG_rec709_display_to_lin_rec709_color4_swizzle --"in1"--> NG_rec709_display_to_lin_rec709_color4_asColor4 + NG_rec709_display_to_lin_rec709_color4_swizzle2 --"in2"--> NG_rec709_display_to_lin_rec709_color4_asColor4 + NG_rec709_display_to_lin_rec709_color4_swizzle3 --"in3"--> NG_rec709_display_to_lin_rec709_color4_asColor4 + NG_rec709_display_to_lin_rec709_color4_swizzle4 --"in4"--> NG_rec709_display_to_lin_rec709_color4_asColor4 NG_rec709_display_to_lin_rec709_color4_asColor4 --> NG_rec709_display_to_lin_rec709_color4_out @@ -21125,6 +21108,10 @@
MaterialX LearnMaterialX Learn NG_acescg_to_lin_rec709_color4_asColor3 NG_acescg_to_lin_rec709_color4_asColor3 --"in"--> NG_acescg_to_lin_rec709_color4_transform - NG_acescg_to_lin_rec709_color4_transform --"in1"--> NG_acescg_to_lin_rec709_color4_asColor4 - NG_acescg_to_lin_rec709_color4_transform --"in2"--> NG_acescg_to_lin_rec709_color4_asColor4 - NG_acescg_to_lin_rec709_color4_transform --"in3"--> NG_acescg_to_lin_rec709_color4_asColor4 - NG_acescg_to_lin_rec709_color4_in --"in4"--> NG_acescg_to_lin_rec709_color4_asColor4 + NG_acescg_to_lin_rec709_color4_transform --"in"--> NG_acescg_to_lin_rec709_color4_swizzle + NG_acescg_to_lin_rec709_color4_transform --"in"--> NG_acescg_to_lin_rec709_color4_swizzle2 + NG_acescg_to_lin_rec709_color4_transform --"in"--> NG_acescg_to_lin_rec709_color4_swizzle3 + NG_acescg_to_lin_rec709_color4_in --"in"--> NG_acescg_to_lin_rec709_color4_swizzle4 + NG_acescg_to_lin_rec709_color4_swizzle --"in1"--> NG_acescg_to_lin_rec709_color4_asColor4 + NG_acescg_to_lin_rec709_color4_swizzle2 --"in2"--> NG_acescg_to_lin_rec709_color4_asColor4 + NG_acescg_to_lin_rec709_color4_swizzle3 --"in3"--> NG_acescg_to_lin_rec709_color4_asColor4 + NG_acescg_to_lin_rec709_color4_swizzle4 --"in4"--> NG_acescg_to_lin_rec709_color4_asColor4 NG_acescg_to_lin_rec709_color4_asColor4 --> NG_acescg_to_lin_rec709_color4_out @@ -21342,6 +21333,10 @@
MaterialX LearnMaterialX Learn NG_g22_ap1_to_lin_rec709_color4_asColor3 NG_g22_ap1_to_lin_rec709_color4_asColor3 --"in"--> NG_g22_ap1_to_lin_rec709_color4_transform - NG_g22_ap1_to_lin_rec709_color4_transform --"in1"--> NG_g22_ap1_to_lin_rec709_color4_asColor4 - NG_g22_ap1_to_lin_rec709_color4_transform --"in2"--> NG_g22_ap1_to_lin_rec709_color4_asColor4 - NG_g22_ap1_to_lin_rec709_color4_transform --"in3"--> NG_g22_ap1_to_lin_rec709_color4_asColor4 - NG_g22_ap1_to_lin_rec709_color4_in --"in4"--> NG_g22_ap1_to_lin_rec709_color4_asColor4 + NG_g22_ap1_to_lin_rec709_color4_transform --"in"--> NG_g22_ap1_to_lin_rec709_color4_swizzle + NG_g22_ap1_to_lin_rec709_color4_transform --"in"--> NG_g22_ap1_to_lin_rec709_color4_swizzle2 + NG_g22_ap1_to_lin_rec709_color4_transform --"in"--> NG_g22_ap1_to_lin_rec709_color4_swizzle3 + NG_g22_ap1_to_lin_rec709_color4_in --"in"--> NG_g22_ap1_to_lin_rec709_color4_swizzle4 + NG_g22_ap1_to_lin_rec709_color4_swizzle --"in1"--> NG_g22_ap1_to_lin_rec709_color4_asColor4 + NG_g22_ap1_to_lin_rec709_color4_swizzle2 --"in2"--> NG_g22_ap1_to_lin_rec709_color4_asColor4 + NG_g22_ap1_to_lin_rec709_color4_swizzle3 --"in3"--> NG_g22_ap1_to_lin_rec709_color4_asColor4 + NG_g22_ap1_to_lin_rec709_color4_swizzle4 --"in4"--> NG_g22_ap1_to_lin_rec709_color4_asColor4 NG_g22_ap1_to_lin_rec709_color4_asColor4 --> NG_g22_ap1_to_lin_rec709_color4_out @@ -21453,8 +21452,11 @@
MaterialX LearnMaterialX Learn NG_srgb_texture_to_lin_rec709_color3_isAboveR + NG_srgb_texture_to_lin_rec709_color3_in --"in"--> NG_srgb_texture_to_lin_rec709_color3_swizzle + NG_srgb_texture_to_lin_rec709_color3_swizzle --"value1"--> NG_srgb_texture_to_lin_rec709_color3_isAboveR NG_srgb_texture_to_lin_rec709_color3_threshhold --"value2"--> NG_srgb_texture_to_lin_rec709_color3_isAboveR - NG_srgb_texture_to_lin_rec709_color3_in --"value1"--> NG_srgb_texture_to_lin_rec709_color3_isAboveG + NG_srgb_texture_to_lin_rec709_color3_in --"in"--> NG_srgb_texture_to_lin_rec709_color3_swizzle2 + NG_srgb_texture_to_lin_rec709_color3_swizzle2 --"value1"--> NG_srgb_texture_to_lin_rec709_color3_isAboveG NG_srgb_texture_to_lin_rec709_color3_threshhold --"value2"--> NG_srgb_texture_to_lin_rec709_color3_isAboveG - NG_srgb_texture_to_lin_rec709_color3_in --"value1"--> NG_srgb_texture_to_lin_rec709_color3_isAboveB + NG_srgb_texture_to_lin_rec709_color3_in --"in"--> NG_srgb_texture_to_lin_rec709_color3_swizzle3 + NG_srgb_texture_to_lin_rec709_color3_swizzle3 --"value1"--> NG_srgb_texture_to_lin_rec709_color3_isAboveB NG_srgb_texture_to_lin_rec709_color3_threshhold --"value2"--> NG_srgb_texture_to_lin_rec709_color3_isAboveB NG_srgb_texture_to_lin_rec709_color3_isAboveR --"in1"--> NG_srgb_texture_to_lin_rec709_color3_isAbove NG_srgb_texture_to_lin_rec709_color3_isAboveG --"in2"--> NG_srgb_texture_to_lin_rec709_color3_isAbove @@ -21582,6 +21587,10 @@
MaterialX LearnMaterialX Learn NG_srgb_texture_to_lin_rec709_color4_asColor3 NG_srgb_texture_to_lin_rec709_color4_asColor3 --"in"--> NG_srgb_texture_to_lin_rec709_color4_transform - NG_srgb_texture_to_lin_rec709_color4_transform --"in1"--> NG_srgb_texture_to_lin_rec709_color4_asColor4 - NG_srgb_texture_to_lin_rec709_color4_transform --"in2"--> NG_srgb_texture_to_lin_rec709_color4_asColor4 - NG_srgb_texture_to_lin_rec709_color4_transform --"in3"--> NG_srgb_texture_to_lin_rec709_color4_asColor4 - NG_srgb_texture_to_lin_rec709_color4_in --"in4"--> NG_srgb_texture_to_lin_rec709_color4_asColor4 + NG_srgb_texture_to_lin_rec709_color4_transform --"in"--> NG_srgb_texture_to_lin_rec709_color4_swizzle + NG_srgb_texture_to_lin_rec709_color4_transform --"in"--> NG_srgb_texture_to_lin_rec709_color4_swizzle2 + NG_srgb_texture_to_lin_rec709_color4_transform --"in"--> NG_srgb_texture_to_lin_rec709_color4_swizzle3 + NG_srgb_texture_to_lin_rec709_color4_in --"in"--> NG_srgb_texture_to_lin_rec709_color4_swizzle4 + NG_srgb_texture_to_lin_rec709_color4_swizzle --"in1"--> NG_srgb_texture_to_lin_rec709_color4_asColor4 + NG_srgb_texture_to_lin_rec709_color4_swizzle2 --"in2"--> NG_srgb_texture_to_lin_rec709_color4_asColor4 + NG_srgb_texture_to_lin_rec709_color4_swizzle3 --"in3"--> NG_srgb_texture_to_lin_rec709_color4_asColor4 + NG_srgb_texture_to_lin_rec709_color4_swizzle4 --"in4"--> NG_srgb_texture_to_lin_rec709_color4_asColor4 NG_srgb_texture_to_lin_rec709_color4_asColor4 --> NG_srgb_texture_to_lin_rec709_color4_out @@ -21802,6 +21815,10 @@
MaterialX LearnMaterialX Learn NG_lin_adobergb_to_lin_rec709_color4_asColor3 NG_lin_adobergb_to_lin_rec709_color4_asColor3 --"in"--> NG_lin_adobergb_to_lin_rec709_color4_transform - NG_lin_adobergb_to_lin_rec709_color4_transform --"in1"--> NG_lin_adobergb_to_lin_rec709_color4_asColor4 - NG_lin_adobergb_to_lin_rec709_color4_transform --"in2"--> NG_lin_adobergb_to_lin_rec709_color4_asColor4 - NG_lin_adobergb_to_lin_rec709_color4_transform --"in3"--> NG_lin_adobergb_to_lin_rec709_color4_asColor4 - NG_lin_adobergb_to_lin_rec709_color4_in --"in4"--> NG_lin_adobergb_to_lin_rec709_color4_asColor4 + NG_lin_adobergb_to_lin_rec709_color4_transform --"in"--> NG_lin_adobergb_to_lin_rec709_color4_swizzle + NG_lin_adobergb_to_lin_rec709_color4_transform --"in"--> NG_lin_adobergb_to_lin_rec709_color4_swizzle2 + NG_lin_adobergb_to_lin_rec709_color4_transform --"in"--> NG_lin_adobergb_to_lin_rec709_color4_swizzle3 + NG_lin_adobergb_to_lin_rec709_color4_in --"in"--> NG_lin_adobergb_to_lin_rec709_color4_swizzle4 + NG_lin_adobergb_to_lin_rec709_color4_swizzle --"in1"--> NG_lin_adobergb_to_lin_rec709_color4_asColor4 + NG_lin_adobergb_to_lin_rec709_color4_swizzle2 --"in2"--> NG_lin_adobergb_to_lin_rec709_color4_asColor4 + NG_lin_adobergb_to_lin_rec709_color4_swizzle3 --"in3"--> NG_lin_adobergb_to_lin_rec709_color4_asColor4 + NG_lin_adobergb_to_lin_rec709_color4_swizzle4 --"in4"--> NG_lin_adobergb_to_lin_rec709_color4_asColor4 NG_lin_adobergb_to_lin_rec709_color4_asColor4 --> NG_lin_adobergb_to_lin_rec709_color4_out @@ -22021,6 +22042,10 @@
MaterialX LearnMaterialX Learn NG_adobergb_to_lin_rec709_color4_asColor3 NG_adobergb_to_lin_rec709_color4_asColor3 --"in"--> NG_adobergb_to_lin_rec709_color4_transform - NG_adobergb_to_lin_rec709_color4_transform --"in1"--> NG_adobergb_to_lin_rec709_color4_asColor4 - NG_adobergb_to_lin_rec709_color4_transform --"in2"--> NG_adobergb_to_lin_rec709_color4_asColor4 - NG_adobergb_to_lin_rec709_color4_transform --"in3"--> NG_adobergb_to_lin_rec709_color4_asColor4 - NG_adobergb_to_lin_rec709_color4_in --"in4"--> NG_adobergb_to_lin_rec709_color4_asColor4 + NG_adobergb_to_lin_rec709_color4_transform --"in"--> NG_adobergb_to_lin_rec709_color4_swizzle + NG_adobergb_to_lin_rec709_color4_transform --"in"--> NG_adobergb_to_lin_rec709_color4_swizzle2 + NG_adobergb_to_lin_rec709_color4_transform --"in"--> NG_adobergb_to_lin_rec709_color4_swizzle3 + NG_adobergb_to_lin_rec709_color4_in --"in"--> NG_adobergb_to_lin_rec709_color4_swizzle4 + NG_adobergb_to_lin_rec709_color4_swizzle --"in1"--> NG_adobergb_to_lin_rec709_color4_asColor4 + NG_adobergb_to_lin_rec709_color4_swizzle2 --"in2"--> NG_adobergb_to_lin_rec709_color4_asColor4 + NG_adobergb_to_lin_rec709_color4_swizzle3 --"in3"--> NG_adobergb_to_lin_rec709_color4_asColor4 + NG_adobergb_to_lin_rec709_color4_swizzle4 --"in4"--> NG_adobergb_to_lin_rec709_color4_asColor4 NG_adobergb_to_lin_rec709_color4_asColor4 --> NG_adobergb_to_lin_rec709_color4_out @@ -22243,6 +22272,10 @@
MaterialX LearnMaterialX Learn NG_srgb_displayp3_to_lin_rec709_color4_asColor3 NG_srgb_displayp3_to_lin_rec709_color4_asColor3 --"in"--> NG_srgb_displayp3_to_lin_rec709_color4_transform - NG_srgb_displayp3_to_lin_rec709_color4_transform --"in1"--> NG_srgb_displayp3_to_lin_rec709_color4_asColor4 - NG_srgb_displayp3_to_lin_rec709_color4_transform --"in2"--> NG_srgb_displayp3_to_lin_rec709_color4_asColor4 - NG_srgb_displayp3_to_lin_rec709_color4_transform --"in3"--> NG_srgb_displayp3_to_lin_rec709_color4_asColor4 - NG_srgb_displayp3_to_lin_rec709_color4_in --"in4"--> NG_srgb_displayp3_to_lin_rec709_color4_asColor4 + NG_srgb_displayp3_to_lin_rec709_color4_transform --"in"--> NG_srgb_displayp3_to_lin_rec709_color4_swizzle + NG_srgb_displayp3_to_lin_rec709_color4_transform --"in"--> NG_srgb_displayp3_to_lin_rec709_color4_swizzle2 + NG_srgb_displayp3_to_lin_rec709_color4_transform --"in"--> NG_srgb_displayp3_to_lin_rec709_color4_swizzle3 + NG_srgb_displayp3_to_lin_rec709_color4_in --"in"--> NG_srgb_displayp3_to_lin_rec709_color4_swizzle4 + NG_srgb_displayp3_to_lin_rec709_color4_swizzle --"in1"--> NG_srgb_displayp3_to_lin_rec709_color4_asColor4 + NG_srgb_displayp3_to_lin_rec709_color4_swizzle2 --"in2"--> NG_srgb_displayp3_to_lin_rec709_color4_asColor4 + NG_srgb_displayp3_to_lin_rec709_color4_swizzle3 --"in3"--> NG_srgb_displayp3_to_lin_rec709_color4_asColor4 + NG_srgb_displayp3_to_lin_rec709_color4_swizzle4 --"in4"--> NG_srgb_displayp3_to_lin_rec709_color4_asColor4 NG_srgb_displayp3_to_lin_rec709_color4_asColor4 --> NG_srgb_displayp3_to_lin_rec709_color4_out @@ -22463,6 +22500,10 @@
MaterialX LearnMaterialX Learn NG_lin_displayp3_to_lin_rec709_color4_asColor3 NG_lin_displayp3_to_lin_rec709_color4_asColor3 --"in"--> NG_lin_displayp3_to_lin_rec709_color4_transform - NG_lin_displayp3_to_lin_rec709_color4_transform --"in1"--> NG_lin_displayp3_to_lin_rec709_color4_asColor4 - NG_lin_displayp3_to_lin_rec709_color4_transform --"in2"--> NG_lin_displayp3_to_lin_rec709_color4_asColor4 - NG_lin_displayp3_to_lin_rec709_color4_transform --"in3"--> NG_lin_displayp3_to_lin_rec709_color4_asColor4 - NG_lin_displayp3_to_lin_rec709_color4_in --"in4"--> NG_lin_displayp3_to_lin_rec709_color4_asColor4 + NG_lin_displayp3_to_lin_rec709_color4_transform --"in"--> NG_lin_displayp3_to_lin_rec709_color4_swizzle + NG_lin_displayp3_to_lin_rec709_color4_transform --"in"--> NG_lin_displayp3_to_lin_rec709_color4_swizzle2 + NG_lin_displayp3_to_lin_rec709_color4_transform --"in"--> NG_lin_displayp3_to_lin_rec709_color4_swizzle3 + NG_lin_displayp3_to_lin_rec709_color4_in --"in"--> NG_lin_displayp3_to_lin_rec709_color4_swizzle4 + NG_lin_displayp3_to_lin_rec709_color4_swizzle --"in1"--> NG_lin_displayp3_to_lin_rec709_color4_asColor4 + NG_lin_displayp3_to_lin_rec709_color4_swizzle2 --"in2"--> NG_lin_displayp3_to_lin_rec709_color4_asColor4 + NG_lin_displayp3_to_lin_rec709_color4_swizzle3 --"in3"--> NG_lin_displayp3_to_lin_rec709_color4_asColor4 + NG_lin_displayp3_to_lin_rec709_color4_swizzle4 --"in4"--> NG_lin_displayp3_to_lin_rec709_color4_asColor4 NG_lin_displayp3_to_lin_rec709_color4_asColor4 --> NG_lin_displayp3_to_lin_rec709_color4_out @@ -23735,8 +23780,8 @@
graph TB subgraph NG_gooch_shade - NG_gooch_shade_normal[normal] - NG_gooch_shade_viewdir[viewdir] + NG_gooch_shade_normal[normal:world] + NG_gooch_shade_viewdir[viewdir:world] NG_gooch_shade_unit_normal[unit_normal] NG_gooch_shade_unit_viewdir[unit_viewdir] NG_gooch_shade_unit_lightdir[unit_lightdir] @@ -24012,18 +24057,11 @@
MaterialX Learn
- -
- - - -
-
-
- -
- -
+ +
+ +

@@ -24247,18 +24285,11 @@
MaterialX Learn
- -
- - - -
-
-
- -
- -
+ +
+ +

@@ -24462,18 +24493,11 @@
MaterialX Learn
- -
- - - -
-
-
- -
- -
+ +
+ +

@@ -24518,6 +24542,10 @@
MaterialX Learnior + + + + + + + + + + + + + + - - @@ -1046,29 +1036,6 @@
MaterialX Learn -
-
-
- -
- -
-
- -
-
- -
-
-
- -
- -
-
-
-
@@ -1190,17 +1157,6 @@
MaterialX Learn
-
-
-
- -
- -
-
-
-

@@ -1215,23 +1171,25 @@

graph TB subgraph NG_standard_surface_to_gltf_pbr + NG_standard_surface_to_gltf_pbr_swizzle[swizzle] NG_standard_surface_to_gltf_pbr_has_coat_color[has_coat_color] NG_standard_surface_to_gltf_pbr_scaledBaseColor[scaledBaseColor] NG_standard_surface_to_gltf_pbr_coatAttenuation[coatAttenuation] NG_standard_surface_to_gltf_pbr_mixedBaseColor[mixedBaseColor] NG_standard_surface_to_gltf_pbr_constantOneThird[constantOneThird] NG_standard_surface_to_gltf_pbr_coatColor[coatColor] + NG_standard_surface_to_gltf_pbr_swizzle2[swizzle2] + NG_standard_surface_to_gltf_pbr_swizzle3[swizzle3] NG_standard_surface_to_gltf_pbr_weightedCoat[weightedCoat] style NG_standard_surface_to_gltf_pbr_base_color fill:#C72, color:#FFF NG_standard_surface_to_gltf_pbr_base_color{base_color} NG_standard_surface_to_gltf_pbr_metallic[metallic] NG_standard_surface_to_gltf_pbr_roughness[roughness] - NG_standard_surface_to_gltf_pbr_normal[normal] NG_standard_surface_to_gltf_pbr_transmission[transmission] NG_standard_surface_to_gltf_pbr_thickness[thickness] NG_standard_surface_to_gltf_pbr_attenuation_color[attenuation_color] NG_standard_surface_to_gltf_pbr_sheen_color[sheen_color] - NG_standard_surface_to_gltf_pbr_sheen_roughness1[sheen_roughness1] + NG_standard_surface_to_gltf_pbr_sheen_roughness[sheen_roughness] style NG_standard_surface_to_gltf_pbr_clearcoat fill:#C72, color:#FFF NG_standard_surface_to_gltf_pbr_clearcoat{clearcoat} NG_standard_surface_to_gltf_pbr_clearcoat_roughness[clearcoat_roughness] @@ -1258,8 +1216,6 @@
MaterialX LearnMaterialX LearnMaterialX LearnMaterialX Learn NG_standard_surface_to_gltf_pbr_has_coat_color + NG_standard_surface_to_gltf_pbr_coat_color --"in"--> NG_standard_surface_to_gltf_pbr_swizzle + NG_standard_surface_to_gltf_pbr_swizzle --"in1"--> NG_standard_surface_to_gltf_pbr_has_coat_color NG_standard_surface_to_gltf_pbr_base_color --"in1"--> NG_standard_surface_to_gltf_pbr_scaledBaseColor NG_standard_surface_to_gltf_pbr_base --"in2"--> NG_standard_surface_to_gltf_pbr_scaledBaseColor NG_standard_surface_to_gltf_pbr_coat_color --"fg"--> NG_standard_surface_to_gltf_pbr_coatAttenuation @@ -1300,21 +1255,22 @@
MaterialX Learn NG_standard_surface_to_gltf_pbr_mixedBaseColor NG_standard_surface_to_gltf_pbr_coat_color --"in1"--> NG_standard_surface_to_gltf_pbr_coatColor NG_standard_surface_to_gltf_pbr_coat --"in2"--> NG_standard_surface_to_gltf_pbr_coatColor - NG_standard_surface_to_gltf_pbr_coatColor --"in1"--> NG_standard_surface_to_gltf_pbr_weightedCoat - NG_standard_surface_to_gltf_pbr_constantOneThird --"in2"--> NG_standard_surface_to_gltf_pbr_weightedCoat + NG_standard_surface_to_gltf_pbr_coatColor --"in"--> NG_standard_surface_to_gltf_pbr_swizzle2 + NG_standard_surface_to_gltf_pbr_constantOneThird --"in"--> NG_standard_surface_to_gltf_pbr_swizzle3 + NG_standard_surface_to_gltf_pbr_swizzle2 --"in1"--> NG_standard_surface_to_gltf_pbr_weightedCoat + NG_standard_surface_to_gltf_pbr_swizzle3 --"in2"--> NG_standard_surface_to_gltf_pbr_weightedCoat NG_standard_surface_to_gltf_pbr_has_coat_color --"value1"--> NG_standard_surface_to_gltf_pbr_base_color NG_standard_surface_to_gltf_pbr_scaledBaseColor --"in1"--> NG_standard_surface_to_gltf_pbr_base_color NG_standard_surface_to_gltf_pbr_mixedBaseColor --"in2"--> NG_standard_surface_to_gltf_pbr_base_color NG_standard_surface_to_gltf_pbr_metalness --"in"--> NG_standard_surface_to_gltf_pbr_metallic NG_standard_surface_to_gltf_pbr_specular_roughness --"in"--> NG_standard_surface_to_gltf_pbr_roughness - NG_standard_surface_to_gltf_pbr_normal:in --"in"--> NG_standard_surface_to_gltf_pbr_normal NG_standard_surface_to_gltf_pbr_transmission:in --"in"--> NG_standard_surface_to_gltf_pbr_transmission NG_standard_surface_to_gltf_pbr_transmission_depth --"in"--> NG_standard_surface_to_gltf_pbr_thickness NG_standard_surface_to_gltf_pbr_transmission_color --"in"--> NG_standard_surface_to_gltf_pbr_attenuation_color NG_standard_surface_to_gltf_pbr_sheen_color:in --"in1"--> NG_standard_surface_to_gltf_pbr_sheen_color NG_standard_surface_to_gltf_pbr_sheen --"in2"--> NG_standard_surface_to_gltf_pbr_sheen_color - NG_standard_surface_to_gltf_pbr_sheen --"value1"--> NG_standard_surface_to_gltf_pbr_sheen_roughness1 - NG_standard_surface_to_gltf_pbr_sheen_roughness --"in1"--> NG_standard_surface_to_gltf_pbr_sheen_roughness1 + NG_standard_surface_to_gltf_pbr_sheen --"value1"--> NG_standard_surface_to_gltf_pbr_sheen_roughness + NG_standard_surface_to_gltf_pbr_sheen_roughness:in --"in1"--> NG_standard_surface_to_gltf_pbr_sheen_roughness NG_standard_surface_to_gltf_pbr_has_coat_color --"value1"--> NG_standard_surface_to_gltf_pbr_clearcoat NG_standard_surface_to_gltf_pbr_coat --"in1"--> NG_standard_surface_to_gltf_pbr_clearcoat NG_standard_surface_to_gltf_pbr_weightedCoat --"in2"--> NG_standard_surface_to_gltf_pbr_clearcoat @@ -1328,11 +1284,10 @@
MaterialX Learn NG_standard_surface_to_gltf_pbr_thickness_out NG_standard_surface_to_gltf_pbr_attenuation_color --> NG_standard_surface_to_gltf_pbr_attenuation_color_out NG_standard_surface_to_gltf_pbr_sheen_color --> NG_standard_surface_to_gltf_pbr_sheen_color_out - NG_standard_surface_to_gltf_pbr_sheen_roughness1 --> NG_standard_surface_to_gltf_pbr_sheen_roughness_out + NG_standard_surface_to_gltf_pbr_sheen_roughness --> NG_standard_surface_to_gltf_pbr_sheen_roughness_out NG_standard_surface_to_gltf_pbr_clearcoat --> NG_standard_surface_to_gltf_pbr_clearcoat_out NG_standard_surface_to_gltf_pbr_clearcoat_roughness --> NG_standard_surface_to_gltf_pbr_clearcoat_roughness_out NG_standard_surface_to_gltf_pbr_emissive --> NG_standard_surface_to_gltf_pbr_emissive_out - NG_standard_surface_to_gltf_pbr_normal --> NG_standard_surface_to_gltf_pbr_normal_out diff --git a/documents/definitions/stdlib_doc.md b/documents/definitions/stdlib_doc.md index fa7a62d0..3c52102a 100644 --- a/documents/definitions/stdlib_doc.md +++ b/documents/definitions/stdlib_doc.md @@ -5,7 +5,7 @@ * [frame](#node-frame) [time](#node-time) --------- ### Node Group: channel -* [combine2](#node-combine2) [combine3](#node-combine3) [combine4](#node-combine4) [convert](#node-convert) [extract](#node-extract) [separate2](#node-separate2) [separate3](#node-separate3) [separate4](#node-separate4) [swizzle](#node-swizzle) +* [combine2](#node-combine2) [combine3](#node-combine3) [combine4](#node-combine4) [convert](#node-convert) [extract](#node-extract) [separate2](#node-separate2) [separate3](#node-separate3) [separate4](#node-separate4) --------- ### Node Group: compositing * [burn](#node-burn) [difference](#node-difference) [disjointover](#node-disjointover) [dodge](#node-dodge) [in](#node-in) [inside](#node-inside) [mask](#node-mask) [matte](#node-matte) [minus](#node-minus) [mix](#node-mix) [out](#node-out) [outside](#node-outside) [over](#node-over) [overlay](#node-overlay) [plus](#node-plus) [premult](#node-premult) [screen](#node-screen) [unpremult](#node-unpremult) @@ -26,7 +26,7 @@ * [surfacematerial](#node-surfacematerial) [volumematerial](#node-volumematerial) --------- ### Node Group: math -* [absval](#node-absval) [acos](#node-acos) [add](#node-add) [arrayappend](#node-arrayappend) [asin](#node-asin) [atan2](#node-atan2) [ceil](#node-ceil) [clamp](#node-clamp) [cos](#node-cos) [creatematrix](#node-creatematrix) [crossproduct](#node-crossproduct) [determinant](#node-determinant) [distance](#node-distance) [divide](#node-divide) [dotproduct](#node-dotproduct) [exp](#node-exp) [floor](#node-floor) [invert](#node-invert) [invertmatrix](#node-invertmatrix) [ln](#node-ln) [magnitude](#node-magnitude) [max](#node-max) [min](#node-min) [modulo](#node-modulo) [multiply](#node-multiply) [normalize](#node-normalize) [normalmap](#node-normalmap) [place2d](#node-place2d) [power](#node-power) [reflect](#node-reflect) [refract](#node-refract) [rotate2d](#node-rotate2d) [rotate3d](#node-rotate3d) [round](#node-round) [safepower](#node-safepower) [sign](#node-sign) [sin](#node-sin) [sqrt](#node-sqrt) [subtract](#node-subtract) [tan](#node-tan) [transformmatrix](#node-transformmatrix) [transformnormal](#node-transformnormal) [transformpoint](#node-transformpoint) [transformvector](#node-transformvector) [transpose](#node-transpose) [trianglewave](#node-trianglewave) +* [absval](#node-absval) [acos](#node-acos) [add](#node-add) [asin](#node-asin) [atan2](#node-atan2) [ceil](#node-ceil) [clamp](#node-clamp) [cos](#node-cos) [creatematrix](#node-creatematrix) [crossproduct](#node-crossproduct) [determinant](#node-determinant) [distance](#node-distance) [divide](#node-divide) [dotproduct](#node-dotproduct) [exp](#node-exp) [floor](#node-floor) [invert](#node-invert) [invertmatrix](#node-invertmatrix) [ln](#node-ln) [magnitude](#node-magnitude) [max](#node-max) [min](#node-min) [modulo](#node-modulo) [multiply](#node-multiply) [normalize](#node-normalize) [normalmap](#node-normalmap) [place2d](#node-place2d) [power](#node-power) [reflect](#node-reflect) [refract](#node-refract) [rotate2d](#node-rotate2d) [rotate3d](#node-rotate3d) [round](#node-round) [safepower](#node-safepower) [sign](#node-sign) [sin](#node-sin) [sqrt](#node-sqrt) [subtract](#node-subtract) [tan](#node-tan) [transformmatrix](#node-transformmatrix) [transformnormal](#node-transformnormal) [transformpoint](#node-transformpoint) [transformvector](#node-transformvector) [transpose](#node-transpose) [trianglewave](#node-trianglewave) --------- ### Node Group: organization * [dot](#node-dot) @@ -2761,6 +2761,7 @@ graph TB graph TB subgraph NG_noise2d_color3 NG_noise2d_color3_N_noise2d[N_noise2d] + NG_noise2d_color3_swizzle[swizzle] style NG_noise2d_color3_out fill:#0C0, color:#FFF NG_noise2d_color3_out([out]) style NG_noise2d_color3_amplitude fill:#09D, color:#FFF @@ -2773,7 +2774,8 @@ graph TB NG_noise2d_color3_amplitude --"amplitude"--> NG_noise2d_color3_N_noise2d NG_noise2d_color3_pivot --"pivot"--> NG_noise2d_color3_N_noise2d NG_noise2d_color3_texcoord --"texcoord"--> NG_noise2d_color3_N_noise2d - NG_noise2d_color3_N_noise2d --> NG_noise2d_color3_out + NG_noise2d_color3_N_noise2d --"in"--> NG_noise2d_color3_swizzle + NG_noise2d_color3_swizzle --> NG_noise2d_color3_out ``` @@ -2798,6 +2800,7 @@ graph TB graph TB subgraph NG_noise2d_color4 NG_noise2d_color4_N_noise2d[N_noise2d] + NG_noise2d_color4_swizzle[swizzle] style NG_noise2d_color4_out fill:#0C0, color:#FFF NG_noise2d_color4_out([out]) style NG_noise2d_color4_amplitude fill:#09D, color:#FFF @@ -2810,7 +2813,8 @@ graph TB NG_noise2d_color4_amplitude --"amplitude"--> NG_noise2d_color4_N_noise2d NG_noise2d_color4_pivot --"pivot"--> NG_noise2d_color4_N_noise2d NG_noise2d_color4_texcoord --"texcoord"--> NG_noise2d_color4_N_noise2d - NG_noise2d_color4_N_noise2d --> NG_noise2d_color4_out + NG_noise2d_color4_N_noise2d --"in"--> NG_noise2d_color4_swizzle + NG_noise2d_color4_swizzle --> NG_noise2d_color4_out ``` @@ -2885,6 +2889,7 @@ graph TB ```mermaid graph TB subgraph NG_noise2d_color3FA + NG_noise2d_color3FA_swizzle[swizzle] NG_noise2d_color3FA_N_noise2d[N_noise2d] style NG_noise2d_color3FA_out fill:#0C0, color:#FFF NG_noise2d_color3FA_out([out]) @@ -2895,7 +2900,8 @@ graph TB style NG_noise2d_color3FA_texcoord fill:#09D, color:#FFF NG_noise2d_color3FA_texcoord([texcoord]) end - NG_noise2d_color3FA_amplitude --"amplitude"--> NG_noise2d_color3FA_N_noise2d + NG_noise2d_color3FA_amplitude --"in"--> NG_noise2d_color3FA_swizzle + NG_noise2d_color3FA_swizzle --"amplitude"--> NG_noise2d_color3FA_N_noise2d NG_noise2d_color3FA_pivot --"pivot"--> NG_noise2d_color3FA_N_noise2d NG_noise2d_color3FA_texcoord --"texcoord"--> NG_noise2d_color3FA_N_noise2d NG_noise2d_color3FA_N_noise2d --> NG_noise2d_color3FA_out @@ -2922,6 +2928,7 @@ graph TB ```mermaid graph TB subgraph NG_noise2d_color4FA + NG_noise2d_color4FA_swizzle[swizzle] NG_noise2d_color4FA_N_noise2d[N_noise2d] style NG_noise2d_color4FA_out fill:#0C0, color:#FFF NG_noise2d_color4FA_out([out]) @@ -2932,7 +2939,11 @@ graph TB style NG_noise2d_color4FA_texcoord fill:#09D, color:#FFF NG_noise2d_color4FA_texcoord([texcoord]) end - NG_noise2d_color4FA_amplitude --"amplitude"--> NG_noise2d_color4FA_N_noise2d + NG_noise2d_color4FA_amplitude --"in1"--> NG_noise2d_color4FA_swizzle + NG_noise2d_color4FA_amplitude --"in2"--> NG_noise2d_color4FA_swizzle + NG_noise2d_color4FA_amplitude --"in3"--> NG_noise2d_color4FA_swizzle + NG_noise2d_color4FA_amplitude --"in4"--> NG_noise2d_color4FA_swizzle + NG_noise2d_color4FA_swizzle --"amplitude"--> NG_noise2d_color4FA_N_noise2d NG_noise2d_color4FA_pivot --"pivot"--> NG_noise2d_color4FA_N_noise2d NG_noise2d_color4FA_texcoord --"texcoord"--> NG_noise2d_color4FA_N_noise2d NG_noise2d_color4FA_N_noise2d --> NG_noise2d_color4FA_out @@ -2959,6 +2970,7 @@ graph TB ```mermaid graph TB subgraph NG_noise2d_vector2FA + NG_noise2d_vector2FA_swizzle[swizzle] NG_noise2d_vector2FA_N_noise2d[N_noise2d] style NG_noise2d_vector2FA_out fill:#0C0, color:#FFF NG_noise2d_vector2FA_out([out]) @@ -2969,7 +2981,9 @@ graph TB style NG_noise2d_vector2FA_texcoord fill:#09D, color:#FFF NG_noise2d_vector2FA_texcoord([texcoord]) end - NG_noise2d_vector2FA_amplitude --"amplitude"--> NG_noise2d_vector2FA_N_noise2d + NG_noise2d_vector2FA_amplitude --"in1"--> NG_noise2d_vector2FA_swizzle + NG_noise2d_vector2FA_amplitude --"in2"--> NG_noise2d_vector2FA_swizzle + NG_noise2d_vector2FA_swizzle --"amplitude"--> NG_noise2d_vector2FA_N_noise2d NG_noise2d_vector2FA_pivot --"pivot"--> NG_noise2d_vector2FA_N_noise2d NG_noise2d_vector2FA_texcoord --"texcoord"--> NG_noise2d_vector2FA_N_noise2d NG_noise2d_vector2FA_N_noise2d --> NG_noise2d_vector2FA_out @@ -2996,6 +3010,7 @@ graph TB ```mermaid graph TB subgraph NG_noise2d_vector3FA + NG_noise2d_vector3FA_swizzle[swizzle] NG_noise2d_vector3FA_N_noise2d[N_noise2d] style NG_noise2d_vector3FA_out fill:#0C0, color:#FFF NG_noise2d_vector3FA_out([out]) @@ -3006,7 +3021,8 @@ graph TB style NG_noise2d_vector3FA_texcoord fill:#09D, color:#FFF NG_noise2d_vector3FA_texcoord([texcoord]) end - NG_noise2d_vector3FA_amplitude --"amplitude"--> NG_noise2d_vector3FA_N_noise2d + NG_noise2d_vector3FA_amplitude --"in"--> NG_noise2d_vector3FA_swizzle + NG_noise2d_vector3FA_swizzle --"amplitude"--> NG_noise2d_vector3FA_N_noise2d NG_noise2d_vector3FA_pivot --"pivot"--> NG_noise2d_vector3FA_N_noise2d NG_noise2d_vector3FA_texcoord --"texcoord"--> NG_noise2d_vector3FA_N_noise2d NG_noise2d_vector3FA_N_noise2d --> NG_noise2d_vector3FA_out @@ -3033,6 +3049,7 @@ graph TB ```mermaid graph TB subgraph NG_noise2d_vector4FA + NG_noise2d_vector4FA_swizzle[swizzle] NG_noise2d_vector4FA_N_noise2d[N_noise2d] style NG_noise2d_vector4FA_out fill:#0C0, color:#FFF NG_noise2d_vector4FA_out([out]) @@ -3043,7 +3060,11 @@ graph TB style NG_noise2d_vector4FA_texcoord fill:#09D, color:#FFF NG_noise2d_vector4FA_texcoord([texcoord]) end - NG_noise2d_vector4FA_amplitude --"amplitude"--> NG_noise2d_vector4FA_N_noise2d + NG_noise2d_vector4FA_amplitude --"in1"--> NG_noise2d_vector4FA_swizzle + NG_noise2d_vector4FA_amplitude --"in2"--> NG_noise2d_vector4FA_swizzle + NG_noise2d_vector4FA_amplitude --"in3"--> NG_noise2d_vector4FA_swizzle + NG_noise2d_vector4FA_amplitude --"in4"--> NG_noise2d_vector4FA_swizzle + NG_noise2d_vector4FA_swizzle --"amplitude"--> NG_noise2d_vector4FA_N_noise2d NG_noise2d_vector4FA_pivot --"pivot"--> NG_noise2d_vector4FA_N_noise2d NG_noise2d_vector4FA_texcoord --"texcoord"--> NG_noise2d_vector4FA_N_noise2d NG_noise2d_vector4FA_N_noise2d --> NG_noise2d_vector4FA_out @@ -3089,6 +3110,7 @@ graph TB graph TB subgraph NG_noise3d_color3 NG_noise3d_color3_N_noise3d[N_noise3d] + NG_noise3d_color3_swizzle[swizzle] style NG_noise3d_color3_out fill:#0C0, color:#FFF NG_noise3d_color3_out([out]) style NG_noise3d_color3_amplitude fill:#09D, color:#FFF @@ -3101,7 +3123,8 @@ graph TB NG_noise3d_color3_amplitude --"amplitude"--> NG_noise3d_color3_N_noise3d NG_noise3d_color3_pivot --"pivot"--> NG_noise3d_color3_N_noise3d NG_noise3d_color3_position --"position"--> NG_noise3d_color3_N_noise3d - NG_noise3d_color3_N_noise3d --> NG_noise3d_color3_out + NG_noise3d_color3_N_noise3d --"in"--> NG_noise3d_color3_swizzle + NG_noise3d_color3_swizzle --> NG_noise3d_color3_out ``` @@ -3126,6 +3149,7 @@ graph TB graph TB subgraph NG_noise3d_color4 NG_noise3d_color4_N_noise3d[N_noise3d] + NG_noise3d_color4_swizzle[swizzle] style NG_noise3d_color4_out fill:#0C0, color:#FFF NG_noise3d_color4_out([out]) style NG_noise3d_color4_amplitude fill:#09D, color:#FFF @@ -3138,7 +3162,8 @@ graph TB NG_noise3d_color4_amplitude --"amplitude"--> NG_noise3d_color4_N_noise3d NG_noise3d_color4_pivot --"pivot"--> NG_noise3d_color4_N_noise3d NG_noise3d_color4_position --"position"--> NG_noise3d_color4_N_noise3d - NG_noise3d_color4_N_noise3d --> NG_noise3d_color4_out + NG_noise3d_color4_N_noise3d --"in"--> NG_noise3d_color4_swizzle + NG_noise3d_color4_swizzle --> NG_noise3d_color4_out ``` @@ -3213,6 +3238,7 @@ graph TB ```mermaid graph TB subgraph NG_noise3d_color3FA + NG_noise3d_color3FA_swizzle[swizzle] NG_noise3d_color3FA_N_noise3d[N_noise3d] style NG_noise3d_color3FA_out fill:#0C0, color:#FFF NG_noise3d_color3FA_out([out]) @@ -3223,7 +3249,8 @@ graph TB style NG_noise3d_color3FA_position fill:#09D, color:#FFF NG_noise3d_color3FA_position([position]) end - NG_noise3d_color3FA_amplitude --"amplitude"--> NG_noise3d_color3FA_N_noise3d + NG_noise3d_color3FA_amplitude --"in"--> NG_noise3d_color3FA_swizzle + NG_noise3d_color3FA_swizzle --"amplitude"--> NG_noise3d_color3FA_N_noise3d NG_noise3d_color3FA_pivot --"pivot"--> NG_noise3d_color3FA_N_noise3d NG_noise3d_color3FA_position --"position"--> NG_noise3d_color3FA_N_noise3d NG_noise3d_color3FA_N_noise3d --> NG_noise3d_color3FA_out @@ -3250,6 +3277,7 @@ graph TB ```mermaid graph TB subgraph NG_noise3d_color4FA + NG_noise3d_color4FA_swizzle[swizzle] NG_noise3d_color4FA_N_noise3d[N_noise3d] style NG_noise3d_color4FA_out fill:#0C0, color:#FFF NG_noise3d_color4FA_out([out]) @@ -3260,7 +3288,11 @@ graph TB style NG_noise3d_color4FA_position fill:#09D, color:#FFF NG_noise3d_color4FA_position([position]) end - NG_noise3d_color4FA_amplitude --"amplitude"--> NG_noise3d_color4FA_N_noise3d + NG_noise3d_color4FA_amplitude --"in1"--> NG_noise3d_color4FA_swizzle + NG_noise3d_color4FA_amplitude --"in2"--> NG_noise3d_color4FA_swizzle + NG_noise3d_color4FA_amplitude --"in3"--> NG_noise3d_color4FA_swizzle + NG_noise3d_color4FA_amplitude --"in4"--> NG_noise3d_color4FA_swizzle + NG_noise3d_color4FA_swizzle --"amplitude"--> NG_noise3d_color4FA_N_noise3d NG_noise3d_color4FA_pivot --"pivot"--> NG_noise3d_color4FA_N_noise3d NG_noise3d_color4FA_position --"position"--> NG_noise3d_color4FA_N_noise3d NG_noise3d_color4FA_N_noise3d --> NG_noise3d_color4FA_out @@ -3287,6 +3319,7 @@ graph TB ```mermaid graph TB subgraph NG_noise3d_vector2FA + NG_noise3d_vector2FA_swizzle[swizzle] NG_noise3d_vector2FA_N_noise3d[N_noise3d] style NG_noise3d_vector2FA_out fill:#0C0, color:#FFF NG_noise3d_vector2FA_out([out]) @@ -3297,7 +3330,9 @@ graph TB style NG_noise3d_vector2FA_position fill:#09D, color:#FFF NG_noise3d_vector2FA_position([position]) end - NG_noise3d_vector2FA_amplitude --"amplitude"--> NG_noise3d_vector2FA_N_noise3d + NG_noise3d_vector2FA_amplitude --"in1"--> NG_noise3d_vector2FA_swizzle + NG_noise3d_vector2FA_amplitude --"in2"--> NG_noise3d_vector2FA_swizzle + NG_noise3d_vector2FA_swizzle --"amplitude"--> NG_noise3d_vector2FA_N_noise3d NG_noise3d_vector2FA_pivot --"pivot"--> NG_noise3d_vector2FA_N_noise3d NG_noise3d_vector2FA_position --"position"--> NG_noise3d_vector2FA_N_noise3d NG_noise3d_vector2FA_N_noise3d --> NG_noise3d_vector2FA_out @@ -3324,6 +3359,7 @@ graph TB ```mermaid graph TB subgraph NG_noise3d_vector3FA + NG_noise3d_vector3FA_swizzle[swizzle] NG_noise3d_vector3FA_N_noise3d[N_noise3d] style NG_noise3d_vector3FA_out fill:#0C0, color:#FFF NG_noise3d_vector3FA_out([out]) @@ -3334,7 +3370,8 @@ graph TB style NG_noise3d_vector3FA_position fill:#09D, color:#FFF NG_noise3d_vector3FA_position([position]) end - NG_noise3d_vector3FA_amplitude --"amplitude"--> NG_noise3d_vector3FA_N_noise3d + NG_noise3d_vector3FA_amplitude --"in"--> NG_noise3d_vector3FA_swizzle + NG_noise3d_vector3FA_swizzle --"amplitude"--> NG_noise3d_vector3FA_N_noise3d NG_noise3d_vector3FA_pivot --"pivot"--> NG_noise3d_vector3FA_N_noise3d NG_noise3d_vector3FA_position --"position"--> NG_noise3d_vector3FA_N_noise3d NG_noise3d_vector3FA_N_noise3d --> NG_noise3d_vector3FA_out @@ -3361,6 +3398,7 @@ graph TB ```mermaid graph TB subgraph NG_noise3d_vector4FA + NG_noise3d_vector4FA_swizzle[swizzle] NG_noise3d_vector4FA_N_noise3d[N_noise3d] style NG_noise3d_vector4FA_out fill:#0C0, color:#FFF NG_noise3d_vector4FA_out([out]) @@ -3371,7 +3409,11 @@ graph TB style NG_noise3d_vector4FA_position fill:#09D, color:#FFF NG_noise3d_vector4FA_position([position]) end - NG_noise3d_vector4FA_amplitude --"amplitude"--> NG_noise3d_vector4FA_N_noise3d + NG_noise3d_vector4FA_amplitude --"in1"--> NG_noise3d_vector4FA_swizzle + NG_noise3d_vector4FA_amplitude --"in2"--> NG_noise3d_vector4FA_swizzle + NG_noise3d_vector4FA_amplitude --"in3"--> NG_noise3d_vector4FA_swizzle + NG_noise3d_vector4FA_amplitude --"in4"--> NG_noise3d_vector4FA_swizzle + NG_noise3d_vector4FA_swizzle --"amplitude"--> NG_noise3d_vector4FA_N_noise3d NG_noise3d_vector4FA_pivot --"pivot"--> NG_noise3d_vector4FA_N_noise3d NG_noise3d_vector4FA_position --"position"--> NG_noise3d_vector4FA_N_noise3d NG_noise3d_vector4FA_N_noise3d --> NG_noise3d_vector4FA_out @@ -3419,6 +3461,7 @@ graph TB graph TB subgraph NG_fractal3d_color3 NG_fractal3d_color3_N_fractal3d[N_fractal3d] + NG_fractal3d_color3_swizzle[swizzle] style NG_fractal3d_color3_out fill:#0C0, color:#FFF NG_fractal3d_color3_out([out]) style NG_fractal3d_color3_amplitude fill:#09D, color:#FFF @@ -3437,7 +3480,8 @@ graph TB NG_fractal3d_color3_lacunarity --"lacunarity"--> NG_fractal3d_color3_N_fractal3d NG_fractal3d_color3_diminish --"diminish"--> NG_fractal3d_color3_N_fractal3d NG_fractal3d_color3_position --"position"--> NG_fractal3d_color3_N_fractal3d - NG_fractal3d_color3_N_fractal3d --> NG_fractal3d_color3_out + NG_fractal3d_color3_N_fractal3d --"in"--> NG_fractal3d_color3_swizzle + NG_fractal3d_color3_swizzle --> NG_fractal3d_color3_out ``` @@ -3464,6 +3508,7 @@ graph TB graph TB subgraph NG_fractal3d_color4 NG_fractal3d_color4_N_fractal3d[N_fractal3d] + NG_fractal3d_color4_swizzle[swizzle] style NG_fractal3d_color4_out fill:#0C0, color:#FFF NG_fractal3d_color4_out([out]) style NG_fractal3d_color4_amplitude fill:#09D, color:#FFF @@ -3482,7 +3527,8 @@ graph TB NG_fractal3d_color4_lacunarity --"lacunarity"--> NG_fractal3d_color4_N_fractal3d NG_fractal3d_color4_diminish --"diminish"--> NG_fractal3d_color4_N_fractal3d NG_fractal3d_color4_position --"position"--> NG_fractal3d_color4_N_fractal3d - NG_fractal3d_color4_N_fractal3d --> NG_fractal3d_color4_out + NG_fractal3d_color4_N_fractal3d --"in"--> NG_fractal3d_color4_swizzle + NG_fractal3d_color4_swizzle --> NG_fractal3d_color4_out ``` @@ -3565,6 +3611,7 @@ graph TB ```mermaid graph TB subgraph NG_fractal3d_color3FA + NG_fractal3d_color3FA_swizzle[swizzle] NG_fractal3d_color3FA_N_fractal3d[N_fractal3d] style NG_fractal3d_color3FA_out fill:#0C0, color:#FFF NG_fractal3d_color3FA_out([out]) @@ -3579,7 +3626,8 @@ graph TB style NG_fractal3d_color3FA_position fill:#09D, color:#FFF NG_fractal3d_color3FA_position([position]) end - NG_fractal3d_color3FA_amplitude --"amplitude"--> NG_fractal3d_color3FA_N_fractal3d + NG_fractal3d_color3FA_amplitude --"in"--> NG_fractal3d_color3FA_swizzle + NG_fractal3d_color3FA_swizzle --"amplitude"--> NG_fractal3d_color3FA_N_fractal3d NG_fractal3d_color3FA_octaves --"octaves"--> NG_fractal3d_color3FA_N_fractal3d NG_fractal3d_color3FA_lacunarity --"lacunarity"--> NG_fractal3d_color3FA_N_fractal3d NG_fractal3d_color3FA_diminish --"diminish"--> NG_fractal3d_color3FA_N_fractal3d @@ -3610,6 +3658,7 @@ graph TB ```mermaid graph TB subgraph NG_fractal3d_color4FA + NG_fractal3d_color4FA_swizzle[swizzle] NG_fractal3d_color4FA_N_fractal3d[N_fractal3d] style NG_fractal3d_color4FA_out fill:#0C0, color:#FFF NG_fractal3d_color4FA_out([out]) @@ -3624,7 +3673,11 @@ graph TB style NG_fractal3d_color4FA_position fill:#09D, color:#FFF NG_fractal3d_color4FA_position([position]) end - NG_fractal3d_color4FA_amplitude --"amplitude"--> NG_fractal3d_color4FA_N_fractal3d + NG_fractal3d_color4FA_amplitude --"in1"--> NG_fractal3d_color4FA_swizzle + NG_fractal3d_color4FA_amplitude --"in2"--> NG_fractal3d_color4FA_swizzle + NG_fractal3d_color4FA_amplitude --"in3"--> NG_fractal3d_color4FA_swizzle + NG_fractal3d_color4FA_amplitude --"in4"--> NG_fractal3d_color4FA_swizzle + NG_fractal3d_color4FA_swizzle --"amplitude"--> NG_fractal3d_color4FA_N_fractal3d NG_fractal3d_color4FA_octaves --"octaves"--> NG_fractal3d_color4FA_N_fractal3d NG_fractal3d_color4FA_lacunarity --"lacunarity"--> NG_fractal3d_color4FA_N_fractal3d NG_fractal3d_color4FA_diminish --"diminish"--> NG_fractal3d_color4FA_N_fractal3d @@ -3655,6 +3708,7 @@ graph TB ```mermaid graph TB subgraph NG_fractal3d_vector2FA + NG_fractal3d_vector2FA_swizzle[swizzle] NG_fractal3d_vector2FA_N_fractal3d[N_fractal3d] style NG_fractal3d_vector2FA_out fill:#0C0, color:#FFF NG_fractal3d_vector2FA_out([out]) @@ -3669,7 +3723,9 @@ graph TB style NG_fractal3d_vector2FA_position fill:#09D, color:#FFF NG_fractal3d_vector2FA_position([position]) end - NG_fractal3d_vector2FA_amplitude --"amplitude"--> NG_fractal3d_vector2FA_N_fractal3d + NG_fractal3d_vector2FA_amplitude --"in1"--> NG_fractal3d_vector2FA_swizzle + NG_fractal3d_vector2FA_amplitude --"in2"--> NG_fractal3d_vector2FA_swizzle + NG_fractal3d_vector2FA_swizzle --"amplitude"--> NG_fractal3d_vector2FA_N_fractal3d NG_fractal3d_vector2FA_octaves --"octaves"--> NG_fractal3d_vector2FA_N_fractal3d NG_fractal3d_vector2FA_lacunarity --"lacunarity"--> NG_fractal3d_vector2FA_N_fractal3d NG_fractal3d_vector2FA_diminish --"diminish"--> NG_fractal3d_vector2FA_N_fractal3d @@ -3700,6 +3756,7 @@ graph TB ```mermaid graph TB subgraph NG_fractal3d_vector3FA + NG_fractal3d_vector3FA_swizzle[swizzle] NG_fractal3d_vector3FA_N_fractal3d[N_fractal3d] style NG_fractal3d_vector3FA_out fill:#0C0, color:#FFF NG_fractal3d_vector3FA_out([out]) @@ -3714,7 +3771,8 @@ graph TB style NG_fractal3d_vector3FA_position fill:#09D, color:#FFF NG_fractal3d_vector3FA_position([position]) end - NG_fractal3d_vector3FA_amplitude --"amplitude"--> NG_fractal3d_vector3FA_N_fractal3d + NG_fractal3d_vector3FA_amplitude --"in"--> NG_fractal3d_vector3FA_swizzle + NG_fractal3d_vector3FA_swizzle --"amplitude"--> NG_fractal3d_vector3FA_N_fractal3d NG_fractal3d_vector3FA_octaves --"octaves"--> NG_fractal3d_vector3FA_N_fractal3d NG_fractal3d_vector3FA_lacunarity --"lacunarity"--> NG_fractal3d_vector3FA_N_fractal3d NG_fractal3d_vector3FA_diminish --"diminish"--> NG_fractal3d_vector3FA_N_fractal3d @@ -3745,6 +3803,7 @@ graph TB ```mermaid graph TB subgraph NG_fractal3d_vector4FA + NG_fractal3d_vector4FA_swizzle[swizzle] NG_fractal3d_vector4FA_N_fractal3d[N_fractal3d] style NG_fractal3d_vector4FA_out fill:#0C0, color:#FFF NG_fractal3d_vector4FA_out([out]) @@ -3759,7 +3818,11 @@ graph TB style NG_fractal3d_vector4FA_position fill:#09D, color:#FFF NG_fractal3d_vector4FA_position([position]) end - NG_fractal3d_vector4FA_amplitude --"amplitude"--> NG_fractal3d_vector4FA_N_fractal3d + NG_fractal3d_vector4FA_amplitude --"in1"--> NG_fractal3d_vector4FA_swizzle + NG_fractal3d_vector4FA_amplitude --"in2"--> NG_fractal3d_vector4FA_swizzle + NG_fractal3d_vector4FA_amplitude --"in3"--> NG_fractal3d_vector4FA_swizzle + NG_fractal3d_vector4FA_amplitude --"in4"--> NG_fractal3d_vector4FA_swizzle + NG_fractal3d_vector4FA_swizzle --"amplitude"--> NG_fractal3d_vector4FA_N_fractal3d NG_fractal3d_vector4FA_octaves --"octaves"--> NG_fractal3d_vector4FA_N_fractal3d NG_fractal3d_vector4FA_lacunarity --"lacunarity"--> NG_fractal3d_vector4FA_N_fractal3d NG_fractal3d_vector4FA_diminish --"diminish"--> NG_fractal3d_vector4FA_N_fractal3d @@ -4539,9 +4602,17 @@ graph TB NG_cloverleaf_float_sample_double[sample_double] NG_cloverleaf_float_sample_add[sample_add] NG_cloverleaf_float_sample_subtract[sample_subtract] + NG_cloverleaf_float_swizzle[swizzle] + NG_cloverleaf_float_swizzle2[swizzle2] NG_cloverleaf_float_coord1[coord1] + NG_cloverleaf_float_swizzle3[swizzle3] + NG_cloverleaf_float_swizzle4[swizzle4] NG_cloverleaf_float_coord2[coord2] + NG_cloverleaf_float_swizzle5[swizzle5] + NG_cloverleaf_float_swizzle6[swizzle6] NG_cloverleaf_float_coord3[coord3] + NG_cloverleaf_float_swizzle7[swizzle7] + NG_cloverleaf_float_swizzle8[swizzle8] NG_cloverleaf_float_coord4[coord4] NG_cloverleaf_float_circle1[circle1] NG_cloverleaf_float_circle2[circle2] @@ -4565,14 +4636,22 @@ graph TB NG_cloverleaf_float_radius --"in2"--> NG_cloverleaf_float_sample_add NG_cloverleaf_float_sample_double --"in1"--> NG_cloverleaf_float_sample_subtract NG_cloverleaf_float_radius --"in2"--> NG_cloverleaf_float_sample_subtract - NG_cloverleaf_float_sample_add --"in1"--> NG_cloverleaf_float_coord1 - NG_cloverleaf_float_sample_double --"in2"--> NG_cloverleaf_float_coord1 - NG_cloverleaf_float_sample_subtract --"in1"--> NG_cloverleaf_float_coord2 - NG_cloverleaf_float_sample_double --"in2"--> NG_cloverleaf_float_coord2 - NG_cloverleaf_float_sample_double --"in1"--> NG_cloverleaf_float_coord3 - NG_cloverleaf_float_sample_subtract --"in2"--> NG_cloverleaf_float_coord3 - NG_cloverleaf_float_sample_double --"in1"--> NG_cloverleaf_float_coord4 - NG_cloverleaf_float_sample_add --"in2"--> NG_cloverleaf_float_coord4 + NG_cloverleaf_float_sample_add --"in"--> NG_cloverleaf_float_swizzle + NG_cloverleaf_float_sample_double --"in"--> NG_cloverleaf_float_swizzle2 + NG_cloverleaf_float_swizzle --"in1"--> NG_cloverleaf_float_coord1 + NG_cloverleaf_float_swizzle2 --"in2"--> NG_cloverleaf_float_coord1 + NG_cloverleaf_float_sample_subtract --"in"--> NG_cloverleaf_float_swizzle3 + NG_cloverleaf_float_sample_double --"in"--> NG_cloverleaf_float_swizzle4 + NG_cloverleaf_float_swizzle3 --"in1"--> NG_cloverleaf_float_coord2 + NG_cloverleaf_float_swizzle4 --"in2"--> NG_cloverleaf_float_coord2 + NG_cloverleaf_float_sample_double --"in"--> NG_cloverleaf_float_swizzle5 + NG_cloverleaf_float_sample_subtract --"in"--> NG_cloverleaf_float_swizzle6 + NG_cloverleaf_float_swizzle5 --"in1"--> NG_cloverleaf_float_coord3 + NG_cloverleaf_float_swizzle6 --"in2"--> NG_cloverleaf_float_coord3 + NG_cloverleaf_float_sample_double --"in"--> NG_cloverleaf_float_swizzle7 + NG_cloverleaf_float_sample_add --"in"--> NG_cloverleaf_float_swizzle8 + NG_cloverleaf_float_swizzle7 --"in1"--> NG_cloverleaf_float_coord4 + NG_cloverleaf_float_swizzle8 --"in2"--> NG_cloverleaf_float_coord4 NG_cloverleaf_float_coord1 --"texcoord"--> NG_cloverleaf_float_circle1 NG_cloverleaf_float_center --"center"--> NG_cloverleaf_float_circle1 NG_cloverleaf_float_radius --"radius"--> NG_cloverleaf_float_circle1 @@ -4618,13 +4697,21 @@ graph TB subgraph NG_hexagon_float NG_hexagon_float_delta[delta] NG_hexagon_float_delta_abs[delta_abs] + NG_hexagon_float_swizzle[swizzle] + NG_hexagon_float_swizzle2[swizzle2] NG_hexagon_float_p[p] style NG_hexagon_float_k fill:#500, color:#FFF NG_hexagon_float_k([k:-0.866025, 0.5, 0.57735]) + NG_hexagon_float_swizzle3[swizzle3] NG_hexagon_float_kz_r1[kz_r1] NG_hexagon_float_minus_k[minus_k] + NG_hexagon_float_swizzle4[swizzle4] NG_hexagon_float_minus_kz_r[minus_kz_r] + NG_hexagon_float_swizzle5[swizzle5] + NG_hexagon_float_swizzle6[swizzle6] NG_hexagon_float_combine_mkx_ky[combine_mkx_ky] + NG_hexagon_float_swizzle7[swizzle7] + NG_hexagon_float_swizzle8[swizzle8] NG_hexagon_float_kxy[kxy] NG_hexagon_float_dot_kxy_p[dot_kxy_p] NG_hexagon_float_dot_kxy_p1[dot_kxy_p1] @@ -4634,6 +4721,7 @@ graph TB NG_hexagon_float_multiply2_1[multiply2_1] NG_hexagon_float_multiply_min_comb[multiply_min_comb] NG_hexagon_float_multiply2_2[multiply2_2] + NG_hexagon_float_swizzle9[swizzle9] NG_hexagon_float_clamp[clamp] NG_hexagon_float_combine_clamp_rad[combine_clamp_rad] NG_hexagon_float_new_p1[new_p1] @@ -4654,17 +4742,25 @@ graph TB NG_hexagon_float_texcoord --"in1"--> NG_hexagon_float_delta NG_hexagon_float_center --"in2"--> NG_hexagon_float_delta NG_hexagon_float_delta --"in"--> NG_hexagon_float_delta_abs - NG_hexagon_float_delta_abs --"in1"--> NG_hexagon_float_p - NG_hexagon_float_delta_abs --"in2"--> NG_hexagon_float_p - NG_hexagon_float_k --"in1"--> NG_hexagon_float_kz_r1 + NG_hexagon_float_delta_abs --"in"--> NG_hexagon_float_swizzle + NG_hexagon_float_delta_abs --"in"--> NG_hexagon_float_swizzle2 + NG_hexagon_float_swizzle --"in1"--> NG_hexagon_float_p + NG_hexagon_float_swizzle2 --"in2"--> NG_hexagon_float_p + NG_hexagon_float_k --"in"--> NG_hexagon_float_swizzle3 + NG_hexagon_float_swizzle3 --"in1"--> NG_hexagon_float_kz_r1 NG_hexagon_float_radius --"in2"--> NG_hexagon_float_kz_r1 NG_hexagon_float_k --"in1"--> NG_hexagon_float_minus_k - NG_hexagon_float_minus_k --"in1"--> NG_hexagon_float_minus_kz_r + NG_hexagon_float_minus_k --"in"--> NG_hexagon_float_swizzle4 + NG_hexagon_float_swizzle4 --"in1"--> NG_hexagon_float_minus_kz_r NG_hexagon_float_radius --"in2"--> NG_hexagon_float_minus_kz_r - NG_hexagon_float_minus_k --"in1"--> NG_hexagon_float_combine_mkx_ky - NG_hexagon_float_k --"in2"--> NG_hexagon_float_combine_mkx_ky - NG_hexagon_float_k --"in1"--> NG_hexagon_float_kxy - NG_hexagon_float_k --"in2"--> NG_hexagon_float_kxy + NG_hexagon_float_minus_k --"in"--> NG_hexagon_float_swizzle5 + NG_hexagon_float_k --"in"--> NG_hexagon_float_swizzle6 + NG_hexagon_float_swizzle5 --"in1"--> NG_hexagon_float_combine_mkx_ky + NG_hexagon_float_swizzle6 --"in2"--> NG_hexagon_float_combine_mkx_ky + NG_hexagon_float_k --"in"--> NG_hexagon_float_swizzle7 + NG_hexagon_float_k --"in"--> NG_hexagon_float_swizzle8 + NG_hexagon_float_swizzle7 --"in1"--> NG_hexagon_float_kxy + NG_hexagon_float_swizzle8 --"in2"--> NG_hexagon_float_kxy NG_hexagon_float_kxy --"in1"--> NG_hexagon_float_dot_kxy_p NG_hexagon_float_p --"in2"--> NG_hexagon_float_dot_kxy_p NG_hexagon_float_combine_mkx_ky --"in1"--> NG_hexagon_float_dot_kxy_p1 @@ -4677,7 +4773,8 @@ graph TB NG_hexagon_float_combine_mkx_ky --"in1"--> NG_hexagon_float_multiply_min_comb NG_hexagon_float_min_0 --"in2"--> NG_hexagon_float_multiply_min_comb NG_hexagon_float_multiply_min_comb --"in1"--> NG_hexagon_float_multiply2_2 - NG_hexagon_float_new_p2 --"in"--> NG_hexagon_float_clamp + NG_hexagon_float_new_p2 --"in"--> NG_hexagon_float_swizzle9 + NG_hexagon_float_swizzle9 --"in"--> NG_hexagon_float_clamp NG_hexagon_float_minus_kz_r --"low"--> NG_hexagon_float_clamp NG_hexagon_float_kz_r1 --"high"--> NG_hexagon_float_clamp NG_hexagon_float_clamp --"in1"--> NG_hexagon_float_combine_clamp_rad @@ -4719,11 +4816,15 @@ graph TB NG_grid_color3_texcoord_scale[texcoord_scale] NG_grid_color3_texcoord_bias[texcoord_bias] NG_grid_color3_thick_to_size[thick_to_size] + NG_grid_color3_swizzle[swizzle] NG_grid_color3_mod_Y[mod_Y] + NG_grid_color3_swizzle2[swizzle2] NG_grid_color3_mod_Y_row[mod_Y_row] NG_grid_color3_mody_2[mody_2] NG_grid_color3_alt_rows_shift[alt_rows_shift] + NG_grid_color3_swizzle3[swizzle3] NG_grid_color3_shift_X[shift_X] + NG_grid_color3_swizzle4[swizzle4] style NG_grid_color3_stagger_selection fill:#C72, color:#FFF NG_grid_color3_stagger_selection{stagger_selection} NG_grid_color3_mod_X[mod_X] @@ -4755,15 +4856,19 @@ graph TB NG_grid_color3_texcoord_scale --"in1"--> NG_grid_color3_texcoord_bias NG_grid_color3_uvoffset --"in2"--> NG_grid_color3_texcoord_bias NG_grid_color3_thickness --"in2"--> NG_grid_color3_thick_to_size - NG_grid_color3_texcoord_bias --"in1"--> NG_grid_color3_mod_Y - NG_grid_color3_texcoord_bias --"in1"--> NG_grid_color3_mod_Y_row + NG_grid_color3_texcoord_bias --"in"--> NG_grid_color3_swizzle + NG_grid_color3_swizzle --"in1"--> NG_grid_color3_mod_Y + NG_grid_color3_texcoord_bias --"in"--> NG_grid_color3_swizzle2 + NG_grid_color3_swizzle2 --"in1"--> NG_grid_color3_mod_Y_row NG_grid_color3_mod_Y --"in1"--> NG_grid_color3_mody_2 NG_grid_color3_mod_Y_row --"value1"--> NG_grid_color3_alt_rows_shift - NG_grid_color3_texcoord_bias --"in1"--> NG_grid_color3_shift_X + NG_grid_color3_texcoord_bias --"in"--> NG_grid_color3_swizzle3 + NG_grid_color3_swizzle3 --"in1"--> NG_grid_color3_shift_X NG_grid_color3_alt_rows_shift --"in2"--> NG_grid_color3_shift_X + NG_grid_color3_texcoord_bias --"in"--> NG_grid_color3_swizzle4 NG_grid_color3_staggered --"value1"--> NG_grid_color3_stagger_selection NG_grid_color3_shift_X --"in1"--> NG_grid_color3_stagger_selection - NG_grid_color3_texcoord_bias --"in2"--> NG_grid_color3_stagger_selection + NG_grid_color3_swizzle4 --"in2"--> NG_grid_color3_stagger_selection NG_grid_color3_stagger_selection --"in1"--> NG_grid_color3_mod_X NG_grid_color3_mod_X --"in1"--> NG_grid_color3_modx_2 NG_grid_color3_modx_2 --"in1"--> NG_grid_color3_subX_1 @@ -4807,11 +4912,15 @@ graph TB subgraph NG_crosshatch_color3 NG_crosshatch_color3_texcoord_scale[texcoord_scale] NG_crosshatch_color3_texcoord_bias[texcoord_bias] + NG_crosshatch_color3_swizzle[swizzle] NG_crosshatch_color3_mod_Y[mod_Y] + NG_crosshatch_color3_swizzle2[swizzle2] NG_crosshatch_color3_mod_Y_row[mod_Y_row] NG_crosshatch_color3_mody_2[mody_2] NG_crosshatch_color3_alt_rows_shift[alt_rows_shift] + NG_crosshatch_color3_swizzle3[swizzle3] NG_crosshatch_color3_shift_X[shift_X] + NG_crosshatch_color3_swizzle4[swizzle4] style NG_crosshatch_color3_stagger_selection fill:#C72, color:#FFF NG_crosshatch_color3_stagger_selection{stagger_selection} NG_crosshatch_color3_mod_X[mod_X] @@ -4841,15 +4950,19 @@ graph TB NG_crosshatch_color3_uvtiling --"in2"--> NG_crosshatch_color3_texcoord_scale NG_crosshatch_color3_texcoord_scale --"in1"--> NG_crosshatch_color3_texcoord_bias NG_crosshatch_color3_uvoffset --"in2"--> NG_crosshatch_color3_texcoord_bias - NG_crosshatch_color3_texcoord_bias --"in1"--> NG_crosshatch_color3_mod_Y - NG_crosshatch_color3_texcoord_bias --"in1"--> NG_crosshatch_color3_mod_Y_row + NG_crosshatch_color3_texcoord_bias --"in"--> NG_crosshatch_color3_swizzle + NG_crosshatch_color3_swizzle --"in1"--> NG_crosshatch_color3_mod_Y + NG_crosshatch_color3_texcoord_bias --"in"--> NG_crosshatch_color3_swizzle2 + NG_crosshatch_color3_swizzle2 --"in1"--> NG_crosshatch_color3_mod_Y_row NG_crosshatch_color3_mod_Y --"in1"--> NG_crosshatch_color3_mody_2 NG_crosshatch_color3_mod_Y_row --"value1"--> NG_crosshatch_color3_alt_rows_shift - NG_crosshatch_color3_texcoord_bias --"in1"--> NG_crosshatch_color3_shift_X + NG_crosshatch_color3_texcoord_bias --"in"--> NG_crosshatch_color3_swizzle3 + NG_crosshatch_color3_swizzle3 --"in1"--> NG_crosshatch_color3_shift_X NG_crosshatch_color3_alt_rows_shift --"in2"--> NG_crosshatch_color3_shift_X + NG_crosshatch_color3_texcoord_bias --"in"--> NG_crosshatch_color3_swizzle4 NG_crosshatch_color3_staggered --"value1"--> NG_crosshatch_color3_stagger_selection NG_crosshatch_color3_shift_X --"in1"--> NG_crosshatch_color3_stagger_selection - NG_crosshatch_color3_texcoord_bias --"in2"--> NG_crosshatch_color3_stagger_selection + NG_crosshatch_color3_swizzle4 --"in2"--> NG_crosshatch_color3_stagger_selection NG_crosshatch_color3_stagger_selection --"in1"--> NG_crosshatch_color3_mod_X NG_crosshatch_color3_mod_X --"in1"--> NG_crosshatch_color3_modx_2 NG_crosshatch_color3_modx_2 --"in1"--> NG_crosshatch_color3_subX_1 @@ -4897,10 +5010,13 @@ graph TB NG_tiledcircles_color3_mod_texcoord[mod_texcoord] NG_tiledcircles_color3_mod_texcoord_2[mod_texcoord_2] NG_tiledcircles_color3_recenter[recenter] + NG_tiledcircles_color3_swizzle[swizzle] NG_tiledcircles_color3_stagg_Y[stagg_Y] NG_tiledcircles_color3_delta_X[delta_X] + NG_tiledcircles_color3_swizzle2[swizzle2] NG_tiledcircles_color3_shift_X[shift_X] NG_tiledcircles_color3_mod_X_1[mod_X_1] + NG_tiledcircles_color3_swizzle3[swizzle3] NG_tiledcircles_color3_mod_Y_1[mod_Y_1] NG_tiledcircles_color3_coord_adj_1[coord_adj_1] NG_tiledcircles_color3_coord_adj_2[coord_adj_2] @@ -4938,12 +5054,15 @@ graph TB NG_tiledcircles_color3_texcoord_bias --"in1"--> NG_tiledcircles_color3_mod_texcoord NG_tiledcircles_color3_mod_texcoord --"in1"--> NG_tiledcircles_color3_mod_texcoord_2 NG_tiledcircles_color3_mod_texcoord_2 --"in1"--> NG_tiledcircles_color3_recenter - NG_tiledcircles_color3_texcoord_bias --"in1"--> NG_tiledcircles_color3_stagg_Y + NG_tiledcircles_color3_texcoord_bias --"in"--> NG_tiledcircles_color3_swizzle + NG_tiledcircles_color3_swizzle --"in1"--> NG_tiledcircles_color3_stagg_Y NG_tiledcircles_color3_stagg_Y --"value1"--> NG_tiledcircles_color3_delta_X - NG_tiledcircles_color3_texcoord_bias --"in1"--> NG_tiledcircles_color3_shift_X + NG_tiledcircles_color3_texcoord_bias --"in"--> NG_tiledcircles_color3_swizzle2 + NG_tiledcircles_color3_swizzle2 --"in1"--> NG_tiledcircles_color3_shift_X NG_tiledcircles_color3_delta_X --"in2"--> NG_tiledcircles_color3_shift_X NG_tiledcircles_color3_shift_X --"in1"--> NG_tiledcircles_color3_mod_X_1 - NG_tiledcircles_color3_texcoord_bias --"in1"--> NG_tiledcircles_color3_mod_Y_1 + NG_tiledcircles_color3_texcoord_bias --"in"--> NG_tiledcircles_color3_swizzle3 + NG_tiledcircles_color3_swizzle3 --"in1"--> NG_tiledcircles_color3_mod_Y_1 NG_tiledcircles_color3_mod_X_1 --"in2"--> NG_tiledcircles_color3_coord_adj_1 NG_tiledcircles_color3_mod_X_1 --"in1"--> NG_tiledcircles_color3_coord_adj_2 NG_tiledcircles_color3_mod_Y_1 --"in2"--> NG_tiledcircles_color3_coord_adj_3 @@ -5002,10 +5121,13 @@ graph TB NG_tiledcloverleafs_color3_mod_texcoord[mod_texcoord] NG_tiledcloverleafs_color3_mod_texcoord_2[mod_texcoord_2] NG_tiledcloverleafs_color3_recenter[recenter] + NG_tiledcloverleafs_color3_swizzle[swizzle] NG_tiledcloverleafs_color3_stagg_Y[stagg_Y] NG_tiledcloverleafs_color3_delta_X[delta_X] + NG_tiledcloverleafs_color3_swizzle2[swizzle2] NG_tiledcloverleafs_color3_shift_X[shift_X] NG_tiledcloverleafs_color3_mod_X_1[mod_X_1] + NG_tiledcloverleafs_color3_swizzle3[swizzle3] NG_tiledcloverleafs_color3_mod_Y_1[mod_Y_1] NG_tiledcloverleafs_color3_coord_adj_1[coord_adj_1] NG_tiledcloverleafs_color3_coord_adj_2[coord_adj_2] @@ -5043,12 +5165,15 @@ graph TB NG_tiledcloverleafs_color3_texcoord_bias --"in1"--> NG_tiledcloverleafs_color3_mod_texcoord NG_tiledcloverleafs_color3_mod_texcoord --"in1"--> NG_tiledcloverleafs_color3_mod_texcoord_2 NG_tiledcloverleafs_color3_mod_texcoord_2 --"in1"--> NG_tiledcloverleafs_color3_recenter - NG_tiledcloverleafs_color3_texcoord_bias --"in1"--> NG_tiledcloverleafs_color3_stagg_Y + NG_tiledcloverleafs_color3_texcoord_bias --"in"--> NG_tiledcloverleafs_color3_swizzle + NG_tiledcloverleafs_color3_swizzle --"in1"--> NG_tiledcloverleafs_color3_stagg_Y NG_tiledcloverleafs_color3_stagg_Y --"value1"--> NG_tiledcloverleafs_color3_delta_X - NG_tiledcloverleafs_color3_texcoord_bias --"in1"--> NG_tiledcloverleafs_color3_shift_X + NG_tiledcloverleafs_color3_texcoord_bias --"in"--> NG_tiledcloverleafs_color3_swizzle2 + NG_tiledcloverleafs_color3_swizzle2 --"in1"--> NG_tiledcloverleafs_color3_shift_X NG_tiledcloverleafs_color3_delta_X --"in2"--> NG_tiledcloverleafs_color3_shift_X NG_tiledcloverleafs_color3_shift_X --"in1"--> NG_tiledcloverleafs_color3_mod_X_1 - NG_tiledcloverleafs_color3_texcoord_bias --"in1"--> NG_tiledcloverleafs_color3_mod_Y_1 + NG_tiledcloverleafs_color3_texcoord_bias --"in"--> NG_tiledcloverleafs_color3_swizzle3 + NG_tiledcloverleafs_color3_swizzle3 --"in1"--> NG_tiledcloverleafs_color3_mod_Y_1 NG_tiledcloverleafs_color3_mod_X_1 --"in2"--> NG_tiledcloverleafs_color3_coord_adj_1 NG_tiledcloverleafs_color3_mod_X_1 --"in1"--> NG_tiledcloverleafs_color3_coord_adj_2 NG_tiledcloverleafs_color3_mod_Y_1 --"in2"--> NG_tiledcloverleafs_color3_coord_adj_3 @@ -5107,10 +5232,13 @@ graph TB NG_tiledhexagons_color3_mod_texcoord[mod_texcoord] NG_tiledhexagons_color3_mod_texcoord_2[mod_texcoord_2] NG_tiledhexagons_color3_recenter[recenter] + NG_tiledhexagons_color3_swizzle[swizzle] NG_tiledhexagons_color3_stagg_Y[stagg_Y] NG_tiledhexagons_color3_delta_X[delta_X] + NG_tiledhexagons_color3_swizzle2[swizzle2] NG_tiledhexagons_color3_shift_X[shift_X] NG_tiledhexagons_color3_mod_X_1[mod_X_1] + NG_tiledhexagons_color3_swizzle3[swizzle3] NG_tiledhexagons_color3_mod_Y_1[mod_Y_1] NG_tiledhexagons_color3_coord_adj_1[coord_adj_1] NG_tiledhexagons_color3_coord_adj_2[coord_adj_2] @@ -5148,12 +5276,15 @@ graph TB NG_tiledhexagons_color3_texcoord_bias --"in1"--> NG_tiledhexagons_color3_mod_texcoord NG_tiledhexagons_color3_mod_texcoord --"in1"--> NG_tiledhexagons_color3_mod_texcoord_2 NG_tiledhexagons_color3_mod_texcoord_2 --"in1"--> NG_tiledhexagons_color3_recenter - NG_tiledhexagons_color3_texcoord_bias --"in1"--> NG_tiledhexagons_color3_stagg_Y + NG_tiledhexagons_color3_texcoord_bias --"in"--> NG_tiledhexagons_color3_swizzle + NG_tiledhexagons_color3_swizzle --"in1"--> NG_tiledhexagons_color3_stagg_Y NG_tiledhexagons_color3_stagg_Y --"value1"--> NG_tiledhexagons_color3_delta_X - NG_tiledhexagons_color3_texcoord_bias --"in1"--> NG_tiledhexagons_color3_shift_X + NG_tiledhexagons_color3_texcoord_bias --"in"--> NG_tiledhexagons_color3_swizzle2 + NG_tiledhexagons_color3_swizzle2 --"in1"--> NG_tiledhexagons_color3_shift_X NG_tiledhexagons_color3_delta_X --"in2"--> NG_tiledhexagons_color3_shift_X NG_tiledhexagons_color3_shift_X --"in1"--> NG_tiledhexagons_color3_mod_X_1 - NG_tiledhexagons_color3_texcoord_bias --"in1"--> NG_tiledhexagons_color3_mod_Y_1 + NG_tiledhexagons_color3_texcoord_bias --"in"--> NG_tiledhexagons_color3_swizzle3 + NG_tiledhexagons_color3_swizzle3 --"in1"--> NG_tiledhexagons_color3_mod_Y_1 NG_tiledhexagons_color3_mod_X_1 --"in2"--> NG_tiledhexagons_color3_coord_adj_1 NG_tiledhexagons_color3_mod_X_1 --"in1"--> NG_tiledhexagons_color3_coord_adj_2 NG_tiledhexagons_color3_mod_Y_1 --"in2"--> NG_tiledhexagons_color3_coord_adj_3 @@ -5589,6 +5720,22 @@ graph TB | **in1** | float | 0.0 | | | | | | | | | | | | **in2** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | +
ND_add_integer +

+ +* *Nodedef*: ND_add_integer +* *Type*: integer +* *Group*: math +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | |

ND_add_color3

@@ -5830,6 +5977,22 @@ graph TB | **in1** | float | 0.0 | | | | | | | | | | | | **in2** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | +

ND_subtract_integer +

+ +* *Nodedef*: ND_subtract_integer +* *Type*: integer +* *Group*: math +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | |

ND_subtract_color3

@@ -7947,8 +8110,8 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | float | 0.0 | | | | | | | | | | | -| **in2** | float | 1.0 | | | | | | | | | | | +| **iny** | float | 0.0 | | | | | | | | | | | +| **inx** | float | 1.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | ### Category: *sin*

ND_sin_vector2 @@ -8044,8 +8207,8 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector2 | 1, 1 | | | | | | | | | | | -| **in2** | vector2 | 0, 0 | | | | | | | | | | | +| **iny** | vector2 | 1, 1 | | | | | | | | | | | +| **inx** | vector2 | 0, 0 | | | | | | | | | | | | *out* | vector2 | None | | | | | | | | | | | ### Category: *sin*
ND_sin_vector3 @@ -8141,8 +8304,8 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector3 | 1, 1, 1 | | | | | | | | | | | -| **in2** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **iny** | vector3 | 1, 1, 1 | | | | | | | | | | | +| **inx** | vector3 | 0, 0, 0 | | | | | | | | | | | | *out* | vector3 | None | | | | | | | | | | | ### Category: *sin*
ND_sin_vector4 @@ -8238,8 +8401,8 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector4 | 1, 1, 1, 1 | | | | | | | | | | | -| **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **iny** | vector4 | 1, 1, 1, 1 | | | | | | | | | | | +| **inx** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | ### Category: *sqrt*
ND_sqrt_float @@ -9450,10 +9613,10 @@ graph TB | **mat** | matrix44 | 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | ### Category: *normalmap* -
ND_normalmap +
ND_normalmap_float

-* *Nodedef*: ND_normalmap +* *Nodedef*: ND_normalmap_float * *Type*: vector3 * *Group*: math * *Version*: 1.0. Is default: False @@ -9691,263 +9854,6 @@ graph TB | **offset** | vector2 | 0, 0 | | | | | | | | | | | | **operationorder** | integer | 0 | | | | | | | | | | | | *out* | vector2 | None | | | | | | | | | | | -### Category: *arrayappend* -

ND_arrayappend_integer_integerarray -

- -* *Nodedef*: ND_arrayappend_integer_integerarray -* *Type*: integerarray -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | integer | 0 | | | | | | | | | | | -| **in2** | integer | 0 | | | | | | | | | | | -| *out* | integerarray | None | | | | | | | | | | | -

ND_arrayappend_integerarray_integerarray -

- -* *Nodedef*: ND_arrayappend_integerarray_integerarray -* *Type*: integerarray -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | integerarray | [] | | | | | | | | | | | -| **in2** | integer | 0 | | | | | | | | | | | -| *out* | integerarray | None | | | | | | | | | | | -

ND_arrayappend_float_floatarray -

- -* *Nodedef*: ND_arrayappend_float_floatarray -* *Type*: floatarray -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | float | 0.0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| *out* | floatarray | None | | | | | | | | | | | -

ND_arrayappend_floatarray_floatarray -

- -* *Nodedef*: ND_arrayappend_floatarray_floatarray -* *Type*: floatarray -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | floatarray | [] | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| *out* | floatarray | None | | | | | | | | | | | -

ND_arrayappend_color3_color3array -

- -* *Nodedef*: ND_arrayappend_color3_color3array -* *Type*: color3array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | color3 | 0, 0, 0 | | | | | | | | | | | -| **in2** | color3 | 0, 0, 0 | | | | | | | | | | | -| *out* | color3array | None | | | | | | | | | | | -

ND_arrayappend_color3array_color3array -

- -* *Nodedef*: ND_arrayappend_color3array_color3array -* *Type*: color3array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | color3array | | | | | | | | | | | | -| **in2** | color3 | 0, 0, 0 | | | | | | | | | | | -| *out* | color3array | None | | | | | | | | | | | -

ND_arrayappend_color4_color4array -

- -* *Nodedef*: ND_arrayappend_color4_color4array -* *Type*: color4array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| **in2** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| *out* | color4array | None | | | | | | | | | | | -

ND_arrayappend_color4array_color4array -

- -* *Nodedef*: ND_arrayappend_color4array_color4array -* *Type*: color4array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | color4array | | | | | | | | | | | | -| **in2** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| *out* | color4array | None | | | | | | | | | | | -

ND_arrayappend_vector2_vector2array -

- -* *Nodedef*: ND_arrayappend_vector2_vector2array -* *Type*: vector2array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector2 | 0, 0 | | | | | | | | | | | -| **in2** | vector2 | 0, 0 | | | | | | | | | | | -| *out* | vector2array | None | | | | | | | | | | | -

ND_arrayappend_vector2array_vector2array -

- -* *Nodedef*: ND_arrayappend_vector2array_vector2array -* *Type*: vector2array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector2array | | | | | | | | | | | | -| **in2** | vector2 | 0, 0 | | | | | | | | | | | -| *out* | vector2array | None | | | | | | | | | | | -

ND_arrayappend_vector3_vector3array -

- -* *Nodedef*: ND_arrayappend_vector3_vector3array -* *Type*: vector3array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector3 | 0, 0, 0 | | | | | | | | | | | -| **in2** | vector3 | 0, 0, 0 | | | | | | | | | | | -| *out* | vector3array | None | | | | | | | | | | | -

ND_arrayappend_vector3array_vector3array -

- -* *Nodedef*: ND_arrayappend_vector3array_vector3array -* *Type*: vector3array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector3array | | | | | | | | | | | | -| **in2** | vector3 | 0, 0, 0 | | | | | | | | | | | -| *out* | vector3array | None | | | | | | | | | | | -

ND_arrayappend_vector4_vector4array -

- -* *Nodedef*: ND_arrayappend_vector4_vector4array -* *Type*: vector4array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| *out* | vector4array | None | | | | | | | | | | | -

ND_arrayappend_vector4array_vector4array -

- -* *Nodedef*: ND_arrayappend_vector4array_vector4array -* *Type*: vector4array -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector4array | | | | | | | | | | | | -| **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| *out* | vector4array | None | | | | | | | | | | | -

ND_arrayappend_string_stringarray -

- -* *Nodedef*: ND_arrayappend_string_stringarray -* *Type*: stringarray -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | string | | | | | | | | | | | | -| **in2** | string | | | | | | | | | | | | -| *out* | stringarray | None | | | | | | | | | | | -

ND_arrayappend_stringarray_stringarray -

- -* *Nodedef*: ND_arrayappend_stringarray_stringarray -* *Type*: stringarray -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | stringarray | [] | | | | | | | | | | | -| **in2** | string | | | | | | | | | | | | -| *out* | stringarray | None | | | | | | | | | | | ### Category: *trianglewave*

ND_trianglewave_float

@@ -10340,7 +10246,11 @@ graph TB ```mermaid graph TB subgraph NG_smoothstep_color3 + NG_smoothstep_color3_swizzle[swizzle] + NG_smoothstep_color3_swizzle2[swizzle2] + NG_smoothstep_color3_swizzle3[swizzle3] NG_smoothstep_color3_N_smoothstep[N_smoothstep] + NG_smoothstep_color3_swizzle4[swizzle4] style NG_smoothstep_color3_out fill:#0C0, color:#FFF NG_smoothstep_color3_out([out]) style NG_smoothstep_color3_in fill:#09D, color:#FFF @@ -10350,10 +10260,14 @@ graph TB style NG_smoothstep_color3_high fill:#09D, color:#FFF NG_smoothstep_color3_high([high]) end - NG_smoothstep_color3_in --"in"--> NG_smoothstep_color3_N_smoothstep - NG_smoothstep_color3_low --"low"--> NG_smoothstep_color3_N_smoothstep - NG_smoothstep_color3_high --"high"--> NG_smoothstep_color3_N_smoothstep - NG_smoothstep_color3_N_smoothstep --> NG_smoothstep_color3_out + NG_smoothstep_color3_in --"in"--> NG_smoothstep_color3_swizzle + NG_smoothstep_color3_low --"in"--> NG_smoothstep_color3_swizzle2 + NG_smoothstep_color3_high --"in"--> NG_smoothstep_color3_swizzle3 + NG_smoothstep_color3_swizzle --"in"--> NG_smoothstep_color3_N_smoothstep + NG_smoothstep_color3_swizzle2 --"low"--> NG_smoothstep_color3_N_smoothstep + NG_smoothstep_color3_swizzle3 --"high"--> NG_smoothstep_color3_N_smoothstep + NG_smoothstep_color3_N_smoothstep --"in"--> NG_smoothstep_color3_swizzle4 + NG_smoothstep_color3_swizzle4 --> NG_smoothstep_color3_out ``` @@ -10377,7 +10291,11 @@ graph TB ```mermaid graph TB subgraph NG_smoothstep_color4 + NG_smoothstep_color4_swizzle[swizzle] + NG_smoothstep_color4_swizzle2[swizzle2] + NG_smoothstep_color4_swizzle3[swizzle3] NG_smoothstep_color4_N_smoothstep[N_smoothstep] + NG_smoothstep_color4_swizzle4[swizzle4] style NG_smoothstep_color4_out fill:#0C0, color:#FFF NG_smoothstep_color4_out([out]) style NG_smoothstep_color4_in fill:#09D, color:#FFF @@ -10387,10 +10305,14 @@ graph TB style NG_smoothstep_color4_high fill:#09D, color:#FFF NG_smoothstep_color4_high([high]) end - NG_smoothstep_color4_in --"in"--> NG_smoothstep_color4_N_smoothstep - NG_smoothstep_color4_low --"low"--> NG_smoothstep_color4_N_smoothstep - NG_smoothstep_color4_high --"high"--> NG_smoothstep_color4_N_smoothstep - NG_smoothstep_color4_N_smoothstep --> NG_smoothstep_color4_out + NG_smoothstep_color4_in --"in"--> NG_smoothstep_color4_swizzle + NG_smoothstep_color4_low --"in"--> NG_smoothstep_color4_swizzle2 + NG_smoothstep_color4_high --"in"--> NG_smoothstep_color4_swizzle3 + NG_smoothstep_color4_swizzle --"in"--> NG_smoothstep_color4_N_smoothstep + NG_smoothstep_color4_swizzle2 --"low"--> NG_smoothstep_color4_N_smoothstep + NG_smoothstep_color4_swizzle3 --"high"--> NG_smoothstep_color4_N_smoothstep + NG_smoothstep_color4_N_smoothstep --"in"--> NG_smoothstep_color4_swizzle4 + NG_smoothstep_color4_swizzle4 --> NG_smoothstep_color4_out ``` @@ -10465,19 +10387,23 @@ graph TB ```mermaid graph TB subgraph NG_smoothstep_color3FA + NG_smoothstep_color3FA_swizzle[swizzle] + NG_smoothstep_color3FA_swizzle2[swizzle2] NG_smoothstep_color3FA_N_smoothstep[N_smoothstep] style NG_smoothstep_color3FA_out fill:#0C0, color:#FFF NG_smoothstep_color3FA_out([out]) - style NG_smoothstep_color3FA_in fill:#09D, color:#FFF - NG_smoothstep_color3FA_in([in]) style NG_smoothstep_color3FA_low fill:#09D, color:#FFF NG_smoothstep_color3FA_low([low]) style NG_smoothstep_color3FA_high fill:#09D, color:#FFF NG_smoothstep_color3FA_high([high]) + style NG_smoothstep_color3FA_in fill:#09D, color:#FFF + NG_smoothstep_color3FA_in([in]) end + NG_smoothstep_color3FA_low --"in"--> NG_smoothstep_color3FA_swizzle + NG_smoothstep_color3FA_high --"in"--> NG_smoothstep_color3FA_swizzle2 NG_smoothstep_color3FA_in --"in"--> NG_smoothstep_color3FA_N_smoothstep - NG_smoothstep_color3FA_low --"low"--> NG_smoothstep_color3FA_N_smoothstep - NG_smoothstep_color3FA_high --"high"--> NG_smoothstep_color3FA_N_smoothstep + NG_smoothstep_color3FA_swizzle --"low"--> NG_smoothstep_color3FA_N_smoothstep + NG_smoothstep_color3FA_swizzle2 --"high"--> NG_smoothstep_color3FA_N_smoothstep NG_smoothstep_color3FA_N_smoothstep --> NG_smoothstep_color3FA_out ``` @@ -10502,19 +10428,29 @@ graph TB ```mermaid graph TB subgraph NG_smoothstep_color4FA + NG_smoothstep_color4FA_swizzle[swizzle] + NG_smoothstep_color4FA_swizzle2[swizzle2] NG_smoothstep_color4FA_N_smoothstep[N_smoothstep] style NG_smoothstep_color4FA_out fill:#0C0, color:#FFF NG_smoothstep_color4FA_out([out]) - style NG_smoothstep_color4FA_in fill:#09D, color:#FFF - NG_smoothstep_color4FA_in([in]) style NG_smoothstep_color4FA_low fill:#09D, color:#FFF NG_smoothstep_color4FA_low([low]) style NG_smoothstep_color4FA_high fill:#09D, color:#FFF NG_smoothstep_color4FA_high([high]) + style NG_smoothstep_color4FA_in fill:#09D, color:#FFF + NG_smoothstep_color4FA_in([in]) end + NG_smoothstep_color4FA_low --"in1"--> NG_smoothstep_color4FA_swizzle + NG_smoothstep_color4FA_low --"in2"--> NG_smoothstep_color4FA_swizzle + NG_smoothstep_color4FA_low --"in3"--> NG_smoothstep_color4FA_swizzle + NG_smoothstep_color4FA_low --"in4"--> NG_smoothstep_color4FA_swizzle + NG_smoothstep_color4FA_high --"in1"--> NG_smoothstep_color4FA_swizzle2 + NG_smoothstep_color4FA_high --"in2"--> NG_smoothstep_color4FA_swizzle2 + NG_smoothstep_color4FA_high --"in3"--> NG_smoothstep_color4FA_swizzle2 + NG_smoothstep_color4FA_high --"in4"--> NG_smoothstep_color4FA_swizzle2 NG_smoothstep_color4FA_in --"in"--> NG_smoothstep_color4FA_N_smoothstep - NG_smoothstep_color4FA_low --"low"--> NG_smoothstep_color4FA_N_smoothstep - NG_smoothstep_color4FA_high --"high"--> NG_smoothstep_color4FA_N_smoothstep + NG_smoothstep_color4FA_swizzle --"low"--> NG_smoothstep_color4FA_N_smoothstep + NG_smoothstep_color4FA_swizzle2 --"high"--> NG_smoothstep_color4FA_N_smoothstep NG_smoothstep_color4FA_N_smoothstep --> NG_smoothstep_color4FA_out ``` @@ -10539,19 +10475,25 @@ graph TB ```mermaid graph TB subgraph NG_smoothstep_vector2FA + NG_smoothstep_vector2FA_swizzle[swizzle] + NG_smoothstep_vector2FA_swizzle2[swizzle2] NG_smoothstep_vector2FA_N_smoothstep[N_smoothstep] style NG_smoothstep_vector2FA_out fill:#0C0, color:#FFF NG_smoothstep_vector2FA_out([out]) - style NG_smoothstep_vector2FA_in fill:#09D, color:#FFF - NG_smoothstep_vector2FA_in([in]) style NG_smoothstep_vector2FA_low fill:#09D, color:#FFF NG_smoothstep_vector2FA_low([low]) style NG_smoothstep_vector2FA_high fill:#09D, color:#FFF NG_smoothstep_vector2FA_high([high]) + style NG_smoothstep_vector2FA_in fill:#09D, color:#FFF + NG_smoothstep_vector2FA_in([in]) end + NG_smoothstep_vector2FA_low --"in1"--> NG_smoothstep_vector2FA_swizzle + NG_smoothstep_vector2FA_low --"in2"--> NG_smoothstep_vector2FA_swizzle + NG_smoothstep_vector2FA_high --"in1"--> NG_smoothstep_vector2FA_swizzle2 + NG_smoothstep_vector2FA_high --"in2"--> NG_smoothstep_vector2FA_swizzle2 NG_smoothstep_vector2FA_in --"in"--> NG_smoothstep_vector2FA_N_smoothstep - NG_smoothstep_vector2FA_low --"low"--> NG_smoothstep_vector2FA_N_smoothstep - NG_smoothstep_vector2FA_high --"high"--> NG_smoothstep_vector2FA_N_smoothstep + NG_smoothstep_vector2FA_swizzle --"low"--> NG_smoothstep_vector2FA_N_smoothstep + NG_smoothstep_vector2FA_swizzle2 --"high"--> NG_smoothstep_vector2FA_N_smoothstep NG_smoothstep_vector2FA_N_smoothstep --> NG_smoothstep_vector2FA_out ``` @@ -10576,19 +10518,23 @@ graph TB ```mermaid graph TB subgraph NG_smoothstep_vector3FA + NG_smoothstep_vector3FA_swizzle[swizzle] + NG_smoothstep_vector3FA_swizzle2[swizzle2] NG_smoothstep_vector3FA_N_smoothstep[N_smoothstep] style NG_smoothstep_vector3FA_out fill:#0C0, color:#FFF NG_smoothstep_vector3FA_out([out]) - style NG_smoothstep_vector3FA_in fill:#09D, color:#FFF - NG_smoothstep_vector3FA_in([in]) style NG_smoothstep_vector3FA_low fill:#09D, color:#FFF NG_smoothstep_vector3FA_low([low]) style NG_smoothstep_vector3FA_high fill:#09D, color:#FFF NG_smoothstep_vector3FA_high([high]) + style NG_smoothstep_vector3FA_in fill:#09D, color:#FFF + NG_smoothstep_vector3FA_in([in]) end + NG_smoothstep_vector3FA_low --"in"--> NG_smoothstep_vector3FA_swizzle + NG_smoothstep_vector3FA_high --"in"--> NG_smoothstep_vector3FA_swizzle2 NG_smoothstep_vector3FA_in --"in"--> NG_smoothstep_vector3FA_N_smoothstep - NG_smoothstep_vector3FA_low --"low"--> NG_smoothstep_vector3FA_N_smoothstep - NG_smoothstep_vector3FA_high --"high"--> NG_smoothstep_vector3FA_N_smoothstep + NG_smoothstep_vector3FA_swizzle --"low"--> NG_smoothstep_vector3FA_N_smoothstep + NG_smoothstep_vector3FA_swizzle2 --"high"--> NG_smoothstep_vector3FA_N_smoothstep NG_smoothstep_vector3FA_N_smoothstep --> NG_smoothstep_vector3FA_out ``` @@ -10613,19 +10559,29 @@ graph TB ```mermaid graph TB subgraph NG_smoothstep_vector4FA + NG_smoothstep_vector4FA_swizzle[swizzle] + NG_smoothstep_vector4FA_swizzle2[swizzle2] NG_smoothstep_vector4FA_N_smoothstep[N_smoothstep] style NG_smoothstep_vector4FA_out fill:#0C0, color:#FFF NG_smoothstep_vector4FA_out([out]) - style NG_smoothstep_vector4FA_in fill:#09D, color:#FFF - NG_smoothstep_vector4FA_in([in]) style NG_smoothstep_vector4FA_low fill:#09D, color:#FFF NG_smoothstep_vector4FA_low([low]) style NG_smoothstep_vector4FA_high fill:#09D, color:#FFF NG_smoothstep_vector4FA_high([high]) + style NG_smoothstep_vector4FA_in fill:#09D, color:#FFF + NG_smoothstep_vector4FA_in([in]) end + NG_smoothstep_vector4FA_low --"in1"--> NG_smoothstep_vector4FA_swizzle + NG_smoothstep_vector4FA_low --"in2"--> NG_smoothstep_vector4FA_swizzle + NG_smoothstep_vector4FA_low --"in3"--> NG_smoothstep_vector4FA_swizzle + NG_smoothstep_vector4FA_low --"in4"--> NG_smoothstep_vector4FA_swizzle + NG_smoothstep_vector4FA_high --"in1"--> NG_smoothstep_vector4FA_swizzle2 + NG_smoothstep_vector4FA_high --"in2"--> NG_smoothstep_vector4FA_swizzle2 + NG_smoothstep_vector4FA_high --"in3"--> NG_smoothstep_vector4FA_swizzle2 + NG_smoothstep_vector4FA_high --"in4"--> NG_smoothstep_vector4FA_swizzle2 NG_smoothstep_vector4FA_in --"in"--> NG_smoothstep_vector4FA_N_smoothstep - NG_smoothstep_vector4FA_low --"low"--> NG_smoothstep_vector4FA_N_smoothstep - NG_smoothstep_vector4FA_high --"high"--> NG_smoothstep_vector4FA_N_smoothstep + NG_smoothstep_vector4FA_swizzle --"low"--> NG_smoothstep_vector4FA_N_smoothstep + NG_smoothstep_vector4FA_swizzle2 --"high"--> NG_smoothstep_vector4FA_N_smoothstep NG_smoothstep_vector4FA_N_smoothstep --> NG_smoothstep_vector4FA_out ``` @@ -13421,6 +13377,24 @@ graph TB | **in1** | float | 0.0 | | | | | | | | | | | | **in2** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | +

ND_ifgreater_integer +

+ +* *Nodedef*: ND_ifgreater_integer +* *Type*: integer +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | float | 1.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | |

ND_ifgreater_color3

@@ -13511,11 +13485,11 @@ graph TB | **in1** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | -

ND_ifgreater_floatI +
ND_ifgreater_matrix33

-* *Nodedef*: ND_ifgreater_floatI -* *Type*: float +* *Nodedef*: ND_ifgreater_matrix33 +* *Type*: matrix33 * *Group*: conditional * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED @@ -13524,11 +13498,65 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **value1** | integer | 1 | | | | | | | | | | | -| **value2** | integer | 0 | | | | | | | | | | | +| **value1** | float | 1.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +

ND_ifgreater_matrix44 +

+ +* *Nodedef*: ND_ifgreater_matrix44 +* *Type*: matrix44 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | float | 1.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | | +

ND_ifgreater_floatI +

+ +* *Nodedef*: ND_ifgreater_floatI +* *Type*: float +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | integer | 1 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | | **in1** | float | 0.0 | | | | | | | | | | | | **in2** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | +

ND_ifgreater_integerI +

+ +* *Nodedef*: ND_ifgreater_integerI +* *Type*: integer +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | integer | 1 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | |

ND_ifgreater_color3I

@@ -13619,6 +13647,42 @@ graph TB | **in1** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | +

ND_ifgreater_matrix33I +

+ +* *Nodedef*: ND_ifgreater_matrix33I +* *Type*: matrix33 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | integer | 1 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +

ND_ifgreater_matrix44I +

+ +* *Nodedef*: ND_ifgreater_matrix44I +* *Type*: matrix44 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | integer | 1 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | | ### Category: *ifgreatereq*

ND_ifgreatereq_float

@@ -13638,6 +13702,24 @@ graph TB | **in1** | float | 0.0 | | | | | | | | | | | | **in2** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | +

ND_ifgreatereq_integer +

+ +* *Nodedef*: ND_ifgreatereq_integer +* *Type*: integer +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | float | 1.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | |

ND_ifgreatereq_color3

@@ -13728,6 +13810,42 @@ graph TB | **in1** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | +

ND_ifgreatereq_matrix33 +

+ +* *Nodedef*: ND_ifgreatereq_matrix33 +* *Type*: matrix33 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | float | 1.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +

ND_ifgreatereq_matrix44 +

+ +* *Nodedef*: ND_ifgreatereq_matrix44 +* *Type*: matrix44 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | float | 1.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | |

ND_ifgreatereq_floatI

@@ -13746,6 +13864,24 @@ graph TB | **in1** | float | 0.0 | | | | | | | | | | | | **in2** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | +

ND_ifgreatereq_integerI +

+ +* *Nodedef*: ND_ifgreatereq_integerI +* *Type*: integer +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | integer | 1 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | |

ND_ifgreatereq_color3I

@@ -13836,6 +13972,42 @@ graph TB | **in1** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | +

ND_ifgreatereq_matrix33I +

+ +* *Nodedef*: ND_ifgreatereq_matrix33I +* *Type*: matrix33 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | integer | 1 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +

ND_ifgreatereq_matrix44I +

+ +* *Nodedef*: ND_ifgreatereq_matrix44I +* *Type*: matrix44 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | integer | 1 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | | ### Category: *ifequal*

ND_ifequal_float

@@ -13855,6 +14027,24 @@ graph TB | **in1** | float | 0.0 | | | | | | | | | | | | **in2** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | +

ND_ifequal_integer +

+ +* *Nodedef*: ND_ifequal_integer +* *Type*: integer +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | float | 0.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | |

ND_ifequal_color3

@@ -13945,6 +14135,42 @@ graph TB | **in1** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | +

ND_ifequal_matrix33 +

+ +* *Nodedef*: ND_ifequal_matrix33 +* *Type*: matrix33 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | float | 0.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +

ND_ifequal_matrix44 +

+ +* *Nodedef*: ND_ifequal_matrix44 +* *Type*: matrix44 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | float | 0.0 | | | | | | | | | | | +| **value2** | float | 0.0 | | | | | | | | | | | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | |

ND_ifequal_floatI

@@ -13963,6 +14189,24 @@ graph TB | **in1** | float | 0.0 | | | | | | | | | | | | **in2** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | | +

ND_ifequal_integerI +

+ +* *Nodedef*: ND_ifequal_integerI +* *Type*: integer +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | integer | 0 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | |

ND_ifequal_color3I

@@ -14053,11 +14297,11 @@ graph TB | **in1** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | -

ND_ifequal_floatB +
ND_ifequal_matrix33I

-* *Nodedef*: ND_ifequal_floatB -* *Type*: float +* *Nodedef*: ND_ifequal_matrix33I +* *Type*: matrix33 * *Group*: conditional * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED @@ -14066,16 +14310,16 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **value1** | boolean | False | | | | | | | | | | | -| **value2** | boolean | False | | | | | | | | | | | -| **in1** | float | 0.0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| *out* | float | None | | | | | | | | | | | -

ND_ifequal_color3B +| **value1** | integer | 0 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +
ND_ifequal_matrix44I

-* *Nodedef*: ND_ifequal_color3B -* *Type*: color3 +* *Nodedef*: ND_ifequal_matrix44I +* *Type*: matrix44 * *Group*: conditional * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED @@ -14084,11 +14328,65 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **value1** | boolean | False | | | | | | | | | | | -| **value2** | boolean | False | | | | | | | | | | | -| **in1** | color3 | 0, 0, 0 | | | | | | | | | | | -| **in2** | color3 | 0, 0, 0 | | | | | | | | | | | -| *out* | color3 | None | | | | | | | | | | | +| **value1** | integer | 0 | | | | | | | | | | | +| **value2** | integer | 0 | | | | | | | | | | | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | | +

ND_ifequal_floatB +

+ +* *Nodedef*: ND_ifequal_floatB +* *Type*: float +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | boolean | False | | | | | | | | | | | +| **value2** | boolean | False | | | | | | | | | | | +| **in1** | float | 0.0 | | | | | | | | | | | +| **in2** | float | 0.0 | | | | | | | | | | | +| *out* | float | None | | | | | | | | | | | +

ND_ifequal_integerB +

+ +* *Nodedef*: ND_ifequal_integerB +* *Type*: integer +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | boolean | False | | | | | | | | | | | +| **value2** | boolean | False | | | | | | | | | | | +| **in1** | integer | 0 | | | | | | | | | | | +| **in2** | integer | 0 | | | | | | | | | | | +| *out* | integer | None | | | | | | | | | | | +

ND_ifequal_color3B +

+ +* *Nodedef*: ND_ifequal_color3B +* *Type*: color3 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | boolean | False | | | | | | | | | | | +| **value2** | boolean | False | | | | | | | | | | | +| **in1** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in2** | color3 | 0, 0, 0 | | | | | | | | | | | +| *out* | color3 | None | | | | | | | | | | |

ND_ifequal_color4B

@@ -14161,6 +14459,42 @@ graph TB | **in1** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in2** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | +

ND_ifequal_matrix33B +

+ +* *Nodedef*: ND_ifequal_matrix33B +* *Type*: matrix33 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | boolean | False | | | | | | | | | | | +| **value2** | boolean | False | | | | | | | | | | | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +

ND_ifequal_matrix44B +

+ +* *Nodedef*: ND_ifequal_matrix44B +* *Type*: matrix44 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **value1** | boolean | False | | | | | | | | | | | +| **value2** | boolean | False | | | | | | | | | | | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | | ### Category: *switch*

ND_switch_float

@@ -14180,6 +14514,11 @@ graph TB | **in3** | float | 0.0 | | | | | | | | | | | | **in4** | float | 0.0 | | | | | | | | | | | | **in5** | float | 0.0 | | | | | | | | | | | +| **in6** | float | 0.0 | | | | | | | | | | | +| **in7** | float | 0.0 | | | | | | | | | | | +| **in8** | float | 0.0 | | | | | | | | | | | +| **in9** | float | 0.0 | | | | | | | | | | | +| **in10** | float | 0.0 | | | | | | | | | | | | **which** | float | 0.0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | |

ND_switch_color3 @@ -14200,6 +14539,11 @@ graph TB | **in3** | color3 | 0, 0, 0 | | | | | | | | | | | | **in4** | color3 | 0, 0, 0 | | | | | | | | | | | | **in5** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in6** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in7** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in8** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in9** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in10** | color3 | 0, 0, 0 | | | | | | | | | | | | **which** | float | 0.0 | | | | | | | | | | | | *out* | color3 | None | | | | | | | | | | |
ND_switch_color4 @@ -14220,6 +14564,11 @@ graph TB | **in3** | color4 | 0, 0, 0, 0 | | | | | | | | | | | | **in4** | color4 | 0, 0, 0, 0 | | | | | | | | | | | | **in5** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in6** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in7** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in8** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in9** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in10** | color4 | 0, 0, 0, 0 | | | | | | | | | | | | **which** | float | 0.0 | | | | | | | | | | | | *out* | color4 | None | | | | | | | | | | |
ND_switch_vector2 @@ -14240,6 +14589,11 @@ graph TB | **in3** | vector2 | 0, 0 | | | | | | | | | | | | **in4** | vector2 | 0, 0 | | | | | | | | | | | | **in5** | vector2 | 0, 0 | | | | | | | | | | | +| **in6** | vector2 | 0, 0 | | | | | | | | | | | +| **in7** | vector2 | 0, 0 | | | | | | | | | | | +| **in8** | vector2 | 0, 0 | | | | | | | | | | | +| **in9** | vector2 | 0, 0 | | | | | | | | | | | +| **in10** | vector2 | 0, 0 | | | | | | | | | | | | **which** | float | 0.0 | | | | | | | | | | | | *out* | vector2 | None | | | | | | | | | | |
ND_switch_vector3 @@ -14260,6 +14614,11 @@ graph TB | **in3** | vector3 | 0, 0, 0 | | | | | | | | | | | | **in4** | vector3 | 0, 0, 0 | | | | | | | | | | | | **in5** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in6** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in7** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in8** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in9** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in10** | vector3 | 0, 0, 0 | | | | | | | | | | | | **which** | float | 0.0 | | | | | | | | | | | | *out* | vector3 | None | | | | | | | | | | |
ND_switch_vector4 @@ -14280,8 +14639,63 @@ graph TB | **in3** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in4** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in5** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in6** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in7** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in8** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in9** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in10** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **which** | float | 0.0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | +
ND_switch_matrix33 +

+ +* *Nodedef*: ND_switch_matrix33 +* *Type*: matrix33 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in3** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in4** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in5** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in6** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in7** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in8** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in9** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in10** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **which** | float | 0.0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +

ND_switch_matrix44 +

+ +* *Nodedef*: ND_switch_matrix44 +* *Type*: matrix44 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in3** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in4** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in5** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in6** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in7** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in8** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in9** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in10** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **which** | float | 0.0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | |

ND_switch_floatI

@@ -14300,6 +14714,11 @@ graph TB | **in3** | float | 0.0 | | | | | | | | | | | | **in4** | float | 0.0 | | | | | | | | | | | | **in5** | float | 0.0 | | | | | | | | | | | +| **in6** | float | 0.0 | | | | | | | | | | | +| **in7** | float | 0.0 | | | | | | | | | | | +| **in8** | float | 0.0 | | | | | | | | | | | +| **in9** | float | 0.0 | | | | | | | | | | | +| **in10** | float | 0.0 | | | | | | | | | | | | **which** | integer | 0 | | | | | | | | | | | | *out* | float | None | | | | | | | | | | |

ND_switch_color3I @@ -14320,6 +14739,11 @@ graph TB | **in3** | color3 | 0, 0, 0 | | | | | | | | | | | | **in4** | color3 | 0, 0, 0 | | | | | | | | | | | | **in5** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in6** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in7** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in8** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in9** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in10** | color3 | 0, 0, 0 | | | | | | | | | | | | **which** | integer | 0 | | | | | | | | | | | | *out* | color3 | None | | | | | | | | | | |
ND_switch_color4I @@ -14340,6 +14764,11 @@ graph TB | **in3** | color4 | 0, 0, 0, 0 | | | | | | | | | | | | **in4** | color4 | 0, 0, 0, 0 | | | | | | | | | | | | **in5** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in6** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in7** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in8** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in9** | color4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in10** | color4 | 0, 0, 0, 0 | | | | | | | | | | | | **which** | integer | 0 | | | | | | | | | | | | *out* | color4 | None | | | | | | | | | | |
ND_switch_vector2I @@ -14360,6 +14789,11 @@ graph TB | **in3** | vector2 | 0, 0 | | | | | | | | | | | | **in4** | vector2 | 0, 0 | | | | | | | | | | | | **in5** | vector2 | 0, 0 | | | | | | | | | | | +| **in6** | vector2 | 0, 0 | | | | | | | | | | | +| **in7** | vector2 | 0, 0 | | | | | | | | | | | +| **in8** | vector2 | 0, 0 | | | | | | | | | | | +| **in9** | vector2 | 0, 0 | | | | | | | | | | | +| **in10** | vector2 | 0, 0 | | | | | | | | | | | | **which** | integer | 0 | | | | | | | | | | | | *out* | vector2 | None | | | | | | | | | | |
ND_switch_vector3I @@ -14380,6 +14814,11 @@ graph TB | **in3** | vector3 | 0, 0, 0 | | | | | | | | | | | | **in4** | vector3 | 0, 0, 0 | | | | | | | | | | | | **in5** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in6** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in7** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in8** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in9** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in10** | vector3 | 0, 0, 0 | | | | | | | | | | | | **which** | integer | 0 | | | | | | | | | | | | *out* | vector3 | None | | | | | | | | | | |
ND_switch_vector4I @@ -14400,8 +14839,63 @@ graph TB | **in3** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in4** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **in5** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in6** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in7** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in8** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in9** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | +| **in10** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | | **which** | integer | 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | +
ND_switch_matrix33I +

+ +* *Nodedef*: ND_switch_matrix33I +* *Type*: matrix33 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **in1** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in3** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in4** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in5** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in6** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in7** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in8** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in9** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in10** | matrix33 | 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **which** | integer | 0 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +

ND_switch_matrix44I +

+ +* *Nodedef*: ND_switch_matrix44I +* *Type*: matrix44 +* *Group*: conditional +* *Version*: 1.0. Is default: False +* *Doc*: UNDOCUMENTED +* *Implementation*: Non-graph + + +| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | +| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | +| **in1** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in2** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in3** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in4** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in5** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in6** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in7** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in8** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in9** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **in10** | matrix44 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 | | | | | | | | | | | +| **which** | integer | 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | | ### Category: *convert*

ND_convert_float_color3

@@ -14918,12 +15412,12 @@ graph TB | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | | **in** | boolean | False | | | | | | | | | | | | *out* | surfaceshader | None | | | | | | | | | | | -### Category: *swizzle* -

ND_swizzle_float_color3 +### Category: *combine2* +
ND_combine2_vector2

-* *Nodedef*: ND_swizzle_float_color3 -* *Type*: color3 +* *Nodedef*: ND_combine2_vector2 +* *Type*: vector2 * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED @@ -14932,13 +15426,13 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | float | 0.0 | | | | | | | | | | | -| **channels** | string | rrr | | | | | | | | | | true | -| *out* | color3 | None | | | | | | | | | | | -

ND_swizzle_float_color4 +| **in1** | float | 0.0 | | | | | | | | | | | +| **in2** | float | 0.0 | | | | | | | | | | | +| *out* | vector2 | None | | | | | | | | | | | +
ND_combine2_color4CF

-* *Nodedef*: ND_swizzle_float_color4 +* *Nodedef*: ND_combine2_color4CF * *Type*: color4 * *Group*: channel * *Version*: 1.0. Is default: False @@ -14948,30 +15442,14 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | float | 0.0 | | | | | | | | | | | -| **channels** | string | rrrr | | | | | | | | | | true | +| **in1** | color3 | 0, 0, 0 | | | | | | | | | | | +| **in2** | float | 0.0 | | | | | | | | | | | | *out* | color4 | None | | | | | | | | | | | -

ND_swizzle_float_vector2 -

- -* *Nodedef*: ND_swizzle_float_vector2 -* *Type*: vector2 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | float | 0.0 | | | | | | | | | | | -| **channels** | string | xx | | | | | | | | | | true | -| *out* | vector2 | None | | | | | | | | | | | -

ND_swizzle_float_vector3 +
ND_combine2_vector4VF

-* *Nodedef*: ND_swizzle_float_vector3 -* *Type*: vector3 +* *Nodedef*: ND_combine2_vector4VF +* *Type*: vector4 * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED @@ -14980,13 +15458,13 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | float | 0.0 | | | | | | | | | | | -| **channels** | string | xxx | | | | | | | | | | true | -| *out* | vector3 | None | | | | | | | | | | | -

ND_swizzle_float_vector4 +| **in1** | vector3 | 0, 0, 0 | | | | | | | | | | | +| **in2** | float | 0.0 | | | | | | | | | | | +| *out* | vector4 | None | | | | | | | | | | | +
ND_combine2_vector4VV

-* *Nodedef*: ND_swizzle_float_vector4 +* *Nodedef*: ND_combine2_vector4VV * *Type*: vector4 * *Group*: channel * *Version*: 1.0. Is default: False @@ -14996,14 +15474,15 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | float | 0.0 | | | | | | | | | | | -| **channels** | string | xxxx | | | | | | | | | | true | +| **in1** | vector2 | 0, 0 | | | | | | | | | | | +| **in2** | vector2 | 0, 0 | | | | | | | | | | | | *out* | vector4 | None | | | | | | | | | | | -

ND_swizzle_color3_float +### Category: *combine3* +
ND_combine3_color3

-* *Nodedef*: ND_swizzle_color3_float -* *Type*: float +* *Nodedef*: ND_combine3_color3 +* *Type*: color3 * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED @@ -15012,14 +15491,15 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | r | | | | | | | | | | true | -| *out* | float | None | | | | | | | | | | | -

ND_swizzle_color3_color3 +| **in1** | float | 0.0 | | | | | | | | | | | +| **in2** | float | 0.0 | | | | | | | | | | | +| **in3** | float | 0.0 | | | | | | | | | | | +| *out* | color3 | None | | | | | | | | | | | +
ND_combine3_vector3

-* *Nodedef*: ND_swizzle_color3_color3 -* *Type*: color3 +* *Nodedef*: ND_combine3_vector3 +* *Type*: vector3 * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED @@ -15028,13 +15508,15 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rrr | | | | | | | | | | true | -| *out* | color3 | None | | | | | | | | | | | -

ND_swizzle_color3_color4 +| **in1** | float | 0.0 | | | | | | | | | | | +| **in2** | float | 0.0 | | | | | | | | | | | +| **in3** | float | 0.0 | | | | | | | | | | | +| *out* | vector3 | None | | | | | | | | | | | +### Category: *combine4* +
ND_combine4_color4

-* *Nodedef*: ND_swizzle_color3_color4 +* *Nodedef*: ND_combine4_color4 * *Type*: color4 * *Group*: channel * *Version*: 1.0. Is default: False @@ -15044,14 +15526,16 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rrrr | | | | | | | | | | true | +| **in1** | float | 0.0 | | | | | | | | | | | +| **in2** | float | 0.0 | | | | | | | | | | | +| **in3** | float | 0.0 | | | | | | | | | | | +| **in4** | float | 0.0 | | | | | | | | | | | | *out* | color4 | None | | | | | | | | | | | -

ND_swizzle_color3_vector2 +
ND_combine4_vector4

-* *Nodedef*: ND_swizzle_color3_vector2 -* *Type*: vector2 +* *Nodedef*: ND_combine4_vector4 +* *Type*: vector4 * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED @@ -15060,15 +15544,18 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rr | | | | | | | | | | true | -| *out* | vector2 | None | | | | | | | | | | | -

ND_swizzle_color3_vector3 +| **in1** | float | 0.0 | | | | | | | | | | | +| **in2** | float | 0.0 | | | | | | | | | | | +| **in3** | float | 0.0 | | | | | | | | | | | +| **in4** | float | 0.0 | | | | | | | | | | | +| *out* | vector4 | None | | | | | | | | | | | +### Category: *creatematrix* +
ND_creatematrix_vector3_matrix33

-* *Nodedef*: ND_swizzle_color3_vector3 -* *Type*: vector3 -* *Group*: channel +* *Nodedef*: ND_creatematrix_vector3_matrix33 +* *Type*: matrix33 +* *Group*: math * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED * *Implementation*: Non-graph @@ -15076,15 +15563,16 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rrr | | | | | | | | | | true | -| *out* | vector3 | None | | | | | | | | | | | -

ND_swizzle_color3_vector4 +| **in1** | vector3 | 1, 0, 0 | | | | | | | | | | | +| **in2** | vector3 | 0, 1, 0 | | | | | | | | | | | +| **in3** | vector3 | 0, 0, 1 | | | | | | | | | | | +| *out* | matrix33 | None | | | | | | | | | | | +
ND_creatematrix_vector3_matrix44

-* *Nodedef*: ND_swizzle_color3_vector4 -* *Type*: vector4 -* *Group*: channel +* *Nodedef*: ND_creatematrix_vector3_matrix44 +* *Type*: matrix44 +* *Group*: math * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED * *Implementation*: Non-graph @@ -15092,572 +15580,17 @@ graph TB | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rrrr | | | | | | | | | | true | -| *out* | vector4 | None | | | | | | | | | | | -

ND_swizzle_color4_float +| **in1** | vector3 | 1, 0, 0 | | | | | | | | | | | +| **in2** | vector3 | 0, 1, 0 | | | | | | | | | | | +| **in3** | vector3 | 0, 0, 1 | | | | | | | | | | | +| **in4** | vector3 | 0, 0, 0 | | | | | | | | | | | +| *out* | matrix44 | None | | | | | | | | | | | +
ND_creatematrix_vector4_matrix44

-* *Nodedef*: ND_swizzle_color4_float -* *Type*: float -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | r | | | | | | | | | | true | -| *out* | float | None | | | | | | | | | | | -

ND_swizzle_color4_color3 -

- -* *Nodedef*: ND_swizzle_color4_color3 -* *Type*: color3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rrr | | | | | | | | | | true | -| *out* | color3 | None | | | | | | | | | | | -

ND_swizzle_color4_color4 -

- -* *Nodedef*: ND_swizzle_color4_color4 -* *Type*: color4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rrrr | | | | | | | | | | true | -| *out* | color4 | None | | | | | | | | | | | -

ND_swizzle_color4_vector2 -

- -* *Nodedef*: ND_swizzle_color4_vector2 -* *Type*: vector2 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rr | | | | | | | | | | true | -| *out* | vector2 | None | | | | | | | | | | | -

ND_swizzle_color4_vector3 -

- -* *Nodedef*: ND_swizzle_color4_vector3 -* *Type*: vector3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rrr | | | | | | | | | | true | -| *out* | vector3 | None | | | | | | | | | | | -

ND_swizzle_color4_vector4 -

- -* *Nodedef*: ND_swizzle_color4_vector4 -* *Type*: vector4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | color4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | rrrr | | | | | | | | | | true | -| *out* | vector4 | None | | | | | | | | | | | -

ND_swizzle_vector2_float -

- -* *Nodedef*: ND_swizzle_vector2_float -* *Type*: float -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector2 | 0, 0 | | | | | | | | | | | -| **channels** | string | x | | | | | | | | | | true | -| *out* | float | None | | | | | | | | | | | -

ND_swizzle_vector2_color3 -

- -* *Nodedef*: ND_swizzle_vector2_color3 -* *Type*: color3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector2 | 0, 0 | | | | | | | | | | | -| **channels** | string | xxx | | | | | | | | | | true | -| *out* | color3 | None | | | | | | | | | | | -

ND_swizzle_vector2_color4 -

- -* *Nodedef*: ND_swizzle_vector2_color4 -* *Type*: color4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector2 | 0, 0 | | | | | | | | | | | -| **channels** | string | xxxx | | | | | | | | | | true | -| *out* | color4 | None | | | | | | | | | | | -

ND_swizzle_vector2_vector2 -

- -* *Nodedef*: ND_swizzle_vector2_vector2 -* *Type*: vector2 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector2 | 0, 0 | | | | | | | | | | | -| **channels** | string | xx | | | | | | | | | | true | -| *out* | vector2 | None | | | | | | | | | | | -

ND_swizzle_vector2_vector3 -

- -* *Nodedef*: ND_swizzle_vector2_vector3 -* *Type*: vector3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector2 | 0, 0 | | | | | | | | | | | -| **channels** | string | xxx | | | | | | | | | | true | -| *out* | vector3 | None | | | | | | | | | | | -

ND_swizzle_vector2_vector4 -

- -* *Nodedef*: ND_swizzle_vector2_vector4 -* *Type*: vector4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector2 | 0, 0 | | | | | | | | | | | -| **channels** | string | xxxx | | | | | | | | | | true | -| *out* | vector4 | None | | | | | | | | | | | -

ND_swizzle_vector3_float -

- -* *Nodedef*: ND_swizzle_vector3_float -* *Type*: float -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | x | | | | | | | | | | true | -| *out* | float | None | | | | | | | | | | | -

ND_swizzle_vector3_color3 -

- -* *Nodedef*: ND_swizzle_vector3_color3 -* *Type*: color3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xxx | | | | | | | | | | true | -| *out* | color3 | None | | | | | | | | | | | -

ND_swizzle_vector3_color4 -

- -* *Nodedef*: ND_swizzle_vector3_color4 -* *Type*: color4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xxxx | | | | | | | | | | true | -| *out* | color4 | None | | | | | | | | | | | -

ND_swizzle_vector3_vector2 -

- -* *Nodedef*: ND_swizzle_vector3_vector2 -* *Type*: vector2 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xx | | | | | | | | | | true | -| *out* | vector2 | None | | | | | | | | | | | -

ND_swizzle_vector3_vector3 -

- -* *Nodedef*: ND_swizzle_vector3_vector3 -* *Type*: vector3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xxx | | | | | | | | | | true | -| *out* | vector3 | None | | | | | | | | | | | -

ND_swizzle_vector3_vector4 -

- -* *Nodedef*: ND_swizzle_vector3_vector4 -* *Type*: vector4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector3 | 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xxxx | | | | | | | | | | true | -| *out* | vector4 | None | | | | | | | | | | | -

ND_swizzle_vector4_float -

- -* *Nodedef*: ND_swizzle_vector4_float -* *Type*: float -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | x | | | | | | | | | | true | -| *out* | float | None | | | | | | | | | | | -

ND_swizzle_vector4_color3 -

- -* *Nodedef*: ND_swizzle_vector4_color3 -* *Type*: color3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xxx | | | | | | | | | | true | -| *out* | color3 | None | | | | | | | | | | | -

ND_swizzle_vector4_color4 -

- -* *Nodedef*: ND_swizzle_vector4_color4 -* *Type*: color4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xxxx | | | | | | | | | | true | -| *out* | color4 | None | | | | | | | | | | | -

ND_swizzle_vector4_vector2 -

- -* *Nodedef*: ND_swizzle_vector4_vector2 -* *Type*: vector2 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xx | | | | | | | | | | true | -| *out* | vector2 | None | | | | | | | | | | | -

ND_swizzle_vector4_vector3 -

- -* *Nodedef*: ND_swizzle_vector4_vector3 -* *Type*: vector3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xxx | | | | | | | | | | true | -| *out* | vector3 | None | | | | | | | | | | | -

ND_swizzle_vector4_vector4 -

- -* *Nodedef*: ND_swizzle_vector4_vector4 -* *Type*: vector4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in** | vector4 | 0, 0, 0, 0 | | | | | | | | | | | -| **channels** | string | xxxx | | | | | | | | | | true | -| *out* | vector4 | None | | | | | | | | | | | -### Category: *combine2* -

ND_combine2_vector2 -

- -* *Nodedef*: ND_combine2_vector2 -* *Type*: vector2 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | float | 0.0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| *out* | vector2 | None | | | | | | | | | | | -

ND_combine2_color4CF -

- -* *Nodedef*: ND_combine2_color4CF -* *Type*: color4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | color3 | 0, 0, 0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| *out* | color4 | None | | | | | | | | | | | -

ND_combine2_vector4VF -

- -* *Nodedef*: ND_combine2_vector4VF -* *Type*: vector4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector3 | 0, 0, 0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| *out* | vector4 | None | | | | | | | | | | | -

ND_combine2_vector4VV -

- -* *Nodedef*: ND_combine2_vector4VV -* *Type*: vector4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector2 | 0, 0 | | | | | | | | | | | -| **in2** | vector2 | 0, 0 | | | | | | | | | | | -| *out* | vector4 | None | | | | | | | | | | | -### Category: *combine3* -

ND_combine3_color3 -

- -* *Nodedef*: ND_combine3_color3 -* *Type*: color3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | float | 0.0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| **in3** | float | 0.0 | | | | | | | | | | | -| *out* | color3 | None | | | | | | | | | | | -

ND_combine3_vector3 -

- -* *Nodedef*: ND_combine3_vector3 -* *Type*: vector3 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | float | 0.0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| **in3** | float | 0.0 | | | | | | | | | | | -| *out* | vector3 | None | | | | | | | | | | | -### Category: *combine4* -

ND_combine4_color4 -

- -* *Nodedef*: ND_combine4_color4 -* *Type*: color4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | float | 0.0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| **in3** | float | 0.0 | | | | | | | | | | | -| **in4** | float | 0.0 | | | | | | | | | | | -| *out* | color4 | None | | | | | | | | | | | -

ND_combine4_vector4 -

- -* *Nodedef*: ND_combine4_vector4 -* *Type*: vector4 -* *Group*: channel -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | float | 0.0 | | | | | | | | | | | -| **in2** | float | 0.0 | | | | | | | | | | | -| **in3** | float | 0.0 | | | | | | | | | | | -| **in4** | float | 0.0 | | | | | | | | | | | -| *out* | vector4 | None | | | | | | | | | | | -### Category: *creatematrix* -

ND_creatematrix_vector3_matrix33 -

- -* *Nodedef*: ND_creatematrix_vector3_matrix33 -* *Type*: matrix33 -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector3 | 1, 0, 0 | | | | | | | | | | | -| **in2** | vector3 | 0, 1, 0 | | | | | | | | | | | -| **in3** | vector3 | 0, 0, 1 | | | | | | | | | | | -| *out* | matrix33 | None | | | | | | | | | | | -

ND_creatematrix_vector3_matrix44 -

- -* *Nodedef*: ND_creatematrix_vector3_matrix44 -* *Type*: matrix44 -* *Group*: math -* *Version*: 1.0. Is default: False -* *Doc*: UNDOCUMENTED -* *Implementation*: Non-graph - - -| Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | -| ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | -| **in1** | vector3 | 1, 0, 0 | | | | | | | | | | | -| **in2** | vector3 | 0, 1, 0 | | | | | | | | | | | -| **in3** | vector3 | 0, 0, 1 | | | | | | | | | | | -| **in4** | vector3 | 0, 0, 0 | | | | | | | | | | | -| *out* | matrix44 | None | | | | | | | | | | | -

ND_creatematrix_vector4_matrix44 -

- -* *Nodedef*: ND_creatematrix_vector4_matrix44 -* *Type*: matrix44 -* *Group*: math +* *Nodedef*: ND_creatematrix_vector4_matrix44 +* *Type*: matrix44 +* *Group*: math * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED * *Implementation*: Non-graph @@ -15679,33 +15612,7 @@ graph TB * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED -* *Nodegraph*: NG_extract_color3 - - -```mermaid -graph TB - subgraph NG_extract_color3 - NG_extract_color3_N_r_color3[N_r_color3] - NG_extract_color3_N_g_color3[N_g_color3] - NG_extract_color3_N_b_color3[N_b_color3] - style NG_extract_color3_N_sw_color3 fill:#C72, color:#FFF - NG_extract_color3_N_sw_color3{N_sw_color3} - style NG_extract_color3_out fill:#0C0, color:#FFF - NG_extract_color3_out([out]) - style NG_extract_color3_in fill:#09D, color:#FFF - NG_extract_color3_in([in]) - style NG_extract_color3_index fill:#09D, color:#FFF - NG_extract_color3_index([index]) - end - NG_extract_color3_in --"in"--> NG_extract_color3_N_r_color3 - NG_extract_color3_in --"in"--> NG_extract_color3_N_g_color3 - NG_extract_color3_in --"in"--> NG_extract_color3_N_b_color3 - NG_extract_color3_N_r_color3 --"in1"--> NG_extract_color3_N_sw_color3 - NG_extract_color3_N_g_color3 --"in2"--> NG_extract_color3_N_sw_color3 - NG_extract_color3_N_b_color3 --"in3"--> NG_extract_color3_N_sw_color3 - NG_extract_color3_index --"which"--> NG_extract_color3_N_sw_color3 - NG_extract_color3_N_sw_color3 --> NG_extract_color3_out -``` +* *Implementation*: Non-graph | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | @@ -15721,36 +15628,7 @@ graph TB * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED -* *Nodegraph*: NG_extract_color4 - - -```mermaid -graph TB - subgraph NG_extract_color4 - NG_extract_color4_N_r_color4[N_r_color4] - NG_extract_color4_N_g_color4[N_g_color4] - NG_extract_color4_N_b_color4[N_b_color4] - NG_extract_color4_N_a_color4[N_a_color4] - style NG_extract_color4_N_sw_color4 fill:#C72, color:#FFF - NG_extract_color4_N_sw_color4{N_sw_color4} - style NG_extract_color4_out fill:#0C0, color:#FFF - NG_extract_color4_out([out]) - style NG_extract_color4_in fill:#09D, color:#FFF - NG_extract_color4_in([in]) - style NG_extract_color4_index fill:#09D, color:#FFF - NG_extract_color4_index([index]) - end - NG_extract_color4_in --"in"--> NG_extract_color4_N_r_color4 - NG_extract_color4_in --"in"--> NG_extract_color4_N_g_color4 - NG_extract_color4_in --"in"--> NG_extract_color4_N_b_color4 - NG_extract_color4_in --"in"--> NG_extract_color4_N_a_color4 - NG_extract_color4_N_r_color4 --"in1"--> NG_extract_color4_N_sw_color4 - NG_extract_color4_N_g_color4 --"in2"--> NG_extract_color4_N_sw_color4 - NG_extract_color4_N_b_color4 --"in3"--> NG_extract_color4_N_sw_color4 - NG_extract_color4_N_a_color4 --"in4"--> NG_extract_color4_N_sw_color4 - NG_extract_color4_index --"which"--> NG_extract_color4_N_sw_color4 - NG_extract_color4_N_sw_color4 --> NG_extract_color4_out -``` +* *Implementation*: Non-graph | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | @@ -15766,30 +15644,7 @@ graph TB * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED -* *Nodegraph*: NG_extract_vector2 - - -```mermaid -graph TB - subgraph NG_extract_vector2 - NG_extract_vector2_N_x_vector2[N_x_vector2] - NG_extract_vector2_N_y_vector2[N_y_vector2] - style NG_extract_vector2_N_sw_vector2 fill:#C72, color:#FFF - NG_extract_vector2_N_sw_vector2{N_sw_vector2} - style NG_extract_vector2_out fill:#0C0, color:#FFF - NG_extract_vector2_out([out]) - style NG_extract_vector2_in fill:#09D, color:#FFF - NG_extract_vector2_in([in]) - style NG_extract_vector2_index fill:#09D, color:#FFF - NG_extract_vector2_index([index]) - end - NG_extract_vector2_in --"in"--> NG_extract_vector2_N_x_vector2 - NG_extract_vector2_in --"in"--> NG_extract_vector2_N_y_vector2 - NG_extract_vector2_N_x_vector2 --"in1"--> NG_extract_vector2_N_sw_vector2 - NG_extract_vector2_N_y_vector2 --"in2"--> NG_extract_vector2_N_sw_vector2 - NG_extract_vector2_index --"which"--> NG_extract_vector2_N_sw_vector2 - NG_extract_vector2_N_sw_vector2 --> NG_extract_vector2_out -``` +* *Implementation*: Non-graph | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | @@ -15805,33 +15660,7 @@ graph TB * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED -* *Nodegraph*: NG_extract_vector3 - - -```mermaid -graph TB - subgraph NG_extract_vector3 - NG_extract_vector3_N_x_vector3[N_x_vector3] - NG_extract_vector3_N_y_vector3[N_y_vector3] - NG_extract_vector3_N_z_vector3[N_z_vector3] - style NG_extract_vector3_N_sw_vector3 fill:#C72, color:#FFF - NG_extract_vector3_N_sw_vector3{N_sw_vector3} - style NG_extract_vector3_out fill:#0C0, color:#FFF - NG_extract_vector3_out([out]) - style NG_extract_vector3_in fill:#09D, color:#FFF - NG_extract_vector3_in([in]) - style NG_extract_vector3_index fill:#09D, color:#FFF - NG_extract_vector3_index([index]) - end - NG_extract_vector3_in --"in"--> NG_extract_vector3_N_x_vector3 - NG_extract_vector3_in --"in"--> NG_extract_vector3_N_y_vector3 - NG_extract_vector3_in --"in"--> NG_extract_vector3_N_z_vector3 - NG_extract_vector3_N_x_vector3 --"in1"--> NG_extract_vector3_N_sw_vector3 - NG_extract_vector3_N_y_vector3 --"in2"--> NG_extract_vector3_N_sw_vector3 - NG_extract_vector3_N_z_vector3 --"in3"--> NG_extract_vector3_N_sw_vector3 - NG_extract_vector3_index --"which"--> NG_extract_vector3_N_sw_vector3 - NG_extract_vector3_N_sw_vector3 --> NG_extract_vector3_out -``` +* *Implementation*: Non-graph | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | @@ -15847,36 +15676,7 @@ graph TB * *Group*: channel * *Version*: 1.0. Is default: False * *Doc*: UNDOCUMENTED -* *Nodegraph*: NG_extract_vector4 - - -```mermaid -graph TB - subgraph NG_extract_vector4 - NG_extract_vector4_N_x_vector4[N_x_vector4] - NG_extract_vector4_N_y_vector4[N_y_vector4] - NG_extract_vector4_N_z_vector4[N_z_vector4] - NG_extract_vector4_N_w_vector4[N_w_vector4] - style NG_extract_vector4_N_sw_vector4 fill:#C72, color:#FFF - NG_extract_vector4_N_sw_vector4{N_sw_vector4} - style NG_extract_vector4_out fill:#0C0, color:#FFF - NG_extract_vector4_out([out]) - style NG_extract_vector4_in fill:#09D, color:#FFF - NG_extract_vector4_in([in]) - style NG_extract_vector4_index fill:#09D, color:#FFF - NG_extract_vector4_index([index]) - end - NG_extract_vector4_in --"in"--> NG_extract_vector4_N_x_vector4 - NG_extract_vector4_in --"in"--> NG_extract_vector4_N_y_vector4 - NG_extract_vector4_in --"in"--> NG_extract_vector4_N_z_vector4 - NG_extract_vector4_in --"in"--> NG_extract_vector4_N_w_vector4 - NG_extract_vector4_N_x_vector4 --"in1"--> NG_extract_vector4_N_sw_vector4 - NG_extract_vector4_N_y_vector4 --"in2"--> NG_extract_vector4_N_sw_vector4 - NG_extract_vector4_N_z_vector4 --"in3"--> NG_extract_vector4_N_sw_vector4 - NG_extract_vector4_N_w_vector4 --"in4"--> NG_extract_vector4_N_sw_vector4 - NG_extract_vector4_index --"which"--> NG_extract_vector4_N_sw_vector4 - NG_extract_vector4_N_sw_vector4 --> NG_extract_vector4_out -``` +* *Implementation*: Non-graph | Name | Type | Default Value | UI name | UI min | UI max | UI Soft Min | UI Soft Max | UI step | UI group | UI Advanced | Doc | Uniform | @@ -15899,8 +15699,8 @@ graph TB ```mermaid graph TB subgraph NG_separate2_vector2 - NG_separate2_vector2_N_x_vector2[N_x_vector2] - NG_separate2_vector2_N_y_vector2[N_y_vector2] + NG_separate2_vector2_N_extract_0[N_extract_0] + NG_separate2_vector2_N_extract_1[N_extract_1] style NG_separate2_vector2_outx fill:#0C0, color:#FFF NG_separate2_vector2_outx([outx]) style NG_separate2_vector2_outy fill:#0C0, color:#FFF @@ -15908,10 +15708,10 @@ graph TB style NG_separate2_vector2_in fill:#09D, color:#FFF NG_separate2_vector2_in([in]) end - NG_separate2_vector2_in --"in"--> NG_separate2_vector2_N_x_vector2 - NG_separate2_vector2_in --"in"--> NG_separate2_vector2_N_y_vector2 - NG_separate2_vector2_N_x_vector2 --> NG_separate2_vector2_outx - NG_separate2_vector2_N_y_vector2 --> NG_separate2_vector2_outy + NG_separate2_vector2_in --"in"--> NG_separate2_vector2_N_extract_0 + NG_separate2_vector2_in --"in"--> NG_separate2_vector2_N_extract_1 + NG_separate2_vector2_N_extract_0 --> NG_separate2_vector2_outx + NG_separate2_vector2_N_extract_1 --> NG_separate2_vector2_outy ``` @@ -15935,9 +15735,9 @@ graph TB ```mermaid graph TB subgraph NG_separate3_color3 - NG_separate3_color3_N_r_color3[N_r_color3] - NG_separate3_color3_N_g_color3[N_g_color3] - NG_separate3_color3_N_b_color3[N_b_color3] + NG_separate3_color3_N_extract_0[N_extract_0] + NG_separate3_color3_N_extract_1[N_extract_1] + NG_separate3_color3_N_extract_2[N_extract_2] style NG_separate3_color3_outr fill:#0C0, color:#FFF NG_separate3_color3_outr([outr]) style NG_separate3_color3_outg fill:#0C0, color:#FFF @@ -15947,12 +15747,12 @@ graph TB style NG_separate3_color3_in fill:#09D, color:#FFF NG_separate3_color3_in([in]) end - NG_separate3_color3_in --"in"--> NG_separate3_color3_N_r_color3 - NG_separate3_color3_in --"in"--> NG_separate3_color3_N_g_color3 - NG_separate3_color3_in --"in"--> NG_separate3_color3_N_b_color3 - NG_separate3_color3_N_r_color3 --> NG_separate3_color3_outr - NG_separate3_color3_N_g_color3 --> NG_separate3_color3_outg - NG_separate3_color3_N_b_color3 --> NG_separate3_color3_outb + NG_separate3_color3_in --"in"--> NG_separate3_color3_N_extract_0 + NG_separate3_color3_in --"in"--> NG_separate3_color3_N_extract_1 + NG_separate3_color3_in --"in"--> NG_separate3_color3_N_extract_2 + NG_separate3_color3_N_extract_0 --> NG_separate3_color3_outr + NG_separate3_color3_N_extract_1 --> NG_separate3_color3_outg + NG_separate3_color3_N_extract_2 --> NG_separate3_color3_outb ``` @@ -15976,9 +15776,9 @@ graph TB ```mermaid graph TB subgraph NG_separate3_vector3 - NG_separate3_vector3_N_x_vector3[N_x_vector3] - NG_separate3_vector3_N_y_vector3[N_y_vector3] - NG_separate3_vector3_N_z_vector3[N_z_vector3] + NG_separate3_vector3_N_extract_0[N_extract_0] + NG_separate3_vector3_N_extract_1[N_extract_1] + NG_separate3_vector3_N_extract_2[N_extract_2] style NG_separate3_vector3_outx fill:#0C0, color:#FFF NG_separate3_vector3_outx([outx]) style NG_separate3_vector3_outy fill:#0C0, color:#FFF @@ -15988,12 +15788,12 @@ graph TB style NG_separate3_vector3_in fill:#09D, color:#FFF NG_separate3_vector3_in([in]) end - NG_separate3_vector3_in --"in"--> NG_separate3_vector3_N_x_vector3 - NG_separate3_vector3_in --"in"--> NG_separate3_vector3_N_y_vector3 - NG_separate3_vector3_in --"in"--> NG_separate3_vector3_N_z_vector3 - NG_separate3_vector3_N_x_vector3 --> NG_separate3_vector3_outx - NG_separate3_vector3_N_y_vector3 --> NG_separate3_vector3_outy - NG_separate3_vector3_N_z_vector3 --> NG_separate3_vector3_outz + NG_separate3_vector3_in --"in"--> NG_separate3_vector3_N_extract_0 + NG_separate3_vector3_in --"in"--> NG_separate3_vector3_N_extract_1 + NG_separate3_vector3_in --"in"--> NG_separate3_vector3_N_extract_2 + NG_separate3_vector3_N_extract_0 --> NG_separate3_vector3_outx + NG_separate3_vector3_N_extract_1 --> NG_separate3_vector3_outy + NG_separate3_vector3_N_extract_2 --> NG_separate3_vector3_outz ``` @@ -16018,10 +15818,10 @@ graph TB ```mermaid graph TB subgraph NG_separate4_color4 - NG_separate4_color4_N_r_color4[N_r_color4] - NG_separate4_color4_N_g_color4[N_g_color4] - NG_separate4_color4_N_b_color4[N_b_color4] - NG_separate4_color4_N_a_color4[N_a_color4] + NG_separate4_color4_N_extract_0[N_extract_0] + NG_separate4_color4_N_extract_1[N_extract_1] + NG_separate4_color4_N_extract_2[N_extract_2] + NG_separate4_color4_N_extract_3[N_extract_3] style NG_separate4_color4_outr fill:#0C0, color:#FFF NG_separate4_color4_outr([outr]) style NG_separate4_color4_outg fill:#0C0, color:#FFF @@ -16033,14 +15833,14 @@ graph TB style NG_separate4_color4_in fill:#09D, color:#FFF NG_separate4_color4_in([in]) end - NG_separate4_color4_in --"in"--> NG_separate4_color4_N_r_color4 - NG_separate4_color4_in --"in"--> NG_separate4_color4_N_g_color4 - NG_separate4_color4_in --"in"--> NG_separate4_color4_N_b_color4 - NG_separate4_color4_in --"in"--> NG_separate4_color4_N_a_color4 - NG_separate4_color4_N_r_color4 --> NG_separate4_color4_outr - NG_separate4_color4_N_g_color4 --> NG_separate4_color4_outg - NG_separate4_color4_N_b_color4 --> NG_separate4_color4_outb - NG_separate4_color4_N_a_color4 --> NG_separate4_color4_outa + NG_separate4_color4_in --"in"--> NG_separate4_color4_N_extract_0 + NG_separate4_color4_in --"in"--> NG_separate4_color4_N_extract_1 + NG_separate4_color4_in --"in"--> NG_separate4_color4_N_extract_2 + NG_separate4_color4_in --"in"--> NG_separate4_color4_N_extract_3 + NG_separate4_color4_N_extract_0 --> NG_separate4_color4_outr + NG_separate4_color4_N_extract_1 --> NG_separate4_color4_outg + NG_separate4_color4_N_extract_2 --> NG_separate4_color4_outb + NG_separate4_color4_N_extract_3 --> NG_separate4_color4_outa ``` @@ -16065,10 +15865,10 @@ graph TB ```mermaid graph TB subgraph NG_separate4_vector4 - NG_separate4_vector4_N_x_vector4[N_x_vector4] - NG_separate4_vector4_N_y_vector4[N_y_vector4] - NG_separate4_vector4_N_z_vector4[N_z_vector4] - NG_separate4_vector4_N_w_vector4[N_w_vector4] + NG_separate4_vector4_N_extract_0[N_extract_0] + NG_separate4_vector4_N_extract_1[N_extract_1] + NG_separate4_vector4_N_extract_2[N_extract_2] + NG_separate4_vector4_N_extract_3[N_extract_3] style NG_separate4_vector4_outx fill:#0C0, color:#FFF NG_separate4_vector4_outx([outx]) style NG_separate4_vector4_outy fill:#0C0, color:#FFF @@ -16080,14 +15880,14 @@ graph TB style NG_separate4_vector4_in fill:#09D, color:#FFF NG_separate4_vector4_in([in]) end - NG_separate4_vector4_in --"in"--> NG_separate4_vector4_N_x_vector4 - NG_separate4_vector4_in --"in"--> NG_separate4_vector4_N_y_vector4 - NG_separate4_vector4_in --"in"--> NG_separate4_vector4_N_z_vector4 - NG_separate4_vector4_in --"in"--> NG_separate4_vector4_N_w_vector4 - NG_separate4_vector4_N_x_vector4 --> NG_separate4_vector4_outx - NG_separate4_vector4_N_y_vector4 --> NG_separate4_vector4_outy - NG_separate4_vector4_N_z_vector4 --> NG_separate4_vector4_outz - NG_separate4_vector4_N_w_vector4 --> NG_separate4_vector4_outw + NG_separate4_vector4_in --"in"--> NG_separate4_vector4_N_extract_0 + NG_separate4_vector4_in --"in"--> NG_separate4_vector4_N_extract_1 + NG_separate4_vector4_in --"in"--> NG_separate4_vector4_N_extract_2 + NG_separate4_vector4_in --"in"--> NG_separate4_vector4_N_extract_3 + NG_separate4_vector4_N_extract_0 --> NG_separate4_vector4_outx + NG_separate4_vector4_N_extract_1 --> NG_separate4_vector4_outy + NG_separate4_vector4_N_extract_2 --> NG_separate4_vector4_outz + NG_separate4_vector4_N_extract_3 --> NG_separate4_vector4_outw ``` diff --git a/documents/definitions/subsurface_bsdf.html b/documents/definitions/subsurface_bsdf.html index 943cdc6a..42ddb50e 100644 --- a/documents/definitions/subsurface_bsdf.html +++ b/documents/definitions/subsurface_bsdf.html @@ -269,7 +269,6 @@

MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -839,8 +837,8 @@
MaterialX Learn
diff --git a/documents/definitions/subtract.html b/documents/definitions/subtract.html index 91390bc4..e0ce1879 100644 --- a/documents/definitions/subtract.html +++ b/documents/definitions/subtract.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -758,6 +756,161 @@
MaterialX Learn
+
ND_subtract_integer +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+../resources/mtlx/nodedef_materials/material_subtract_integer_out_genglsl.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+

+

Code Implementation + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

+
+
+
+
+
ND_subtract_color3
diff --git a/documents/definitions/surface.html b/documents/definitions/surface.html index 21bc33f2..eec0ccde 100644 --- a/documents/definitions/surface.html +++ b/documents/definitions/surface.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -764,8 +762,8 @@
MaterialX Learn
diff --git a/documents/definitions/surface_unlit.html b/documents/definitions/surface_unlit.html index 96653f31..42280a78 100644 --- a/documents/definitions/surface_unlit.html +++ b/documents/definitions/surface_unlit.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/surfacematerial.html b/documents/definitions/surfacematerial.html index 778fbd90..cd69e795 100644 --- a/documents/definitions/surfacematerial.html +++ b/documents/definitions/surfacematerial.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/switch.html b/documents/definitions/switch.html index 287ea302..6a309859 100644 --- a/documents/definitions/switch.html +++ b/documents/definitions/switch.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil @@ -634,6 +632,16 @@
MaterialX Learnin4
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-
ND_switch_floatI +
ND_switch_matrix33
@@ -2174,419 +2942,537 @@
MaterialX Learn
Library
Node Group
-
Type
+
Type
Version : 1.0
-../resources/mtlx/nodedef_materials/material_switch_floatI_out_genglsl.png +images/no_image.png
Parameters:

-
+
- -
- + +
+ +
+
+ +
+
+
-
-
- -
- -
-
-
-
-
- -
- + +
+
-
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
- +
-
+
- -
- + +
+ +
+
+ +
+
+
-
-
- -
- -
-
-
-
-
- -
- + +
+ +
+
+ +
+
+
-
-
- -
- -
-
-
-
-
- -
- + +
+
-
+
+ +
+
+ +
+
- +
-
+
- -
- + +
+ +
+
+ +
+
+
-
-
- -
- -
-
-
-
-
- -
- + +
+ +
+
+ +
+
+
-
-
- -
- -
-
-
-
-
-
-

-

Code Implementation - - -
-
- -
- -
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
-
-

-
-
-
-
-
-
ND_switch_color3I -
-
-
-
-
-
-
Library
-
Node Group
-
Type
-
Version : 1.0
-
-
-
-../resources/mtlx/nodedef_materials/material_switch_color3I_out_genglsl.png -
-
-
Parameters: -
-
-
-
- -
- -
-
- + +
+
- +
- +
-
+
- +
-
+
-
- -
-
- +
+
- +
- +
-
-
- -
- -
-
-
-
-
- -
- + +
+
-
- +
+
- +
+
+
+
- +
-
+
+ +
+
+ +
+
- +
-
+
-
- -
-
- +
+
- +
- +
-
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
- +
-
+
-
- +
+
-
- +
+
- + +
+
+
+ +
+
- + +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
- +
-
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
- +
- +
-
+
@@ -2597,7 +3483,7 @@
MaterialX Learn
- +
@@ -2632,7 +3518,7 @@
MaterialX LearnCode:
+ style="resize: none;" disabled>materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_matrix33({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}})

@@ -2669,7 +3555,7 @@
MaterialX Learn
-
ND_switch_color4I +
ND_switch_matrix44
@@ -2678,444 +3564,777 @@
MaterialX Learn
Library
Node Group
-
Type
+
Type
Version : 1.0
-../resources/mtlx/nodedef_materials/material_switch_color4I_out_genglsl.png +images/no_image.png
Parameters:

-
+
- +
- +
- +
- + +
+
+
+ +
+
- + +
+
+ +
+
+
-
-
- -
- -
-
-
-
-
- +
- +
- +
- +
- + +
+
+
+ +
+
- +
-
+
+ +
+
+ +
+
- +
-
+
- +
- +
- +
- +
+
+
+
- +
-
-
- -
- +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+
-
+
- +
- +
- +
- +
+
+
+
- +
-
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
- +
- +
- +
- +
+
+
+
- +
-
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
- -
- + +
+
-
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
- -
- + +
+
-
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
-

-

Code Implementation - - -
- -
- + +
+
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
-
- -
- -
-
-
- -
- -
-
-
-
-

-
-
-
+
-
-
ND_switch_vector2I -
-
-
-
-
-
-
Library
-
Node Group
-
Type
-
Version : 1.0
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
-
-
-../resources/mtlx/nodedef_materials/material_switch_vector2I_out_genglsl.png +
+ +
+ +
+
+ +
+
+ +
+
+ +
-
-
Parameters: - +
+ +
+ +
+
+ +
+
+ +
+
+ +
-
-
-
- -
- + +
+
-
- +
+
-
+
+ +
+
+ +
+
- +
-
+
-
- +
+
-
- +
+ +
+
+ +
+
+
-
-
- -
- -
-
-
-
-
- -
- + +
+
-
- +
+ +
+
+ +
+
+
-
-
- -
- -
-
-
-
-
- -
- + +
+
-
- +
+
-
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
-
- +
+
-
- +
+
-
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
- +
- +
-
+
@@ -3126,7 +4345,7 @@
MaterialX Learn
- +
@@ -3161,7 +4380,7 @@
MaterialX LearnCode:
+ style="resize: none;" disabled>materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_matrix44({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}})

@@ -3198,7 +4417,7 @@
MaterialX Learn
-
ND_switch_vector3I +
ND_switch_floatI
@@ -3207,159 +4426,234 @@
MaterialX Learn
Library
Node Group
-
Type
+
Type
Version : 1.0
-../resources/mtlx/nodedef_materials/material_switch_vector3I_out_genglsl.png +../resources/mtlx/nodedef_materials/material_switch_floatI_out_genglsl.png
Parameters:

-
+
- -
- -
-
- -
-
- + +
+
- +
-
+
- -
- -
-
- -
-
- + +
+
- +
-
+
- -
- -
-
- + +
+
-
- +
+
+ +
+ +
+
+
+
+
+
+
+ +
+
- +
-
+
- -
- + +
+
-
- +
+
+ +
+ +
+
+
+
+
+
+
+ +
+
-
- +
+
+ +
+ +
+
+
+
+
+
+
+ +
+
- +
-
+
- -
- + +
+
-
- +
+
+ +
+ +
+
+
+
+
+
+
+ +
+
-
- +
+
+ +
+ +
+
+
+
+
+
+
+ +
+
- +
-
+
- +
@@ -3371,8 +4665,8 @@
MaterialX Learn
-
+
@@ -3383,7 +4677,7 @@
MaterialX Learn
- +
@@ -3418,7 +4712,7 @@
MaterialX LearnCode:
+ style="resize: none;" disabled>materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}})

@@ -3454,184 +4748,3396 @@
MaterialX Learn
-
-
ND_switch_vector4I -
-
-
-
-
-
-
Library
-
Node Group
-
Type
-
Version : 1.0
+
+
ND_switch_color3I +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+../resources/mtlx/nodedef_materials/material_switch_color3I_out_genglsl.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+

+

Code Implementation + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

+
+
+
+
+
+
ND_switch_color4I +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+../resources/mtlx/nodedef_materials/material_switch_color4I_out_genglsl.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+

+

Code Implementation + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

+
+
+
+
+
+
ND_switch_vector2I +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+../resources/mtlx/nodedef_materials/material_switch_vector2I_out_genglsl.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+

+

Code Implementation + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

+
+
+
+
+
+
ND_switch_vector3I +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+../resources/mtlx/nodedef_materials/material_switch_vector3I_out_genglsl.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+

+

Code Implementation + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

+
+
+
+
+
+
ND_switch_vector4I +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+../resources/mtlx/nodedef_materials/material_switch_vector4I_out_genglsl.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+

+

Code Implementation + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

+
+
+
+
+
+
ND_switch_matrix33I +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+images/no_image.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+

+

Code Implementation + + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+

+
+
+
+
+
+
ND_switch_matrix44I +
+
+
+
+
+
+
Library
+
Node Group
+
Type
+
Version : 1.0
+
+
+
+images/no_image.png +
+
+
Parameters: + +
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
-
-
-../resources/mtlx/nodedef_materials/material_switch_vector4I_out_genglsl.png +
+ +
+ +
+
+ +
+
+ +
+
+ +
-
-
Parameters: - +
+ +
+ +
+
+ +
+
+ +
+
+ +
-
-
-
- +
- +
- +
- +
- +
-
+
- +
-
+
- +
- +
- +
- +
-
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
- +
- +
- +
- +
-
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
- +
- +
- +
- +
-
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
- +
- +
- +
- +
-
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
- +
-
+
- +
@@ -3643,8 +8149,8 @@
MaterialX Learn
-
+
@@ -3655,7 +8161,7 @@
MaterialX Learn
- +
@@ -3690,7 +8196,7 @@
MaterialX LearnCode:
+ style="resize: none;" disabled>materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_matrix44I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}})

diff --git a/documents/definitions/swizzle.html b/documents/definitions/swizzle.html index 3dece74d..8d7598b2 100644 --- a/documents/definitions/swizzle.html +++ b/documents/definitions/swizzle.html @@ -494,6 +494,7 @@
MaterialX Learnstandard_surface subsurface_bsdf surface +thin_film_bsdf thin_surface translucent_bsdf uniform_edf diff --git a/documents/definitions/tan.html b/documents/definitions/tan.html index e261aa28..78bf2d52 100644 --- a/documents/definitions/tan.html +++ b/documents/definitions/tan.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/tangent.html b/documents/definitions/tangent.html index 82ad508a..c5156a9d 100644 --- a/documents/definitions/tangent.html +++ b/documents/definitions/tangent.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/texcoord.html b/documents/definitions/texcoord.html index 48646593..5ef17c12 100644 --- a/documents/definitions/texcoord.html +++ b/documents/definitions/texcoord.html @@ -269,7 +269,6 @@
MaterialX Learnseparate2 separate3 separate4 -swizzle
@@ -386,7 +385,6 @@
MaterialX Learnabsval acos add -arrayappend asin atan2 ceil diff --git a/documents/definitions/thin_film_bsdf.html b/documents/definitions/thin_film_bsdf.html index 1c938f30..6ed258e0 100644 --- a/documents/definitions/thin_film_bsdf.html +++ b/documents/definitions/thin_film_bsdf.html @@ -25,13 +25,14 @@ --> - + + @@ -40,190 +41,188 @@ - - - + + +
- -
- - + // Save svg element to file as png + saveElem = document.getElementById("savePNG"); + if (saveElem) { + saveElem.addEventListener("click", (e) => { + const element = document.getElementById("mermaid_output_rendered"); + if (element) { + savePNG(element, "graph.png"); + } + }); + } + + setDefaultGraph(); + + addCopyHandlers(); + addPasteHandlers(); + +
diff --git a/documents/mtlx_1380_vs_1381.html b/documents/mtlx_1380_vs_1381.html index a3407081..5b4239af 100644 --- a/documents/mtlx_1380_vs_1381.html +++ b/documents/mtlx_1380_vs_1381.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
MaterialX LearnMaterialX Library Comparison

Libraries Loaded

    -
  • Loaded 662 first library definitions from 26 files. Version 1.39.0
      +
    • Loaded 663 first library definitions from 26 files. Version 1.39.0
      • First library location: ['../../resources/libraries_1.38.1']. Search path: ""
    • -
    • Loaded 662 second library definitions from 26 files. Version 1.39
        +
      • Loaded 663 second library definitions from 26 files. Version 1.39
        • Second library location: ['../../resources/libraries_1.38.0']. Search path: ""
      • @@ -232,8 +232,8 @@

        Libraries Loaded

        Node Definition Comparison

          -
        • First library has 662 nodedefs.
        • -
        • Second library has 662 nodedefs
        • +
        • First library has 663 nodedefs.
        • +
        • Second library has 663 nodedefs
        0 definitions modified @@ -251,7 +251,7 @@

        Implementations

      • Second library shader targets: ['genglsl', 'genmdl', 'genosl']
      First Library Definitions / Implementations
      -
      541 shaders: genglsl +
      542 shaders: genglsl
      DefinitionImplementationFile
      ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
      ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -264,6 +264,7 @@
      First Library Definitions / I
      ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
      ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
      ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
      ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
      ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
      ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
      ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -797,7 +798,7 @@
      First Library Definitions / I
      -
      549 shaders: genmdl +
      550 shaders: genmdl
      DefinitionImplementationFile
      ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
      ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -807,6 +808,7 @@
      First Library Definitions / I
      ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
      ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
      ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
      ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
      ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
      ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
      ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1351,7 +1353,7 @@
      First Library Definitions / I
      -
      540 shaders: genosl +
      541 shaders: genosl
      DefinitionImplementationFile
      ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
      ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1361,6 +1363,7 @@
      First Library Definitions / I
      ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
      ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
      ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
      ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
      ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
      ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
      ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -1999,7 +2002,7 @@
      First Library Definitions / I

      Second Library Definitions / Implementations
      -
      541 shaders: genglsl +
      542 shaders: genglsl
      DefinitionImplementationFile
      ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
      ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2012,6 +2015,7 @@
      Second Library Definitions /
      ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
      ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
      ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
      ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
      ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
      ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
      ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -2545,7 +2549,7 @@
      Second Library Definitions /
      -
      549 shaders: genmdl +
      550 shaders: genmdl
      DefinitionImplementationFile
      ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
      ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -2555,6 +2559,7 @@
      Second Library Definitions /
      ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
      ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
      ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
      ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
      ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
      ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
      ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -3099,7 +3104,7 @@
      Second Library Definitions /
      -
      540 shaders: genosl +
      541 shaders: genosl
      DefinitionImplementationFile
      ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
      ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -3109,6 +3114,7 @@
      Second Library Definitions /
      ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
      ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
      ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
      ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
      ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
      ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
      ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -3747,13 +3753,13 @@
      Second Library Definitions /

      Implementation Comparison

      -

      First library implementation count: 2169 -Second library implementation count: 2169

      +

      First library implementation count: 2172 +Second library implementation count: 2172

      1 implementations modified - +
      Name Change
      IMPL_standard_surface_surfaceshader - Number of children on: IMPL_standard_surface_surfaceshader changed from ( 51 ) to ( 50 )
      - swizzle /opacity_luminance_r removed from IMPL_standard_surface_surfaceshader
      - attribute: channels=( r ) added to: opacity
      - attribute: nodename changed on opacity from ( opacity_luminance_r ) to ( opacity_luminance )
      IMPL_standard_surface_surfaceshader - extract /opacity_luminance_r removed from IMPL_standard_surface_surfaceshader
      - extract /swizzle add to IMPL_standard_surface_surfaceshader
      - attribute: nodename changed on opacity from ( opacity_luminance_r ) to ( swizzle )
      diff --git a/documents/mtlx_1380_vs_1390.html b/documents/mtlx_1380_vs_1390.html index e8a21a42..89661ae2 100644 --- a/documents/mtlx_1380_vs_1390.html +++ b/documents/mtlx_1380_vs_1390.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
      MaterialX LearnMaterialX Library Comparison

      Libraries Loaded

        -
      • Loaded 766 first library definitions from 46 files. Version 1.39.0
          +
        • Loaded 742 first library definitions from 46 files. Version 1.39.0
          • First library location: ['../../pymaterialx/python/MaterialX/libraries']. Search path: ""
        • -
        • Loaded 662 second library definitions from 26 files. Version 1.39
            +
          • Loaded 663 second library definitions from 26 files. Version 1.39
            • Second library location: ['../../resources/libraries_1.38.0']. Search path: ""
          • @@ -232,27 +232,80 @@

            Libraries Loaded

            Node Definition Comparison

              -
            • First library has 766 nodedefs.
            • -
            • Second library has 662 nodedefs
            • +
            • First library has 742 nodedefs.
            • +
            • Second library has 663 nodedefs
            -
            9 node definitions removed +
            62 node definitions removed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            Name Category
            ND_add_displacementshader add
            ND_add_surfaceshader add
            ND_add_volumeshader add
            ND_arrayappend_color3_color3array arrayappend
            ND_arrayappend_color3array_color3array arrayappend
            ND_arrayappend_color4_color4array arrayappend
            ND_arrayappend_color4array_color4array arrayappend
            ND_arrayappend_float_floatarray arrayappend
            ND_arrayappend_floatarray_floatarray arrayappend
            ND_arrayappend_integer_integerarray arrayappend
            ND_arrayappend_integerarray_integerarray arrayappend
            ND_arrayappend_string_stringarray arrayappend
            ND_arrayappend_stringarray_stringarray arrayappend
            ND_arrayappend_vector2_vector2array arrayappend
            ND_arrayappend_vector2array_vector2array arrayappend
            ND_arrayappend_vector3_vector3array arrayappend
            ND_arrayappend_vector3array_vector3array arrayappend
            ND_arrayappend_vector4_vector4array arrayappend
            ND_arrayappend_vector4array_vector4array arrayappend
            ND_multiply_displacementshaderF multiply
            ND_multiply_displacementshaderV multiply
            ND_multiply_surfaceshaderC multiply
            ND_multiply_surfaceshaderF multiply
            ND_multiply_volumeshaderC multiply
            ND_multiply_volumeshaderF multiply
            ND_normalmap normalmap
            ND_swizzle_color3_color3 swizzle
            ND_swizzle_color3_color4 swizzle
            ND_swizzle_color3_float swizzle
            ND_swizzle_color3_vector2 swizzle
            ND_swizzle_color3_vector3 swizzle
            ND_swizzle_color3_vector4 swizzle
            ND_swizzle_color4_color3 swizzle
            ND_swizzle_color4_color4 swizzle
            ND_swizzle_color4_float swizzle
            ND_swizzle_color4_vector2 swizzle
            ND_swizzle_color4_vector3 swizzle
            ND_swizzle_color4_vector4 swizzle
            ND_swizzle_float_color3 swizzle
            ND_swizzle_float_color4 swizzle
            ND_swizzle_float_vector2 swizzle
            ND_swizzle_float_vector3 swizzle
            ND_swizzle_float_vector4 swizzle
            ND_swizzle_vector2_color3 swizzle
            ND_swizzle_vector2_color4 swizzle
            ND_swizzle_vector2_float swizzle
            ND_swizzle_vector2_vector2 swizzle
            ND_swizzle_vector2_vector3 swizzle
            ND_swizzle_vector2_vector4 swizzle
            ND_swizzle_vector3_color3 swizzle
            ND_swizzle_vector3_color4 swizzle
            ND_swizzle_vector3_float swizzle
            ND_swizzle_vector3_vector2 swizzle
            ND_swizzle_vector3_vector3 swizzle
            ND_swizzle_vector3_vector4 swizzle
            ND_swizzle_vector4_color3 swizzle
            ND_swizzle_vector4_color4 swizzle
            ND_swizzle_vector4_float swizzle
            ND_swizzle_vector4_vector2 swizzle
            ND_swizzle_vector4_vector3 swizzle
            ND_swizzle_vector4_vector4 swizzle
            ND_thin_film_bsdf thin_film_bsdf
            -
            113 node definitions added. (Sorted by category) +
            141 node definitions added. (Sorted by category) @@ -271,6 +324,7 @@

            Node Definition Comparison

            + @@ -315,6 +369,27 @@

            Node Definition Comparison

            + + + + + + + + + + + + + + + + + + + + + @@ -326,6 +401,7 @@

            Node Definition Comparison

            + @@ -361,7 +437,12 @@

            Node Definition Comparison

            + + + + + @@ -437,7 +518,7 @@

            Node Definition Comparison

            -
            36 definitions modified +
            54 definitions modified
            Name Category NodeGroup
            ND_UsdUVTexture_23 UsdUVTexture texture2d
            ND_acescg_to_lin_rec709_color3 acescg_to_lin_rec709 colortransform
            ND_acescg_to_lin_rec709_color4 acescg_to_lin_rec709 colortransform
            ND_add_integer add math
            ND_adobergb_to_lin_rec709_color3 adobergb_to_lin_rec709 colortransform
            ND_adobergb_to_lin_rec709_color4 adobergb_to_lin_rec709 colortransform
            ND_bump_vector3 bump geometric
            ND_gooch_shade gooch_shade npr
            ND_grid_color3 grid procedural2d
            ND_hexagon_float hexagon procedural2d
            ND_ifequal_integer ifequal conditional
            ND_ifequal_matrix33 ifequal conditional
            ND_ifequal_matrix44 ifequal conditional
            ND_ifequal_integerI ifequal conditional
            ND_ifequal_matrix33I ifequal conditional
            ND_ifequal_matrix44I ifequal conditional
            ND_ifequal_integerB ifequal conditional
            ND_ifequal_matrix33B ifequal conditional
            ND_ifequal_matrix44B ifequal conditional
            ND_ifgreater_integer ifgreater conditional
            ND_ifgreater_matrix33 ifgreater conditional
            ND_ifgreater_matrix44 ifgreater conditional
            ND_ifgreater_integerI ifgreater conditional
            ND_ifgreater_matrix33I ifgreater conditional
            ND_ifgreater_matrix44I ifgreater conditional
            ND_ifgreatereq_integer ifgreatereq conditional
            ND_ifgreatereq_matrix33 ifgreatereq conditional
            ND_ifgreatereq_matrix44 ifgreatereq conditional
            ND_ifgreatereq_integerI ifgreatereq conditional
            ND_ifgreatereq_matrix33I ifgreatereq conditional
            ND_ifgreatereq_matrix44I ifgreatereq conditional
            ND_layer_vdf layer pbr
            ND_lin_adobergb_to_lin_rec709_color3 lin_adobergb_to_lin_rec709 colortransform
            ND_lin_adobergb_to_lin_rec709_color4 lin_adobergb_to_lin_rec709 colortransform
            ND_mix_vector2_vector2 mix compositing
            ND_mix_vector3_vector3 mix compositing
            ND_mix_vector4_vector4 mix compositing
            ND_normalmap_float normalmap math
            ND_normalmap_vector2 normalmap math
            ND_open_pbr_surface_surfaceshader open_pbr_surface pbr
            ND_randomcolor_float randomcolor procedural3d
            ND_standard_surface_surfaceshader_100 standard_surface pbr
            ND_standard_surface_to_UsdPreviewSurface standard_surface_to_UsdPreviewSurface translation
            ND_standard_surface_to_gltf_pbr standard_surface_to_gltf_pbr translation
            ND_subtract_integer subtract math
            ND_surface_unlit surface_unlit shader
            ND_switch_matrix33 switch conditional
            ND_switch_matrix44 switch conditional
            ND_switch_matrix33I switch conditional
            ND_switch_matrix44I switch conditional
            ND_tiledcircles_color3 tiledcircles procedural2d
            ND_tiledcloverleafs_color3 tiledcloverleafs procedural2d
            ND_tiledhexagons_color3 tiledhexagons procedural2d
            @@ -480,9 +561,15 @@

            Node Definition Comparison

            + + - Number of children on: ND_conductor_bsdf changed from ( 8 ) to ( 10 )
            - input /thinfilm_thickness added to ND_conductor_bsdf. Value=( 0 )
            - input /thinfilm_ior added to ND_conductor_bsdf. Value=( 1.5 )
            - attribute: value changed on ior from ( 0.271, 0.677, 1.316 ) to ( 0.183, 0.421, 1.373 )
            - attribute: value changed on extinction from ( 3.609, 2.625, 2.292 ) to ( 3.424, 2.346, 1.770 )
            + @@ -516,6 +603,18 @@

            Node Definition Comparison

            + + + + @@ -546,6 +645,42 @@

            Node Definition Comparison

            + + + + + + + + + + + + @@ -562,7 +697,7 @@

            Implementations

          • Shader targets added: ['essl', 'genmsl']
          • First Library Definitions / Implementations
            -
            540 shaders: genglsl +
            537 shaders: genglsl
            Name Change
            ND_UsdTransform2d - attribute: nodegroup=( math ) added to: ND_UsdTransform2d
            - attribute: value=( 0, 0 ) added to: in
            ND_dielectric_bsdf + + - Number of children on: ND_dielectric_bsdf changed from ( 9 ) to ( 11 )
            - input /thinfilm_thickness added to ND_dielectric_bsdf. Value=( 0 )
            - input /thinfilm_ior added to ND_dielectric_bsdf. Value=( 1.5 )
            ND_conductor_bsdf - - attribute: value changed on ior from ( 0.271, 0.677, 1.316 ) to ( 0.183, 0.421, 1.373 )
            - attribute: value changed on extinction from ( 3.609, 2.625, 2.292 ) to ( 3.424, 2.346, 1.770 )
            ND_generalized_schlick_bsdf + + - Number of children on: ND_generalized_schlick_bsdf changed from ( 10 ) to ( 13 )
            - input /color82 added to ND_generalized_schlick_bsdf. Value=( 1.0, 1.0, 1.0 )
            - input /thinfilm_thickness added to ND_generalized_schlick_bsdf. Value=( 0 )
            - input /thinfilm_ior added to ND_generalized_schlick_bsdf. Value=( 1.5 )
            ND_mix_bsdf - attribute: value changed on mix from ( 1.0 ) to ( 0.0 )
            ND_geompropvalue_integer - attribute: uniform=( true ) removed from: default
            ND_atan2_float + + - input /in1 removed from ND_atan2_float. Value=( 0.0 )
            - input /in2 removed from ND_atan2_float. Value=( 1.0 )
            - input /iny added to ND_atan2_float. Value=( 0.0 )
            - input /inx added to ND_atan2_float. Value=( 1.0 )
            ND_atan2_vector2 + + - input /in1 removed from ND_atan2_vector2. Value=( 1.0, 1.0 )
            - input /in2 removed from ND_atan2_vector2. Value=( 0.0, 0.0 )
            - input /iny added to ND_atan2_vector2. Value=( 1.0, 1.0 )
            - input /inx added to ND_atan2_vector2. Value=( 0.0, 0.0 )
            ND_atan2_vector3 + + - input /in1 removed from ND_atan2_vector3. Value=( 1.0, 1.0, 1.0 )
            - input /in2 removed from ND_atan2_vector3. Value=( 0.0, 0.0, 0.0 )
            - input /iny added to ND_atan2_vector3. Value=( 1.0, 1.0, 1.0 )
            - input /inx added to ND_atan2_vector3. Value=( 0.0, 0.0, 0.0 )
            ND_atan2_vector4 + + - input /in1 removed from ND_atan2_vector4. Value=( 1.0, 1.0, 1.0, 1.0 )
            - input /in2 removed from ND_atan2_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /iny added to ND_atan2_vector4. Value=( 1.0, 1.0, 1.0, 1.0 )
            - input /inx added to ND_atan2_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
            ND_place2d_vector2 - Number of children on: ND_place2d_vector2 changed from ( 6 ) to ( 7 )
            - input /operationorder added to ND_place2d_vector2. Value=( 0 )
            ND_mix_volumeshader - attribute: uisoftmin=( 0.0 ) added to: mix
            - attribute: uisoftmax=( 1.0 ) added to: mix
            ND_switch_float + + - Number of children on: ND_switch_float changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_float. Value=( 0.0 )
            - input /in7 added to ND_switch_float. Value=( 0.0 )
            - input /in8 added to ND_switch_float. Value=( 0.0 )
            - input /in9 added to ND_switch_float. Value=( 0.0 )
            - input /in10 added to ND_switch_float. Value=( 0.0 )
            ND_switch_color3 + + - Number of children on: ND_switch_color3 changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
            - input /in7 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
            - input /in8 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
            - input /in9 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
            - input /in10 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
            ND_switch_color4 + + - Number of children on: ND_switch_color4 changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in7 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in8 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in9 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in10 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
            ND_switch_vector2 + + - Number of children on: ND_switch_vector2 changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_vector2. Value=( 0.0, 0.0 )
            - input /in7 added to ND_switch_vector2. Value=( 0.0, 0.0 )
            - input /in8 added to ND_switch_vector2. Value=( 0.0, 0.0 )
            - input /in9 added to ND_switch_vector2. Value=( 0.0, 0.0 )
            - input /in10 added to ND_switch_vector2. Value=( 0.0, 0.0 )
            ND_switch_vector3 + + - Number of children on: ND_switch_vector3 changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
            - input /in7 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
            - input /in8 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
            - input /in9 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
            - input /in10 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
            ND_switch_vector4 + + - Number of children on: ND_switch_vector4 changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in7 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in8 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in9 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in10 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
            ND_switch_floatI + + - Number of children on: ND_switch_floatI changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_floatI. Value=( 0.0 )
            - input /in7 added to ND_switch_floatI. Value=( 0.0 )
            - input /in8 added to ND_switch_floatI. Value=( 0.0 )
            - input /in9 added to ND_switch_floatI. Value=( 0.0 )
            - input /in10 added to ND_switch_floatI. Value=( 0.0 )
            ND_switch_color3I + + - Number of children on: ND_switch_color3I changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
            - input /in7 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
            - input /in8 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
            - input /in9 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
            - input /in10 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
            ND_switch_color4I + + - Number of children on: ND_switch_color4I changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in7 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in8 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in9 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in10 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            ND_switch_vector2I + + - Number of children on: ND_switch_vector2I changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
            - input /in7 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
            - input /in8 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
            - input /in9 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
            - input /in10 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
            ND_switch_vector3I + + - Number of children on: ND_switch_vector3I changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
            - input /in7 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
            - input /in8 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
            - input /in9 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
            - input /in10 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
            ND_switch_vector4I + + - Number of children on: ND_switch_vector4I changed from ( 7 ) to ( 12 )
            - input /in6 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in7 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in8 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in9 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            - input /in10 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
            ND_heighttonormal_vector3 - attribute: default changed on out from ( 0.0, 1.0, 0.0 ) to ( 0.5, 0.5, 1.0 )
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -682,6 +817,7 @@
            First Library Definitions / I
            ND_frame_floatIM_frame_float_genglslstdlib_genglsl_impl.mtlx
            ND_time_floatIM_time_float_genglslstdlib_genglsl_impl.mtlx
            ND_add_floatIM_add_float_genglslstdlib_genglsl_impl.mtlx +
            ND_add_integerIM_add_integer_genglslstdlib_genglsl_impl.mtlx
            ND_add_color3IM_add_color3_genglslstdlib_genglsl_impl.mtlx
            ND_add_color4IM_add_color4_genglslstdlib_genglsl_impl.mtlx
            ND_add_vector2IM_add_vector2_genglslstdlib_genglsl_impl.mtlx @@ -697,6 +833,7 @@
            First Library Definitions / I
            ND_add_matrix33FAIM_add_matrix33FA_genglslstdlib_genglsl_impl.mtlx
            ND_add_matrix44FAIM_add_matrix44FA_genglslstdlib_genglsl_impl.mtlx
            ND_subtract_floatIM_subtract_float_genglslstdlib_genglsl_impl.mtlx +
            ND_subtract_integerIM_subtract_integer_genglslstdlib_genglsl_impl.mtlx
            ND_subtract_color3IM_subtract_color3_genglslstdlib_genglsl_impl.mtlx
            ND_subtract_color4IM_subtract_color4_genglslstdlib_genglsl_impl.mtlx
            ND_subtract_vector2IM_subtract_vector2_genglslstdlib_genglsl_impl.mtlx @@ -889,7 +1026,7 @@
            First Library Definitions / I
            ND_transformmatrix_vector3IM_transformmatrix_vector3_genglslstdlib_genglsl_impl.mtlx
            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genglslstdlib_genglsl_impl.mtlx
            ND_transformmatrix_vector4IM_transformmatrix_vector4_genglslstdlib_genglsl_impl.mtlx -
            ND_normalmapIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx +
            ND_normalmap_floatIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx
            ND_normalmap_vector2IM_normalmap_vector2_genglslstdlib_genglsl_impl.mtlx
            ND_transpose_matrix33IM_transpose_matrix33_genglslstdlib_genglsl_impl.mtlx
            ND_transpose_matrix44IM_transpose_matrix44_genglslstdlib_genglsl_impl.mtlx @@ -965,59 +1102,84 @@
            First Library Definitions / I
            ND_mix_vector4_vector4IM_mix_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
            ND_mix_surfaceshaderIM_mix_surfaceshader_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_floatIM_ifgreater_float_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreater_integerIM_ifgreater_integer_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_color3IM_ifgreater_color3_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_color4IM_ifgreater_color4_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_vector2IM_ifgreater_vector2_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_vector3IM_ifgreater_vector3_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_vector4IM_ifgreater_vector4_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreater_matrix33IM_ifgreater_matrix33_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreater_matrix44IM_ifgreater_matrix44_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_floatIIM_ifgreater_floatI_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreater_integerIIM_ifgreater_integerI_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_color3IIM_ifgreater_color3I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_color4IIM_ifgreater_color4I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_vector2IIM_ifgreater_vector2I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_vector3IIM_ifgreater_vector3I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreater_vector4IIM_ifgreater_vector4I_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_floatIM_ifgreatereq_float_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreatereq_integerIM_ifgreatereq_integer_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_color3IM_ifgreatereq_color3_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_color4IM_ifgreatereq_color4_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genglslstdlib_genglsl_impl.mtlx
            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genglslstdlib_genglsl_impl.mtlx +
            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_floatIM_ifequal_float_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_integerIM_ifequal_integer_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_color3IM_ifequal_color3_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_color4IM_ifequal_color4_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector2IM_ifequal_vector2_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector3IM_ifequal_vector3_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector4IM_ifequal_vector4_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_matrix33IM_ifequal_matrix33_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_matrix44IM_ifequal_matrix44_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_floatIIM_ifequal_floatI_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_integerIIM_ifequal_integerI_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_color3IIM_ifequal_color3I_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_color4IIM_ifequal_color4I_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector2IIM_ifequal_vector2I_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector3IIM_ifequal_vector3I_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector4IIM_ifequal_vector4I_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_matrix33IIM_ifequal_matrix33I_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_matrix44IIM_ifequal_matrix44I_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_floatBIM_ifequal_floatB_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_integerBIM_ifequal_integerB_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_color3BIM_ifequal_color3B_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_color4BIM_ifequal_color4B_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector2BIM_ifequal_vector2B_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector3BIM_ifequal_vector3B_genglslstdlib_genglsl_impl.mtlx
            ND_ifequal_vector4BIM_ifequal_vector4B_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_matrix33BIM_ifequal_matrix33B_genglslstdlib_genglsl_impl.mtlx +
            ND_ifequal_matrix44BIM_ifequal_matrix44B_genglslstdlib_genglsl_impl.mtlx
            ND_switch_floatIM_switch_float_genglslstdlib_genglsl_impl.mtlx
            ND_switch_color3IM_switch_color3_genglslstdlib_genglsl_impl.mtlx
            ND_switch_color4IM_switch_color4_genglslstdlib_genglsl_impl.mtlx
            ND_switch_vector2IM_switch_vector2_genglslstdlib_genglsl_impl.mtlx
            ND_switch_vector3IM_switch_vector3_genglslstdlib_genglsl_impl.mtlx
            ND_switch_vector4IM_switch_vector4_genglslstdlib_genglsl_impl.mtlx +
            ND_switch_matrix33IM_switch_matrix33_genglslstdlib_genglsl_impl.mtlx +
            ND_switch_matrix44IM_switch_matrix44_genglslstdlib_genglsl_impl.mtlx
            ND_switch_floatIIM_switch_floatI_genglslstdlib_genglsl_impl.mtlx
            ND_switch_color3IIM_switch_color3I_genglslstdlib_genglsl_impl.mtlx
            ND_switch_color4IIM_switch_color4I_genglslstdlib_genglsl_impl.mtlx
            ND_switch_vector2IIM_switch_vector2I_genglslstdlib_genglsl_impl.mtlx
            ND_switch_vector3IIM_switch_vector3I_genglslstdlib_genglsl_impl.mtlx
            ND_switch_vector4IIM_switch_vector4I_genglslstdlib_genglsl_impl.mtlx +
            ND_switch_matrix33IIM_switch_matrix33I_genglslstdlib_genglsl_impl.mtlx +
            ND_switch_matrix44IIM_switch_matrix44I_genglslstdlib_genglsl_impl.mtlx
            ND_convert_float_color3IM_convert_float_color3_genglslstdlib_genglsl_impl.mtlx
            ND_convert_float_color4IM_convert_float_color4_genglslstdlib_genglsl_impl.mtlx
            ND_convert_float_vector2IM_convert_float_vector2_genglslstdlib_genglsl_impl.mtlx @@ -1035,41 +1197,6 @@
            First Library Definitions / I
            ND_convert_color4_color3IM_convert_color4_color3_genglslstdlib_genglsl_impl.mtlx
            ND_convert_boolean_floatIM_convert_boolean_float_genglslstdlib_genglsl_impl.mtlx
            ND_convert_integer_floatIM_convert_integer_float_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_float_color3IM_swizzle_float_color3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_float_color4IM_swizzle_float_color4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_float_vector2IM_swizzle_float_vector2_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_float_vector3IM_swizzle_float_vector3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_float_vector4IM_swizzle_float_vector4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color3_floatIM_swizzle_color3_float_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color3_color3IM_swizzle_color3_color3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color3_color4IM_swizzle_color3_color4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color4_floatIM_swizzle_color4_float_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color4_color3IM_swizzle_color4_color3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color4_color4IM_swizzle_color4_color4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genglslstdlib_genglsl_impl.mtlx -
            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
            ND_combine2_vector2IM_combine2_vector2_genglslstdlib_genglsl_impl.mtlx
            ND_combine2_color4CFIM_combine2_color4CF_genglslstdlib_genglsl_impl.mtlx
            ND_combine2_vector4VFIM_combine2_vector4VF_genglslstdlib_genglsl_impl.mtlx @@ -1081,6 +1208,11 @@
            First Library Definitions / I
            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genglslstdlib_genglsl_impl.mtlx
            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genglslstdlib_genglsl_impl.mtlx
            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genglslstdlib_genglsl_impl.mtlx +
            ND_extract_color3IM_extract_color3_genglslstdlib_genglsl_impl.mtlx +
            ND_extract_color4IM_extract_color4_genglslstdlib_genglsl_impl.mtlx +
            ND_extract_vector2IM_extract_vector2_genglslstdlib_genglsl_impl.mtlx +
            ND_extract_vector3IM_extract_vector3_genglslstdlib_genglsl_impl.mtlx +
            ND_extract_vector4IM_extract_vector4_genglslstdlib_genglsl_impl.mtlx
            ND_blur_floatIM_blur_float_genglslstdlib_genglsl_impl.mtlx
            ND_blur_color3IM_blur_color3_genglslstdlib_genglsl_impl.mtlx
            ND_blur_color4IM_blur_color4_genglslstdlib_genglsl_impl.mtlx @@ -1107,7 +1239,7 @@
            First Library Definitions / I
            -
            549 shaders: genmdl +
            546 shaders: genmdl
            DefinitionImplementationFile
            ND_viewdirection_vector3IM_viewdirection_vector3_genmdlnprlib_genmdl_impl.mtlx
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1234,6 +1366,7 @@
            First Library Definitions / I
            ND_frame_floatIM_frame_float_genmdlstdlib_genmdl_impl.mtlx
            ND_time_floatIM_time_float_genmdlstdlib_genmdl_impl.mtlx
            ND_add_floatIM_add_float_genmdlstdlib_genmdl_impl.mtlx +
            ND_add_integerIM_add_integer_genmdlstdlib_genmdl_impl.mtlx
            ND_add_color3IM_add_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_add_color4IM_add_color4_genmdlstdlib_genmdl_impl.mtlx
            ND_add_vector2IM_add_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1249,6 +1382,7 @@
            First Library Definitions / I
            ND_add_matrix33FAIM_add_matrix33FA_genmdlstdlib_genmdl_impl.mtlx
            ND_add_matrix44FAIM_add_matrix44FA_genmdlstdlib_genmdl_impl.mtlx
            ND_subtract_floatIM_subtract_float_genmdlstdlib_genmdl_impl.mtlx +
            ND_subtract_integerIM_subtract_integer_genmdlstdlib_genmdl_impl.mtlx
            ND_subtract_color3IM_subtract_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_subtract_color4IM_subtract_color4_genmdlstdlib_genmdl_impl.mtlx
            ND_subtract_vector2IM_subtract_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1441,7 +1575,7 @@
            First Library Definitions / I
            ND_transformmatrix_vector3IM_transformmatrix_vector3_genmdlstdlib_genmdl_impl.mtlx
            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genmdlstdlib_genmdl_impl.mtlx
            ND_transformmatrix_vector4IM_transformmatrix_vector4_genmdlstdlib_genmdl_impl.mtlx -
            ND_normalmapIM_normalmap_float_genmdlstdlib_genmdl_impl.mtlx +
            ND_normalmap_floatIM_normalmap_float_genmdlstdlib_genmdl_impl.mtlx
            ND_normalmap_vector2IM_normalmap_vector2_genmdlstdlib_genmdl_impl.mtlx
            ND_transpose_matrix33IM_transpose_matrix33_genmdlstdlib_genmdl_impl.mtlx
            ND_transpose_matrix44IM_transpose_matrix44_genmdlstdlib_genmdl_impl.mtlx @@ -1519,59 +1653,84 @@
            First Library Definitions / I
            ND_mix_displacementshaderIM_mix_displacementshader_genmdlstdlib_genmdl_impl.mtlx
            ND_mix_volumeshaderIM_mix_volumeshader_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_floatIM_ifgreater_float_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreater_integerIM_ifgreater_integer_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_color3IM_ifgreater_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_color4IM_ifgreater_color4_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_vector2IM_ifgreater_vector2_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_vector3IM_ifgreater_vector3_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_vector4IM_ifgreater_vector4_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreater_matrix33IM_ifgreater_matrix33_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreater_matrix44IM_ifgreater_matrix44_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_floatIIM_ifgreater_floatI_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreater_integerIIM_ifgreater_integerI_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_color3IIM_ifgreater_color3I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_color4IIM_ifgreater_color4I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_vector2IIM_ifgreater_vector2I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_vector3IIM_ifgreater_vector3I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreater_vector4IIM_ifgreater_vector4I_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_floatIM_ifgreatereq_float_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreatereq_integerIM_ifgreatereq_integer_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_color3IM_ifgreatereq_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_color4IM_ifgreatereq_color4_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_floatIM_ifequal_float_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_integerIM_ifequal_integer_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_color3IM_ifequal_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_color4IM_ifequal_color4_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector2IM_ifequal_vector2_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector3IM_ifequal_vector3_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector4IM_ifequal_vector4_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_matrix33IM_ifequal_matrix33_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_matrix44IM_ifequal_matrix44_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_floatIIM_ifequal_floatI_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_integerIIM_ifequal_integerI_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_color3IIM_ifequal_color3I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_color4IIM_ifequal_color4I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector2IIM_ifequal_vector2I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector3IIM_ifequal_vector3I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector4IIM_ifequal_vector4I_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_matrix33IIM_ifequal_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_matrix44IIM_ifequal_matrix44I_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_floatBIM_ifequal_floatB_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_integerBIM_ifequal_integerB_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_color3BIM_ifequal_color3B_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_color4BIM_ifequal_color4B_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector2BIM_ifequal_vector2B_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector3BIM_ifequal_vector3B_genmdlstdlib_genmdl_impl.mtlx
            ND_ifequal_vector4BIM_ifequal_vector4B_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_matrix33BIM_ifequal_matrix33B_genmdlstdlib_genmdl_impl.mtlx +
            ND_ifequal_matrix44BIM_ifequal_matrix44B_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_floatIM_switch_float_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_color3IM_switch_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_color4IM_switch_color4_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_vector2IM_switch_vector2_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_vector3IM_switch_vector3_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_vector4IM_switch_vector4_genmdlstdlib_genmdl_impl.mtlx +
            ND_switch_matrix33IM_switch_matrix33_genmdlstdlib_genmdl_impl.mtlx +
            ND_switch_matrix44IM_switch_matrix44_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_floatIIM_switch_floatI_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_color3IIM_switch_color3I_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_color4IIM_switch_color4I_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_vector2IIM_switch_vector2I_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_vector3IIM_switch_vector3I_genmdlstdlib_genmdl_impl.mtlx
            ND_switch_vector4IIM_switch_vector4I_genmdlstdlib_genmdl_impl.mtlx +
            ND_switch_matrix33IIM_switch_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
            ND_switch_matrix44IIM_switch_matrix44I_genmdlstdlib_genmdl_impl.mtlx
            ND_convert_float_color3IM_convert_float_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_convert_float_color4IM_convert_float_color4_genmdlstdlib_genmdl_impl.mtlx
            ND_convert_float_vector2IM_convert_float_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1589,41 +1748,6 @@
            First Library Definitions / I
            ND_convert_color4_color3IM_convert_color4_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_convert_boolean_floatIM_convert_boolean_float_genmdlstdlib_genmdl_impl.mtlx
            ND_convert_integer_floatIM_convert_integer_float_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_float_color3IM_swizzle_float_color3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_float_color4IM_swizzle_float_color4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_float_vector2IM_swizzle_float_vector2_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_float_vector3IM_swizzle_float_vector3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_float_vector4IM_swizzle_float_vector4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color3_floatIM_swizzle_color3_float_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color3_color3IM_swizzle_color3_color3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color3_color4IM_swizzle_color3_color4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color4_floatIM_swizzle_color4_float_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color4_color3IM_swizzle_color4_color3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color4_color4IM_swizzle_color4_color4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genmdlstdlib_genmdl_impl.mtlx -
            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genmdlstdlib_genmdl_impl.mtlx
            ND_combine2_vector2IM_combine2_vector2_genmdlstdlib_genmdl_impl.mtlx
            ND_combine2_color4CFIM_combine2_color4CF_genmdlstdlib_genmdl_impl.mtlx
            ND_combine2_vector4VFIM_combine2_vector4VF_genmdlstdlib_genmdl_impl.mtlx @@ -1635,6 +1759,11 @@
            First Library Definitions / I
            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genmdlstdlib_genmdl_impl.mtlx
            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genmdlstdlib_genmdl_impl.mtlx
            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genmdlstdlib_genmdl_impl.mtlx +
            ND_extract_color3IM_extract_color3_genmdlstdlib_genmdl_impl.mtlx +
            ND_extract_color4IM_extract_color4_genmdlstdlib_genmdl_impl.mtlx +
            ND_extract_vector2IM_extract_vector2_genmdlstdlib_genmdl_impl.mtlx +
            ND_extract_vector3IM_extract_vector3_genmdlstdlib_genmdl_impl.mtlx +
            ND_extract_vector4IM_extract_vector4_genmdlstdlib_genmdl_impl.mtlx
            ND_blur_floatIM_blur_float_genmdlstdlib_genmdl_impl.mtlx
            ND_blur_color3IM_blur_color3_genmdlstdlib_genmdl_impl.mtlx
            ND_blur_color4IM_blur_color4_genmdlstdlib_genmdl_impl.mtlx @@ -1661,7 +1790,7 @@
            First Library Definitions / I
            -
            537 shaders: genosl +
            534 shaders: genosl
            DefinitionImplementationFile
            ND_viewdirection_vector3IM_viewdirection_vector3_genoslnprlib_genosl_impl.mtlx
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1778,6 +1907,7 @@
            First Library Definitions / I
            ND_frame_floatIM_frame_float_genoslstdlib_genosl_impl.mtlx
            ND_time_floatIM_time_float_genoslstdlib_genosl_impl.mtlx
            ND_add_floatIM_add_float_genoslstdlib_genosl_impl.mtlx +
            ND_add_integerIM_add_integer_genoslstdlib_genosl_impl.mtlx
            ND_add_color3IM_add_color3_genoslstdlib_genosl_impl.mtlx
            ND_add_color4IM_add_color4_genoslstdlib_genosl_impl.mtlx
            ND_add_vector2IM_add_vector2_genoslstdlib_genosl_impl.mtlx @@ -1793,6 +1923,7 @@
            First Library Definitions / I
            ND_add_matrix33FAIM_add_matrix33FA_genoslstdlib_genosl_impl.mtlx
            ND_add_matrix44FAIM_add_matrix44FA_genoslstdlib_genosl_impl.mtlx
            ND_subtract_floatIM_subtract_float_genoslstdlib_genosl_impl.mtlx +
            ND_subtract_integerIM_subtract_integer_genoslstdlib_genosl_impl.mtlx
            ND_subtract_color3IM_subtract_color3_genoslstdlib_genosl_impl.mtlx
            ND_subtract_color4IM_subtract_color4_genoslstdlib_genosl_impl.mtlx
            ND_subtract_vector2IM_subtract_vector2_genoslstdlib_genosl_impl.mtlx @@ -1985,7 +2116,7 @@
            First Library Definitions / I
            ND_transformmatrix_vector3IM_transformmatrix_vector3_genoslstdlib_genosl_impl.mtlx
            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genoslstdlib_genosl_impl.mtlx
            ND_transformmatrix_vector4IM_transformmatrix_vector4_genoslstdlib_genosl_impl.mtlx -
            ND_normalmapIM_normalmap_float_genoslstdlib_genosl_impl.mtlx +
            ND_normalmap_floatIM_normalmap_float_genoslstdlib_genosl_impl.mtlx
            ND_normalmap_vector2IM_normalmap_vector2_genoslstdlib_genosl_impl.mtlx
            ND_transpose_matrix33IM_transpose_matrix33_genoslstdlib_genosl_impl.mtlx
            ND_transpose_matrix44IM_transpose_matrix44_genoslstdlib_genosl_impl.mtlx @@ -2061,59 +2192,84 @@
            First Library Definitions / I
            ND_mix_vector4_vector4IM_mix_vector4_vector4_genoslstdlib_genosl_impl.mtlx
            ND_mix_surfaceshaderIM_mix_surfaceshader_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_floatIM_ifgreater_float_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreater_integerIM_ifgreater_integer_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_color3IM_ifgreater_color3_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_color4IM_ifgreater_color4_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_vector2IM_ifgreater_vector2_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_vector3IM_ifgreater_vector3_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_vector4IM_ifgreater_vector4_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreater_matrix33IM_ifgreater_matrix33_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreater_matrix44IM_ifgreater_matrix44_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_floatIIM_ifgreater_floatI_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreater_integerIIM_ifgreater_integerI_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_color3IIM_ifgreater_color3I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_color4IIM_ifgreater_color4I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_vector2IIM_ifgreater_vector2I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_vector3IIM_ifgreater_vector3I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreater_vector4IIM_ifgreater_vector4I_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_floatIM_ifgreatereq_float_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreatereq_integerIM_ifgreatereq_integer_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_color3IM_ifgreatereq_color3_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_color4IM_ifgreatereq_color4_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genoslstdlib_genosl_impl.mtlx
            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genoslstdlib_genosl_impl.mtlx +
            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_floatIM_ifequal_float_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_integerIM_ifequal_integer_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_color3IM_ifequal_color3_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_color4IM_ifequal_color4_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector2IM_ifequal_vector2_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector3IM_ifequal_vector3_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector4IM_ifequal_vector4_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_matrix33IM_ifequal_matrix33_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_matrix44IM_ifequal_matrix44_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_floatIIM_ifequal_floatI_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_integerIIM_ifequal_integerI_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_color3IIM_ifequal_color3I_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_color4IIM_ifequal_color4I_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector2IIM_ifequal_vector2I_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector3IIM_ifequal_vector3I_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector4IIM_ifequal_vector4I_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_matrix33IIM_ifequal_matrix33I_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_matrix44IIM_ifequal_matrix44I_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_floatBIM_ifequal_floatB_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_integerBIM_ifequal_integerB_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_color3BIM_ifequal_color3B_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_color4BIM_ifequal_color4B_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector2BIM_ifequal_vector2B_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector3BIM_ifequal_vector3B_genoslstdlib_genosl_impl.mtlx
            ND_ifequal_vector4BIM_ifequal_vector4B_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_matrix33BIM_ifequal_matrix33B_genoslstdlib_genosl_impl.mtlx +
            ND_ifequal_matrix44BIM_ifequal_matrix44B_genoslstdlib_genosl_impl.mtlx
            ND_switch_floatIM_switch_float_genoslstdlib_genosl_impl.mtlx
            ND_switch_color3IM_switch_color3_genoslstdlib_genosl_impl.mtlx
            ND_switch_color4IM_switch_color4_genoslstdlib_genosl_impl.mtlx
            ND_switch_vector2IM_switch_vector2_genoslstdlib_genosl_impl.mtlx
            ND_switch_vector3IM_switch_vector3_genoslstdlib_genosl_impl.mtlx
            ND_switch_vector4IM_switch_vector4_genoslstdlib_genosl_impl.mtlx +
            ND_switch_matrix33IM_switch_matrix33_genoslstdlib_genosl_impl.mtlx +
            ND_switch_matrix44IM_switch_matrix44_genoslstdlib_genosl_impl.mtlx
            ND_switch_floatIIM_switch_floatI_genoslstdlib_genosl_impl.mtlx
            ND_switch_color3IIM_switch_color3I_genoslstdlib_genosl_impl.mtlx
            ND_switch_color4IIM_switch_color4I_genoslstdlib_genosl_impl.mtlx
            ND_switch_vector2IIM_switch_vector2I_genoslstdlib_genosl_impl.mtlx
            ND_switch_vector3IIM_switch_vector3I_genoslstdlib_genosl_impl.mtlx
            ND_switch_vector4IIM_switch_vector4I_genoslstdlib_genosl_impl.mtlx +
            ND_switch_matrix33IIM_switch_matrix33I_genoslstdlib_genosl_impl.mtlx +
            ND_switch_matrix44IIM_switch_matrix44I_genoslstdlib_genosl_impl.mtlx
            ND_convert_float_color3IM_convert_float_color3_genoslstdlib_genosl_impl.mtlx
            ND_convert_float_color4IM_convert_float_color4_genoslstdlib_genosl_impl.mtlx
            ND_convert_float_vector2IM_convert_float_vector2_genoslstdlib_genosl_impl.mtlx @@ -2131,41 +2287,6 @@
            First Library Definitions / I
            ND_convert_color4_color3IM_convert_color4_color3_genoslstdlib_genosl_impl.mtlx
            ND_convert_boolean_floatIM_convert_boolean_float_genoslstdlib_genosl_impl.mtlx
            ND_convert_integer_floatIM_convert_integer_float_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_float_color3IM_swizzle_float_color3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_float_color4IM_swizzle_float_color4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_float_vector2IM_swizzle_float_vector2_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_float_vector3IM_swizzle_float_vector3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_float_vector4IM_swizzle_float_vector4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color3_floatIM_swizzle_color3_float_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color3_color3IM_swizzle_color3_color3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color3_color4IM_swizzle_color3_color4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color4_floatIM_swizzle_color4_float_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color4_color3IM_swizzle_color4_color3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color4_color4IM_swizzle_color4_color4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genoslstdlib_genosl_impl.mtlx -
            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genoslstdlib_genosl_impl.mtlx
            ND_combine2_vector2IM_combine2_vector2_genoslstdlib_genosl_impl.mtlx
            ND_combine2_color4CFIM_combine2_color4CF_genoslstdlib_genosl_impl.mtlx
            ND_combine2_vector4VFIM_combine2_vector4VF_genoslstdlib_genosl_impl.mtlx @@ -2177,6 +2298,11 @@
            First Library Definitions / I
            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genoslstdlib_genosl_impl.mtlx
            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genoslstdlib_genosl_impl.mtlx
            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genoslstdlib_genosl_impl.mtlx +
            ND_extract_color3IM_extract_color3_genoslstdlib_genosl_impl.mtlx +
            ND_extract_color4IM_extract_color4_genoslstdlib_genosl_impl.mtlx +
            ND_extract_vector2IM_extract_vector2_genoslstdlib_genosl_impl.mtlx +
            ND_extract_vector3IM_extract_vector3_genoslstdlib_genosl_impl.mtlx +
            ND_extract_vector4IM_extract_vector4_genoslstdlib_genosl_impl.mtlx
            ND_blur_floatIM_blur_float_genoslstdlib_genosl_impl.mtlx
            ND_blur_color3IM_blur_color3_genoslstdlib_genosl_impl.mtlx
            ND_blur_color4IM_blur_color4_genoslstdlib_genosl_impl.mtlx @@ -2203,7 +2329,7 @@
            First Library Definitions / I
            -
            190 node graphs +
            185 node graphs
            DefinitionNodeGraphFile
            ND_disney_brdf_2012_surfaceIM_disney_brdf_2012_surface_brdf_explorerdisney_brdf_2012.mtlx
            ND_disney_bsdf_2015_surfaceIM_disney_bsdf_2015_surface_pbrtdisney_brdf_2015.mtlx @@ -2385,11 +2511,6 @@
            First Library Definitions / I
            ND_convert_vector4_surfaceshaderNG_convert_vector4_surfaceshaderstdlib_ng.mtlx
            ND_convert_integer_surfaceshaderNG_convert_integer_surfaceshaderstdlib_ng.mtlx
            ND_convert_boolean_surfaceshaderNG_convert_boolean_surfaceshaderstdlib_ng.mtlx -
            ND_extract_color3NG_extract_color3stdlib_ng.mtlx -
            ND_extract_color4NG_extract_color4stdlib_ng.mtlx -
            ND_extract_vector2NG_extract_vector2stdlib_ng.mtlx -
            ND_extract_vector3NG_extract_vector3stdlib_ng.mtlx -
            ND_extract_vector4NG_extract_vector4stdlib_ng.mtlx
            ND_separate2_vector2NG_separate2_vector2stdlib_ng.mtlx
            ND_separate3_color3NG_separate3_color3stdlib_ng.mtlx
            ND_separate3_vector3NG_separate3_vector3stdlib_ng.mtlx @@ -2406,7 +2527,7 @@
            Second Library Definitions /
            DefinitionImplementationFile
            -
            541 shaders: genglsl +
            542 shaders: genglsl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2419,6 +2540,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -2952,7 +3074,7 @@
            Second Library Definitions /
            -
            549 shaders: genmdl +
            550 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -2962,6 +3084,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -3511,7 +3634,7 @@
            Second Library Definitions /
            DefinitionImplementationFile
            -
            540 shaders: genosl +
            541 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -3521,6 +3644,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -4159,9 +4283,9 @@
            Second Library Definitions /

            Implementation Comparison

            -

            First library implementation count: 2934 -Second library implementation count: 2169

            -
            765 implementations added +

            First library implementation count: 3030 +Second library implementation count: 2172

            +
            858 implementations added @@ -4192,6 +4316,10 @@

            Implementation Comparison

            + + + + @@ -4358,6 +4486,26 @@

            Implementation Comparison

            + + + + + + + + + + + + + + + + + + + + @@ -4401,6 +4549,42 @@

            Implementation Comparison

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4416,6 +4600,30 @@

            Implementation Comparison

            + + + + + + + + + + + + + + + + + + + + + + + + @@ -4428,6 +4636,30 @@

            Implementation Comparison

            + + + + + + + + + + + + + + + + + + + + + + + + @@ -4701,6 +4933,10 @@

            Implementation Comparison

            + + + + @@ -4726,47 +4962,28 @@

            Implementation Comparison

            + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4934,11 +5151,11 @@

            Implementation Comparison

            -
            1080 implementations modified +
            1089 implementations modified
            Name Node Category Node Type
            IM_add_color4_genmsl add color4
            IM_add_edf_genmsl add EDF
            IM_add_float_genmsl add float
            IM_add_integer_genglsl add integer
            IM_add_integer_genmdl add integer
            IM_add_integer_genmsl add integer
            IM_add_integer_genosl add integer
            IM_add_matrix33FA_genmsl add matrix33
            IM_add_matrix33_genmsl add matrix33
            IM_add_matrix44FA_genmsl add matrix44
            IM_exp_vector2_genmsl exp vector2
            IM_exp_vector3_genmsl exp vector3
            IM_exp_vector4_genmsl exp vector4
            IM_extract_color3_genglsl extract float
            IM_extract_color3_genmdl extract float
            IM_extract_color3_genmsl extract float
            IM_extract_color3_genosl extract float
            IM_extract_color4_genglsl extract float
            IM_extract_color4_genmdl extract float
            IM_extract_color4_genmsl extract float
            IM_extract_color4_genosl extract float
            IM_extract_vector2_genglsl extract float
            IM_extract_vector2_genmdl extract float
            IM_extract_vector2_genmsl extract float
            IM_extract_vector2_genosl extract float
            IM_extract_vector3_genglsl extract float
            IM_extract_vector3_genmdl extract float
            IM_extract_vector3_genmsl extract float
            IM_extract_vector3_genosl extract float
            IM_extract_vector4_genglsl extract float
            IM_extract_vector4_genmdl extract float
            IM_extract_vector4_genmsl extract float
            IM_extract_vector4_genosl extract float
            IM_floor_color3_genmsl floor color3
            IM_floor_color4_genmsl floor color4
            IM_floor_float_genmsl floor float
            IM_ifequal_floatB_genmsl ifequal float
            IM_ifequal_floatI_genmsl ifequal float
            IM_ifequal_float_genmsl ifequal float
            IM_ifequal_integerB_genglsl ifequal integer
            IM_ifequal_integerB_genmdl ifequal integer
            IM_ifequal_integerB_genmsl ifequal integer
            IM_ifequal_integerB_genosl ifequal integer
            IM_ifequal_integerI_genglsl ifequal integer
            IM_ifequal_integerI_genmdl ifequal integer
            IM_ifequal_integerI_genmsl ifequal integer
            IM_ifequal_integerI_genosl ifequal integer
            IM_ifequal_integer_genglsl ifequal integer
            IM_ifequal_integer_genmdl ifequal integer
            IM_ifequal_integer_genmsl ifequal integer
            IM_ifequal_integer_genosl ifequal integer
            IM_ifequal_matrix33B_genglsl ifequal matrix33
            IM_ifequal_matrix33B_genmdl ifequal matrix33
            IM_ifequal_matrix33B_genmsl ifequal matrix33
            IM_ifequal_matrix33B_genosl ifequal matrix33
            IM_ifequal_matrix33I_genglsl ifequal matrix33
            IM_ifequal_matrix33I_genmdl ifequal matrix33
            IM_ifequal_matrix33I_genmsl ifequal matrix33
            IM_ifequal_matrix33I_genosl ifequal matrix33
            IM_ifequal_matrix33_genglsl ifequal matrix33
            IM_ifequal_matrix33_genmdl ifequal matrix33
            IM_ifequal_matrix33_genmsl ifequal matrix33
            IM_ifequal_matrix33_genosl ifequal matrix33
            IM_ifequal_matrix44B_genglsl ifequal matrix44
            IM_ifequal_matrix44B_genmdl ifequal matrix44
            IM_ifequal_matrix44B_genmsl ifequal matrix44
            IM_ifequal_matrix44B_genosl ifequal matrix44
            IM_ifequal_matrix44I_genglsl ifequal matrix44
            IM_ifequal_matrix44I_genmdl ifequal matrix44
            IM_ifequal_matrix44I_genmsl ifequal matrix44
            IM_ifequal_matrix44I_genosl ifequal matrix44
            IM_ifequal_matrix44_genglsl ifequal matrix44
            IM_ifequal_matrix44_genmdl ifequal matrix44
            IM_ifequal_matrix44_genmsl ifequal matrix44
            IM_ifequal_matrix44_genosl ifequal matrix44
            IM_ifequal_vector2B_genmsl ifequal vector2
            IM_ifequal_vector2I_genmsl ifequal vector2
            IM_ifequal_vector2_genmsl ifequal vector2
            IM_ifgreater_color4_genmsl ifgreater color4
            IM_ifgreater_floatI_genmsl ifgreater float
            IM_ifgreater_float_genmsl ifgreater float
            IM_ifgreater_integerI_genglsl ifgreater integer
            IM_ifgreater_integerI_genmdl ifgreater integer
            IM_ifgreater_integerI_genmsl ifgreater integer
            IM_ifgreater_integerI_genosl ifgreater integer
            IM_ifgreater_integer_genglsl ifgreater integer
            IM_ifgreater_integer_genmdl ifgreater integer
            IM_ifgreater_integer_genmsl ifgreater integer
            IM_ifgreater_integer_genosl ifgreater integer
            IM_ifgreater_matrix33I_genglsl ifgreater matrix33
            IM_ifgreater_matrix33I_genmdl ifgreater matrix33
            IM_ifgreater_matrix33I_genmsl ifgreater matrix33
            IM_ifgreater_matrix33I_genosl ifgreater matrix33
            IM_ifgreater_matrix33_genglsl ifgreater matrix33
            IM_ifgreater_matrix33_genmdl ifgreater matrix33
            IM_ifgreater_matrix33_genmsl ifgreater matrix33
            IM_ifgreater_matrix33_genosl ifgreater matrix33
            IM_ifgreater_matrix44I_genglsl ifgreater matrix44
            IM_ifgreater_matrix44I_genmdl ifgreater matrix44
            IM_ifgreater_matrix44I_genmsl ifgreater matrix44
            IM_ifgreater_matrix44I_genosl ifgreater matrix44
            IM_ifgreater_matrix44_genglsl ifgreater matrix44
            IM_ifgreater_matrix44_genmdl ifgreater matrix44
            IM_ifgreater_matrix44_genmsl ifgreater matrix44
            IM_ifgreater_matrix44_genosl ifgreater matrix44
            IM_ifgreater_vector2I_genmsl ifgreater vector2
            IM_ifgreater_vector2_genmsl ifgreater vector2
            IM_ifgreater_vector3I_genmsl ifgreater vector3
            IM_ifgreatereq_color4_genmsl ifgreatereq color4
            IM_ifgreatereq_floatI_genmsl ifgreatereq float
            IM_ifgreatereq_float_genmsl ifgreatereq float
            IM_ifgreatereq_integerI_genglsl ifgreatereq integer
            IM_ifgreatereq_integerI_genmdl ifgreatereq integer
            IM_ifgreatereq_integerI_genmsl ifgreatereq integer
            IM_ifgreatereq_integerI_genosl ifgreatereq integer
            IM_ifgreatereq_integer_genglsl ifgreatereq integer
            IM_ifgreatereq_integer_genmdl ifgreatereq integer
            IM_ifgreatereq_integer_genmsl ifgreatereq integer
            IM_ifgreatereq_integer_genosl ifgreatereq integer
            IM_ifgreatereq_matrix33I_genglsl ifgreatereq matrix33
            IM_ifgreatereq_matrix33I_genmdl ifgreatereq matrix33
            IM_ifgreatereq_matrix33I_genmsl ifgreatereq matrix33
            IM_ifgreatereq_matrix33I_genosl ifgreatereq matrix33
            IM_ifgreatereq_matrix33_genglsl ifgreatereq matrix33
            IM_ifgreatereq_matrix33_genmdl ifgreatereq matrix33
            IM_ifgreatereq_matrix33_genmsl ifgreatereq matrix33
            IM_ifgreatereq_matrix33_genosl ifgreatereq matrix33
            IM_ifgreatereq_matrix44I_genglsl ifgreatereq matrix44
            IM_ifgreatereq_matrix44I_genmdl ifgreatereq matrix44
            IM_ifgreatereq_matrix44I_genmsl ifgreatereq matrix44
            IM_ifgreatereq_matrix44I_genosl ifgreatereq matrix44
            IM_ifgreatereq_matrix44_genglsl ifgreatereq matrix44
            IM_ifgreatereq_matrix44_genmdl ifgreatereq matrix44
            IM_ifgreatereq_matrix44_genmsl ifgreatereq matrix44
            IM_ifgreatereq_matrix44_genosl ifgreatereq matrix44
            IM_ifgreatereq_vector2I_genmsl ifgreatereq vector2
            IM_ifgreatereq_vector2_genmsl ifgreatereq vector2
            IM_ifgreatereq_vector3I_genmsl ifgreatereq vector3
            IM_subtract_color4FA_genmsl subtract color4
            IM_subtract_color4_genmsl subtract color4
            IM_subtract_float_genmsl subtract float
            IM_subtract_integer_genglsl subtract integer
            IM_subtract_integer_genmdl subtract integer
            IM_subtract_integer_genmsl subtract integer
            IM_subtract_integer_genosl subtract integer
            IM_subtract_matrix33FA_genmsl subtract matrix33
            IM_subtract_matrix33_genmsl subtract matrix33
            IM_subtract_matrix44FA_genmsl subtract matrix44
            IM_switch_color4_genmsl switch color4
            IM_switch_floatI_genmsl switch float
            IM_switch_float_genmsl switch float
            IM_switch_matrix33I_genglsl switch matrix33
            IM_switch_matrix33I_genmdl switch matrix33
            IM_switch_matrix33I_genmsl switch matrix33
            IM_switch_matrix33I_genosl switch matrix33
            IM_switch_matrix33_genglsl switch matrix33
            IM_switch_matrix33_genmdl switch matrix33
            IM_switch_matrix33_genmsl switch matrix33
            IM_switch_matrix33_genosl switch matrix33
            IM_switch_matrix44I_genglsl switch matrix44
            IM_switch_matrix44I_genmdl switch matrix44
            IM_switch_matrix44I_genmsl switch matrix44
            IM_switch_matrix44I_genosl switch matrix44
            IM_switch_matrix44_genglsl switch matrix44
            IM_switch_matrix44_genmdl switch matrix44
            IM_switch_matrix44_genmsl switch matrix44
            IM_switch_matrix44_genosl switch matrix44
            IM_switch_vector2I_genmsl switch vector2
            IM_switch_vector2_genmsl switch vector2
            IM_switch_vector3I_genmsl switch vector3
            IM_switch_vector3_genmsl switch vector3
            IM_switch_vector4I_genmsl switch vector4
            IM_switch_vector4_genmsl switch vector4
            IM_swizzle_color3_color3_genmsl swizzle color3
            IM_swizzle_color3_color4_genmsl swizzle color4
            IM_swizzle_color3_float_genmsl swizzle float
            IM_swizzle_color3_vector2_genmsl swizzle vector2
            IM_swizzle_color3_vector3_genmsl swizzle vector3
            IM_swizzle_color3_vector4_genmsl swizzle vector4
            IM_swizzle_color4_color3_genmsl swizzle color3
            IM_swizzle_color4_color4_genmsl swizzle color4
            IM_swizzle_color4_float_genmsl swizzle float
            IM_swizzle_color4_vector2_genmsl swizzle vector2
            IM_swizzle_color4_vector3_genmsl swizzle vector3
            IM_swizzle_color4_vector4_genmsl swizzle vector4
            IM_swizzle_float_color3_genmsl swizzle color3
            IM_swizzle_float_color4_genmsl swizzle color4
            IM_swizzle_float_vector2_genmsl swizzle vector2
            IM_swizzle_float_vector3_genmsl swizzle vector3
            IM_swizzle_float_vector4_genmsl swizzle vector4
            IM_swizzle_vector2_color3_genmsl swizzle color3
            IM_swizzle_vector2_color4_genmsl swizzle color4
            IM_swizzle_vector2_float_genmsl swizzle float
            IM_swizzle_vector2_vector2_genmsl swizzle vector2
            IM_swizzle_vector2_vector3_genmsl swizzle vector3
            IM_swizzle_vector2_vector4_genmsl swizzle vector4
            IM_swizzle_vector3_color3_genmsl swizzle color3
            IM_swizzle_vector3_color4_genmsl swizzle color4
            IM_swizzle_vector3_float_genmsl swizzle float
            IM_swizzle_vector3_vector2_genmsl swizzle vector2
            IM_swizzle_vector3_vector3_genmsl swizzle vector3
            IM_swizzle_vector3_vector4_genmsl swizzle vector4
            IM_swizzle_vector4_color3_genmsl swizzle color3
            IM_swizzle_vector4_color4_genmsl swizzle color4
            IM_swizzle_vector4_float_genmsl swizzle float
            IM_swizzle_vector4_vector2_genmsl swizzle vector2
            IM_swizzle_vector4_vector3_genmsl swizzle vector3
            IM_swizzle_vector4_vector4_genmsl swizzle vector4
            IM_tan_float_genmsl tan float
            IM_tan_vector2_genmsl tan vector2
            IM_tan_vector3_genmsl tan vector3
            - + @@ -4970,7 +5187,7 @@

            Implementation Comparison

            - + @@ -4981,7 +5198,7 @@

            Implementation Comparison

            - + @@ -5018,20 +5235,24 @@

            Implementation Comparison

            - - - - - - - - + + + + + + + + + + + + - + @@ -5086,8 +5307,8 @@

            Implementation Comparison

            - - + + @@ -5130,8 +5351,8 @@

            Implementation Comparison

            - - + + @@ -5257,8 +5478,8 @@

            Implementation Comparison

            - - + + @@ -5558,7 +5779,7 @@

            Implementation Comparison

            - + @@ -5566,7 +5787,7 @@

            Implementation Comparison

            - + @@ -5607,10 +5828,10 @@

            Implementation Comparison

            - + - + @@ -5621,10 +5842,10 @@

            Implementation Comparison

            - + - + @@ -5677,7 +5898,7 @@

            Implementation Comparison

            - + @@ -5825,7 +6046,7 @@

            Implementation Comparison

            - + @@ -5907,7 +6128,7 @@

            Implementation Comparison

            - + @@ -5938,19 +6159,19 @@

            Implementation Comparison

            - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -5988,14 +6209,14 @@

            Implementation Comparison

            - + - + @@ -6012,6 +6233,11 @@

            Implementation Comparison

            + + + + + diff --git a/documents/mtlx_1381_vs_1382.html b/documents/mtlx_1381_vs_1382.html index 21cf5a96..2f1ed0a5 100644 --- a/documents/mtlx_1381_vs_1382.html +++ b/documents/mtlx_1381_vs_1382.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
            MaterialX LearnMaterialX Library Comparison

            Libraries Loaded

              -
            • Loaded 675 first library definitions from 38 files. Version 1.39.0
                +
              • Loaded 676 first library definitions from 38 files. Version 1.39.0
                • First library location: ['../../resources/libraries_1.38.2']. Search path: ""
              • -
              • Loaded 662 second library definitions from 26 files. Version 1.39
                  +
                • Loaded 663 second library definitions from 26 files. Version 1.39
                  • Second library location: ['../../resources/libraries_1.38.1']. Search path: ""
                • @@ -232,8 +232,8 @@

                  Libraries Loaded

                  Node Definition Comparison

                    -
                  • First library has 675 nodedefs.
                  • -
                  • Second library has 662 nodedefs
                  • +
                  • First library has 676 nodedefs.
                  • +
                  • Second library has 663 nodedefs
                  13 node definitions added. (Sorted by category) @@ -307,7 +307,7 @@

                  Implementations

                • Shader targets added: ['essl']
                First Library Definitions / Implementations
                -
                541 shaders: genglsl +
                542 shaders: genglsl
            Name Change
            IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 28 ) to ( 33 )
            - divide /div_ior removed from IMP_UsdPreviewSurface_surfaceshader
            - clamp /opacity_clamped removed from IMP_UsdPreviewSurface_surfaceshader
            - subtract /inverse_metalness add to IMP_UsdPreviewSurface_surfaceshader
            - mix /diffuse_bsdf_weight add to IMP_UsdPreviewSurface_surfaceshader
            - divide /R add to IMP_UsdPreviewSurface_surfaceshader
            - multiply /R_sq add to IMP_UsdPreviewSurface_surfaceshader
            - mix /specular_color_metallic add to IMP_UsdPreviewSurface_surfaceshader
            - multiply /specular_color_metallic_R_sq add to IMP_UsdPreviewSurface_surfaceshader
            - convert /coat_F0 add to IMP_UsdPreviewSurface_surfaceshader
            - attribute: value=( 1 ) removed from: weight
            - attribute: nodename=( diffuse_bsdf_weight ) added to: weight
            - Number of children on: transmission_bsdf changed from ( 5 ) to ( 6 )
            - input /roughness added to IMP_UsdPreviewSurface_surfaceshader/transmission_bsdf. Value=( 0.0, 0.0 )
            - Category changed on: F0 from mix to multiply
            - attribute: type changed on F0 from ( float ) to ( color3 )
            - Number of children on: F0 changed from ( 2 ) to ( 3 )
            - input /in1 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - input /in2 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - input /fg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - input /bg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - input /mix added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - attribute: channels=( rrr ) removed from: color0
            - attribute: value=( 1, 1, 1 ) removed from: color90
            - attribute: nodename=( specular_color_metallic ) added to: color90
            - Category changed on: coat_dielectric_bsdf from generalized_schlick_bsdf to dielectric_bsdf
            - input /tint removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
            - input /ior removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1.5 )
            - input /color0 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( )
            - input /color90 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
            - Category changed on: cutout_opacity from ifgreatereq to ifgreater
            - attribute: nodename=( opacity_clamped ) removed from: value1
            - attribute: interfacename=( opacity ) added to: value1
            IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 29 ) to ( 33 )
            - divide /div_ior removed from IMP_UsdPreviewSurface_surfaceshader
            - convert /swizzle removed from IMP_UsdPreviewSurface_surfaceshader
            - clamp /opacity_clamped removed from IMP_UsdPreviewSurface_surfaceshader
            - subtract /inverse_metalness add to IMP_UsdPreviewSurface_surfaceshader
            - mix /diffuse_bsdf_weight add to IMP_UsdPreviewSurface_surfaceshader
            - divide /R add to IMP_UsdPreviewSurface_surfaceshader
            - multiply /R_sq add to IMP_UsdPreviewSurface_surfaceshader
            - mix /specular_color_metallic add to IMP_UsdPreviewSurface_surfaceshader
            - multiply /specular_color_metallic_R_sq add to IMP_UsdPreviewSurface_surfaceshader
            - convert /coat_F0 add to IMP_UsdPreviewSurface_surfaceshader
            - attribute: value=( 1 ) removed from: weight
            - attribute: nodename=( diffuse_bsdf_weight ) added to: weight
            - Number of children on: transmission_bsdf changed from ( 5 ) to ( 6 )
            - input /roughness added to IMP_UsdPreviewSurface_surfaceshader/transmission_bsdf. Value=( 0.0, 0.0 )
            - Category changed on: F0 from mix to multiply
            - attribute: type changed on F0 from ( float ) to ( color3 )
            - Number of children on: F0 changed from ( 2 ) to ( 3 )
            - input /in1 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - input /in2 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - input /fg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - input /bg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - input /mix added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
            - attribute: nodename changed on color0 from ( swizzle ) to ( F0 )
            - attribute: value=( 1, 1, 1 ) removed from: color90
            - attribute: nodename=( specular_color_metallic ) added to: color90
            - Category changed on: coat_dielectric_bsdf from generalized_schlick_bsdf to dielectric_bsdf
            - input /tint removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
            - input /ior removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1.5 )
            - input /color0 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( )
            - input /color90 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
            - Category changed on: cutout_opacity from ifgreatereq to ifgreater
            - attribute: nodename=( opacity_clamped ) removed from: value1
            - attribute: interfacename=( opacity ) added to: value1
            IMP_UsdPrimvarReader_boolean - Number of children on: primvar changed from ( 1 ) to ( 2 )
            - input /default added to IMP_UsdPrimvarReader_boolean/primvar. Value=( )
            IMP_UsdPrimvarReader_float - Number of children on: primvar changed from ( 1 ) to ( 2 )
            - input /default added to IMP_UsdPrimvarReader_float/primvar. Value=( )
            IMP_UsdPrimvarReader_integer - Number of children on: primvar changed from ( 1 ) to ( 2 )
            - input /default added to IMP_UsdPrimvarReader_integer/primvar. Value=( )
            IM_acos_vector4_genosl - attribute: file=( stdlib/genosl/mx_acos.inline ) removed from: IM_acos_vector4_genosl
            - attribute: sourcecode=( acos({{in}}) ) added to: IM_acos_vector4_genosl
            IM_add_bsdf_genglsl - attribute: file=( pbrlib/genglsl/mx_add_bsdf.glsl ) removed from: IM_add_bsdf_genglsl
            - attribute: function=( mx_add_bsdf ) removed from: IM_add_bsdf_genglsl
            IM_add_bsdf_genmdl - attribute: sourcecode changed on IM_add_bsdf_genmdl from ( {{in1}} ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_add_bsdf(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
            IM_add_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_add.inline ) removed from: IM_add_bsdf_genosl
            IM_add_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_add.inline ) removed from: IM_add_bsdf_genosl
            - attribute: sourcecode=( ({{in1}} + {{in2}}) ) added to: IM_add_bsdf_genosl
            IM_add_color3FA_genglsl - attribute: file=( stdlib/genglsl/mx_add.inline ) removed from: IM_add_color3FA_genglsl
            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_color3FA_genglsl
            IM_add_color3FA_genosl - attribute: file=( stdlib/genosl/mx_add.inline ) removed from: IM_add_color3FA_genosl
            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_color3FA_genosl
            IM_add_color3_genglsl - attribute: file=( stdlib/genglsl/mx_add.inline ) removed from: IM_add_color3_genglsl
            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_color3_genglsl
            IM_add_color4_genosl - attribute: file=( stdlib/genosl/mx_add.inline ) removed from: IM_add_color4_genosl
            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_color4_genosl
            IM_add_edf_genglsl - attribute: file=( pbrlib/genglsl/mx_add_edf.glsl ) removed from: IM_add_edf_genglsl
            - attribute: function=( mx_add_edf ) removed from: IM_add_edf_genglsl
            IM_add_edf_genmdl - attribute: sourcecode changed on IM_add_edf_genmdl from ( {{in2}} ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_add_edf(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
            IM_add_edf_genosl - attribute: file=( pbrlib/genosl/mx_add.inline ) removed from: IM_add_edf_genosl
            IM_add_edf_genosl - attribute: file=( pbrlib/genosl/mx_add.inline ) removed from: IM_add_edf_genosl
            - attribute: sourcecode=( ({{in1}} + {{in2}}) ) added to: IM_add_edf_genosl
            IM_add_float_genglsl - attribute: file=( stdlib/genglsl/mx_add.inline ) removed from: IM_add_float_genglsl
            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_float_genglsl
            IM_add_float_genosl - attribute: file=( stdlib/genosl/mx_add.inline ) removed from: IM_add_float_genosl
            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_float_genosl
            IM_add_matrix33FA_genglsl - attribute: file=( stdlib/genglsl/mx_add.inline ) removed from: IM_add_matrix33FA_genglsl
            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_matrix33FA_genglsl
            IM_asin_vector3_genosl - attribute: file=( stdlib/genosl/mx_asin.inline ) removed from: IM_asin_vector3_genosl
            - attribute: sourcecode=( asin({{in}}) ) added to: IM_asin_vector3_genosl
            IM_asin_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_asin.inline ) removed from: IM_asin_vector4_genglsl
            - attribute: sourcecode=( asin({{in}}) ) added to: IM_asin_vector4_genglsl
            IM_asin_vector4_genosl - attribute: file=( stdlib/genosl/mx_asin.inline ) removed from: IM_asin_vector4_genosl
            - attribute: sourcecode=( asin({{in}}) ) added to: IM_asin_vector4_genosl
            IM_atan2_float_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_float_genglsl
            - attribute: sourcecode=( atan({{in1}}, {{in2}}) ) added to: IM_atan2_float_genglsl
            IM_atan2_float_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_float_genosl
            - attribute: sourcecode=( atan2({{in1}},{{in2}}) ) added to: IM_atan2_float_genosl
            IM_atan2_vector2_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector2_genglsl
            - attribute: sourcecode=( atan({{in1}}, {{in2}}) ) added to: IM_atan2_vector2_genglsl
            IM_atan2_vector2_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector2_genosl
            - attribute: sourcecode=( atan2({{in1}},{{in2}}) ) added to: IM_atan2_vector2_genosl
            IM_atan2_vector3_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector3_genglsl
            - attribute: sourcecode=( atan({{in1}}, {{in2}}) ) added to: IM_atan2_vector3_genglsl
            IM_atan2_vector3_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector3_genosl
            - attribute: sourcecode=( atan2({{in1}},{{in2}}) ) added to: IM_atan2_vector3_genosl
            IM_atan2_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector4_genglsl
            - attribute: sourcecode=( atan({{in1}}, {{in2}}) ) added to: IM_atan2_vector4_genglsl
            IM_atan2_vector4_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector4_genosl
            - attribute: sourcecode=( atan2({{in1}},{{in2}}) ) added to: IM_atan2_vector4_genosl
            IM_atan2_float_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_float_genglsl
            - attribute: sourcecode=( atan({{iny}}, {{inx}}) ) added to: IM_atan2_float_genglsl
            IM_atan2_float_genmdl - attribute: sourcecode changed on IM_atan2_float_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
            IM_atan2_float_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_float_genosl
            - attribute: sourcecode=( atan2({{iny}},{{inx}}) ) added to: IM_atan2_float_genosl
            IM_atan2_vector2_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector2_genglsl
            - attribute: sourcecode=( atan({{iny}}, {{inx}}) ) added to: IM_atan2_vector2_genglsl
            IM_atan2_vector2_genmdl - attribute: sourcecode changed on IM_atan2_vector2_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
            IM_atan2_vector2_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector2_genosl
            - attribute: sourcecode=( atan2({{iny}},{{inx}}) ) added to: IM_atan2_vector2_genosl
            IM_atan2_vector3_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector3_genglsl
            - attribute: sourcecode=( atan({{iny}}, {{inx}}) ) added to: IM_atan2_vector3_genglsl
            IM_atan2_vector3_genmdl - attribute: sourcecode changed on IM_atan2_vector3_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
            IM_atan2_vector3_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector3_genosl
            - attribute: sourcecode=( atan2({{iny}},{{inx}}) ) added to: IM_atan2_vector3_genosl
            IM_atan2_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector4_genglsl
            - attribute: sourcecode=( atan({{iny}}, {{inx}}) ) added to: IM_atan2_vector4_genglsl
            IM_atan2_vector4_genmdl - attribute: sourcecode changed on IM_atan2_vector4_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
            IM_atan2_vector4_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector4_genosl
            - attribute: sourcecode=( atan2({{iny}},{{inx}}) ) added to: IM_atan2_vector4_genosl
            IM_bitangent_vector3_genmdl - attribute: sourcecode changed on IM_bitangent_vector3_genmdl from ( mx::stdlib::mx_bitangent_vector3(mxp_space:{{space}}, mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_bitangent_vector3(mxp_space:{{space}}, mxp_index:{{index}}) )
            IM_bitangent_vector3_genosl - attribute: file=( stdlib/genosl/mx_bitangent_vector3.inline ) removed from: IM_bitangent_vector3_genosl
            - attribute: sourcecode=( transform({{space}}, normalize(dPdv)) ) added to: IM_bitangent_vector3_genosl
            IM_blackbody_genmdl - attribute: sourcecode changed on IM_blackbody_genmdl from ( mx::pbrlib::mx_blackbody(mxp_temperature:{{temperature}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_blackbody(mxp_temperature:{{temperature}}) )
            IM_burley_diffuse_bsdf_genglsl - attribute: file changed on IM_burley_diffuse_bsdf_genglsl from ( pbrlib/genglsl/mx_burley_diffuse_bsdf.glsl ) to ( mx_burley_diffuse_bsdf.glsl )
            IM_burley_diffuse_bsdf_genmdl - attribute: sourcecode changed on IM_burley_diffuse_bsdf_genmdl from ( mx::pbrlib::mx_burley_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_burley_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}) )
            IM_burley_diffuse_bsdf_genosl - attribute: file changed on IM_burley_diffuse_bsdf_genosl from ( pbrlib/genosl/mx_burley_diffuse_bsdf.osl ) to ( legacy/mx_burley_diffuse_bsdf.osl )
            IM_burley_diffuse_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_burley_diffuse_bsdf.osl ) removed from: IM_burley_diffuse_bsdf_genosl
            - attribute: function=( mx_burley_diffuse_bsdf ) removed from: IM_burley_diffuse_bsdf_genosl
            - attribute: sourcecode=( {{weight}} * burley_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) added to: IM_burley_diffuse_bsdf_genosl
            IM_burn_color3_genglsl - attribute: file changed on IM_burn_color3_genglsl from ( stdlib/genglsl/mx_burn_color3.glsl ) to ( mx_burn_color3.glsl )
            IM_burn_color3_genmdl - attribute: sourcecode changed on IM_burn_color3_genmdl from ( mx::stdlib::mx_burn_color3({{fg}}, {{bg}}, {{mix}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_burn_color3({{fg}}, {{bg}}, {{mix}}) )
            IM_burn_color3_genosl - attribute: file changed on IM_burn_color3_genosl from ( stdlib/genosl/mx_burn_color3.osl ) to ( mx_burn_color3.osl )
            IM_clamp_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_clamp.inline ) removed from: IM_clamp_vector4_genglsl
            - attribute: sourcecode=( clamp({{in}}, {{low}}, {{high}}) ) added to: IM_clamp_vector4_genglsl
            IM_clamp_vector4_genosl - attribute: file=( stdlib/genosl/mx_clamp.inline ) removed from: IM_clamp_vector4_genosl
            - attribute: sourcecode=( clamp({{in}}, {{low}}, {{high}}) ) added to: IM_clamp_vector4_genosl
            IM_conductor_bsdf_genglsl - attribute: file changed on IM_conductor_bsdf_genglsl from ( pbrlib/genglsl/mx_conductor_bsdf.glsl ) to ( mx_conductor_bsdf.glsl )
            IM_conductor_bsdf_genmdl - attribute: sourcecode changed on IM_conductor_bsdf_genmdl from ( mx::pbrlib::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) )
            IM_conductor_bsdf_genosl - attribute: file changed on IM_conductor_bsdf_genosl from ( pbrlib/genosl/mx_conductor_bsdf.osl ) to ( legacy/mx_conductor_bsdf.osl )
            IM_conductor_bsdf_genmdl - attribute: sourcecode changed on IM_conductor_bsdf_genmdl from ( mx::pbrlib::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}) )
            IM_conductor_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_conductor_bsdf.osl ) removed from: IM_conductor_bsdf_genosl
            - attribute: function=( mx_conductor_bsdf ) removed from: IM_conductor_bsdf_genosl
            - attribute: sourcecode=( {{weight}} * conductor_bsdf({{normal}}, {{tangent}}, {{roughness}}.x, {{roughness}}.y, {{ior}}, {{extinction}}, {{distribution}}, "thinfilm_thickness", {{thinfilm_thickness}}, "thinfilm_ior", {{thinfilm_ior}}) ) added to: IM_conductor_bsdf_genosl
            IM_conical_edf_genmdl - attribute: sourcecode changed on IM_conical_edf_genmdl from ( mx::pbrlib::mx_conical_edf(mxp_color:{{color}}, mxp_normal:{{normal}}, mxp_inner_angle:{{inner_angle}}, mxp_outer_angle:{{outer_angle}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conical_edf(mxp_color:{{color}}, mxp_normal:{{normal}}, mxp_inner_angle:{{inner_angle}}, mxp_outer_angle:{{outer_angle}}) )
            IM_constant_boolean_genglsl - attribute: file=( stdlib/genglsl/mx_constant.inline ) removed from: IM_constant_boolean_genglsl
            - attribute: sourcecode=( {{value}} ) added to: IM_constant_boolean_genglsl
            IM_constant_boolean_genosl - attribute: file=( stdlib/genosl/mx_constant.inline ) removed from: IM_constant_boolean_genosl
            - attribute: sourcecode=( {{value}} ) added to: IM_constant_boolean_genosl
            IM_determinant_matrix44_genmdl - attribute: sourcecode changed on IM_determinant_matrix44_genmdl from ( mx::stdlib::mx_determinant_matrix44({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_determinant_matrix44({{in}}) )
            IM_determinant_matrix44_genosl - attribute: file=( stdlib/genosl/mx_determinant.inline ) removed from: IM_determinant_matrix44_genosl
            - attribute: sourcecode=( determinant({{in}}) ) added to: IM_determinant_matrix44_genosl
            IM_dielectric_bsdf_genglsl - attribute: file changed on IM_dielectric_bsdf_genglsl from ( pbrlib/genglsl/mx_dielectric_bsdf.glsl ) to ( mx_dielectric_bsdf.glsl )
            IM_dielectric_bsdf_genmdl - attribute: sourcecode changed on IM_dielectric_bsdf_genmdl from ( mx::pbrlib::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) )
            IM_dielectric_bsdf_genosl - attribute: file changed on IM_dielectric_bsdf_genosl from ( pbrlib/genosl/mx_dielectric_bsdf.osl ) to ( legacy/mx_dielectric_bsdf.osl )
            IM_dielectric_bsdf_genmdl - attribute: sourcecode changed on IM_dielectric_bsdf_genmdl from ( mx::pbrlib::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) )
            IM_dielectric_bsdf_genosl - attribute: file changed on IM_dielectric_bsdf_genosl from ( pbrlib/genosl/mx_dielectric_bsdf.osl ) to ( mx_dielectric_bsdf.osl )
            IM_difference_color3_genglsl - attribute: file=( stdlib/genglsl/mx_difference.inline ) removed from: IM_difference_color3_genglsl
            - attribute: sourcecode=( ({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_difference_color3_genglsl
            IM_difference_color3_genosl - attribute: file=( stdlib/genosl/mx_difference.inline ) removed from: IM_difference_color3_genosl
            - attribute: sourcecode=( ({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_difference_color3_genosl
            IM_difference_color4_genglsl - attribute: file=( stdlib/genglsl/mx_difference.inline ) removed from: IM_difference_color4_genglsl
            - attribute: sourcecode=( ({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_difference_color4_genglsl
            IM_frame_float_genmdl - attribute: sourcecode changed on IM_frame_float_genmdl from ( mx::stdlib::mx_frame_float() ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_frame_float() )
            IM_frame_float_genosl - attribute: file changed on IM_frame_float_genosl from ( stdlib/genosl/mx_frame_float.osl ) to ( mx_frame_float.osl )
            IM_generalized_schlick_bsdf_genglsl - attribute: file changed on IM_generalized_schlick_bsdf_genglsl from ( pbrlib/genglsl/mx_generalized_schlick_bsdf.glsl ) to ( mx_generalized_schlick_bsdf.glsl )
            IM_generalized_schlick_bsdf_genmdl - attribute: sourcecode changed on IM_generalized_schlick_bsdf_genmdl from ( mx::pbrlib::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) )
            IM_generalized_schlick_bsdf_genosl - attribute: file changed on IM_generalized_schlick_bsdf_genosl from ( pbrlib/genosl/mx_generalized_schlick_bsdf.osl ) to ( legacy/mx_generalized_schlick_bsdf.osl )
            IM_generalized_schlick_bsdf_genmdl - attribute: sourcecode changed on IM_generalized_schlick_bsdf_genmdl from ( mx::pbrlib::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) )
            IM_generalized_schlick_bsdf_genosl - attribute: file changed on IM_generalized_schlick_bsdf_genosl from ( pbrlib/genosl/mx_generalized_schlick_bsdf.osl ) to ( mx_generalized_schlick_bsdf.osl )
            IM_geomcolor_color3_genmdl - attribute: sourcecode changed on IM_geomcolor_color3_genmdl from ( mx::stdlib::mx_geomcolor_color3(mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_geomcolor_color3(mxp_index:{{index}}) )
            IM_geomcolor_color3_genosl - attribute: file changed on IM_geomcolor_color3_genosl from ( stdlib/genosl/mx_geomcolor_color3.osl ) to ( mx_geomcolor_color3.osl )
            IM_geomcolor_color4_genmdl - attribute: sourcecode changed on IM_geomcolor_color4_genmdl from ( mx::stdlib::mx_geomcolor_color4(mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_geomcolor_color4(mxp_index:{{index}}) )
            IM_minus_float_genosl - attribute: file=( stdlib/genosl/mx_minus.inline ) removed from: IM_minus_float_genosl
            - attribute: sourcecode=( ({{mix}}*({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_minus_float_genosl
            IM_mix_bsdf_genglsl - attribute: file=( pbrlib/genglsl/mx_mix_bsdf.glsl ) removed from: IM_mix_bsdf_genglsl
            - attribute: function=( mx_mix_bsdf ) removed from: IM_mix_bsdf_genglsl
            IM_mix_bsdf_genmdl - attribute: sourcecode changed on IM_mix_bsdf_genmdl from ( mx::pbrlib::mx_mix_bsdf(mxp_fg:{{fg}}, mxp_bg:{{bg}}, mxp_mix:{{mix}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_mix_bsdf(mxp_fg:{{fg}}, mxp_bg:{{bg}}, mxp_mix:{{mix}}) )
            IM_mix_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_mix.inline ) removed from: IM_mix_bsdf_genosl
            IM_mix_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_mix.inline ) removed from: IM_mix_bsdf_genosl
            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_bsdf_genosl
            IM_mix_color3_genglsl - attribute: file=( stdlib/genglsl/mx_mix.inline ) removed from: IM_mix_color3_genglsl
            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_color3_genglsl
            IM_mix_color3_genosl - attribute: file=( stdlib/genosl/mx_mix.inline ) removed from: IM_mix_color3_genosl
            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_color3_genosl
            IM_mix_color4_genglsl - attribute: file=( stdlib/genglsl/mx_mix.inline ) removed from: IM_mix_color4_genglsl
            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_color4_genglsl
            IM_mix_color4_genosl - attribute: file=( stdlib/genosl/mx_mix.inline ) removed from: IM_mix_color4_genosl
            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_color4_genosl
            IM_mix_edf_genglsl - attribute: file=( pbrlib/genglsl/mx_mix_edf.glsl ) removed from: IM_mix_edf_genglsl
            - attribute: function=( mx_mix_edf ) removed from: IM_mix_edf_genglsl
            IM_mix_edf_genmdl - attribute: sourcecode changed on IM_mix_edf_genmdl from ( mx::pbrlib::mx_mix_edf(mxp_fg:{{fg}}, mxp_bg:{{bg}}, mxp_mix:{{mix}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_mix_edf(mxp_fg:{{fg}}, mxp_bg:{{bg}}, mxp_mix:{{mix}}) )
            IM_mix_edf_genosl - attribute: file=( pbrlib/genosl/mx_mix.inline ) removed from: IM_mix_edf_genosl
            IM_mix_edf_genosl - attribute: file=( pbrlib/genosl/mx_mix.inline ) removed from: IM_mix_edf_genosl
            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_edf_genosl
            IM_mix_float_genglsl - attribute: file=( stdlib/genglsl/mx_mix.inline ) removed from: IM_mix_float_genglsl
            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_float_genglsl
            IM_mix_float_genosl - attribute: file=( stdlib/genosl/mx_mix.inline ) removed from: IM_mix_float_genosl
            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_float_genosl
            IM_mix_surfaceshader_genglsl - attribute: file changed on IM_mix_surfaceshader_genglsl from ( stdlib/genglsl/mx_mix_surfaceshader.glsl ) to ( mx_mix_surfaceshader.glsl )
            IM_modulo_vector4_genosl - attribute: file=( stdlib/genosl/mx_modulo.inline ) removed from: IM_modulo_vector4_genosl
            - attribute: sourcecode=( mod({{in1}}, {{in2}}) ) added to: IM_modulo_vector4_genosl
            IM_multiply_bsdfC_genglsl - attribute: file=( pbrlib/genglsl/mx_multiply_bsdf_color.glsl ) removed from: IM_multiply_bsdfC_genglsl
            - attribute: function=( mx_multiply_bsdf_color ) removed from: IM_multiply_bsdfC_genglsl
            IM_multiply_bsdfC_genmdl - attribute: sourcecode changed on IM_multiply_bsdfC_genmdl from ( mx::pbrlib::mx_multiply_bsdf_color3(mxp_in1:{{in1}}, mxp_in2:{{in2}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_multiply_bsdf_color3(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
            IM_multiply_bsdfC_genosl - attribute: file=( pbrlib/genosl/mx_multiply_bsdf.inline ) removed from: IM_multiply_bsdfC_genosl
            IM_multiply_bsdfC_genosl - attribute: file=( pbrlib/genosl/mx_multiply_bsdf.inline ) removed from: IM_multiply_bsdfC_genosl
            - attribute: sourcecode=( ({{in2}} * {{in1}}) ) added to: IM_multiply_bsdfC_genosl
            IM_multiply_bsdfF_genglsl - attribute: file=( pbrlib/genglsl/mx_multiply_bsdf_float.glsl ) removed from: IM_multiply_bsdfF_genglsl
            - attribute: function=( mx_multiply_bsdf_float ) removed from: IM_multiply_bsdfF_genglsl
            IM_multiply_bsdfF_genmdl - attribute: sourcecode changed on IM_multiply_bsdfF_genmdl from ( mx::pbrlib::mx_multiply_bsdf_float(mxp_in1:{{in1}}, mxp_in2:{{in2}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_multiply_bsdf_float(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
            IM_multiply_bsdfF_genosl - attribute: file=( pbrlib/genosl/mx_multiply_bsdf.inline ) removed from: IM_multiply_bsdfF_genosl
            IM_multiply_bsdfF_genosl - attribute: file=( pbrlib/genosl/mx_multiply_bsdf.inline ) removed from: IM_multiply_bsdfF_genosl
            - attribute: sourcecode=( ({{in2}} * {{in1}}) ) added to: IM_multiply_bsdfF_genosl
            IM_multiply_color3FA_genglsl - attribute: file=( stdlib/genglsl/mx_multiply.inline ) removed from: IM_multiply_color3FA_genglsl
            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_color3FA_genglsl
            IM_multiply_color3FA_genosl - attribute: file=( stdlib/genosl/mx_multiply.inline ) removed from: IM_multiply_color3FA_genosl
            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_color3FA_genosl
            IM_multiply_color3_genglsl - attribute: file=( stdlib/genglsl/mx_multiply.inline ) removed from: IM_multiply_color3_genglsl
            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_color3_genglsl
            IM_multiply_color4_genosl - attribute: file=( stdlib/genosl/mx_multiply.inline ) removed from: IM_multiply_color4_genosl
            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_color4_genosl
            IM_multiply_edfC_genglsl - attribute: file=( pbrlib/genglsl/mx_multiply_edf_color.glsl ) removed from: IM_multiply_edfC_genglsl
            - attribute: function=( mx_multiply_edf_color ) removed from: IM_multiply_edfC_genglsl
            IM_multiply_edfC_genmdl - attribute: sourcecode changed on IM_multiply_edfC_genmdl from ( {{in1}} ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_multiply_edf_color3(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
            IM_multiply_edfC_genosl - attribute: file=( pbrlib/genosl/mx_multiply_edf.inline ) removed from: IM_multiply_edfC_genosl
            IM_multiply_edfC_genosl - attribute: file=( pbrlib/genosl/mx_multiply_edf.inline ) removed from: IM_multiply_edfC_genosl
            - attribute: sourcecode=( ({{in2}} * {{in1}}) ) added to: IM_multiply_edfC_genosl
            IM_multiply_edfF_genglsl - attribute: file=( pbrlib/genglsl/mx_multiply_edf_float.glsl ) removed from: IM_multiply_edfF_genglsl
            - attribute: function=( mx_multiply_edf_float ) removed from: IM_multiply_edfF_genglsl
            IM_multiply_edfF_genmdl - attribute: sourcecode changed on IM_multiply_edfF_genmdl from ( {{in1}} ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_multiply_edf_float(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
            IM_multiply_edfF_genosl - attribute: file=( pbrlib/genosl/mx_multiply_edf.inline ) removed from: IM_multiply_edfF_genosl
            IM_multiply_edfF_genosl - attribute: file=( pbrlib/genosl/mx_multiply_edf.inline ) removed from: IM_multiply_edfF_genosl
            - attribute: sourcecode=( ({{in2}} * {{in1}}) ) added to: IM_multiply_edfF_genosl
            IM_multiply_float_genglsl - attribute: file=( stdlib/genglsl/mx_multiply.inline ) removed from: IM_multiply_float_genglsl
            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_float_genglsl
            IM_multiply_float_genosl - attribute: file=( stdlib/genosl/mx_multiply.inline ) removed from: IM_multiply_float_genosl
            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_float_genosl
            IM_multiply_matrix33_genglsl - attribute: file=( stdlib/genglsl/mx_multiply.inline ) removed from: IM_multiply_matrix33_genglsl
            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_matrix33_genglsl
            IM_normalize_vector4_genosl - attribute: file=( stdlib/genosl/mx_normalize.inline ) removed from: IM_normalize_vector4_genosl
            - attribute: sourcecode=( normalize({{in}}) ) added to: IM_normalize_vector4_genosl
            IM_oren_nayar_diffuse_bsdf_genglsl - attribute: file changed on IM_oren_nayar_diffuse_bsdf_genglsl from ( pbrlib/genglsl/mx_oren_nayar_diffuse_bsdf.glsl ) to ( mx_oren_nayar_diffuse_bsdf.glsl )
            IM_oren_nayar_diffuse_bsdf_genmdl - attribute: sourcecode changed on IM_oren_nayar_diffuse_bsdf_genmdl from ( mx::pbrlib::mx_oren_nayar_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_oren_nayar_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}) )
            IM_oren_nayar_diffuse_bsdf_genosl - attribute: function=( mx_oren_nayar_diffuse_bsdf ) added to: IM_oren_nayar_diffuse_bsdf_genosl
            - attribute: file changed on IM_oren_nayar_diffuse_bsdf_genosl from ( pbrlib/genosl/mx_oren_nayar_diffuse_bsdf.inline ) to ( legacy/mx_oren_nayar_diffuse_bsdf.osl )
            IM_oren_nayar_diffuse_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_oren_nayar_diffuse_bsdf.inline ) removed from: IM_oren_nayar_diffuse_bsdf_genosl
            - attribute: sourcecode=( {{weight}} * oren_nayar_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) added to: IM_oren_nayar_diffuse_bsdf_genosl
            IM_out_color4_genglsl - attribute: file=( stdlib/genglsl/mx_out_color4.inline ) removed from: IM_out_color4_genglsl
            - attribute: sourcecode=( ({{fg}}*(1.0-{{bg}}.a) * {{mix}}) + ({{bg}} * (1.0-{{mix}})); ) added to: IM_out_color4_genglsl
            IM_out_color4_genmdl - attribute: sourcecode changed on IM_out_color4_genmdl from ( mx::stdlib::mx_out_color4({{fg}}, {{bg}}, {{mix}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_out_color4({{fg}}, {{bg}}, {{mix}}) )
            IM_out_color4_genosl - attribute: file=( stdlib/genosl/mx_out.inline ) removed from: IM_out_color4_genosl
            - attribute: sourcecode=( ({{fg}}*(1.0-{{bg}}.a) * {{mix}}) + ({{bg}} * (1.0-{{mix}})) ) added to: IM_out_color4_genosl
            IM_screen_float_genosl - attribute: file=( stdlib/genosl/mx_screen.inline ) removed from: IM_screen_float_genosl
            - attribute: sourcecode=( ({{mix}}*((1.0 - (1.0 - {{fg}}) * (1 - {{bg}})))) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_screen_float_genosl
            IM_sheen_bsdf_genglsl - attribute: file changed on IM_sheen_bsdf_genglsl from ( pbrlib/genglsl/mx_sheen_bsdf.glsl ) to ( mx_sheen_bsdf.glsl )
            IM_sheen_bsdf_genmdl - attribute: sourcecode changed on IM_sheen_bsdf_genmdl from ( mx::pbrlib::mx_sheen_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_sheen_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_base:{{base}}) )
            IM_sheen_bsdf_genosl - attribute: file changed on IM_sheen_bsdf_genosl from ( pbrlib/genosl/mx_sheen_bsdf.osl ) to ( legacy/mx_sheen_bsdf.osl )
            IM_sheen_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_sheen_bsdf.osl ) removed from: IM_sheen_bsdf_genosl
            - attribute: function=( mx_sheen_bsdf ) removed from: IM_sheen_bsdf_genosl
            - attribute: sourcecode=( {{weight}} * sheen_bsdf({{normal}}, {{color}}, {{roughness}}) ) added to: IM_sheen_bsdf_genosl
            IM_sign_color3_genglsl - attribute: file=( stdlib/genglsl/mx_sign.inline ) removed from: IM_sign_color3_genglsl
            - attribute: sourcecode=( sign({{in}}) ) added to: IM_sign_color3_genglsl
            IM_sign_color3_genmdl - attribute: sourcecode changed on IM_sign_color3_genmdl from ( mx::stdlib::mx_sign_color3({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_sign_color3({{in}}) )
            IM_sign_color3_genosl - attribute: file=( stdlib/genosl/mx_sign.inline ) removed from: IM_sign_color3_genosl
            - attribute: sourcecode=( sign({{in}}) ) added to: IM_sign_color3_genosl
            IM_sqrt_vector4_genosl - attribute: file=( stdlib/genosl/mx_sqrt.inline ) removed from: IM_sqrt_vector4_genosl
            - attribute: sourcecode=( sqrt({{in}}) ) added to: IM_sqrt_vector4_genosl
            IM_subsurface_bsdf_genglsl - attribute: file changed on IM_subsurface_bsdf_genglsl from ( pbrlib/genglsl/mx_subsurface_bsdf.glsl ) to ( mx_subsurface_bsdf.glsl )
            IM_subsurface_bsdf_genmdl - attribute: sourcecode changed on IM_subsurface_bsdf_genmdl from ( mx::pbrlib::mx_subsurface_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_radius:{{radius}}, mxp_anisotropy:{{anisotropy}}, mxp_normal:{{normal}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_subsurface_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_radius:{{radius}}, mxp_anisotropy:{{anisotropy}}, mxp_normal:{{normal}}) )
            IM_subsurface_bsdf_genosl - attribute: file changed on IM_subsurface_bsdf_genosl from ( pbrlib/genosl/mx_subsurface_bsdf.osl ) to ( legacy/mx_subsurface_bsdf.osl )
            IM_subsurface_bsdf_genosl - attribute: file changed on IM_subsurface_bsdf_genosl from ( pbrlib/genosl/mx_subsurface_bsdf.osl ) to ( mx_subsurface_bsdf.osl )
            IM_subtract_color3FA_genglsl - attribute: file=( stdlib/genglsl/mx_subtract.inline ) removed from: IM_subtract_color3FA_genglsl
            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_color3FA_genglsl
            IM_subtract_color3FA_genosl - attribute: file=( stdlib/genosl/mx_subtract.inline ) removed from: IM_subtract_color3FA_genosl
            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_color3FA_genosl
            IM_subtract_color3_genglsl - attribute: file=( stdlib/genglsl/mx_subtract.inline ) removed from: IM_subtract_color3_genglsl
            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_color3_genglsl
            IM_subtract_vector4FA_genosl - attribute: file=( stdlib/genosl/mx_subtract.inline ) removed from: IM_subtract_vector4FA_genosl
            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_vector4FA_genosl
            IM_subtract_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_subtract.inline ) removed from: IM_subtract_vector4_genglsl
            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_vector4_genglsl
            IM_subtract_vector4_genosl - attribute: file=( stdlib/genosl/mx_subtract.inline ) removed from: IM_subtract_vector4_genosl
            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_vector4_genosl
            IM_surface_genosl - attribute: file changed on IM_surface_genosl from ( pbrlib/genosl/mx_surface.osl ) to ( legacy/mx_surface.osl )
            IM_switch_color3I_genmdl - attribute: sourcecode changed on IM_switch_color3I_genmdl from ( mx::stdlib::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_color3_genmdl - attribute: sourcecode changed on IM_switch_color3_genmdl from ( mx::stdlib::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_color4I_genmdl - attribute: sourcecode changed on IM_switch_color4I_genmdl from ( mx::stdlib::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_color4_genmdl - attribute: sourcecode changed on IM_switch_color4_genmdl from ( mx::stdlib::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_floatI_genmdl - attribute: sourcecode changed on IM_switch_floatI_genmdl from ( mx::stdlib::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_float_genmdl - attribute: sourcecode changed on IM_switch_float_genmdl from ( mx::stdlib::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_vector2I_genmdl - attribute: sourcecode changed on IM_switch_vector2I_genmdl from ( mx::stdlib::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_vector2_genmdl - attribute: sourcecode changed on IM_switch_vector2_genmdl from ( mx::stdlib::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_vector3I_genmdl - attribute: sourcecode changed on IM_switch_vector3I_genmdl from ( mx::stdlib::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_vector3_genmdl - attribute: sourcecode changed on IM_switch_vector3_genmdl from ( mx::stdlib::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_vector4I_genmdl - attribute: sourcecode changed on IM_switch_vector4I_genmdl from ( mx::stdlib::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_switch_vector4_genmdl - attribute: sourcecode changed on IM_switch_vector4_genmdl from ( mx::stdlib::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
            IM_surface_genosl - attribute: file changed on IM_surface_genosl from ( pbrlib/genosl/mx_surface.osl ) to ( mx_surface.osl )
            IM_switch_color3I_genmdl - attribute: sourcecode changed on IM_switch_color3I_genmdl from ( mx::stdlib::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_color3_genmdl - attribute: sourcecode changed on IM_switch_color3_genmdl from ( mx::stdlib::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_color4I_genmdl - attribute: sourcecode changed on IM_switch_color4I_genmdl from ( mx::stdlib::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_color4_genmdl - attribute: sourcecode changed on IM_switch_color4_genmdl from ( mx::stdlib::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_floatI_genmdl - attribute: sourcecode changed on IM_switch_floatI_genmdl from ( mx::stdlib::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_float_genmdl - attribute: sourcecode changed on IM_switch_float_genmdl from ( mx::stdlib::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_vector2I_genmdl - attribute: sourcecode changed on IM_switch_vector2I_genmdl from ( mx::stdlib::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_vector2_genmdl - attribute: sourcecode changed on IM_switch_vector2_genmdl from ( mx::stdlib::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_vector3I_genmdl - attribute: sourcecode changed on IM_switch_vector3I_genmdl from ( mx::stdlib::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_vector3_genmdl - attribute: sourcecode changed on IM_switch_vector3_genmdl from ( mx::stdlib::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_vector4I_genmdl - attribute: sourcecode changed on IM_switch_vector4I_genmdl from ( mx::stdlib::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_switch_vector4_genmdl - attribute: sourcecode changed on IM_switch_vector4_genmdl from ( mx::stdlib::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
            IM_tan_float_genglsl - attribute: file=( stdlib/genglsl/mx_tan.inline ) removed from: IM_tan_float_genglsl
            - attribute: sourcecode=( tan({{in}}) ) added to: IM_tan_float_genglsl
            IM_tan_float_genosl - attribute: file=( stdlib/genosl/mx_tan.inline ) removed from: IM_tan_float_genosl
            - attribute: sourcecode=( tan({{in}}) ) added to: IM_tan_float_genosl
            IM_tan_vector2_genglsl - attribute: file=( stdlib/genglsl/mx_tan.inline ) removed from: IM_tan_vector2_genglsl
            - attribute: sourcecode=( tan({{in}}) ) added to: IM_tan_vector2_genglsl
            IM_transformvector_vector3_genosl - attribute: file=( stdlib/genosl/mx_transformvector.inline ) removed from: IM_transformvector_vector3_genosl
            - attribute: sourcecode=( transform({{fromspace}}, {{tospace}}, {{in}}) ) added to: IM_transformvector_vector3_genosl
            IM_translucent_bsdf_genglsl - attribute: file changed on IM_translucent_bsdf_genglsl from ( pbrlib/genglsl/mx_translucent_bsdf.glsl ) to ( mx_translucent_bsdf.glsl )
            IM_translucent_bsdf_genmdl - attribute: sourcecode changed on IM_translucent_bsdf_genmdl from ( mx::pbrlib::mx_translucent_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_normal:{{normal}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_translucent_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_normal:{{normal}}) )
            IM_translucent_bsdf_genosl - attribute: function=( mx_translucent_bsdf ) added to: IM_translucent_bsdf_genosl
            - attribute: file changed on IM_translucent_bsdf_genosl from ( pbrlib/genosl/mx_translucent_bsdf.inline ) to ( legacy/mx_translucent_bsdf.osl )
            IM_translucent_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_translucent_bsdf.inline ) removed from: IM_translucent_bsdf_genosl
            - attribute: sourcecode=( {{weight}} * translucent_bsdf({{normal}}, {{color}}) ) added to: IM_translucent_bsdf_genosl
            IM_transpose_matrix33_genglsl - attribute: file=( stdlib/genglsl/mx_transpose.inline ) removed from: IM_transpose_matrix33_genglsl
            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix33_genglsl
            IM_transpose_matrix33_genosl - attribute: file=( stdlib/genosl/mx_transpose.inline ) removed from: IM_transpose_matrix33_genosl
            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix33_genosl
            IM_transpose_matrix44_genglsl - attribute: file=( stdlib/genglsl/mx_transpose.inline ) removed from: IM_transpose_matrix44_genglsl
            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix44_genglsl
            IM_transpose_matrix44_genosl - attribute: file=( stdlib/genosl/mx_transpose.inline ) removed from: IM_transpose_matrix44_genosl
            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix44_genosl
            IM_uniform_edf_genglsl - attribute: file changed on IM_uniform_edf_genglsl from ( pbrlib/genglsl/mx_uniform_edf.glsl ) to ( mx_uniform_edf.glsl )
            IM_uniform_edf_genmdl - attribute: sourcecode changed on IM_uniform_edf_genmdl from ( mx::pbrlib::mx_uniform_edf(mxp_color:{{color}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_uniform_edf(mxp_color:{{color}}) )
            IM_uniform_edf_genosl - attribute: file=( pbrlib/genosl/mx_uniform_edf.inline ) removed from: IM_uniform_edf_genosl
            - attribute: sourcecode=( {{color}} * emission() ) added to: IM_uniform_edf_genosl
            IM_uniform_edf_genosl - attribute: file=( pbrlib/genosl/mx_uniform_edf.inline ) removed from: IM_uniform_edf_genosl
            - attribute: sourcecode=( uniform_edf({{color}}) ) added to: IM_uniform_edf_genosl
            IM_unpremult_color4_genglsl - attribute: file changed on IM_unpremult_color4_genglsl from ( stdlib/genglsl/mx_unpremult_color4.glsl ) to ( mx_unpremult_color4.glsl )
            IM_unpremult_color4_genmdl - attribute: sourcecode changed on IM_unpremult_color4_genmdl from ( mx::stdlib::mx_unpremult_color4({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_unpremult_color4({{in}}) )
            IM_unpremult_color4_genosl - attribute: file changed on IM_unpremult_color4_genosl from ( stdlib/genosl/mx_unpremult_color4.osl ) to ( mx_unpremult_color4.osl )
            NG_range_vector3FA - Number of children on: N_clamp_vector3FA changed from ( 1 ) to ( 3 )
            - input /low added to NG_range_vector3FA/N_clamp_vector3FA. Value=( )
            - input /high added to NG_range_vector3FA/N_clamp_vector3FA. Value=( )
            NG_range_vector4 - Number of children on: N_clamp_vector4 changed from ( 1 ) to ( 3 )
            - input /low added to NG_range_vector4/N_clamp_vector4. Value=( )
            - input /high added to NG_range_vector4/N_clamp_vector4. Value=( )
            NG_range_vector4FA - Number of children on: N_clamp_vector4FA changed from ( 1 ) to ( 3 )
            - input /low added to NG_range_vector4FA/N_clamp_vector4FA. Value=( )
            - input /high added to NG_range_vector4FA/N_clamp_vector4FA. Value=( )
            NG_separate2_vector2 - extract /N_x_vector2 removed from NG_separate2_vector2
            - extract /N_y_vector2 removed from NG_separate2_vector2
            - extract /N_extract_0 add to NG_separate2_vector2
            - extract /N_extract_1 add to NG_separate2_vector2
            - attribute: nodename changed on outx from ( N_x_vector2 ) to ( N_extract_0 )
            - attribute: nodename changed on outy from ( N_y_vector2 ) to ( N_extract_1 )
            NG_separate3_color3 - extract /N_r_color3 removed from NG_separate3_color3
            - extract /N_g_color3 removed from NG_separate3_color3
            - extract /N_b_color3 removed from NG_separate3_color3
            - extract /N_extract_0 add to NG_separate3_color3
            - extract /N_extract_1 add to NG_separate3_color3
            - extract /N_extract_2 add to NG_separate3_color3
            - attribute: nodename changed on outr from ( N_r_color3 ) to ( N_extract_0 )
            - attribute: nodename changed on outg from ( N_g_color3 ) to ( N_extract_1 )
            - attribute: nodename changed on outb from ( N_b_color3 ) to ( N_extract_2 )
            NG_separate3_vector3 - extract /N_x_vector3 removed from NG_separate3_vector3
            - extract /N_y_vector3 removed from NG_separate3_vector3
            - extract /N_z_vector3 removed from NG_separate3_vector3
            - extract /N_extract_0 add to NG_separate3_vector3
            - extract /N_extract_1 add to NG_separate3_vector3
            - extract /N_extract_2 add to NG_separate3_vector3
            - attribute: nodename changed on outx from ( N_x_vector3 ) to ( N_extract_0 )
            - attribute: nodename changed on outy from ( N_y_vector3 ) to ( N_extract_1 )
            - attribute: nodename changed on outz from ( N_z_vector3 ) to ( N_extract_2 )
            NG_separate4_color4 - extract /N_r_color4 removed from NG_separate4_color4
            - extract /N_g_color4 removed from NG_separate4_color4
            - extract /N_b_color4 removed from NG_separate4_color4
            - extract /N_a_color4 removed from NG_separate4_color4
            - extract /N_extract_0 add to NG_separate4_color4
            - extract /N_extract_1 add to NG_separate4_color4
            - extract /N_extract_2 add to NG_separate4_color4
            - extract /N_extract_3 add to NG_separate4_color4
            - attribute: nodename changed on outr from ( N_r_color4 ) to ( N_extract_0 )
            - attribute: nodename changed on outg from ( N_g_color4 ) to ( N_extract_1 )
            - attribute: nodename changed on outb from ( N_b_color4 ) to ( N_extract_2 )
            - attribute: nodename changed on outa from ( N_a_color4 ) to ( N_extract_3 )
            NG_separate4_vector4 - extract /N_x_vector4 removed from NG_separate4_vector4
            - extract /N_y_vector4 removed from NG_separate4_vector4
            - extract /N_z_vector4 removed from NG_separate4_vector4
            - extract /N_w_vector4 removed from NG_separate4_vector4
            - extract /N_extract_0 add to NG_separate4_vector4
            - extract /N_extract_1 add to NG_separate4_vector4
            - extract /N_extract_2 add to NG_separate4_vector4
            - extract /N_extract_3 add to NG_separate4_vector4
            - attribute: nodename changed on outx from ( N_x_vector4 ) to ( N_extract_0 )
            - attribute: nodename changed on outy from ( N_y_vector4 ) to ( N_extract_1 )
            - attribute: nodename changed on outz from ( N_z_vector4 ) to ( N_extract_2 )
            - attribute: nodename changed on outw from ( N_w_vector4 ) to ( N_extract_3 )
            NG_triplanarprojection_color3 - Number of children on: NG_triplanarprojection_color3 changed from ( 22 ) to ( 32 )
            - normalize /N_norm_color3 removed from NG_triplanarprojection_color3
            - dotproduct /N_dotX_color3 removed from NG_triplanarprojection_color3
            - dotproduct /N_dotY_color3 removed from NG_triplanarprojection_color3
            - dotproduct /N_dotZ_color3 removed from NG_triplanarprojection_color3
            - absval /N_blendX_color3 removed from NG_triplanarprojection_color3
            - absval /N_blendY_color3 removed from NG_triplanarprojection_color3
            - absval /N_blendZ_color3 removed from NG_triplanarprojection_color3
            - multiply /N_vecXY_invert_color3 add to NG_triplanarprojection_color3
            - combine2 /N_vecXY_xUp_color3 add to NG_triplanarprojection_color3
            - combine2 /N_vecXZ_xUp_color3 add to NG_triplanarprojection_color3
            - combine2 /N_vecYZ_yUp_color3 add to NG_triplanarprojection_color3
            - switch /N_upDirSwitchXY_color3 add to NG_triplanarprojection_color3
            - switch /N_upDirSwitchXZ_color3 add to NG_triplanarprojection_color3
            - switch /N_upDirSwitchYZ_color3 add to NG_triplanarprojection_color3
            - normalize /N_norm_vector3 add to NG_triplanarprojection_color3
            - absval /N_absN add to NG_triplanarprojection_color3
            - dotproduct /N_dotN add to NG_triplanarprojection_color3
            - divide /N_normalizeWeights add to NG_triplanarprojection_color3
            - clamp /N_clampForPrecision add to NG_triplanarprojection_color3
            - divide /N_oneOverBlend add to NG_triplanarprojection_color3
            - power /N_blendPower add to NG_triplanarprojection_color3
            - dotproduct /N_dotBlendedN add to NG_triplanarprojection_color3
            - divide /N_normalizeBlendedWeights add to NG_triplanarprojection_color3
            - separate3 /N_separateWeights add to NG_triplanarprojection_color3
            - attribute: nodename changed on texcoord from ( N_vecYZ_color3 ) to ( N_upDirSwitchYZ_color3 )
            - attribute: nodename changed on texcoord from ( N_vecXZ_color3 ) to ( N_upDirSwitchXZ_color3 )
            - attribute: nodename changed on texcoord from ( N_vecXY_color3 ) to ( N_upDirSwitchXY_color3 )
            - attribute: output=( outx ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendX_color3 ) to ( N_separateWeights )
            - attribute: output=( outy ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendY_color3 ) to ( N_separateWeights )
            - attribute: output=( outz ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendZ_color3 ) to ( N_separateWeights )
            NG_triplanarprojection_color4 - Number of children on: NG_triplanarprojection_color4 changed from ( 22 ) to ( 32 )
            - normalize /N_norm_color4 removed from NG_triplanarprojection_color4
            - dotproduct /N_dotX_color4 removed from NG_triplanarprojection_color4
            - dotproduct /N_dotY_color4 removed from NG_triplanarprojection_color4
            - dotproduct /N_dotZ_color4 removed from NG_triplanarprojection_color4
            - absval /N_blendX_color4 removed from NG_triplanarprojection_color4
            - absval /N_blendY_color4 removed from NG_triplanarprojection_color4
            - absval /N_blendZ_color4 removed from NG_triplanarprojection_color4
            - multiply /N_vecXY_invert_color4 add to NG_triplanarprojection_color4
            - combine2 /N_vecXY_xUp_color4 add to NG_triplanarprojection_color4
            - combine2 /N_vecXZ_xUp_color4 add to NG_triplanarprojection_color4
            - combine2 /N_vecYZ_yUp_color4 add to NG_triplanarprojection_color4
            - switch /N_upDirSwitchXY_color4 add to NG_triplanarprojection_color4
            - switch /N_upDirSwitchXZ_color4 add to NG_triplanarprojection_color4
            - switch /N_upDirSwitchYZ_color4 add to NG_triplanarprojection_color4
            - normalize /N_norm_vector3 add to NG_triplanarprojection_color4
            - absval /N_absN add to NG_triplanarprojection_color4
            - dotproduct /N_dotN add to NG_triplanarprojection_color4
            - divide /N_normalizeWeights add to NG_triplanarprojection_color4
            - clamp /N_clampForPrecision add to NG_triplanarprojection_color4
            - divide /N_oneOverBlend add to NG_triplanarprojection_color4
            - power /N_blendPower add to NG_triplanarprojection_color4
            - dotproduct /N_dotBlendedN add to NG_triplanarprojection_color4
            - divide /N_normalizeBlendedWeights add to NG_triplanarprojection_color4
            - separate3 /N_separateWeights add to NG_triplanarprojection_color4
            - attribute: nodename changed on texcoord from ( N_vecYZ_color4 ) to ( N_upDirSwitchYZ_color4 )
            - attribute: nodename changed on texcoord from ( N_vecXZ_color4 ) to ( N_upDirSwitchXZ_color4 )
            - attribute: nodename changed on texcoord from ( N_vecXY_color4 ) to ( N_upDirSwitchXY_color4 )
            - attribute: output=( outx ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendX_color4 ) to ( N_separateWeights )
            - attribute: output=( outy ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendY_color4 ) to ( N_separateWeights )
            - attribute: output=( outz ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendZ_color4 ) to ( N_separateWeights )
            NG_triplanarprojection_float - Number of children on: NG_triplanarprojection_float changed from ( 22 ) to ( 32 )
            - normalize /N_norm_float removed from NG_triplanarprojection_float
            - dotproduct /N_dotX_float removed from NG_triplanarprojection_float
            - dotproduct /N_dotY_float removed from NG_triplanarprojection_float
            - dotproduct /N_dotZ_float removed from NG_triplanarprojection_float
            - absval /N_blendX_float removed from NG_triplanarprojection_float
            - absval /N_blendY_float removed from NG_triplanarprojection_float
            - absval /N_blendZ_float removed from NG_triplanarprojection_float
            - multiply /N_vecXY_invert_float add to NG_triplanarprojection_float
            - combine2 /N_vecXY_xUp_float add to NG_triplanarprojection_float
            - combine2 /N_vecXZ_xUp_float add to NG_triplanarprojection_float
            - combine2 /N_vecYZ_yUp_float add to NG_triplanarprojection_float
            - switch /N_upDirSwitchXY_float add to NG_triplanarprojection_float
            - switch /N_upDirSwitchXZ_float add to NG_triplanarprojection_float
            - switch /N_upDirSwitchYZ_float add to NG_triplanarprojection_float
            - normalize /N_norm_vector3 add to NG_triplanarprojection_float
            - absval /N_absN add to NG_triplanarprojection_float
            - dotproduct /N_dotN add to NG_triplanarprojection_float
            - divide /N_normalizeWeights add to NG_triplanarprojection_float
            - clamp /N_clampForPrecision add to NG_triplanarprojection_float
            - divide /N_oneOverBlend add to NG_triplanarprojection_float
            - power /N_blendPower add to NG_triplanarprojection_float
            - dotproduct /N_dotBlendedN add to NG_triplanarprojection_float
            - divide /N_normalizeBlendedWeights add to NG_triplanarprojection_float
            - separate3 /N_separateWeights add to NG_triplanarprojection_float
            - attribute: nodename changed on texcoord from ( N_vecYZ_float ) to ( N_upDirSwitchYZ_float )
            - attribute: nodename changed on texcoord from ( N_vecXZ_float ) to ( N_upDirSwitchXZ_float )
            - attribute: nodename changed on texcoord from ( N_vecXY_float ) to ( N_upDirSwitchXY_float )
            - attribute: output=( outx ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendX_float ) to ( N_separateWeights )
            - attribute: output=( outy ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendY_float ) to ( N_separateWeights )
            - attribute: output=( outz ) added to: in2
            - attribute: nodename changed on in2 from ( N_blendZ_float ) to ( N_separateWeights )
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -320,6 +320,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -853,7 +854,7 @@
            First Library Definitions / I
            -
            549 shaders: genmdl +
            550 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -863,6 +864,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1407,7 +1409,7 @@
            First Library Definitions / I
            -
            540 shaders: genosl +
            541 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1417,6 +1419,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -2073,7 +2076,7 @@
            Second Library Definitions /
            DefinitionImplementationFile
            -
            541 shaders: genglsl +
            542 shaders: genglsl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2086,6 +2089,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -2619,7 +2623,7 @@
            Second Library Definitions /
            -
            549 shaders: genmdl +
            550 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -2629,6 +2633,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -3173,7 +3178,7 @@
            Second Library Definitions /
            -
            540 shaders: genosl +
            541 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -3183,6 +3188,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -3821,8 +3827,8 @@
            Second Library Definitions /

            Implementation Comparison

            -

            First library implementation count: 2182 -Second library implementation count: 2169

            +

            First library implementation count: 2185 +Second library implementation count: 2172

            13 implementations added diff --git a/documents/mtlx_1382_vs_1383.html b/documents/mtlx_1382_vs_1383.html index aa9be2fe..fa74909e 100644 --- a/documents/mtlx_1382_vs_1383.html +++ b/documents/mtlx_1382_vs_1383.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
            MaterialX LearnMaterialX Library Comparison

            Libraries Loaded

              -
            • Loaded 677 first library definitions from 38 files. Version 1.39.0
                +
              • Loaded 678 first library definitions from 38 files. Version 1.39.0
                • First library location: ['../../resources/libraries_1.38.3']. Search path: ""
              • -
              • Loaded 675 second library definitions from 38 files. Version 1.39
                  +
                • Loaded 676 second library definitions from 38 files. Version 1.39
                  • Second library location: ['../../resources/libraries_1.38.2']. Search path: ""
                • @@ -232,8 +232,8 @@

                  Libraries Loaded

                  Node Definition Comparison

                    -
                  • First library has 677 nodedefs.
                  • -
                  • Second library has 675 nodedefs
                  • +
                  • First library has 678 nodedefs.
                  • +
                  • Second library has 676 nodedefs
                  2 node definitions added. (Sorted by category) @@ -267,7 +267,7 @@

                  Implementations

                • Second library shader targets: ['essl', 'genglsl', 'genmdl', 'genosl']
                First Library Definitions / Implementations
                -
                543 shaders: essl +
                544 shaders: essl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -280,6 +280,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -815,7 +816,7 @@
            First Library Definitions / I
            -
            543 shaders: genglsl +
            544 shaders: genglsl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -828,6 +829,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -1363,7 +1365,7 @@
            First Library Definitions / I
            -
            550 shaders: genmdl +
            551 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1373,6 +1375,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1918,7 +1921,7 @@
            First Library Definitions / I
            -
            542 shaders: genosl +
            543 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1928,6 +1931,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -2581,7 +2585,7 @@
            First Library Definitions / I

            Second Library Definitions / Implementations
            -
            541 shaders: essl +
            542 shaders: essl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2594,6 +2598,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -3127,7 +3132,7 @@
            Second Library Definitions /
            -
            541 shaders: genglsl +
            542 shaders: genglsl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3140,6 +3145,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -3673,7 +3679,7 @@
            Second Library Definitions /
            -
            549 shaders: genmdl +
            550 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3683,6 +3689,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4227,7 +4234,7 @@
            Second Library Definitions /
            -
            540 shaders: genosl +
            541 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4237,6 +4244,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -4888,8 +4896,8 @@
            Second Library Definitions /

            Implementation Comparison

            -

            First library implementation count: 2190 -Second library implementation count: 2182

            +

            First library implementation count: 2193 +Second library implementation count: 2185

            8 implementations added diff --git a/documents/mtlx_1383_vs_1384.html b/documents/mtlx_1383_vs_1384.html index 2bcc5c15..c4066077 100644 --- a/documents/mtlx_1383_vs_1384.html +++ b/documents/mtlx_1383_vs_1384.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
            MaterialX LearnMaterialX Library Comparison

            Libraries Loaded

              -
            • Loaded 679 first library definitions from 38 files. Version 1.39.0
                +
              • Loaded 680 first library definitions from 38 files. Version 1.39.0
                • First library location: ['../../resources/libraries_1.38.4']. Search path: ""
              • -
              • Loaded 677 second library definitions from 38 files. Version 1.39
                  +
                • Loaded 678 second library definitions from 38 files. Version 1.39
                  • Second library location: ['../../resources/libraries_1.38.3']. Search path: ""
                • @@ -232,8 +232,8 @@

                  Libraries Loaded

                  Node Definition Comparison

                    -
                  • First library has 679 nodedefs.
                  • -
                  • Second library has 677 nodedefs
                  • +
                  • First library has 680 nodedefs.
                  • +
                  • Second library has 678 nodedefs
                  2 node definitions added. (Sorted by category) @@ -274,7 +274,7 @@

                  Implementations

                • Second library shader targets: ['essl', 'genglsl', 'genmdl', 'genosl']
                First Library Definitions / Implementations
                -
                550 shaders: essl +
                551 shaders: essl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -287,6 +287,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -829,7 +830,7 @@
            First Library Definitions / I
            -
            550 shaders: genglsl +
            551 shaders: genglsl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -842,6 +843,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -1384,7 +1386,7 @@
            First Library Definitions / I
            -
            557 shaders: genmdl +
            558 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1394,6 +1396,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1946,7 +1949,7 @@
            First Library Definitions / I
            -
            549 shaders: genosl +
            550 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1956,6 +1959,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -2591,7 +2595,7 @@
            First Library Definitions / I

            Second Library Definitions / Implementations
            -
            543 shaders: essl +
            544 shaders: essl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2604,6 +2608,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3139,7 +3144,7 @@
            Second Library Definitions /
            -
            543 shaders: genglsl +
            544 shaders: genglsl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3152,6 +3157,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3687,7 +3693,7 @@
            Second Library Definitions /
            -
            550 shaders: genmdl +
            551 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3697,6 +3703,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4242,7 +4249,7 @@
            Second Library Definitions /
            -
            542 shaders: genosl +
            543 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4252,6 +4259,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -4905,8 +4913,8 @@
            Second Library Definitions /

            Implementation Comparison

            -

            First library implementation count: 2211 -Second library implementation count: 2189

            +

            First library implementation count: 2214 +Second library implementation count: 2192

            22 implementations added diff --git a/documents/mtlx_1384_vs_1385.html b/documents/mtlx_1384_vs_1385.html index 5b1a3b2c..a1146488 100644 --- a/documents/mtlx_1384_vs_1385.html +++ b/documents/mtlx_1384_vs_1385.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
            MaterialX LearnMaterialX Library Comparison

            Libraries Loaded

              -
            • Loaded 680 first library definitions from 38 files. Version 1.39.0
                +
              • Loaded 681 first library definitions from 38 files. Version 1.39.0
                • First library location: ['../../resources/libraries_1.38.5']. Search path: ""
              • -
              • Loaded 679 second library definitions from 38 files. Version 1.39
                  +
                • Loaded 680 second library definitions from 38 files. Version 1.39
                  • Second library location: ['../../resources/libraries_1.38.4']. Search path: ""
                • @@ -232,8 +232,8 @@

                  Libraries Loaded

                  Node Definition Comparison

                    -
                  • First library has 680 nodedefs.
                  • -
                  • Second library has 679 nodedefs
                  • +
                  • First library has 681 nodedefs.
                  • +
                  • Second library has 680 nodedefs
                  1 node definitions added. (Sorted by category) @@ -323,7 +323,7 @@

                  Implementations

                • Second library shader targets: ['essl', 'genglsl', 'genmdl', 'genosl']
                First Library Definitions / Implementations
                -
                553 shaders: essl +
                554 shaders: essl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -336,6 +336,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -881,7 +882,7 @@
            First Library Definitions / I
            -
            553 shaders: genglsl +
            554 shaders: genglsl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -894,6 +895,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -1439,7 +1441,7 @@
            First Library Definitions / I
            -
            558 shaders: genmdl +
            559 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1449,6 +1451,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -2002,7 +2005,7 @@
            First Library Definitions / I
            -
            550 shaders: genosl +
            551 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2012,6 +2015,7 @@
            First Library Definitions / I
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -2649,7 +2653,7 @@
            First Library Definitions / I

            Second Library Definitions / Implementations
            -
            550 shaders: essl +
            551 shaders: essl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2662,6 +2666,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3204,7 +3209,7 @@
            Second Library Definitions /
            -
            550 shaders: genglsl +
            551 shaders: genglsl
            DefinitionImplementationFile
            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3217,6 +3222,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3759,7 +3765,7 @@
            Second Library Definitions /
            -
            557 shaders: genmdl +
            558 shaders: genmdl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3769,6 +3775,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4321,7 +4328,7 @@
            Second Library Definitions /
            -
            549 shaders: genosl +
            550 shaders: genosl
            DefinitionImplementationFile
            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4331,6 +4338,7 @@
            Second Library Definitions /
            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -4966,8 +4974,8 @@
            Second Library Definitions /

            Implementation Comparison

            -

            First library implementation count: 1748 -Second library implementation count: 1741

            +

            First library implementation count: 1751 +Second library implementation count: 1744

            7 implementations added @@ -5807,7 +5815,7 @@

            Implementation Comparison

            - +
            IM_worleynoise3d_vector2_genosl - attribute: file changed on IM_worleynoise3d_vector2_genosl from ( libraries/stdlib/genosl/mx_worleynoise3d_vector2.osl ) to ( mx_worleynoise3d_vector2.osl )
            IM_worleynoise3d_vector3_genglsl - attribute: file changed on IM_worleynoise3d_vector3_genglsl from ( libraries/stdlib/genglsl/mx_worleynoise3d_vector3.glsl ) to ( mx_worleynoise3d_vector3.glsl )
            IM_worleynoise3d_vector3_genosl - attribute: file changed on IM_worleynoise3d_vector3_genosl from ( libraries/stdlib/genosl/mx_worleynoise3d_vector3.osl ) to ( mx_worleynoise3d_vector3.osl )
            NG_standard_surface_surfaceshader_100 - layer /specular_layer_with_thin_film removed from NG_standard_surface_surfaceshader_100
            - multiply /metalness_mix_attenuated removed from NG_standard_surface_surfaceshader_100
            - layer /thin_film_layer add to NG_standard_surface_surfaceshader_100
            - multiply /thin_film_layer_attenuated add to NG_standard_surface_surfaceshader_100
            - Number of children on: metal_bsdf changed from ( 7 ) to ( 9 )
            - input /thinfilm_thickness added to NG_standard_surface_surfaceshader_100/metal_bsdf. Value=( )
            - input /thinfilm_ior added to NG_standard_surface_surfaceshader_100/metal_bsdf. Value=( )
            - attribute: nodename changed on base from ( metalness_mix_attenuated ) to ( thin_film_layer_attenuated )
            NG_standard_surface_surfaceshader_100 - multiply /metalness_mix_attenuated removed from NG_standard_surface_surfaceshader_100
            - multiply /thin_film_layer_attenuated add to NG_standard_surface_surfaceshader_100
            - Number of children on: metal_bsdf changed from ( 7 ) to ( 9 )
            - input /thinfilm_thickness added to NG_standard_surface_surfaceshader_100/metal_bsdf. Value=( )
            - input /thinfilm_ior added to NG_standard_surface_surfaceshader_100/metal_bsdf. Value=( )
            - attribute: nodename changed on base from ( metalness_mix_attenuated ) to ( thin_film_layer_attenuated )
            diff --git a/documents/mtlx_1385_vs_1386.html b/documents/mtlx_1385_vs_1386.html index 7a9426a3..0ceeeab0 100644 --- a/documents/mtlx_1385_vs_1386.html +++ b/documents/mtlx_1385_vs_1386.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
            MaterialX LearnMaterialX Library Comparison

            Libraries Loaded

              -
            • Loaded 689 first library definitions from 39 files. Version 1.39.0
                +
              • Loaded 690 first library definitions from 39 files. Version 1.39.0
                • First library location: ['../../resources/libraries_1.38.6']. Search path: ""
              • -
              • Loaded 680 second library definitions from 38 files. Version 1.39
                  +
                • Loaded 681 second library definitions from 38 files. Version 1.39
                  • Second library location: ['../../resources/libraries_1.38.5']. Search path: ""
                • @@ -232,8 +232,8 @@

                  Libraries Loaded

                  Node Definition Comparison

                    -
                  • First library has 689 nodedefs.
                  • -
                  • Second library has 680 nodedefs
                  • +
                  • First library has 690 nodedefs.
                  • +
                  • Second library has 681 nodedefs
                  9 node definitions removed @@ -317,7 +317,7 @@

                  Implementations

                • Second library shader targets: ['essl', 'genglsl', 'genmdl', 'genosl']
                First Library Definitions / Implementations
                -
                555 shaders: essl +
                556 shaders: essl
                DefinitionImplementationFile
                ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -330,6 +330,7 @@
                First Library Definitions / I
                ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -877,7 +878,7 @@
                First Library Definitions / I
                -
                555 shaders: genglsl +
                556 shaders: genglsl
                DefinitionImplementationFile
                ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -890,6 +891,7 @@
                First Library Definitions / I
                ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -1437,7 +1439,7 @@
                First Library Definitions / I
                -
                560 shaders: genmdl +
                561 shaders: genmdl
                DefinitionImplementationFile
                ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1447,6 +1449,7 @@
                First Library Definitions / I
                ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -2002,7 +2005,7 @@
                First Library Definitions / I
                -
                552 shaders: genosl +
                553 shaders: genosl
                DefinitionImplementationFile
                ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2012,6 +2015,7 @@
                First Library Definitions / I
                ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -2664,7 +2668,7 @@
                First Library Definitions / I

                Second Library Definitions / Implementations
                -
                553 shaders: essl +
                554 shaders: essl
                DefinitionImplementationFile
                ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2677,6 +2681,7 @@
                Second Library Definitions /
                ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3222,7 +3227,7 @@
                Second Library Definitions /
                -
                553 shaders: genglsl +
                554 shaders: genglsl
                DefinitionImplementationFile
                ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3235,6 +3240,7 @@
                Second Library Definitions /
                ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3780,7 +3786,7 @@
                Second Library Definitions /
                -
                558 shaders: genmdl +
                559 shaders: genmdl
                DefinitionImplementationFile
                ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3790,6 +3796,7 @@
                Second Library Definitions /
                ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4343,7 +4350,7 @@
                Second Library Definitions /
                -
                550 shaders: genosl +
                551 shaders: genosl
                DefinitionImplementationFile
                ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4353,6 +4360,7 @@
                Second Library Definitions /
                ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -4990,8 +4998,8 @@
                Second Library Definitions /

                Implementation Comparison

                -

                First library implementation count: 1775 -Second library implementation count: 1747

                +

                First library implementation count: 1778 +Second library implementation count: 1750

                28 implementations added @@ -5032,8 +5040,8 @@

                Implementation Comparison

                - - + + @@ -5053,7 +5061,7 @@

                Implementation Comparison

                - +
                Name Change
                IMPL_gltf_pbr_surfaceshader - Number of children on: IMPL_gltf_pbr_surfaceshader changed from ( 40 ) to ( 52 )
                - oren_nayar_diffuse_bsdf /tf_diffuse_bsdf add to IMPL_gltf_pbr_surfaceshader
                - dielectric_bsdf /tf_transmission_bsdf add to IMPL_gltf_pbr_surfaceshader
                - generalized_schlick_bsdf /tf_reflection_bsdf add to IMPL_gltf_pbr_surfaceshader
                - mix /tf_transmission_mix add to IMPL_gltf_pbr_surfaceshader
                - layer /tf_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                - thin_film_bsdf /dielectric_thinfilm_bsdf add to IMPL_gltf_pbr_surfaceshader
                - layer /iridescent_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                - mix /mix_iridescent_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                - generalized_schlick_bsdf /tf_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                - thin_film_bsdf /metal_thinfilm_bsdf add to IMPL_gltf_pbr_surfaceshader
                - layer /iridescent_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                - mix /mix_iridescent_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                - attribute: nodename changed on bg from ( dielectric_bsdf ) to ( mix_iridescent_dielectric_bsdf )
                - attribute: nodename changed on fg from ( metal_bsdf ) to ( mix_iridescent_metal_bsdf )
                IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 28 ) to ( 34 )
                - divide /div_ior removed from IMP_UsdPreviewSurface_surfaceshader
                - subtract /inverse_metalness add to IMP_UsdPreviewSurface_surfaceshader
                - mix /diffuse_bsdf_weight add to IMP_UsdPreviewSurface_surfaceshader
                - divide /R add to IMP_UsdPreviewSurface_surfaceshader
                - multiply /R_sq add to IMP_UsdPreviewSurface_surfaceshader
                - mix /specular_color_metallic add to IMP_UsdPreviewSurface_surfaceshader
                - multiply /specular_color_metallic_R_sq add to IMP_UsdPreviewSurface_surfaceshader
                - convert /coat_F0 add to IMP_UsdPreviewSurface_surfaceshader
                - attribute: value=( 1 ) removed from: weight
                - attribute: nodename=( diffuse_bsdf_weight ) added to: weight
                - Category changed on: F0 from mix to multiply
                - attribute: type changed on F0 from ( float ) to ( color3 )
                - Number of children on: F0 changed from ( 2 ) to ( 3 )
                - input /in1 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - input /in2 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - input /fg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - input /bg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - input /mix added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - attribute: channels=( rrr ) removed from: color0
                - attribute: value=( 1, 1, 1 ) removed from: color90
                - attribute: interfacename=( specularColor ) added to: color90
                - Category changed on: coat_dielectric_bsdf from generalized_schlick_bsdf to dielectric_bsdf
                - input /tint removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                - input /ior removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1.5 )
                - input /color0 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( )
                - input /color90 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                IMPL_gltf_pbr_surfaceshader - Number of children on: IMPL_gltf_pbr_surfaceshader changed from ( 40 ) to ( 48 )
                - oren_nayar_diffuse_bsdf /tf_diffuse_bsdf add to IMPL_gltf_pbr_surfaceshader
                - dielectric_bsdf /tf_transmission_bsdf add to IMPL_gltf_pbr_surfaceshader
                - generalized_schlick_bsdf /tf_reflection_bsdf add to IMPL_gltf_pbr_surfaceshader
                - mix /tf_transmission_mix add to IMPL_gltf_pbr_surfaceshader
                - layer /tf_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                - mix /mix_iridescent_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                - generalized_schlick_bsdf /tf_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                - mix /mix_iridescent_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                - attribute: nodename changed on bg from ( dielectric_bsdf ) to ( mix_iridescent_dielectric_bsdf )
                - attribute: nodename changed on fg from ( metal_bsdf ) to ( mix_iridescent_metal_bsdf )
                IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 29 ) to ( 34 )
                - divide /div_ior removed from IMP_UsdPreviewSurface_surfaceshader
                - convert /swizzle removed from IMP_UsdPreviewSurface_surfaceshader
                - subtract /inverse_metalness add to IMP_UsdPreviewSurface_surfaceshader
                - mix /diffuse_bsdf_weight add to IMP_UsdPreviewSurface_surfaceshader
                - divide /R add to IMP_UsdPreviewSurface_surfaceshader
                - multiply /R_sq add to IMP_UsdPreviewSurface_surfaceshader
                - mix /specular_color_metallic add to IMP_UsdPreviewSurface_surfaceshader
                - multiply /specular_color_metallic_R_sq add to IMP_UsdPreviewSurface_surfaceshader
                - convert /coat_F0 add to IMP_UsdPreviewSurface_surfaceshader
                - attribute: value=( 1 ) removed from: weight
                - attribute: nodename=( diffuse_bsdf_weight ) added to: weight
                - Category changed on: F0 from mix to multiply
                - attribute: type changed on F0 from ( float ) to ( color3 )
                - Number of children on: F0 changed from ( 2 ) to ( 3 )
                - input /in1 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - input /in2 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - input /fg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - input /bg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - input /mix added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                - attribute: nodename changed on color0 from ( swizzle ) to ( F0 )
                - attribute: value=( 1, 1, 1 ) removed from: color90
                - attribute: interfacename=( specularColor ) added to: color90
                - Category changed on: coat_dielectric_bsdf from generalized_schlick_bsdf to dielectric_bsdf
                - input /tint removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                - input /ior removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1.5 )
                - input /color0 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( )
                - input /color90 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                IM_add_bsdf_genosl - attribute: sourcecode=( ({{in1}} + {{in2}}) ) added to: IM_add_bsdf_genosl
                IM_add_edf_genosl - attribute: sourcecode=( ({{in1}} + {{in2}}) ) added to: IM_add_edf_genosl
                IM_burley_diffuse_bsdf_genosl - attribute: file=( mx_burley_diffuse_bsdf.osl ) removed from: IM_burley_diffuse_bsdf_genosl
                - attribute: function=( mx_burley_diffuse_bsdf ) removed from: IM_burley_diffuse_bsdf_genosl
                - attribute: sourcecode=( {{weight}} * burley_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) added to: IM_burley_diffuse_bsdf_genosl
                IM_uniform_edf_genosl - attribute: file=( mx_uniform_edf.inline ) removed from: IM_uniform_edf_genosl
                - attribute: sourcecode=( uniform_edf({{color}}) ) added to: IM_uniform_edf_genosl
                NG_place2d_vector2 - Number of children on: NG_place2d_vector2 changed from ( 6 ) to ( 11 )
                - subtract /N_applyoffset2 add to NG_place2d_vector2
                - rotate2d /N_applyrot2 add to NG_place2d_vector2
                - divide /N_applyscale2 add to NG_place2d_vector2
                - add /N_addpivot2 add to NG_place2d_vector2
                - switch /N_switch_operationorder add to NG_place2d_vector2
                - attribute: nodename changed on out from ( N_addpivot ) to ( N_switch_operationorder )
                NG_range_color4 - Number of children on: NG_range_color4 changed from ( 11 ) to ( 10 )
                - input /value1 removed from NG_range_color4. Value=( )
                NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 50 ) to ( 56 )
                - add /transmission_roughness_add add to NG_standard_surface_surfaceshader_100
                - clamp /transmission_roughness_clamped add to NG_standard_surface_surfaceshader_100
                - mix /coat_affected_transmission_roughness add to NG_standard_surface_surfaceshader_100
                - roughness_anisotropy /transmission_roughness add to NG_standard_surface_surfaceshader_100
                - max /base_color_nonnegative add to NG_standard_surface_surfaceshader_100
                - max /subsurface_color_nonnegative add to NG_standard_surface_surfaceshader_100
                - attribute: interfacename=( base_color ) removed from: in1
                - attribute: nodename=( base_color_nonnegative ) added to: in1
                - attribute: interfacename=( subsurface_color ) removed from: in1
                - attribute: nodename=( subsurface_color_nonnegative ) added to: in1
                - attribute: nodename changed on roughness from ( main_roughness ) to ( transmission_roughness )
                NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 49 ) to ( 55 )
                - add /transmission_roughness_add add to NG_standard_surface_surfaceshader_100
                - clamp /transmission_roughness_clamped add to NG_standard_surface_surfaceshader_100
                - mix /coat_affected_transmission_roughness add to NG_standard_surface_surfaceshader_100
                - roughness_anisotropy /transmission_roughness add to NG_standard_surface_surfaceshader_100
                - max /base_color_nonnegative add to NG_standard_surface_surfaceshader_100
                - max /subsurface_color_nonnegative add to NG_standard_surface_surfaceshader_100
                - attribute: interfacename=( base_color ) removed from: in1
                - attribute: nodename=( base_color_nonnegative ) added to: in1
                - attribute: interfacename=( subsurface_color ) removed from: in1
                - attribute: nodename=( subsurface_color_nonnegative ) added to: in1
                - attribute: nodename changed on roughness from ( main_roughness ) to ( transmission_roughness )
                diff --git a/documents/mtlx_1386_vs_1387.html b/documents/mtlx_1386_vs_1387.html index 7d1760a7..0616c524 100644 --- a/documents/mtlx_1386_vs_1387.html +++ b/documents/mtlx_1386_vs_1387.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
                MaterialX LearnMaterialX Library Comparison

                Libraries Loaded

                  -
                • Loaded 698 first library definitions from 45 files. Version 1.39.0
                    +
                  • Loaded 699 first library definitions from 45 files. Version 1.39.0
                    • First library location: ['../../resources/libraries_1.38.7']. Search path: ""
                  • -
                  • Loaded 689 second library definitions from 39 files. Version 1.39
                      +
                    • Loaded 690 second library definitions from 39 files. Version 1.39
                      • Second library location: ['../../resources/libraries_1.38.6']. Search path: ""
                    • @@ -232,8 +232,8 @@

                      Libraries Loaded

                      Node Definition Comparison

                        -
                      • First library has 698 nodedefs.
                      • -
                      • Second library has 689 nodedefs
                      • +
                      • First library has 699 nodedefs.
                      • +
                      • Second library has 690 nodedefs
                      9 node definitions added. (Sorted by category) @@ -386,7 +386,7 @@

                      Implementations

                    • Shader targets added: ['genmsl']
                    First Library Definitions / Implementations
                    -
                    556 shaders: essl +
                    557 shaders: essl
                    DefinitionImplementationFile
                    ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                    ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -399,6 +399,7 @@
                    First Library Definitions / I
                    ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                    ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                    ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                    ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -947,7 +948,7 @@
                    First Library Definitions / I
                    -
                    556 shaders: genglsl +
                    557 shaders: genglsl
                    DefinitionImplementationFile
                    ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                    ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -960,6 +961,7 @@
                    First Library Definitions / I
                    ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                    ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                    ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                    ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -1508,7 +1510,7 @@
                    First Library Definitions / I
                    -
                    564 shaders: genmdl +
                    565 shaders: genmdl
                    DefinitionImplementationFile
                    ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1518,6 +1520,7 @@
                    First Library Definitions / I
                    ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                    ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -2077,7 +2080,7 @@
                    First Library Definitions / I
                    -
                    553 shaders: genosl +
                    554 shaders: genosl
                    DefinitionImplementationFile
                    ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                    ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2087,6 +2090,7 @@
                    First Library Definitions / I
                    ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                    ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                    ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                    ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                    ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                    ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                    ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -2748,7 +2752,7 @@
                    First Library Definitions / I

                    Second Library Definitions / Implementations
                    -
                    555 shaders: essl +
                    556 shaders: essl
                    DefinitionImplementationFile
                    ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                    ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2761,6 +2765,7 @@
                    Second Library Definitions /
                    ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                    ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                    ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3308,7 +3313,7 @@
                    Second Library Definitions /
                    -
                    555 shaders: genglsl +
                    556 shaders: genglsl
                    DefinitionImplementationFile
                    ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                    ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3321,6 +3326,7 @@
                    Second Library Definitions /
                    ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                    ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                    ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                    ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3868,7 +3874,7 @@
                    Second Library Definitions /
                    -
                    560 shaders: genmdl +
                    561 shaders: genmdl
                    DefinitionImplementationFile
                    ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3878,6 +3884,7 @@
                    Second Library Definitions /
                    ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                    ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                    ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4438,7 +4445,7 @@
                    Second Library Definitions /
                    DefinitionImplementationFile
                    -
                    552 shaders: genosl +
                    553 shaders: genosl
                    DefinitionImplementationFile
                    ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                    ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4448,6 +4455,7 @@
                    Second Library Definitions /
                    ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                    ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                    ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                    ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                    ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                    ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                    ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -5100,9 +5108,9 @@
                    Second Library Definitions /

                    Implementation Comparison

                    -

                    First library implementation count: 2335 -Second library implementation count: 1766

                    -
                    569 implementations added +

                    First library implementation count: 2339 +Second library implementation count: 1769

                    +
                    570 implementations added @@ -5648,6 +5656,7 @@

                    Implementation Comparison

                    + @@ -6372,8 +6381,8 @@

                    Implementation Comparison

                    - - + +
                    Name Node Category Node Type
                    IM_tangent_vector3_genmsl tangent vector3
                    IM_texcoord_vector2_genmsl texcoord vector2
                    IM_texcoord_vector3_genmsl texcoord vector3
                    IM_thin_film_bsdf_genmsl thin_film_bsdf BSDF
                    IM_time_float_genmsl time float
                    IM_transformmatrix_vector2M3_genmsl transformmatrix vector2
                    IM_transformmatrix_vector3M4_genmsl transformmatrix vector3
                    IM_transpose_matrix44_genosl - attribute: file=( mx_transpose.inline ) removed from: IM_transpose_matrix44_genosl
                    - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix44_genosl
                    NG_gltf_colorimage - attribute: uniform=( true ) added to: uvindex
                    NG_gltf_iridescence_thickness_float_1_0 - attribute: uniform=( true ) added to: uvindex
                    NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 56 ) to ( 61 )
                    - mix /coat_emission_attenuation removed from NG_standard_surface_surfaceshader_100
                    - multiply /emission_weight_attenuated removed from NG_standard_surface_surfaceshader_100
                    - subtract /one_minus_coat_ior add to NG_standard_surface_surfaceshader_100
                    - add /one_plus_coat_ior add to NG_standard_surface_surfaceshader_100
                    - divide /coat_ior_to_F0_sqrt add to NG_standard_surface_surfaceshader_100
                    - multiply /coat_ior_to_F0 add to NG_standard_surface_surfaceshader_100
                    - multiply /coat_tinted_emission_edf add to NG_standard_surface_surfaceshader_100
                    - generalized_schlick_edf /coat_emission_edf add to NG_standard_surface_surfaceshader_100
                    - mix /blended_coat_emission_edf add to NG_standard_surface_surfaceshader_100
                    - attribute: nodename changed on color from ( emission_weight_attenuated ) to ( emission_weight )
                    - attribute: nodename changed on edf from ( emission_edf ) to ( blended_coat_emission_edf )
                    NG_standard_surface_to_gltf_pbr - Number of children on: NG_standard_surface_to_gltf_pbr changed from ( 31 ) to ( 29 )
                    - dot /emissive_strength removed from NG_standard_surface_to_gltf_pbr
                    - output /emissive_strength_out removed from NG_standard_surface_to_gltf_pbr. Value=( )
                    - Category changed on: sheen_roughness from ifgreater to dot
                    - Number of children on: sheen_roughness changed from ( 1 ) to ( 4 )
                    - input /in removed from NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                    - input /value1 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                    - input /value2 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( 0 )
                    - input /in1 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                    - input /in2 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( 0 )
                    - Category changed on: emissive from multiply to dot
                    - Number of children on: emissive changed from ( 1 ) to ( 2 )
                    - input /in removed from NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                    - input /in1 added to NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                    - input /in2 added to NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                    NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 55 ) to ( 61 )
                    - mix /coat_emission_attenuation removed from NG_standard_surface_surfaceshader_100
                    - multiply /emission_weight_attenuated removed from NG_standard_surface_surfaceshader_100
                    - subtract /one_minus_coat_ior add to NG_standard_surface_surfaceshader_100
                    - add /one_plus_coat_ior add to NG_standard_surface_surfaceshader_100
                    - divide /coat_ior_to_F0_sqrt add to NG_standard_surface_surfaceshader_100
                    - multiply /coat_ior_to_F0 add to NG_standard_surface_surfaceshader_100
                    - multiply /coat_tinted_emission_edf add to NG_standard_surface_surfaceshader_100
                    - generalized_schlick_edf /coat_emission_edf add to NG_standard_surface_surfaceshader_100
                    - mix /blended_coat_emission_edf add to NG_standard_surface_surfaceshader_100
                    - extract /swizzle2 add to NG_standard_surface_surfaceshader_100
                    - attribute: nodename changed on color from ( emission_weight_attenuated ) to ( emission_weight )
                    - Category changed on: swizzle from convert to extract
                    - attribute: type changed on swizzle from ( float ) to ( color3 )
                    - Number of children on: swizzle changed from ( 2 ) to ( 1 )
                    - input /index removed from NG_standard_surface_surfaceshader_100/swizzle. Value=( 0 )
                    - attribute: type changed on in from ( color3 ) to ( float )
                    - attribute: nodename changed on in from ( opacity_luminance ) to ( coat_ior_to_F0 )
                    - attribute: nodename changed on edf from ( emission_edf ) to ( blended_coat_emission_edf )
                    - attribute: nodename changed on opacity from ( swizzle ) to ( swizzle2 )
                    NG_standard_surface_to_gltf_pbr - Number of children on: NG_standard_surface_to_gltf_pbr changed from ( 34 ) to ( 32 )
                    - dot /emissive_strength removed from NG_standard_surface_to_gltf_pbr
                    - output /emissive_strength_out removed from NG_standard_surface_to_gltf_pbr. Value=( )
                    - Category changed on: sheen_roughness from ifgreater to dot
                    - Number of children on: sheen_roughness changed from ( 1 ) to ( 4 )
                    - input /in removed from NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                    - input /value1 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                    - input /value2 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( 0 )
                    - input /in1 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                    - input /in2 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( 0 )
                    - Category changed on: emissive from multiply to dot
                    - Number of children on: emissive changed from ( 1 ) to ( 2 )
                    - input /in removed from NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                    - input /in1 added to NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                    - input /in2 added to NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                    diff --git a/documents/mtlx_1387_vs_1388.html b/documents/mtlx_1387_vs_1388.html index d6c67c00..13894c26 100644 --- a/documents/mtlx_1387_vs_1388.html +++ b/documents/mtlx_1387_vs_1388.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
                    MaterialX LearnMaterialX Library Comparison

                    Libraries Loaded

                      -
                    • Loaded 738 first library definitions from 39 files. Version 1.39.0
                        +
                      • Loaded 739 first library definitions from 39 files. Version 1.39.0
                        • First library location: ['../../resources/libraries_1.38.8']. Search path: ""
                      • -
                      • Loaded 698 second library definitions from 45 files. Version 1.39
                          +
                        • Loaded 699 second library definitions from 45 files. Version 1.39
                          • Second library location: ['../../resources/libraries_1.38.7']. Search path: ""
                        • @@ -232,8 +232,8 @@

                          Libraries Loaded

                          Node Definition Comparison

                            -
                          • First library has 738 nodedefs.
                          • -
                          • Second library has 698 nodedefs
                          • +
                          • First library has 739 nodedefs.
                          • +
                          • Second library has 699 nodedefs
                          40 node definitions added. (Sorted by category) @@ -376,7 +376,7 @@

                          Implementations

                        • Second library shader targets: ['essl', 'genglsl', 'genmdl', 'genmsl', 'genosl']
                        First Library Definitions / Implementations
                        -
                        559 shaders: essl +
                        560 shaders: essl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -389,6 +389,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -940,7 +941,7 @@
                        First Library Definitions / I
                        -
                        559 shaders: genglsl +
                        560 shaders: genglsl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -953,6 +954,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -1504,7 +1506,7 @@
                        First Library Definitions / I
                        -
                        568 shaders: genmdl +
                        569 shaders: genmdl
                        DefinitionImplementationFile
                        ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1514,6 +1516,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -2077,7 +2080,7 @@
                        First Library Definitions / I
                        -
                        558 shaders: genmsl +
                        559 shaders: genmsl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -2090,6 +2093,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -2640,7 +2644,7 @@
                        First Library Definitions / I
                        -
                        556 shaders: genosl +
                        557 shaders: genosl
                        DefinitionImplementationFile
                        ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2650,6 +2654,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -3352,7 +3357,7 @@
                        First Library Definitions / I

                        Second Library Definitions / Implementations
                        -
                        556 shaders: essl +
                        557 shaders: essl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3365,6 +3370,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -3913,7 +3919,7 @@
                        Second Library Definitions /
                        -
                        556 shaders: genglsl +
                        557 shaders: genglsl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3926,6 +3932,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -4474,7 +4481,7 @@
                        Second Library Definitions /
                        -
                        564 shaders: genmdl +
                        565 shaders: genmdl
                        DefinitionImplementationFile
                        ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -4484,6 +4491,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -5043,7 +5051,7 @@
                        Second Library Definitions /
                        -
                        555 shaders: genmsl +
                        556 shaders: genmsl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -5056,6 +5064,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -5603,7 +5612,7 @@
                        Second Library Definitions /
                        -
                        553 shaders: genosl +
                        554 shaders: genosl
                        DefinitionImplementationFile
                        ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -5613,6 +5622,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -6274,8 +6284,8 @@
                        Second Library Definitions /

                        Implementation Comparison

                        -

                        First library implementation count: 2386 -Second library implementation count: 2335

                        +

                        First library implementation count: 2390 +Second library implementation count: 2339

                        51 implementations added @@ -6339,7 +6349,7 @@

                        Implementation Comparison

                        - + diff --git a/documents/mtlx_1388_vs_1389.html b/documents/mtlx_1388_vs_1389.html index 10d45897..9a90add4 100644 --- a/documents/mtlx_1388_vs_1389.html +++ b/documents/mtlx_1388_vs_1389.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
                        MaterialX LearnMaterialX Library Comparison

                        Libraries Loaded

                          -
                        • Loaded 765 first library definitions from 45 files. Version 1.39.0
                            +
                          • Loaded 766 first library definitions from 45 files. Version 1.39.0
                            • First library location: ['../../resources/libraries_1.38.9']. Search path: ""
                          • -
                          • Loaded 738 second library definitions from 39 files. Version 1.39
                              +
                            • Loaded 739 second library definitions from 39 files. Version 1.39
                              • Second library location: ['../../resources/libraries_1.38.8']. Search path: ""
                            • @@ -232,8 +232,8 @@

                              Libraries Loaded

                              Node Definition Comparison

                                -
                              • First library has 765 nodedefs.
                              • -
                              • Second library has 738 nodedefs
                              • +
                              • First library has 766 nodedefs.
                              • +
                              • Second library has 739 nodedefs
                              27 node definitions added. (Sorted by category) @@ -305,7 +305,7 @@

                              Implementations

                            • Second library shader targets: ['essl', 'genglsl', 'genmdl', 'genmsl', 'genosl']
                            First Library Definitions / Implementations
                            -
                            540 shaders: essl +
                            541 shaders: essl
                        Name Change
                        IMPL_gltf_pbr_surfaceshader - Number of children on: IMPL_gltf_pbr_surfaceshader changed from ( 52 ) to ( 51 )
                        - oren_nayar_diffuse_bsdf /tf_diffuse_bsdf removed from IMPL_gltf_pbr_surfaceshader
                        - attribute: nodename changed on bg from ( tf_diffuse_bsdf ) to ( diffuse_bsdf )
                        IMPL_gltf_pbr_surfaceshader - Number of children on: IMPL_gltf_pbr_surfaceshader changed from ( 48 ) to ( 47 )
                        - oren_nayar_diffuse_bsdf /tf_diffuse_bsdf removed from IMPL_gltf_pbr_surfaceshader
                        - attribute: nodename changed on bg from ( tf_diffuse_bsdf ) to ( diffuse_bsdf )
                        IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 34 ) to ( 33 )
                        - clamp /opacity_clamped removed from IMP_UsdPreviewSurface_surfaceshader
                        - attribute: nodename=( opacity_clamped ) removed from: value1
                        - attribute: interfacename=( opacity ) added to: value1
                        NG_NG_gltf_image_color3_color3_1_0 - Number of children on: NG_NG_gltf_image_color3_color3_1_0 changed from ( 8 ) to ( 7 )
                        - texcoord /texcoord1 removed from NG_NG_gltf_image_color3_color3_1_0
                        - attribute: nodename=( texcoord1 ) removed from: texcoord
                        - attribute: interfacename=( texcoord ) added to: texcoord
                        NG_gltf_colorimage - Number of children on: NG_gltf_colorimage changed from ( 9 ) to ( 8 )
                        - texcoord /texcoord1 removed from NG_gltf_colorimage
                        - input /uvindex removed from NG_gltf_colorimage/image. Value=( )
                        - input /texcoord added to NG_gltf_colorimage/image. Value=( )
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -319,6 +319,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -850,7 +851,7 @@
                        First Library Definitions / I
                        -
                        540 shaders: genglsl +
                        541 shaders: genglsl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -864,6 +865,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -1395,7 +1397,7 @@
                        First Library Definitions / I
                        -
                        549 shaders: genmdl +
                        550 shaders: genmdl
                        DefinitionImplementationFile
                        ND_viewdirection_vector3IM_viewdirection_vector3_genmdlnprlib_genmdl_impl.mtlx
                        ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1406,6 +1408,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1949,7 +1952,7 @@
                        First Library Definitions / I
                        -
                        539 shaders: genmsl +
                        540 shaders: genmsl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -1963,6 +1966,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -2493,7 +2497,7 @@
                        First Library Definitions / I
                        -
                        537 shaders: genosl +
                        538 shaders: genosl
                        DefinitionImplementationFile
                        ND_viewdirection_vector3IM_viewdirection_vector3_genoslnprlib_genosl_impl.mtlx
                        ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2504,6 +2508,7 @@
                        First Library Definitions / I
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -3232,7 +3237,7 @@
                        First Library Definitions / I

                        Second Library Definitions / Implementations
                        -
                        559 shaders: essl +
                        560 shaders: essl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3245,6 +3250,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -3796,7 +3802,7 @@
                        Second Library Definitions /
                        -
                        559 shaders: genglsl +
                        560 shaders: genglsl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3809,6 +3815,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -4360,7 +4367,7 @@
                        Second Library Definitions /
                        -
                        568 shaders: genmdl +
                        569 shaders: genmdl
                        DefinitionImplementationFile
                        ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -4370,6 +4377,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                        ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4933,7 +4941,7 @@
                        Second Library Definitions /
                        -
                        558 shaders: genmsl +
                        559 shaders: genmsl
                        DefinitionImplementationFile
                        ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                        ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -4946,6 +4954,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                        ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -5496,7 +5505,7 @@
                        Second Library Definitions /
                        -
                        556 shaders: genosl +
                        557 shaders: genosl
                        DefinitionImplementationFile
                        ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -5506,6 +5515,7 @@
                        Second Library Definitions /
                        ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                        ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                        ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                        ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                        ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -6208,8 +6218,8 @@
                        Second Library Definitions /

                        Implementation Comparison

                        -

                        First library implementation count: 2484 -Second library implementation count: 2386

                        +

                        First library implementation count: 2488 +Second library implementation count: 2390

                        98 implementations added @@ -6316,7 +6326,7 @@

                        Implementation Comparison

                        -
                        246 implementations modified +
                        247 implementations modified
                        @@ -6546,6 +6556,7 @@

                        Implementation Comparison

                        + @@ -6565,7 +6576,7 @@

                        Implementation Comparison

                        - +
                        Name Change
                        IM_tangent_vector3_genmdl - attribute: sourcecode changed on IM_tangent_vector3_genmdl from ( mx::stdlib::mx_tangent_vector3(mxp_space:{{space}}, mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_tangent_vector3(mxp_space:{{space}}, mxp_index:{{index}}) )
                        IM_texcoord_vector2_genmdl - attribute: sourcecode changed on IM_texcoord_vector2_genmdl from ( mx::stdlib::mx_texcoord_vector2(mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_texcoord_vector2(mxp_index:{{index}}) )
                        IM_texcoord_vector3_genmdl - attribute: sourcecode changed on IM_texcoord_vector3_genmdl from ( mx::stdlib::mx_texcoord_vector3(mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_texcoord_vector3(mxp_index:{{index}}) )
                        IM_thin_film_bsdf_genmdl - attribute: sourcecode changed on IM_thin_film_bsdf_genmdl from ( mx::pbrlib::mx_thin_film_bsdf(mxp_thickness:{{thickness}}, mxp_ior:{{ior}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_thin_film_bsdf(mxp_thickness:{{thickness}}, mxp_ior:{{ior}}, mxp_base:{{base}}) )
                        IM_thin_surface_genmdl - attribute: sourcecode changed on IM_thin_surface_genmdl from ( mx::pbrlib::mx_thin_surface(mxp_front_bsdf:{{front_bsdf}}, mxp_front_edf:{{front_edf}}, mxp_back_bsdf:{{back_bsdf}}, mxp_back_edf:{{back_edf}}, mxp_opacity:{{opacity}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_thin_surface(mxp_front_bsdf:{{front_bsdf}}, mxp_front_edf:{{front_edf}}, mxp_back_bsdf:{{back_bsdf}}, mxp_back_edf:{{back_edf}}, mxp_opacity:{{opacity}}) )
                        IM_time_float_genmdl - attribute: sourcecode changed on IM_time_float_genmdl from ( mx::stdlib::mx_time_float() ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_time_float() )
                        IM_transformmatrix_vector2M3_genmdl - attribute: sourcecode changed on IM_transformmatrix_vector2M3_genmdl from ( mx::stdlib::mx_transformmatrix_vector2M3({{in}}, {{mat}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_transformmatrix_vector2M3({{in}}, {{mat}}) )
                        IM_worleynoise3d_float_genmdl - attribute: sourcecode changed on IM_worleynoise3d_float_genmdl from ( mx::stdlib::mx_worleynoise3d_float(mxp_position:{{position}}, mxp_jitter:{{jitter}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_worleynoise3d_float(mxp_position:{{position}}, mxp_jitter:{{jitter}}) )
                        IM_worleynoise3d_vector2_genmdl - attribute: sourcecode changed on IM_worleynoise3d_vector2_genmdl from ( mx::stdlib::mx_worleynoise3d_float2(mxp_position:{{position}}, mxp_jitter:{{jitter}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_worleynoise3d_float2(mxp_position:{{position}}, mxp_jitter:{{jitter}}) )
                        IM_worleynoise3d_vector3_genmdl - attribute: sourcecode changed on IM_worleynoise3d_vector3_genmdl from ( mx::stdlib::mx_worleynoise3d_float3(mxp_position:{{position}}, mxp_jitter:{{jitter}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_worleynoise3d_float3(mxp_position:{{position}}, mxp_jitter:{{jitter}}) )
                        NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 61 ) to ( 62 )
                        - subtract /one_minus_coat_ior_to_F0 add to NG_standard_surface_surfaceshader_100
                        - attribute: value=( 1.0, 1.0, 1.0 ) removed from: color0
                        - attribute: nodename=( one_minus_coat_ior_to_F0 ) added to: color0
                        - attribute: channels=( rrr ) added to: color0
                        - attribute: nodename=( coat_ior_to_F0 ) removed from: color90
                        - attribute: channels=( rrr ) removed from: color90
                        - attribute: value=( 0.0, 0.0, 0.0 ) added to: color90
                        NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 61 ) to ( 62 )
                        - subtract /one_minus_coat_ior_to_F0 add to NG_standard_surface_surfaceshader_100
                        - attribute: nodename changed on in from ( coat_ior_to_F0 ) to ( one_minus_coat_ior_to_F0 )
                        - attribute: value=( 1.0, 1.0, 1.0 ) removed from: color0
                        - attribute: nodename=( swizzle ) added to: color0
                        - attribute: nodename=( swizzle ) removed from: color90
                        - attribute: value=( 0.0, 0.0, 0.0 ) added to: color90
                        diff --git a/documents/mtlx_1389_vs_1390.html b/documents/mtlx_1389_vs_1390.html index 3c4e9b12..44623d06 100644 --- a/documents/mtlx_1389_vs_1390.html +++ b/documents/mtlx_1389_vs_1390.html @@ -51,7 +51,7 @@ - + @@ -219,11 +219,11 @@
                        MaterialX LearnMaterialX Library Comparison

                        Libraries Loaded

                          -
                        • Loaded 766 first library definitions from 46 files. Version 1.39.0
                            +
                          • Loaded 742 first library definitions from 46 files. Version 1.39.0
                            • First library location: ['../../pymaterialx/python/MaterialX/libraries']. Search path: ""
                          • -
                          • Loaded 765 second library definitions from 45 files. Version 1.39
                              +
                            • Loaded 766 second library definitions from 45 files. Version 1.39
                              • Second library location: ['../../resources/libraries_1.38.9']. Search path: ""
                            • @@ -232,14 +232,103 @@

                              Libraries Loaded

                              Node Definition Comparison

                                -
                              • First library has 766 nodedefs.
                              • -
                              • Second library has 765 nodedefs
                              • +
                              • First library has 742 nodedefs.
                              • +
                              • Second library has 766 nodedefs
                              -
                              1 node definitions added. (Sorted by category) +
                              53 node definitions removed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              Name Category
                              ND_arrayappend_color3_color3array arrayappend
                              ND_arrayappend_color3array_color3array arrayappend
                              ND_arrayappend_color4_color4array arrayappend
                              ND_arrayappend_color4array_color4array arrayappend
                              ND_arrayappend_float_floatarray arrayappend
                              ND_arrayappend_floatarray_floatarray arrayappend
                              ND_arrayappend_integer_integerarray arrayappend
                              ND_arrayappend_integerarray_integerarray arrayappend
                              ND_arrayappend_string_stringarray arrayappend
                              ND_arrayappend_stringarray_stringarray arrayappend
                              ND_arrayappend_vector2_vector2array arrayappend
                              ND_arrayappend_vector2array_vector2array arrayappend
                              ND_arrayappend_vector3_vector3array arrayappend
                              ND_arrayappend_vector3array_vector3array arrayappend
                              ND_arrayappend_vector4_vector4array arrayappend
                              ND_arrayappend_vector4array_vector4array arrayappend
                              ND_normalmap normalmap
                              ND_swizzle_color3_color3 swizzle
                              ND_swizzle_color3_color4 swizzle
                              ND_swizzle_color3_float swizzle
                              ND_swizzle_color3_vector2 swizzle
                              ND_swizzle_color3_vector3 swizzle
                              ND_swizzle_color3_vector4 swizzle
                              ND_swizzle_color4_color3 swizzle
                              ND_swizzle_color4_color4 swizzle
                              ND_swizzle_color4_float swizzle
                              ND_swizzle_color4_vector2 swizzle
                              ND_swizzle_color4_vector3 swizzle
                              ND_swizzle_color4_vector4 swizzle
                              ND_swizzle_float_color3 swizzle
                              ND_swizzle_float_color4 swizzle
                              ND_swizzle_float_vector2 swizzle
                              ND_swizzle_float_vector3 swizzle
                              ND_swizzle_float_vector4 swizzle
                              ND_swizzle_vector2_color3 swizzle
                              ND_swizzle_vector2_color4 swizzle
                              ND_swizzle_vector2_float swizzle
                              ND_swizzle_vector2_vector2 swizzle
                              ND_swizzle_vector2_vector3 swizzle
                              ND_swizzle_vector2_vector4 swizzle
                              ND_swizzle_vector3_color3 swizzle
                              ND_swizzle_vector3_color4 swizzle
                              ND_swizzle_vector3_float swizzle
                              ND_swizzle_vector3_vector2 swizzle
                              ND_swizzle_vector3_vector3 swizzle
                              ND_swizzle_vector3_vector4 swizzle
                              ND_swizzle_vector4_color3 swizzle
                              ND_swizzle_vector4_color4 swizzle
                              ND_swizzle_vector4_float swizzle
                              ND_swizzle_vector4_vector2 swizzle
                              ND_swizzle_vector4_vector3 swizzle
                              ND_swizzle_vector4_vector4 swizzle
                              ND_thin_film_bsdf thin_film_bsdf
                              + +
                              + +
                              29 node definitions added. (Sorted by category) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                              Name Category NodeGroup
                              ND_add_integer add math
                              ND_ifequal_integer ifequal conditional
                              ND_ifequal_matrix33 ifequal conditional
                              ND_ifequal_matrix44 ifequal conditional
                              ND_ifequal_integerI ifequal conditional
                              ND_ifequal_matrix33I ifequal conditional
                              ND_ifequal_matrix44I ifequal conditional
                              ND_ifequal_integerB ifequal conditional
                              ND_ifequal_matrix33B ifequal conditional
                              ND_ifequal_matrix44B ifequal conditional
                              ND_ifgreater_integer ifgreater conditional
                              ND_ifgreater_matrix33 ifgreater conditional
                              ND_ifgreater_matrix44 ifgreater conditional
                              ND_ifgreater_integerI ifgreater conditional
                              ND_ifgreater_matrix33I ifgreater conditional
                              ND_ifgreater_matrix44I ifgreater conditional
                              ND_ifgreatereq_integer ifgreatereq conditional
                              ND_ifgreatereq_matrix33 ifgreatereq conditional
                              ND_ifgreatereq_matrix44 ifgreatereq conditional
                              ND_ifgreatereq_integerI ifgreatereq conditional
                              ND_ifgreatereq_matrix33I ifgreatereq conditional
                              ND_ifgreatereq_matrix44I ifgreatereq conditional
                              ND_normalmap_float normalmap math
                              ND_open_pbr_surface_surfaceshader open_pbr_surface pbr
                              ND_subtract_integer subtract math
                              ND_switch_matrix33 switch conditional
                              ND_switch_matrix44 switch conditional
                              ND_switch_matrix33I switch conditional
                              ND_switch_matrix44I switch conditional
                              @@ -253,13 +342,73 @@

                              Node Definition Comparison

                              -
                              1 definitions modified +
                              21 definitions modified - + + + + + + + + + + + + + + + + + + + + - attribute: default changed on out from ( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0 ) to ( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 )
                              +
                              Name Change
                              ND_standard_surface_to_gltf_pbr +
                              ND_dielectric_bsdf + + - Number of children on: ND_dielectric_bsdf changed from ( 9 ) to ( 11 )
                              - input /thinfilm_thickness added to ND_dielectric_bsdf. Value=( 0 )
                              - input /thinfilm_ior added to ND_dielectric_bsdf. Value=( 1.5 )
                              ND_conductor_bsdf + + - Number of children on: ND_conductor_bsdf changed from ( 8 ) to ( 10 )
                              - input /thinfilm_thickness added to ND_conductor_bsdf. Value=( 0 )
                              - input /thinfilm_ior added to ND_conductor_bsdf. Value=( 1.5 )
                              ND_generalized_schlick_bsdf + + - Number of children on: ND_generalized_schlick_bsdf changed from ( 10 ) to ( 13 )
                              - input /color82 added to ND_generalized_schlick_bsdf. Value=( 1.0, 1.0, 1.0 )
                              - input /thinfilm_thickness added to ND_generalized_schlick_bsdf. Value=( 0 )
                              - input /thinfilm_ior added to ND_generalized_schlick_bsdf. Value=( 1.5 )
                              ND_atan2_float + + - input /in1 removed from ND_atan2_float. Value=( 0.0 )
                              - input /in2 removed from ND_atan2_float. Value=( 1.0 )
                              - input /iny added to ND_atan2_float. Value=( 0.0 )
                              - input /inx added to ND_atan2_float. Value=( 1.0 )
                              ND_atan2_vector2 + + - input /in1 removed from ND_atan2_vector2. Value=( 1.0, 1.0 )
                              - input /in2 removed from ND_atan2_vector2. Value=( 0.0, 0.0 )
                              - input /iny added to ND_atan2_vector2. Value=( 1.0, 1.0 )
                              - input /inx added to ND_atan2_vector2. Value=( 0.0, 0.0 )
                              ND_atan2_vector3 + + - input /in1 removed from ND_atan2_vector3. Value=( 1.0, 1.0, 1.0 )
                              - input /in2 removed from ND_atan2_vector3. Value=( 0.0, 0.0, 0.0 )
                              - input /iny added to ND_atan2_vector3. Value=( 1.0, 1.0, 1.0 )
                              - input /inx added to ND_atan2_vector3. Value=( 0.0, 0.0, 0.0 )
                              ND_atan2_vector4 + + - input /in1 removed from ND_atan2_vector4. Value=( 1.0, 1.0, 1.0, 1.0 )
                              - input /in2 removed from ND_atan2_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /iny added to ND_atan2_vector4. Value=( 1.0, 1.0, 1.0, 1.0 )
                              - input /inx added to ND_atan2_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              ND_switch_float + + - Number of children on: ND_switch_float changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_float. Value=( 0.0 )
                              - input /in7 added to ND_switch_float. Value=( 0.0 )
                              - input /in8 added to ND_switch_float. Value=( 0.0 )
                              - input /in9 added to ND_switch_float. Value=( 0.0 )
                              - input /in10 added to ND_switch_float. Value=( 0.0 )
                              ND_switch_color3 + + - Number of children on: ND_switch_color3 changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                              - input /in7 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                              - input /in8 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                              - input /in9 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                              - input /in10 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                              ND_switch_color4 + + - Number of children on: ND_switch_color4 changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in7 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in8 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in9 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in10 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              ND_switch_vector2 + + - Number of children on: ND_switch_vector2 changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                              - input /in7 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                              - input /in8 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                              - input /in9 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                              - input /in10 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                              ND_switch_vector3 + + - Number of children on: ND_switch_vector3 changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                              - input /in7 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                              - input /in8 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                              - input /in9 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                              - input /in10 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                              ND_switch_vector4 + + - Number of children on: ND_switch_vector4 changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in7 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in8 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in9 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in10 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                              ND_switch_floatI + + - Number of children on: ND_switch_floatI changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_floatI. Value=( 0.0 )
                              - input /in7 added to ND_switch_floatI. Value=( 0.0 )
                              - input /in8 added to ND_switch_floatI. Value=( 0.0 )
                              - input /in9 added to ND_switch_floatI. Value=( 0.0 )
                              - input /in10 added to ND_switch_floatI. Value=( 0.0 )
                              ND_switch_color3I + + - Number of children on: ND_switch_color3I changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                              - input /in7 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                              - input /in8 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                              - input /in9 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                              - input /in10 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                              ND_switch_color4I + + - Number of children on: ND_switch_color4I changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in7 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in8 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in9 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in10 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              ND_switch_vector2I + + - Number of children on: ND_switch_vector2I changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                              - input /in7 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                              - input /in8 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                              - input /in9 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                              - input /in10 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                              ND_switch_vector3I + + - Number of children on: ND_switch_vector3I changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                              - input /in7 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                              - input /in8 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                              - input /in9 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                              - input /in10 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                              ND_switch_vector4I + + - Number of children on: ND_switch_vector4I changed from ( 7 ) to ( 12 )
                              - input /in6 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in7 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in8 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in9 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              - input /in10 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                              ND_creatematrix_vector3_matrix44 - - Number of children on: ND_standard_surface_to_gltf_pbr changed from ( 26 ) to ( 28 )
                              - input /normal added to ND_standard_surface_to_gltf_pbr. Value=( 1, 1, 1 )
                              - output /normal_out added to ND_standard_surface_to_gltf_pbr. Value=( )
                              ND_creatematrix_vector4_matrix44 + + - attribute: default changed on out from ( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0 ) to ( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 )
                              @@ -272,7 +421,7 @@

                              Implementations

                            • Second library shader targets: ['essl', 'genglsl', 'genmdl', 'genmsl', 'genosl']
                            First Library Definitions / Implementations
                            -
                            540 shaders: essl +
                            537 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -392,6 +541,7 @@
                            First Library Definitions / I
                            ND_frame_floatIM_frame_float_genglslstdlib_genglsl_impl.mtlx
                            ND_time_floatIM_time_float_genglslstdlib_genglsl_impl.mtlx
                            ND_add_floatIM_add_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_add_integerIM_add_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color3IM_add_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color4IM_add_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genglslstdlib_genglsl_impl.mtlx @@ -407,6 +557,7 @@
                            First Library Definitions / I
                            ND_add_matrix33FAIM_add_matrix33FA_genglslstdlib_genglsl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genglslstdlib_genglsl_impl.mtlx @@ -599,7 +750,7 @@
                            First Library Definitions / I
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genglslstdlib_genglsl_impl.mtlx @@ -675,59 +826,84 @@
                            First Library Definitions / I
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIM_switch_float_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genglslstdlib_genglsl_impl.mtlx @@ -745,41 +921,6 @@
                            First Library Definitions / I
                            ND_convert_color4_color3IM_convert_color4_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genglslstdlib_genglsl_impl.mtlx @@ -791,6 +932,11 @@
                            First Library Definitions / I
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_floatIM_blur_float_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genglslstdlib_genglsl_impl.mtlx @@ -817,7 +963,7 @@
                            First Library Definitions / I
                            -
                            540 shaders: genglsl +
                            537 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -937,6 +1083,7 @@
                            First Library Definitions / I
                            ND_frame_floatIM_frame_float_genglslstdlib_genglsl_impl.mtlx
                            ND_time_floatIM_time_float_genglslstdlib_genglsl_impl.mtlx
                            ND_add_floatIM_add_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_add_integerIM_add_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color3IM_add_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color4IM_add_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genglslstdlib_genglsl_impl.mtlx @@ -952,6 +1099,7 @@
                            First Library Definitions / I
                            ND_add_matrix33FAIM_add_matrix33FA_genglslstdlib_genglsl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genglslstdlib_genglsl_impl.mtlx @@ -1144,7 +1292,7 @@
                            First Library Definitions / I
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genglslstdlib_genglsl_impl.mtlx @@ -1220,59 +1368,84 @@
                            First Library Definitions / I
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIM_switch_float_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genglslstdlib_genglsl_impl.mtlx @@ -1290,41 +1463,6 @@
                            First Library Definitions / I
                            ND_convert_color4_color3IM_convert_color4_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genglslstdlib_genglsl_impl.mtlx @@ -1336,6 +1474,11 @@
                            First Library Definitions / I
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_floatIM_blur_float_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genglslstdlib_genglsl_impl.mtlx @@ -1362,7 +1505,7 @@
                            First Library Definitions / I
                            -
                            549 shaders: genmdl +
                            546 shaders: genmdl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genmdlnprlib_genmdl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1489,6 +1632,7 @@
                            First Library Definitions / I
                            ND_frame_floatIM_frame_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_time_floatIM_time_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_floatIM_add_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_add_integerIM_add_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_color3IM_add_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_color4IM_add_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1504,6 +1648,7 @@
                            First Library Definitions / I
                            ND_add_matrix33FAIM_add_matrix33FA_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1696,7 +1841,7 @@
                            First Library Definitions / I
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genmdlstdlib_genmdl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genmdlstdlib_genmdl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genmdlstdlib_genmdl_impl.mtlx @@ -1774,59 +1919,84 @@
                            First Library Definitions / I
                            ND_mix_displacementshaderIM_mix_displacementshader_genmdlstdlib_genmdl_impl.mtlx
                            ND_mix_volumeshaderIM_mix_volumeshader_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_floatIM_switch_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1844,41 +2014,6 @@
                            First Library Definitions / I
                            ND_convert_color4_color3IM_convert_color4_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genmdlstdlib_genmdl_impl.mtlx @@ -1890,6 +2025,11 @@
                            First Library Definitions / I
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genmdlstdlib_genmdl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_floatIM_blur_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genmdlstdlib_genmdl_impl.mtlx @@ -1916,7 +2056,7 @@
                            First Library Definitions / I
                            -
                            539 shaders: genmsl +
                            536 shaders: genmsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -2035,6 +2175,7 @@
                            First Library Definitions / I
                            ND_frame_floatIM_frame_float_genmslstdlib_genmsl_impl.mtlx
                            ND_time_floatIM_time_float_genmslstdlib_genmsl_impl.mtlx
                            ND_add_floatIM_add_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_add_integerIM_add_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_add_color3IM_add_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_add_color4IM_add_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genmslstdlib_genmsl_impl.mtlx @@ -2050,6 +2191,7 @@
                            First Library Definitions / I
                            ND_add_matrix33FAIM_add_matrix33FA_genmslstdlib_genmsl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genmslstdlib_genmsl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genmslstdlib_genmsl_impl.mtlx @@ -2242,7 +2384,7 @@
                            First Library Definitions / I
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genmslstdlib_genmsl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genmslstdlib_genmsl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genmslstdlib_genmsl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genmslstdlib_genmsl_impl.mtlx @@ -2318,59 +2460,84 @@
                            First Library Definitions / I
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genmslstdlib_genmsl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_floatIM_switch_float_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genmslstdlib_genmsl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genmslstdlib_genmsl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genmslstdlib_genmsl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genmslstdlib_genmsl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genmslstdlib_genmsl_impl.mtlx @@ -2388,41 +2555,6 @@
                            First Library Definitions / I
                            ND_convert_color4_color3IM_convert_color4_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genmslstdlib_genmsl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genmslstdlib_genmsl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genmslstdlib_genmsl_impl.mtlx @@ -2434,6 +2566,11 @@
                            First Library Definitions / I
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genmslstdlib_genmsl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genmslstdlib_genmsl_impl.mtlx
                            ND_blur_floatIM_blur_float_genmslstdlib_genmsl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genmslstdlib_genmsl_impl.mtlx @@ -2460,7 +2597,7 @@
                            First Library Definitions / I
                            -
                            537 shaders: genosl +
                            534 shaders: genosl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genoslnprlib_genosl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2577,6 +2714,7 @@
                            First Library Definitions / I
                            ND_frame_floatIM_frame_float_genoslstdlib_genosl_impl.mtlx
                            ND_time_floatIM_time_float_genoslstdlib_genosl_impl.mtlx
                            ND_add_floatIM_add_float_genoslstdlib_genosl_impl.mtlx +
                            ND_add_integerIM_add_integer_genoslstdlib_genosl_impl.mtlx
                            ND_add_color3IM_add_color3_genoslstdlib_genosl_impl.mtlx
                            ND_add_color4IM_add_color4_genoslstdlib_genosl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genoslstdlib_genosl_impl.mtlx @@ -2592,6 +2730,7 @@
                            First Library Definitions / I
                            ND_add_matrix33FAIM_add_matrix33FA_genoslstdlib_genosl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genoslstdlib_genosl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genoslstdlib_genosl_impl.mtlx @@ -2784,7 +2923,7 @@
                            First Library Definitions / I
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genoslstdlib_genosl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genoslstdlib_genosl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genoslstdlib_genosl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genoslstdlib_genosl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genoslstdlib_genosl_impl.mtlx @@ -2860,59 +2999,84 @@
                            First Library Definitions / I
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genoslstdlib_genosl_impl.mtlx
                            ND_switch_floatIM_switch_float_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genoslstdlib_genosl_impl.mtlx @@ -2930,41 +3094,6 @@
                            First Library Definitions / I
                            ND_convert_color4_color3IM_convert_color4_color3_genoslstdlib_genosl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genoslstdlib_genosl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genoslstdlib_genosl_impl.mtlx @@ -2976,6 +3105,11 @@
                            First Library Definitions / I
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genoslstdlib_genosl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_blur_floatIM_blur_float_genoslstdlib_genosl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genoslstdlib_genosl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genoslstdlib_genosl_impl.mtlx @@ -3002,7 +3136,7 @@
                            First Library Definitions / I
                            -
                            190 node graphs +
                            185 node graphs
                            DefinitionNodeGraphFile
                            ND_disney_brdf_2012_surfaceIM_disney_brdf_2012_surface_brdf_explorerdisney_brdf_2012.mtlx
                            ND_disney_bsdf_2015_surfaceIM_disney_bsdf_2015_surface_pbrtdisney_brdf_2015.mtlx @@ -3184,11 +3318,6 @@
                            First Library Definitions / I
                            ND_convert_vector4_surfaceshaderNG_convert_vector4_surfaceshaderstdlib_ng.mtlx
                            ND_convert_integer_surfaceshaderNG_convert_integer_surfaceshaderstdlib_ng.mtlx
                            ND_convert_boolean_surfaceshaderNG_convert_boolean_surfaceshaderstdlib_ng.mtlx -
                            ND_extract_color3NG_extract_color3stdlib_ng.mtlx -
                            ND_extract_color4NG_extract_color4stdlib_ng.mtlx -
                            ND_extract_vector2NG_extract_vector2stdlib_ng.mtlx -
                            ND_extract_vector3NG_extract_vector3stdlib_ng.mtlx -
                            ND_extract_vector4NG_extract_vector4stdlib_ng.mtlx
                            ND_separate2_vector2NG_separate2_vector2stdlib_ng.mtlx
                            ND_separate3_color3NG_separate3_color3stdlib_ng.mtlx
                            ND_separate3_vector3NG_separate3_vector3stdlib_ng.mtlx @@ -3200,7 +3329,7 @@
                            First Library Definitions / I

                            Second Library Definitions / Implementations
                            -
                            540 shaders: essl +
                            541 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3214,6 +3343,7 @@
                            Second Library Definitions /
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -3745,7 +3875,7 @@
                            Second Library Definitions /
                            -
                            540 shaders: genglsl +
                            541 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3759,6 +3889,7 @@
                            Second Library Definitions /
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -4290,7 +4421,7 @@
                            Second Library Definitions /
                            -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genmdlnprlib_genmdl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -4301,6 +4432,7 @@
                            Second Library Definitions /
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4844,7 +4976,7 @@
                            Second Library Definitions /
                            -
                            539 shaders: genmsl +
                            540 shaders: genmsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -4858,6 +4990,7 @@
                            Second Library Definitions /
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -5388,7 +5521,7 @@
                            Second Library Definitions /
                            -
                            537 shaders: genosl +
                            538 shaders: genosl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genoslnprlib_genosl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -5399,6 +5532,7 @@
                            Second Library Definitions /
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -6127,42 +6261,194 @@
                            Second Library Definitions /

                            Implementation Comparison

                            -

                            First library implementation count: 2357 -Second library implementation count: 2356

                            -
                            1 implementations added +

                            First library implementation count: 2489 +Second library implementation count: 2360

                            +
                            129 implementations added + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            Name Node Category Node Type
                            IM_add_integer_genglsl add integer
                            IM_add_integer_genmdl add integer
                            IM_add_integer_genmsl add integer
                            IM_add_integer_genosl add integer
                            IM_extract_color3_genglsl extract float
                            IM_extract_color3_genmdl extract float
                            IM_extract_color3_genmsl extract float
                            IM_extract_color3_genosl extract float
                            IM_extract_color4_genglsl extract float
                            IM_extract_color4_genmdl extract float
                            IM_extract_color4_genmsl extract float
                            IM_extract_color4_genosl extract float
                            IM_extract_vector2_genglsl extract float
                            IM_extract_vector2_genmdl extract float
                            IM_extract_vector2_genmsl extract float
                            IM_extract_vector2_genosl extract float
                            IM_extract_vector3_genglsl extract float
                            IM_extract_vector3_genmdl extract float
                            IM_extract_vector3_genmsl extract float
                            IM_extract_vector3_genosl extract float
                            IM_extract_vector4_genglsl extract float
                            IM_extract_vector4_genmdl extract float
                            IM_extract_vector4_genmsl extract float
                            IM_extract_vector4_genosl extract float
                            IM_ifequal_integerB_genglsl ifequal integer
                            IM_ifequal_integerB_genmdl ifequal integer
                            IM_ifequal_integerB_genmsl ifequal integer
                            IM_ifequal_integerB_genosl ifequal integer
                            IM_ifequal_integerI_genglsl ifequal integer
                            IM_ifequal_integerI_genmdl ifequal integer
                            IM_ifequal_integerI_genmsl ifequal integer
                            IM_ifequal_integerI_genosl ifequal integer
                            IM_ifequal_integer_genglsl ifequal integer
                            IM_ifequal_integer_genmdl ifequal integer
                            IM_ifequal_integer_genmsl ifequal integer
                            IM_ifequal_integer_genosl ifequal integer
                            IM_ifequal_matrix33B_genglsl ifequal matrix33
                            IM_ifequal_matrix33B_genmdl ifequal matrix33
                            IM_ifequal_matrix33B_genmsl ifequal matrix33
                            IM_ifequal_matrix33B_genosl ifequal matrix33
                            IM_ifequal_matrix33I_genglsl ifequal matrix33
                            IM_ifequal_matrix33I_genmdl ifequal matrix33
                            IM_ifequal_matrix33I_genmsl ifequal matrix33
                            IM_ifequal_matrix33I_genosl ifequal matrix33
                            IM_ifequal_matrix33_genglsl ifequal matrix33
                            IM_ifequal_matrix33_genmdl ifequal matrix33
                            IM_ifequal_matrix33_genmsl ifequal matrix33
                            IM_ifequal_matrix33_genosl ifequal matrix33
                            IM_ifequal_matrix44B_genglsl ifequal matrix44
                            IM_ifequal_matrix44B_genmdl ifequal matrix44
                            IM_ifequal_matrix44B_genmsl ifequal matrix44
                            IM_ifequal_matrix44B_genosl ifequal matrix44
                            IM_ifequal_matrix44I_genglsl ifequal matrix44
                            IM_ifequal_matrix44I_genmdl ifequal matrix44
                            IM_ifequal_matrix44I_genmsl ifequal matrix44
                            IM_ifequal_matrix44I_genosl ifequal matrix44
                            IM_ifequal_matrix44_genglsl ifequal matrix44
                            IM_ifequal_matrix44_genmdl ifequal matrix44
                            IM_ifequal_matrix44_genmsl ifequal matrix44
                            IM_ifequal_matrix44_genosl ifequal matrix44
                            IM_ifgreater_integerI_genglsl ifgreater integer
                            IM_ifgreater_integerI_genmdl ifgreater integer
                            IM_ifgreater_integerI_genmsl ifgreater integer
                            IM_ifgreater_integerI_genosl ifgreater integer
                            IM_ifgreater_integer_genglsl ifgreater integer
                            IM_ifgreater_integer_genmdl ifgreater integer
                            IM_ifgreater_integer_genmsl ifgreater integer
                            IM_ifgreater_integer_genosl ifgreater integer
                            IM_ifgreater_matrix33I_genglsl ifgreater matrix33
                            IM_ifgreater_matrix33I_genmdl ifgreater matrix33
                            IM_ifgreater_matrix33I_genmsl ifgreater matrix33
                            IM_ifgreater_matrix33I_genosl ifgreater matrix33
                            IM_ifgreater_matrix33_genglsl ifgreater matrix33
                            IM_ifgreater_matrix33_genmdl ifgreater matrix33
                            IM_ifgreater_matrix33_genmsl ifgreater matrix33
                            IM_ifgreater_matrix33_genosl ifgreater matrix33
                            IM_ifgreater_matrix44I_genglsl ifgreater matrix44
                            IM_ifgreater_matrix44I_genmdl ifgreater matrix44
                            IM_ifgreater_matrix44I_genmsl ifgreater matrix44
                            IM_ifgreater_matrix44I_genosl ifgreater matrix44
                            IM_ifgreater_matrix44_genglsl ifgreater matrix44
                            IM_ifgreater_matrix44_genmdl ifgreater matrix44
                            IM_ifgreater_matrix44_genmsl ifgreater matrix44
                            IM_ifgreater_matrix44_genosl ifgreater matrix44
                            IM_ifgreatereq_integerI_genglsl ifgreatereq integer
                            IM_ifgreatereq_integerI_genmdl ifgreatereq integer
                            IM_ifgreatereq_integerI_genmsl ifgreatereq integer
                            IM_ifgreatereq_integerI_genosl ifgreatereq integer
                            IM_ifgreatereq_integer_genglsl ifgreatereq integer
                            IM_ifgreatereq_integer_genmdl ifgreatereq integer
                            IM_ifgreatereq_integer_genmsl ifgreatereq integer
                            IM_ifgreatereq_integer_genosl ifgreatereq integer
                            IM_ifgreatereq_matrix33I_genglsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genmdl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genmsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genosl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genglsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genmdl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genmsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genosl ifgreatereq matrix33
                            IM_ifgreatereq_matrix44I_genglsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genmdl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genmsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genosl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genglsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genmdl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genmsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genosl ifgreatereq matrix44
                            IM_subtract_integer_genglsl subtract integer
                            IM_subtract_integer_genmdl subtract integer
                            IM_subtract_integer_genmsl subtract integer
                            IM_subtract_integer_genosl subtract integer
                            IM_switch_matrix33I_genglsl switch matrix33
                            IM_switch_matrix33I_genmdl switch matrix33
                            IM_switch_matrix33I_genmsl switch matrix33
                            IM_switch_matrix33I_genosl switch matrix33
                            IM_switch_matrix33_genglsl switch matrix33
                            IM_switch_matrix33_genmdl switch matrix33
                            IM_switch_matrix33_genmsl switch matrix33
                            IM_switch_matrix33_genosl switch matrix33
                            IM_switch_matrix44I_genglsl switch matrix44
                            IM_switch_matrix44I_genmdl switch matrix44
                            IM_switch_matrix44I_genmsl switch matrix44
                            IM_switch_matrix44I_genosl switch matrix44
                            IM_switch_matrix44_genglsl switch matrix44
                            IM_switch_matrix44_genmdl switch matrix44
                            IM_switch_matrix44_genmsl switch matrix44
                            IM_switch_matrix44_genosl switch matrix44
                            NG_open_pbr_surface_surfaceshader open_pbr_surface surfaceshader
                            -
                            21 implementations modified +
                            45 implementations modified - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            Name Change
                            IM_add_bsdf_genosl - attribute: sourcecode=( ({{in1}} + {{in2}}) ) removed from: IM_add_bsdf_genosl
                            IM_add_edf_genosl - attribute: sourcecode=( ({{in1}} + {{in2}}) ) removed from: IM_add_edf_genosl
                            IM_anisotropic_vdf_genosl - attribute: file changed on IM_anisotropic_vdf_genosl from ( mx_anisotropic_vdf.osl ) to ( legacy/mx_anisotropic_vdf.osl )
                            IM_burley_diffuse_bsdf_genosl - attribute: sourcecode=( {{weight}} * burley_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) removed from: IM_burley_diffuse_bsdf_genosl
                            - attribute: file=( legacy/mx_burley_diffuse_bsdf.osl ) added to: IM_burley_diffuse_bsdf_genosl
                            - attribute: function=( mx_burley_diffuse_bsdf ) added to: IM_burley_diffuse_bsdf_genosl
                            IM_conductor_bsdf_genosl - attribute: sourcecode=( {{weight}} * conductor_bsdf({{normal}}, {{tangent}}, {{roughness}}.x, {{roughness}}.y, {{ior}}, {{extinction}}, {{distribution}}) ) removed from: IM_conductor_bsdf_genosl
                            - attribute: file=( legacy/mx_conductor_bsdf.osl ) added to: IM_conductor_bsdf_genosl
                            - attribute: function=( mx_conductor_bsdf ) added to: IM_conductor_bsdf_genosl
                            IM_dielectric_bsdf_genosl - attribute: file changed on IM_dielectric_bsdf_genosl from ( mx_dielectric_bsdf.osl ) to ( legacy/mx_dielectric_bsdf.osl )
                            IM_generalized_schlick_bsdf_genosl - attribute: file changed on IM_generalized_schlick_bsdf_genosl from ( mx_generalized_schlick_bsdf.osl ) to ( legacy/mx_generalized_schlick_bsdf.osl )
                            IM_mix_bsdf_genosl - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) removed from: IM_mix_bsdf_genosl
                            IM_mix_edf_genosl - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) removed from: IM_mix_edf_genosl
                            IM_multiply_bsdfC_genosl - attribute: sourcecode=( ({{in2}} * {{in1}}) ) removed from: IM_multiply_bsdfC_genosl
                            IM_multiply_bsdfF_genosl - attribute: sourcecode=( ({{in2}} * {{in1}}) ) removed from: IM_multiply_bsdfF_genosl
                            IM_multiply_edfC_genosl - attribute: sourcecode=( ({{in2}} * {{in1}}) ) removed from: IM_multiply_edfC_genosl
                            IM_multiply_edfF_genosl - attribute: sourcecode=( ({{in2}} * {{in1}}) ) removed from: IM_multiply_edfF_genosl
                            IM_oren_nayar_diffuse_bsdf_genosl - attribute: sourcecode=( {{weight}} * oren_nayar_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) removed from: IM_oren_nayar_diffuse_bsdf_genosl
                            - attribute: file=( legacy/mx_oren_nayar_diffuse_bsdf.osl ) added to: IM_oren_nayar_diffuse_bsdf_genosl
                            - attribute: function=( mx_oren_nayar_diffuse_bsdf ) added to: IM_oren_nayar_diffuse_bsdf_genosl
                            IM_sheen_bsdf_genosl - attribute: sourcecode=( {{weight}} * sheen_bsdf({{normal}}, {{color}}, {{roughness}}) ) removed from: IM_sheen_bsdf_genosl
                            - attribute: file=( legacy/mx_sheen_bsdf.osl ) added to: IM_sheen_bsdf_genosl
                            - attribute: function=( mx_sheen_bsdf ) added to: IM_sheen_bsdf_genosl
                            IM_subsurface_bsdf_genosl - attribute: file changed on IM_subsurface_bsdf_genosl from ( mx_subsurface_bsdf.osl ) to ( legacy/mx_subsurface_bsdf.osl )
                            IM_surface_genosl - attribute: file changed on IM_surface_genosl from ( mx_surface.osl ) to ( legacy/mx_surface.osl )
                            IM_translucent_bsdf_genosl - attribute: sourcecode=( {{weight}} * translucent_bsdf({{normal}}, {{color}}) ) removed from: IM_translucent_bsdf_genosl
                            - attribute: file=( legacy/mx_translucent_bsdf.osl ) added to: IM_translucent_bsdf_genosl
                            - attribute: function=( mx_translucent_bsdf ) added to: IM_translucent_bsdf_genosl
                            IM_uniform_edf_genosl - attribute: sourcecode changed on IM_uniform_edf_genosl from ( uniform_edf({{color}}) ) to ( {{color}} * emission() )
                            NG_gooch_shade - Number of children on: normal changed from ( 1 ) to ( 0 )
                            - input /space removed from NG_gooch_shade/normal. Value=( world )
                            - Number of children on: viewdir changed from ( 1 ) to ( 0 )
                            - input /space removed from NG_gooch_shade/viewdir. Value=( world )
                            NG_standard_surface_to_gltf_pbr - Number of children on: NG_standard_surface_to_gltf_pbr changed from ( 29 ) to ( 31 )
                            - ifgreater /sheen_roughness removed from NG_standard_surface_to_gltf_pbr
                            - dot /normal add to NG_standard_surface_to_gltf_pbr
                            - ifgreater /sheen_roughness1 add to NG_standard_surface_to_gltf_pbr
                            - output /normal_out added to NG_standard_surface_to_gltf_pbr. Value=( )
                            - attribute: nodename changed on sheen_roughness_out from ( sheen_roughness ) to ( sheen_roughness1 )
                            IM_atan2_float_genglsl - attribute: sourcecode changed on IM_atan2_float_genglsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_float_genmdl - attribute: sourcecode changed on IM_atan2_float_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_float_genmsl - attribute: sourcecode changed on IM_atan2_float_genmsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_float_genosl - attribute: sourcecode changed on IM_atan2_float_genosl from ( atan2({{in1}},{{in2}}) ) to ( atan2({{iny}},{{inx}}) )
                            IM_atan2_vector2_genglsl - attribute: sourcecode changed on IM_atan2_vector2_genglsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector2_genmdl - attribute: sourcecode changed on IM_atan2_vector2_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector2_genmsl - attribute: sourcecode changed on IM_atan2_vector2_genmsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector2_genosl - attribute: sourcecode changed on IM_atan2_vector2_genosl from ( atan2({{in1}},{{in2}}) ) to ( atan2({{iny}},{{inx}}) )
                            IM_atan2_vector3_genglsl - attribute: sourcecode changed on IM_atan2_vector3_genglsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector3_genmdl - attribute: sourcecode changed on IM_atan2_vector3_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector3_genmsl - attribute: sourcecode changed on IM_atan2_vector3_genmsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector3_genosl - attribute: sourcecode changed on IM_atan2_vector3_genosl from ( atan2({{in1}},{{in2}}) ) to ( atan2({{iny}},{{inx}}) )
                            IM_atan2_vector4_genglsl - attribute: sourcecode changed on IM_atan2_vector4_genglsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector4_genmdl - attribute: sourcecode changed on IM_atan2_vector4_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector4_genmsl - attribute: sourcecode changed on IM_atan2_vector4_genmsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector4_genosl - attribute: sourcecode changed on IM_atan2_vector4_genosl from ( atan2({{in1}},{{in2}}) ) to ( atan2({{iny}},{{inx}}) )
                            IM_conductor_bsdf_genmdl - attribute: sourcecode changed on IM_conductor_bsdf_genmdl from ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}) )
                            IM_conductor_bsdf_genosl - attribute: sourcecode changed on IM_conductor_bsdf_genosl from ( {{weight}} * conductor_bsdf({{normal}}, {{tangent}}, {{roughness}}.x, {{roughness}}.y, {{ior}}, {{extinction}}, {{distribution}}) ) to ( {{weight}} * conductor_bsdf({{normal}}, {{tangent}}, {{roughness}}.x, {{roughness}}.y, {{ior}}, {{extinction}}, {{distribution}}, "thinfilm_thickness", {{thinfilm_thickness}}, "thinfilm_ior", {{thinfilm_ior}}) )
                            IM_dielectric_bsdf_genmdl - attribute: sourcecode changed on IM_dielectric_bsdf_genmdl from ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) )
                            IM_generalized_schlick_bsdf_genmdl - attribute: sourcecode changed on IM_generalized_schlick_bsdf_genmdl from ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) )
                            IM_normalmap_float_genglsl - attribute: nodedef changed on IM_normalmap_float_genglsl from ( ND_normalmap ) to ( ND_normalmap_float )
                            IM_normalmap_float_genmdl - attribute: nodedef changed on IM_normalmap_float_genmdl from ( ND_normalmap ) to ( ND_normalmap_float )
                            IM_normalmap_float_genmsl - attribute: nodedef changed on IM_normalmap_float_genmsl from ( ND_normalmap ) to ( ND_normalmap_float )
                            IM_normalmap_float_genosl - attribute: nodedef changed on IM_normalmap_float_genosl from ( ND_normalmap ) to ( ND_normalmap_float )
                            IM_round_color3_genmdl - attribute: sourcecode changed on IM_round_color3_genmdl from ( mx::stdlib::mx_round_color3({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_round_color3({{in}}) )
                            IM_round_color4_genmdl - attribute: sourcecode changed on IM_round_color4_genmdl from ( mx::stdlib::mx_round_color4({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_round_color4({{in}}) )
                            IM_switch_color3I_genmdl - attribute: sourcecode changed on IM_switch_color3I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color3_genmdl - attribute: sourcecode changed on IM_switch_color3_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color4I_genmdl - attribute: sourcecode changed on IM_switch_color4I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color4_genmdl - attribute: sourcecode changed on IM_switch_color4_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_floatI_genmdl - attribute: sourcecode changed on IM_switch_floatI_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_float_genmdl - attribute: sourcecode changed on IM_switch_float_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector2I_genmdl - attribute: sourcecode changed on IM_switch_vector2I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector2_genmdl - attribute: sourcecode changed on IM_switch_vector2_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector3I_genmdl - attribute: sourcecode changed on IM_switch_vector3I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector3_genmdl - attribute: sourcecode changed on IM_switch_vector3_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector4I_genmdl - attribute: sourcecode changed on IM_switch_vector4I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector4_genmdl - attribute: sourcecode changed on IM_switch_vector4_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            NG_overlay_color3 - attribute: nodedef=( ND_separate3_color3 ) removed from: N_split_color3_fg
                            - attribute: nodedef=( ND_separate3_color3 ) removed from: N_split_color3_bg
                            NG_overlay_color4 - attribute: nodedef=( ND_separate4_color4 ) removed from: N_split_fg
                            - attribute: nodedef=( ND_separate4_color4 ) removed from: N_split_bg
                            NG_separate2_vector2 - extract /N_x_vector2 removed from NG_separate2_vector2
                            - extract /N_y_vector2 removed from NG_separate2_vector2
                            - extract /N_extract_0 add to NG_separate2_vector2
                            - extract /N_extract_1 add to NG_separate2_vector2
                            - attribute: nodename changed on outx from ( N_x_vector2 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector2 ) to ( N_extract_1 )
                            NG_separate3_color3 - extract /N_r_color3 removed from NG_separate3_color3
                            - extract /N_g_color3 removed from NG_separate3_color3
                            - extract /N_b_color3 removed from NG_separate3_color3
                            - extract /N_extract_0 add to NG_separate3_color3
                            - extract /N_extract_1 add to NG_separate3_color3
                            - extract /N_extract_2 add to NG_separate3_color3
                            - attribute: nodename changed on outr from ( N_r_color3 ) to ( N_extract_0 )
                            - attribute: nodename changed on outg from ( N_g_color3 ) to ( N_extract_1 )
                            - attribute: nodename changed on outb from ( N_b_color3 ) to ( N_extract_2 )
                            NG_separate3_vector3 - extract /N_x_vector3 removed from NG_separate3_vector3
                            - extract /N_y_vector3 removed from NG_separate3_vector3
                            - extract /N_z_vector3 removed from NG_separate3_vector3
                            - extract /N_extract_0 add to NG_separate3_vector3
                            - extract /N_extract_1 add to NG_separate3_vector3
                            - extract /N_extract_2 add to NG_separate3_vector3
                            - attribute: nodename changed on outx from ( N_x_vector3 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector3 ) to ( N_extract_1 )
                            - attribute: nodename changed on outz from ( N_z_vector3 ) to ( N_extract_2 )
                            NG_separate4_color4 - extract /N_r_color4 removed from NG_separate4_color4
                            - extract /N_g_color4 removed from NG_separate4_color4
                            - extract /N_b_color4 removed from NG_separate4_color4
                            - extract /N_a_color4 removed from NG_separate4_color4
                            - extract /N_extract_0 add to NG_separate4_color4
                            - extract /N_extract_1 add to NG_separate4_color4
                            - extract /N_extract_2 add to NG_separate4_color4
                            - extract /N_extract_3 add to NG_separate4_color4
                            - attribute: nodename changed on outr from ( N_r_color4 ) to ( N_extract_0 )
                            - attribute: nodename changed on outg from ( N_g_color4 ) to ( N_extract_1 )
                            - attribute: nodename changed on outb from ( N_b_color4 ) to ( N_extract_2 )
                            - attribute: nodename changed on outa from ( N_a_color4 ) to ( N_extract_3 )
                            NG_separate4_vector4 - extract /N_x_vector4 removed from NG_separate4_vector4
                            - extract /N_y_vector4 removed from NG_separate4_vector4
                            - extract /N_z_vector4 removed from NG_separate4_vector4
                            - extract /N_w_vector4 removed from NG_separate4_vector4
                            - extract /N_extract_0 add to NG_separate4_vector4
                            - extract /N_extract_1 add to NG_separate4_vector4
                            - extract /N_extract_2 add to NG_separate4_vector4
                            - extract /N_extract_3 add to NG_separate4_vector4
                            - attribute: nodename changed on outx from ( N_x_vector4 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector4 ) to ( N_extract_1 )
                            - attribute: nodename changed on outz from ( N_z_vector4 ) to ( N_extract_2 )
                            - attribute: nodename changed on outw from ( N_w_vector4 ) to ( N_extract_3 )
                            diff --git a/documents/mtlx_utilities.html b/documents/mtlx_utilities.html index f81dfff5..e972d5bc 100644 --- a/documents/mtlx_utilities.html +++ b/documents/mtlx_utilities.html @@ -51,7 +51,7 @@ - + diff --git a/documents/node_definitions.html b/documents/node_definitions.html index b309c595..481bafc4 100644 --- a/documents/node_definitions.html +++ b/documents/node_definitions.html @@ -51,7 +51,7 @@ - + diff --git a/documents/nodes_and_nodegraphs.html b/documents/nodes_and_nodegraphs.html index 5de193f0..fb381c6a 100644 --- a/documents/nodes_and_nodegraphs.html +++ b/documents/nodes_and_nodegraphs.html @@ -51,7 +51,7 @@ - + diff --git a/documents/presentations.html b/documents/presentations.html index 64278579..6025eaa9 100644 --- a/documents/presentations.html +++ b/documents/presentations.html @@ -51,7 +51,7 @@ - + diff --git a/documents/property_editor_ui.html b/documents/property_editor_ui.html index 8dc3ac16..a0cf27ab 100644 --- a/documents/property_editor_ui.html +++ b/documents/property_editor_ui.html @@ -51,7 +51,7 @@ - + diff --git a/documents/python_MaterialX.html b/documents/python_MaterialX.html index 89ff6717..348ae9c4 100644 --- a/documents/python_MaterialX.html +++ b/documents/python_MaterialX.html @@ -51,7 +51,7 @@ - + diff --git a/documents/using_library.html b/documents/using_library.html index ba36e64f..28de6e47 100644 --- a/documents/using_library.html +++ b/documents/using_library.html @@ -51,7 +51,7 @@ - + diff --git a/documents/workflow_gltf.html b/documents/workflow_gltf.html index 94a8d367..57f620ae 100644 --- a/documents/workflow_gltf.html +++ b/documents/workflow_gltf.html @@ -51,7 +51,7 @@ - + diff --git a/documents/workflow_ocio.html b/documents/workflow_ocio.html index fec9f374..0b1d58b4 100644 --- a/documents/workflow_ocio.html +++ b/documents/workflow_ocio.html @@ -51,7 +51,7 @@ - + diff --git a/documents/workflow_usd.html b/documents/workflow_usd.html index 6a0ebc50..351a6e5d 100644 --- a/documents/workflow_usd.html +++ b/documents/workflow_usd.html @@ -51,7 +51,7 @@ - + diff --git a/javascript/JsMaterialXCore.js b/javascript/JsMaterialXCore.js index 46722791..10205181 100644 --- a/javascript/JsMaterialXCore.js +++ b/javascript/JsMaterialXCore.js @@ -6,7 +6,7 @@ var MaterialX = (function() { function(MaterialX) { MaterialX = MaterialX || {}; -var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXCore.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Sa"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Va"];addOnInit(Module["asm"]["Ta"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={134596:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},134680:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},134765:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"x":___assert_fail,"r":___cxa_allocate_exception,"n":___cxa_begin_catch,"z":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"i":___cxa_find_matching_catch_3,"Ia":___cxa_find_matching_catch_4,"s":___cxa_free_exception,"ha":___cxa_rethrow,"D":___cxa_throw,"ra":___cxa_uncaught_exceptions,"c":___resumeException,"ba":___sys_fcntl64,"xa":___sys_ioctl,"za":___sys_open,"ya":___sys_stat64,"Oa":__embind_finalize_value_array,"ja":__embind_register_bigint,"Ba":__embind_register_bool,"t":__embind_register_class,"y":__embind_register_class_class_function,"o":__embind_register_class_class_property,"v":__embind_register_class_constructor,"h":__embind_register_class_function,"G":__embind_register_class_property,"M":__embind_register_constant,"Aa":__embind_register_emval,"Y":__embind_register_enum,"X":__embind_register_enum_value,"ea":__embind_register_float,"C":__embind_register_function,"H":__embind_register_integer,"F":__embind_register_memory_view,"p":__embind_register_smart_ptr,"fa":__embind_register_std_string,"T":__embind_register_std_wstring,"ga":__embind_register_value_array,"R":__embind_register_value_array_element,"Ca":__embind_register_void,"J":__emval_as,"Pa":__emval_call,"Q":__emval_call_void_method,"aa":__emval_decref,"P":__emval_get_method_caller,"Na":__emval_get_property,"da":__emval_incref,"Ra":__emval_new_array,"Ma":__emval_new_cstring,"Ja":__emval_new_object,"La":__emval_run_destructors,"Qa":__emval_set_property,"A":__emval_take_value,"Ka":__emval_typeof,"qa":_abort,"W":_emscripten_asm_const_int,"pa":_emscripten_memcpy_big,"S":_emscripten_resize_heap,"ta":_environ_get,"ua":_environ_sizes_get,"ca":_fd_close,"wa":_fd_read,"ia":_fd_seek,"va":_fd_write,"a":_getTempRet0,"Da":invoke_di,"U":invoke_fi,"Ga":invoke_fifii,"ma":invoke_fii,"oa":invoke_fiii,"u":invoke_i,"g":invoke_ii,"Ea":invoke_iid,"Fa":invoke_iif,"d":invoke_iii,"j":invoke_iiii,"w":invoke_iiiii,"Z":invoke_iiiiid,"V":invoke_iiiiii,"I":invoke_iiiiiii,"_":invoke_iiiiiiii,"O":invoke_iiiiiiiiiiii,"k":invoke_v,"l":invoke_vi,"na":invoke_vid,"Ha":invoke_vif,"e":invoke_vii,"la":invoke_viif,"f":invoke_viii,"m":invoke_viiii,"q":invoke_viiiii,"L":invoke_viiiiii,"E":invoke_viiiiiii,"$":invoke_viiiiiiiii,"K":invoke_viiiiiiiiii,"N":invoke_viiiiiiiiiiiiiii,"B":_llvm_eh_typeid_for,"ka":_setTempRet0,"sa":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Ta"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Ua"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["Wa"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["Xa"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["Za"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_a"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$a"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["ab"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["bb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["cb"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["db"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["eb"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["fb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["gb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["ib"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); +var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXCore.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Ta"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Wa"];addOnInit(Module["asm"]["Ua"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={130504:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},130588:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},130673:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"x":___assert_fail,"r":___cxa_allocate_exception,"n":___cxa_begin_catch,"y":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"i":___cxa_find_matching_catch_3,"Ha":___cxa_find_matching_catch_4,"s":___cxa_free_exception,"ha":___cxa_rethrow,"D":___cxa_throw,"sa":___cxa_uncaught_exceptions,"c":___resumeException,"aa":___sys_fcntl64,"za":___sys_getdents64,"ya":___sys_ioctl,"ba":___sys_open,"va":___sys_stat64,"Pa":__embind_finalize_value_array,"ja":__embind_register_bigint,"Ba":__embind_register_bool,"t":__embind_register_class,"z":__embind_register_class_class_function,"o":__embind_register_class_class_property,"w":__embind_register_class_constructor,"h":__embind_register_class_function,"L":__embind_register_class_property,"M":__embind_register_constant,"Aa":__embind_register_emval,"Ja":__embind_register_enum,"Ia":__embind_register_enum_value,"da":__embind_register_float,"C":__embind_register_function,"H":__embind_register_integer,"F":__embind_register_memory_view,"p":__embind_register_smart_ptr,"ea":__embind_register_std_string,"U":__embind_register_std_wstring,"ga":__embind_register_value_array,"S":__embind_register_value_array_element,"Ca":__embind_register_void,"J":__emval_as,"Qa":__emval_call,"R":__emval_call_void_method,"$":__emval_decref,"Q":__emval_get_method_caller,"Oa":__emval_get_property,"ca":__emval_incref,"Sa":__emval_new_array,"Na":__emval_new_cstring,"Ka":__emval_new_object,"Ma":__emval_run_destructors,"Ra":__emval_set_property,"A":__emval_take_value,"La":__emval_typeof,"qa":_abort,"X":_emscripten_asm_const_int,"pa":_emscripten_memcpy_big,"T":_emscripten_resize_heap,"ta":_environ_get,"ua":_environ_sizes_get,"P":_fd_close,"wa":_fd_read,"ia":_fd_seek,"xa":_fd_write,"a":_getTempRet0,"Da":invoke_di,"W":invoke_fi,"Ga":invoke_fifii,"ma":invoke_fii,"oa":invoke_fiii,"u":invoke_i,"g":invoke_ii,"Ea":invoke_iid,"Fa":invoke_iif,"d":invoke_iii,"j":invoke_iiii,"v":invoke_iiiii,"Z":invoke_iiiiid,"V":invoke_iiiiii,"G":invoke_iiiiiii,"Y":invoke_iiiiiiii,"O":invoke_iiiiiiiiiiii,"k":invoke_v,"l":invoke_vi,"na":invoke_vid,"fa":invoke_vif,"e":invoke_vii,"la":invoke_viif,"f":invoke_viii,"m":invoke_viiii,"q":invoke_viiiii,"I":invoke_viiiiii,"E":invoke_viiiiiii,"_":invoke_viiiiiiiii,"K":invoke_viiiiiiiiii,"N":invoke_viiiiiiiiiiiiiii,"B":_llvm_eh_typeid_for,"ka":_setTempRet0,"ra":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Ua"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Va"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["Xa"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["Za"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["_a"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["$a"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["ab"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["bb"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["cb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["db"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["eb"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["fb"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["gb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["ib"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["jb"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); return MaterialX.ready diff --git a/javascript/JsMaterialXCore.wasm b/javascript/JsMaterialXCore.wasm index 4b7265b5..8e4bb349 100644 Binary files a/javascript/JsMaterialXCore.wasm and b/javascript/JsMaterialXCore.wasm differ diff --git a/javascript/JsMaterialXGenShader.data b/javascript/JsMaterialXGenShader.data index afd055fd..29f9cb9d 100644 --- a/javascript/JsMaterialXGenShader.data +++ b/javascript/JsMaterialXGenShader.data @@ -112,1778 +112,1262 @@ endif() Copyright Contributors to the MaterialX Project SPDX-License-Identifier: Apache-2.0 - Declarations of the default color transforms in MaterialX. + Declarations of standard data types and nodes included in the MaterialX specification. --> - - - - + + + - - - - + + + - - - - + + + - - - + + + + + + + - - - + + + + + + + - - - + + + + + + - - - + + + + + + + + + + + + + - - - + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + - - - + + + + + + + + - - - + + + + + + + - - - - + + + - - - + + + + - - - + + + + + + + - - - + + + + + + - - - + + + + + + + - - - - + + + - - - + + + + - - - + + + + + + - - - - + + + - - - + + + + + + - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + - Declarations of standard data types and nodes included in the MaterialX specification. - --> + + - - - + + - + + - - - + + - - - - - + + - - - - - - - - + + - - - - - - - - - + + - - - - + - Graph definitions of standard nodes included in the MaterialX specification. - --> + + - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + - Declarations for OSL implementations of standard nodes included in the MaterialX specification. - --> + + - - - + + - - + + - - - - + + - Declarations for MSL implementations of standard nodes included in the MaterialX specification. - --> + + + - - - + + + + - - + + + + - - - - + + + + + + - Declarations for MDL implementations of standard nodes included in the MaterialX specification. - --> + + - - - + + - - + + + + + - - - + vec3 r = clamp(reflectivity, 0.0, 0.99); + vec3 r_sqrt = sqrt(r); + vec3 n_min = (1.0 - r) / (1.0 + r); + vec3 n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); + ior = mix(n_max, n_min, edge_color); - - - + vec3 np1 = ior + 1.0; + vec3 nm1 = ior - 1.0; + vec3 k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); + k2 = max(k2, 0.0); + extinction = sqrt(k2); +} +#include "lib/mx_microfacet_sheen.glsl" - - +void mx_sheen_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - - - - + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float NdotH = clamp(dot(N, H), M_FLOAT_EPS, 1.0); - - - + vec3 fr = color * mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); + float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); + bsdf.throughput = vec3(1.0 - dirAlbedo * weight); - - - - - - - - + // We need to include NdotL from the light integral here + // as in this case it's not cancelled out by the BRDF denominator. + bsdf.response = fr * NdotL * occlusion * weight; +} - - - - - - - +void mx_sheen_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - + N = mx_forward_facing_normal(N, V); - -void mx_directional_light(LightData light, float3 position, thread lightshader& result) -{ - result.direction = -light.direction; - result.intensity = light.color * light.intensity; -} -void mx_spot_light(LightData light, float3 position, thread lightshader& result) -{ - result.direction = light.position - position; - float distance = length(result.direction) + M_FLOAT_EPS; - float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); - result.intensity = light.color * light.intensity / attenuation; - result.direction /= distance; - float low = min(light.inner_angle, light.outer_angle); - float high = light.inner_angle; - float cosDir = dot(result.direction, -light.direction); - float spotAttenuation = smoothstep(low, high, cosDir); - result.intensity *= spotAttenuation; + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); + bsdf.throughput = vec3(1.0 - dirAlbedo * weight); + + vec3 Li = mx_environment_irradiance(N); + bsdf.response = Li * color * dirAlbedo * weight; } -void mx_point_light(LightData light, float3 position, thread lightshader& result) +#include "lib/mx_microfacet.glsl" + +void mx_generalized_schlick_edf(vec3 N, vec3 V, vec3 color0, vec3 color90, float exponent, EDF base, out EDF result) { - result.direction = light.position - position; - float distance = length(result.direction) + M_FLOAT_EPS; - float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); - result.intensity = light.color * light.intensity / attenuation; - result.direction /= distance; + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + vec3 f = mx_fresnel_schlick(NdotV, color0, color90, exponent); + result = base * f; } - - +#include "lib/mx_microfacet_specular.glsl" - - +void mx_generalized_schlick_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - - + N = mx_forward_facing_normal(N, V); - - + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); - - - + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - - + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); - - + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - -void mx_directional_light(LightData light, vec3 position, out lightshader result) -{ - result.direction = -light.direction; - result.intensity = light.color * light.intensity; -} -void mx_spot_light(LightData light, vec3 position, out lightshader result) -{ - result.direction = light.position - position; - float distance = length(result.direction) + M_FLOAT_EPS; - float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); - result.intensity = light.color * light.intensity / attenuation; - result.direction /= distance; - float low = min(light.inner_angle, light.outer_angle); - float high = light.inner_angle; - float cosDir = dot(result.direction, -light.direction); - float spotAttenuation = smoothstep(low, high, cosDir); - result.intensity *= spotAttenuation; + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); } -void mx_point_light(LightData light, vec3 position, out lightshader result) + +void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) { - result.direction = light.position - position; - float distance = length(result.direction) + M_FLOAT_EPS; - float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); - result.intensity = light.color * light.intensity / attenuation; - result.direction /= distance; -} - - + if (weight < M_FLOAT_EPS) + { + return; + } - + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - - - + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); - + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - - - - + if (scatter_mode != 0) + { + float avgF0 = dot(safeColor0, vec3(1.0 / 3.0)); + fd.ior = vec3(mx_f0_to_ior(avgF0)); + bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeColor0) * weight; + } +} - - - +void mx_generalized_schlick_bsdf_indirect(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - - - + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); + bsdf.response = Li * comp * weight; +} +void mx_displacement_vector3(vec3 disp, float scale, out displacementshader result) +{ + result.offset = disp; + result.scale = scale; +} +#include "lib/mx_microfacet_diffuse.glsl" - - - - +void mx_burley_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - + if (weight < M_FLOAT_EPS) + { + return; + } - + normal = mx_forward_facing_normal(normal, V); - - - - + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float LdotH = clamp(dot(L, normalize(L + V)), M_FLOAT_EPS, 1.0); - - - - +void mx_burley_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - + normal = mx_forward_facing_normal(normal, V); - - - + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); - - - - - - - - + vec3 Li = mx_environment_irradiance(normal) * + mx_burley_diffuse_dir_albedo(NdotV, roughness); + bsdf.response = Li * color * weight; +} +void mx_anisotropic_vdf(vec3 absorption, vec3 scattering, float anisotropy, inout BSDF bsdf) +{ + // TODO: Add some approximation for volumetric light absorption. +} +void mx_roughness_dual(vec2 roughness, out vec2 result) +{ + if (roughness.y < 0.0) + { + roughness.y = roughness.x; + } + result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); + result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); +} +#include "lib/mx_microfacet_diffuse.glsl" - - - - - - - - +void mx_oren_nayar_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - - + normal = mx_forward_facing_normal(normal, V); - - - - - - - - - - - - - + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - + bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; + if (roughness > 0.0) + { + bsdf.response *= mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); + } +} - - - - - - - - - +void mx_oren_nayar_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - + normal = mx_forward_facing_normal(normal, V); - - - - - + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); - - - - - - - - + vec3 Li = mx_environment_irradiance(normal) * + mx_oren_nayar_diffuse_dir_albedo(NdotV, roughness); + bsdf.response = Li * color * weight; +} +void mx_roughness_anisotropy(float roughness, float anisotropy, out vec2 result) +{ + float roughness_sqr = clamp(roughness*roughness, M_FLOAT_EPS, 1.0); + if (anisotropy > 0.0) + { + float aspect = sqrt(1.0 - clamp(anisotropy, 0.0, 0.98)); + result.x = min(roughness_sqr / aspect, 1.0); + result.y = roughness_sqr * aspect; + } + else + { + result.x = roughness_sqr; + result.y = roughness_sqr; + } +} +#include "lib/mx_microfacet_diffuse.glsl" - - - - - - - +void mx_subsurface_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - + normal = mx_forward_facing_normal(normal, V); - - - - - + vec3 sss = mx_subsurface_scattering_approx(normal, L, P, color, radius); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float visibleOcclusion = 1.0 - NdotL * (1.0 - occlusion); + bsdf.response = sss * visibleOcclusion * weight; +} - - - - - - - +void mx_subsurface_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - + normal = mx_forward_facing_normal(normal, V); - - - - - - - - - + // For now, we render indirect subsurface as simple indirect diffuse. + vec3 Li = mx_environment_irradiance(normal); + bsdf.response = Li * color * weight; +} +void mx_add_edf(vec3 N, vec3 L, EDF in1, EDF in2, out EDF result) +{ + result = in1 + in2; +} +#include "lib/mx_microfacet_specular.glsl" - - - - - - +void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - + N = mx_forward_facing_normal(N, V); - - - + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); - - - - - - - - - - - + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - - - - - - - - - - - - - - - - + FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - - - - - - + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); +} - - - - - +void mx_conductor_bsdf_indirect(vec3 V, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - + N = mx_forward_facing_normal(N, V); - - - - - - - + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - - - - - - - - - - - + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); - -void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) -{ - // TODO: Need to remap parameters to match the new closure, - // or change the MaterialX spec to OSL parameterization. - vdf = 0; + bsdf.response = Li * comp * weight; } - + - + - + - + - + - + - + - + - - - - - - - + - - + + - - + + - - + + - - - - + + + + + + + + + + - + - - + + + + + - + - + - + - + -void mx_displacement_float(float displacement, float scale, output displacementshader result) -{ - result = vector(displacement * scale); -} -#include "lib/mx_microfacet.osl" - -void mx_generalized_schlick_edf(color color0, color color90, float exponent, EDF base, output EDF result) +void mx_uniform_edf(vec3 N, vec3 L, vec3 color, out EDF result) { - float NdotV = fabs(dot(N,-I)); - color f = mx_fresnel_schlick(NdotV, color0, color90, exponent); - result = base * f; + result = color; } -void mx_artistic_ior(color reflectivity, color edge_color, output vector ior, output vector extinction) +// We fake diffuse transmission by using diffuse reflection from the opposite side. +// So this BTDF is really a BRDF. +void mx_translucent_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 normal, inout BSDF bsdf) { - // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 - // http://jcgt.org/published/0003/04/03/paper.pdf + bsdf.throughput = vec3(0.0); - color r = clamp(reflectivity, 0.0, 0.99); - color r_sqrt = sqrt(r); - color n_min = (1.0 - r) / (1.0 + r); - color n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); - ior = mix(n_max, n_min, edge_color); + // Invert normal since we're transmitting light from the other side + float NdotL = dot(L, -normal); + if (NdotL <= 0.0 || weight < M_FLOAT_EPS) + { + return; + } - color np1 = ior + 1.0; - color nm1 = ior - 1.0; - color k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); - k2 = max(k2, 0.0); - extinction = sqrt(k2); + bsdf.response = color * weight * NdotL * M_PI_INV; } -void mx_blackbody(float temp, output color color_value) -{ - float xc, yc; - float t, t2, t3, xc2, xc3; - // if value outside valid range of approximation clamp to accepted temperature range - float temperature = clamp(temp, 1667.0, 25000.0); +void mx_translucent_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - t = 1000.0 / temperature; - t2 = t * t; - t3 = t * t * t; + if (weight < M_FLOAT_EPS) + { + return; + } - // Cubic spline approximation for Kelvin temperature to sRGB conversion - // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) - if (temperature < 4000.0) { // 1667K <= temperature < 4000K + // Invert normal since we're transmitting light from the other side + vec3 Li = mx_environment_irradiance(-normal); + bsdf.response = Li * color * weight; +} +#include "lib/mx_microfacet_specular.glsl" + +void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); + + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * safeTint * occlusion * weight / (4.0 * NdotV); +} + +void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + if (scatter_mode != 0) + { + bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeTint) * weight; + } +} + +void mx_dielectric_bsdf_indirect(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); + bsdf.response = Li * safeTint * comp * weight; +} +/// XYZ to Rec.709 RGB colorspace conversion +const mat3 XYZ_to_RGB = mat3( 3.2406, -0.9689, 0.0557, + -1.5372, 1.8758, -0.2040, + -0.4986, 0.0415, 1.0570); + +void mx_blackbody(float temperatureKelvin, out vec3 colorValue) +{ + float xc, yc; + float t, t2, t3, xc2, xc3; + + // if value outside valid range of approximation clamp to accepted temperature range + temperatureKelvin = clamp(temperatureKelvin, 1667.0, 25000.0); + + t = 1000.0 / temperatureKelvin; + t2 = t * t; + t3 = t * t * t; + + // Cubic spline approximation for Kelvin temperature to sRGB conversion + // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) + if (temperatureKelvin < 4000.0) { // 1667K <= temperatureKelvin < 4000K xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; } - else { // 4000K <= temperature <= 25000K + else { // 4000K <= temperatureKelvin <= 25000K xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; } xc2 = xc * xc; xc3 = xc * xc * xc; - if (temperature < 2222.0) { // 1667K <= temperature < 2222K + if (temperatureKelvin < 2222.0) { // 1667K <= temperatureKelvin < 2222K yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; } - else if (temperature < 4000.0) { // 2222K <= temperature < 4000K + else if (temperatureKelvin < 4000.0) { // 2222K <= temperatureKelvin < 4000K yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; } - else { // 4000K <= temperature <= 25000K + else { // 4000K <= temperatureKelvin <= 25000K yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; } if (yc <= 0.0) { // avoid division by zero - color_value = color(1.0); + colorValue = vec3(1.0); return; } - vector XYZ = vector(xc / yc, 1.0, (1 - xc - yc) / yc); - - /// XYZ to Rec.709 RGB colorspace conversion - matrix XYZ_to_RGB = matrix( 3.2406, -0.9689, 0.0557, 0.0, - -1.5372, 1.8758, -0.2040, 0.0, - -0.4986, 0.0415, 1.0570, 0.0, - 0.0, 0.0, 0.0, 1.0); + vec3 XYZ = vec3(xc / yc, 1.0, (1.0 - xc - yc) / yc); - color_value = transform(XYZ_to_RGB, XYZ); - color_value = max(color_value, vector(0.0)); -} -void mx_displacement_vector3(vector displacement, float scale, output displacementshader result) -{ - result = displacement * scale; -} -void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) -{ - // TODO: Subsurface closure is not supported by vanilla OSL. - bsdf = _color * weight * diffuse(N); + colorValue = XYZ_to_RGB * XYZ; + colorValue = max(colorValue, vec3(0.0)); } -void mx_roughness_dual(vector2 roughness, output vector2 result) +#include "mx_microfacet_specular.glsl" + +vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) { - result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); - if (roughness.y < 0.0) - { - result.y = result.x; - } - else + // Approximate the appearance of surface transmission as glossy + // environment map refraction, ignoring any scene geometry that might + // be visible through the surface. + fd.refraction = true; + if ($refractionTwoSided) { - result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); + tint = mx_square(tint); } + return mx_environment_radiance(N, V, X, alpha, distribution, fd) * tint; } - - - - - +#include "mx_microfacet_specular.glsl" - - +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) +{ + // Generate tangent frame. + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + mat3 tangentToWorld = mat3(X, Y, N); - - + // Transform the view vector to tangent space. + V = vec3(dot(V, X), dot(V, Y), dot(V, N)); - - + // Compute derived properties. + float NdotV = clamp(V.z, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(alpha); + float G1V = mx_ggx_smith_G1(NdotV, avgAlpha); + + // Integrate outgoing radiance using filtered importance sampling. + // http://cgg.mff.cuni.cz/~jaroslav/papers/2008-egsr-fis/2008-egsr-fis-final-embedded.pdf + vec3 radiance = vec3(0.0); + int envRadianceSamples = $envRadianceSamples; + for (int i = 0; i < envRadianceSamples; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); - - + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, alpha); + vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, H, fd.ior.x) : -reflect(V, H); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); - - + // Sample the environment light from the given direction. + vec3 Lw = tangentToWorld * L; + float pdf = mx_ggx_NDF(H, alpha) * G1V / (4.0 * NdotV); + float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); + vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); - - + // Compute the Fresnel term. + vec3 F = mx_compute_fresnel(VdotH, fd); - - + // Compute the geometric term. + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); - - + // Compute the combined FG term, which is inverted for refraction. + vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; - - + // Add the radiance contribution of this sample. + // From https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf + // incidentLight = sampleColor * NdotL + // microfacetSpecular = D * F * G / (4 * NdotL * NdotV) + // pdf = D * G1V / (4 * NdotV); + // radiance = incidentLight * microfacetSpecular / pdf + radiance += sampleColor * FG; + } - - + // Apply the global component of the geometric term and normalize. + radiance /= G1V * float(envRadianceSamples); - - - + // Return the final radiance. + return radiance * $envLightIntensity; +} - - - +vec3 mx_environment_irradiance(vec3 N) +{ + vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + return Li * $envLightIntensity; +} +#define M_PI 3.1415926535897932 +#define M_PI_INV (1.0 / M_PI) - - - +float mx_pow5(float x) +{ + return mx_square(mx_square(x)) * x; +} - - - - - - - - - - - - - - - - - - - - - - - - - - -void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) -{ - result.bsdf = bsdf; - result.edf = edf; - result.opacity = clamp(opacity, 0.0, 1.0); -} -void mx_roughness_anisotropy(float roughness, float anisotropy, output vector2 result) -{ - float roughness_sqr = clamp(roughness*roughness, M_FLOAT_EPS, 1.0); - if (anisotropy > 0.0) - { - float aspect = sqrt(1.0 - clamp(anisotropy, 0.0, 0.98)); - result.x = min(roughness_sqr / aspect, 1.0); - result.y = roughness_sqr * aspect; - } - else - { - result.x = roughness_sqr; - result.y = roughness_sqr; - } -} -void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) -{ - if (scatter_mode == "R") - { - bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(0.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } - else if (scatter_mode == "T") - { - bsdf = weight * generalized_schlick_bsdf(N, U, color(0.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } - else - { - bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } -} -void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) -{ - if (scatter_mode == "R") - { - bsdf = weight * dielectric_bsdf(N, U, tint, color(0.0), roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } - else if (scatter_mode == "T") - { - bsdf = weight * dielectric_bsdf(N, U, color(0.0), tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } - else - { - bsdf = weight * dielectric_bsdf(N, U, tint, tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } -} -#include "mx_microfacet.osl" - -// Rational curve fit approximation for the directional albedo of Imageworks sheen. -float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) -{ - float a = 5.25248 - 7.66024 * NdotV + 14.26377 * roughness; - float b = 1.0 + 30.66449 * NdotV + 32.53420 * roughness; - return a / b; -} - -float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) -{ - float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); - return clamp(dirAlbedo, 0.0, 1.0); -} -#include "mx_microfacet.osl" - -// Compute the average of an anisotropic alpha pair. -float mx_average_alpha(vector2 alpha) -{ - return sqrt(alpha.x * alpha.y); -} - -// Convert a real-valued index of refraction to normal-incidence reflectivity. -float mx_ior_to_f0(float ior) -{ - return mx_square((ior - 1.0) / (ior + 1.0)); -} - -// Convert normal-incidence reflectivity to real-valued index of refraction. -float mx_f0_to_ior(float F0) -{ - float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); - return (1.0 + sqrtF0) / (1.0 - sqrtF0); -} - -// Rational quadratic fit to Monte Carlo data for GGX directional albedo. -color mx_ggx_dir_albedo(float NdotV, float alpha, color F0, color F90) +float mx_pow6(float x) { - float x = NdotV; - float y = alpha; float x2 = mx_square(x); - float y2 = mx_square(y); - vector4 r = vector4(0.1003, 0.9345, 1.0, 1.0) + - vector4(-0.6303, -2.323, -1.765, 0.2281) * x + - vector4(9.748, 2.229, 8.263, 15.94) * y + - vector4(-2.038, -3.748, 11.53, -55.83) * x * y + - vector4(29.34, 1.424, 28.96, 13.08) * x2 + - vector4(-8.245, -0.7684, -7.507, 41.26) * y2 + - vector4(-26.44, 1.436, -36.11, 54.9) * x2 * y + - vector4(19.99, 0.2913, 15.86, 300.2) * x * y2 + - vector4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; - vector2 AB = vector2(r.x, r.y) / vector2(r.z, r.w); - AB.x = clamp(AB.x, 0.0, 1.0); - AB.y = clamp(AB.y, 0.0, 1.0); - return F0 * AB.x + F90 * AB.y; -} - -float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) -{ - color result = mx_ggx_dir_albedo(NdotV, alpha, color(F0), color(F90)); - return result[0]; -} - -float mx_ggx_dir_albedo(float NdotV, float alpha, float ior) -{ - color result = mx_ggx_dir_albedo(NdotV, alpha, color(mx_ior_to_f0(ior)), color(1.0)); - return result[0]; -} - -// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf -// Equations 14 and 16 -color mx_ggx_energy_compensation(float NdotV, float alpha, color Fss) -{ - float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); - return 1.0 + Fss * (1.0 - Ess) / Ess; -} - -float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) -{ - color result = mx_ggx_energy_compensation(NdotV, alpha, color(Fss)); - return result[0]; -} -float mx_square(float x) -{ - return x*x; -} - -vector2 mx_square(vector2 x) -{ - return x*x; -} - -vector mx_square(vector x) -{ - return x*x; -} - -vector4 mx_square(vector4 x) -{ - return x*x; -} - -float mx_pow5(float x) -{ - return mx_square(mx_square(x)) * x; -} - -color mx_fresnel_conductor(float cosTheta, vector n, vector k) -{ - float c2 = cosTheta*cosTheta; - vector n2_k2 = n*n + k*k; - vector nc2 = 2.0 * n * cosTheta; - - vector rs_a = n2_k2 + c2; - vector rp_a = n2_k2 * c2 + 1.0; - vector rs = (rs_a - nc2) / (rs_a + nc2); - vector rp = (rp_a - nc2) / (rp_a + nc2); - - return 0.5 * (rs + rp); + return mx_square(x2) * x2; } // Standard Schlick Fresnel @@ -1893,7 +1377,7 @@ float mx_fresnel_schlick(float cosTheta, float F0) float x5 = mx_pow5(x); return F0 + (1.0 - F0) * x5; } -color mx_fresnel_schlick(float cosTheta, color F0) +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0) { float x = clamp(1.0 - cosTheta, 0.0, 1.0); float x5 = mx_pow5(x); @@ -1907,7 +1391,7 @@ float mx_fresnel_schlick(float cosTheta, float F0, float F90) float x5 = mx_pow5(x); return mix(F0, F90, x5); } -color mx_fresnel_schlick(float cosTheta, color F0, color F90) +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90) { float x = clamp(1.0 - cosTheta, 0.0, 1.0); float x5 = mx_pow5(x); @@ -1915,935 +1399,1169 @@ color mx_fresnel_schlick(float cosTheta, color F0, color F90) } // Generalized Schlick Fresnel with a variable exponent -color mx_fresnel_schlick(float cosTheta, float f0, float f90, float exponent) +float mx_fresnel_schlick(float cosTheta, float F0, float F90, float exponent) { float x = clamp(1.0 - cosTheta, 0.0, 1.0); - return mix(f0, f90, pow(x, exponent)); + return mix(F0, F90, pow(x, exponent)); } -color mx_fresnel_schlick(float cosTheta, color f0, color f90, float exponent) +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90, float exponent) { float x = clamp(1.0 - cosTheta, 0.0, 1.0); - return mix(f0, f90, pow(x, exponent)); + return mix(F0, F90, pow(x, exponent)); } -void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) + +// Enforce that the given normal is forward-facing from the specified view direction. +vec3 mx_forward_facing_normal(vec3 N, vec3 V) { - // Not implemented in vanilla OSL - vdf = 0; // volume_henyey_greenstein(color(absorption), color(scattering), color(0.0), anisotropy); + return (dot(N, V) < 0.0) ? -N : N; } -#include "../lib/mx_microfacet_sheen.osl" -// TODO: Vanilla OSL doesn't have a proper sheen closure, -// so use 'diffuse' scaled by sheen directional albedo for now. -void mx_sheen_bsdf(float weight, color Ks, float roughness, vector N, output BSDF bsdf) +// https://www.graphics.rwth-aachen.de/publication/2/jgt.pdf +float mx_golden_ratio_sequence(int i) { - if (weight < M_FLOAT_EPS) - { - bsdf.response = 0; - bsdf.throughput = color(1.0); - return; - } - - // TODO: Normalization should not be needed. My suspicion is that - // BSDF sampling of new outgoing direction in 'testrender' needs - // to be fixed. - vector V = normalize(-I); - - float NdotV = fabs(dot(N,V)); - float alpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float albedo = weight * mx_imageworks_sheen_dir_albedo(NdotV, alpha); - bsdf.response = albedo * Ks * diffuse(N); - bsdf.throughput = 1.0 - albedo; + const float GOLDEN_RATIO = 1.6180339887498948; + return fract((float(i) + 1.0) * GOLDEN_RATIO); } -void mx_burley_diffuse_bsdf(float weight, color reflectance, float roughness, normal N, output BSDF bsdf) + +// https://people.irisa.fr/Ricardo.Marques/articles/2013/SF_CGF.pdf +vec2 mx_spherical_fibonacci(int i, int numSamples) { - // TODO: Implement properly. - bsdf.response = reflectance * weight * oren_nayar(N, roughness); - bsdf.throughput = color(0.0); + return vec2((float(i) + 0.5) / float(numSamples), mx_golden_ratio_sequence(i)); } -void mx_translucent_bsdf(float weight, color _color, normal N, output BSDF bsdf) + +// Generate a uniform-weighted sample in the unit hemisphere. +vec3 mx_uniform_sample_hemisphere(vec2 Xi) { - bsdf.response = _color * weight * translucent(N); - bsdf.throughput = color(0.0); -} -void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) -{ - // TODO: Subsurface closure is not supported by vanilla OSL. - bsdf.response = _color * weight * diffuse(N); - bsdf.throughput = color(0.0); -} -void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) -{ - result.bsdf = bsdf.response; - result.edf = edf; - result.opacity = clamp(opacity, 0.0, 1.0); -} -void mx_oren_nayar_diffuse_bsdf(float weight, color _color, float roughness, normal N, output BSDF bsdf) -{ - bsdf.response = _color * weight * oren_nayar(N, roughness); - bsdf.throughput = color(0.0); + float phi = 2.0 * M_PI * Xi.x; + float cosTheta = 1.0 - Xi.y; + float sinTheta = sqrt(1.0 - mx_square(cosTheta)); + return vec3(cos(phi) * sinTheta, + sin(phi) * sinTheta, + cosTheta); } -#include "../lib/mx_microfacet_specular.osl" +#include "mx_microfacet.glsl" -void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) -{ - float avgF0 = dot(color0, color(1.0 / 3.0)); - float ior = mx_f0_to_ior(avgF0); +const int FRESNEL_MODEL_DIELECTRIC = 0; +const int FRESNEL_MODEL_CONDUCTOR = 1; +const int FRESNEL_MODEL_SCHLICK = 2; - if (scatter_mode == "T") - { - bsdf.response = weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); - bsdf.throughput = weight; - return; - } +// Parameters for Fresnel calculations +struct FresnelData +{ + // Fresnel model + int model; + bool airy; - float NdotV = fabs(dot(N,-I)); - color F = mx_fresnel_schlick(NdotV, color0, color90, exponent); + // Physical Fresnel + vec3 ior; + vec3 extinction; - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + // Generalized Schlick Fresnel + vec3 F0; + vec3 F82; + vec3 F90; + float exponent; - // Calculate throughput from directional albedo. - color dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, color0, color90) * comp; - float avgDirAlbedo = dot(dirAlbedo, color(1.0 / 3.0)); - bsdf.throughput = 1.0 - avgDirAlbedo * weight; + // Thin film + float tf_thickness; + float tf_ior; - // Calculate the reflection response, setting IOR to zero to disable internal Fresnel. - bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, 0); + // Refraction + bool refraction; +}; - if (scatter_mode == "RT") - { - bsdf.response += bsdf.throughput * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 1); - } +// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf +// Appendix B.2 Equation 13 +float mx_ggx_NDF(vec3 H, vec2 alpha) +{ + vec2 He = H.xy / alpha; + float denom = dot(He, He) + mx_square(H.z); + return 1.0 / (M_PI * alpha.x * alpha.y * mx_square(denom)); } -#include "../lib/mx_microfacet_specular.osl" -void mx_conductor_bsdf(float weight, color ior_n, color ior_k, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, output BSDF bsdf) +// https://ggx-research.github.io/publication/2023/06/09/publication-ggx.html +vec3 mx_ggx_importance_sample_VNDF(vec2 Xi, vec3 V, vec2 alpha) { - bsdf.throughput = color(0.0); + // Transform the view direction to the hemisphere configuration. + V = normalize(vec3(V.xy * alpha, V.z)); - if (weight < M_FLOAT_EPS) - { - bsdf.response = 0; - return; - } + // Sample a spherical cap in (-V.z, 1]. + float phi = 2.0 * M_PI * Xi.x; + float z = (1.0 - Xi.y) * (1.0 + V.z) - V.z; + float sinTheta = sqrt(clamp(1.0 - z * z, 0.0, 1.0)); + float x = sinTheta * cos(phi); + float y = sinTheta * sin(phi); + vec3 c = vec3(x, y, z); - // Calculate conductor fresnel - // - // Fresnel should be based on microfacet normal - // but we have no access to that from here, so just use - // view direction and surface normal instead - // - float NdotV = fabs(dot(N,-I)); - color F = mx_fresnel_conductor(NdotV, ior_n, ior_k); + // Compute the microfacet normal. + vec3 H = c + V; - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + // Transform the microfacet normal back to the ellipsoid configuration. + H = normalize(vec3(H.xy * alpha, max(H.z, 0.0))); - // Set ior to 0.0 to disable the internal dielectric fresnel - bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, false); + return H; } -#include "../lib/mx_microfacet_specular.osl" -void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +// https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf +// Equation 34 +float mx_ggx_smith_G1(float cosTheta, float alpha) { - if (scatter_mode == "T") - { - bsdf.response = tint * weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); - bsdf.throughput = tint * weight; - return; - } - - float NdotV = clamp(dot(N,-I), M_FLOAT_EPS, 1.0); - float F0 = mx_ior_to_f0(ior); - float F = mx_fresnel_schlick(NdotV, F0); + float cosTheta2 = mx_square(cosTheta); + float tanTheta2 = (1.0 - cosTheta2) / cosTheta2; + return 2.0 / (1.0 + sqrt(1.0 + mx_square(alpha) * tanTheta2)); +} - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - float comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); +// Height-correlated Smith masking-shadowing +// http://jcgt.org/published/0003/02/03/paper.pdf +// Equations 72 and 99 +float mx_ggx_smith_G2(float NdotL, float NdotV, float alpha) +{ + float alpha2 = mx_square(alpha); + float lambdaL = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotL)); + float lambdaV = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotV)); + return 2.0 / (lambdaL / NdotL + lambdaV / NdotV); +} - // Calculate throughput from directional albedo. - float dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, ior) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; +// Rational quadratic fit to Monte Carlo data for GGX directional albedo. +vec3 mx_ggx_dir_albedo_analytic(float NdotV, float alpha, vec3 F0, vec3 F90) +{ + float x = NdotV; + float y = alpha; + float x2 = mx_square(x); + float y2 = mx_square(y); + vec4 r = vec4(0.1003, 0.9345, 1.0, 1.0) + + vec4(-0.6303, -2.323, -1.765, 0.2281) * x + + vec4(9.748, 2.229, 8.263, 15.94) * y + + vec4(-2.038, -3.748, 11.53, -55.83) * x * y + + vec4(29.34, 1.424, 28.96, 13.08) * x2 + + vec4(-8.245, -0.7684, -7.507, 41.26) * y2 + + vec4(-26.44, 1.436, -36.11, 54.9) * x2 * y + + vec4(19.99, 0.2913, 15.86, 300.2) * x * y2 + + vec4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; + vec2 AB = clamp(r.xy / r.zw, 0.0, 1.0); + return F0 * AB.x + F90 * AB.y; +} - if (scatter_mode == "R") - { - bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 0); - } - else +vec3 mx_ggx_dir_albedo_table_lookup(float NdotV, float alpha, vec3 F0, vec3 F90) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) { - bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 2); + vec2 AB = texture($albedoTable, vec2(NdotV, alpha)).rg; + return F0 * AB.x + F90 * AB.y; } +#endif + return vec3(0.0); } - - - - - - - +// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf +vec3 mx_ggx_dir_albedo_monte_carlo(float NdotV, float alpha, vec3 F0, vec3 F90) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0 - mx_square(NdotV)), 0, NdotV); - - + vec2 AB = vec2(0.0); + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); - - + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); + vec3 L = -reflect(V, H); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); - - + // Compute the Fresnel term. + float Fc = mx_fresnel_schlick(VdotH, 0.0, 1.0); - - + // Compute the per-sample geometric term. + // https://hal.inria.fr/hal-00996995v2/document, Algorithm 2 + float G2 = mx_ggx_smith_G2(NdotL, NdotV, alpha); + + // Add the contribution of this sample. + AB += vec2(G2 * (1.0 - Fc), G2 * Fc); + } - - + // Apply the global component of the geometric term and normalize. + AB /= mx_ggx_smith_G1(NdotV, alpha) * float(SAMPLE_COUNT); - - + // Return the final directional albedo. + return F0 * AB.x + F90 * AB.y; +} - - +vec3 mx_ggx_dir_albedo(float NdotV, float alpha, vec3 F0, vec3 F90) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 0 + return mx_ggx_dir_albedo_analytic(NdotV, alpha, F0, F90); +#elif DIRECTIONAL_ALBEDO_METHOD == 1 + return mx_ggx_dir_albedo_table_lookup(NdotV, alpha, F0, F90); +#else + return mx_ggx_dir_albedo_monte_carlo(NdotV, alpha, F0, F90); +#endif +} - - - - - - - - - - - - - - - - - - - - +float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) +{ + return mx_ggx_dir_albedo(NdotV, alpha, vec3(F0), vec3(F90)).x; +} - - +// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf +// Equations 14 and 16 +vec3 mx_ggx_energy_compensation(float NdotV, float alpha, vec3 Fss) +{ + float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); + return 1.0 + Fss * (1.0 - Ess) / Ess; +} - - - +float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) +{ + return mx_ggx_energy_compensation(NdotV, alpha, vec3(Fss)).x; +} - - +// Compute the average of an anisotropic alpha pair. +float mx_average_alpha(vec2 alpha) +{ + return sqrt(alpha.x * alpha.y); +} - - +// Convert a real-valued index of refraction to normal-incidence reflectivity. +float mx_ior_to_f0(float ior) +{ + return mx_square((ior - 1.0) / (ior + 1.0)); +} - - +// Convert normal-incidence reflectivity to real-valued index of refraction. +float mx_f0_to_ior(float F0) +{ + float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (1.0 + sqrtF0) / (1.0 - sqrtF0); +} +vec3 mx_f0_to_ior(vec3 F0) +{ + vec3 sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0); +} - - +// https://renderwonk.com/publications/wp-generalization-adobe/gen-adobe.pdf +vec3 mx_fresnel_hoffman_schlick(float cosTheta, FresnelData fd) +{ + const float COS_THETA_MAX = 1.0 / 7.0; + const float COS_THETA_FACTOR = 1.0 / (COS_THETA_MAX * pow(1.0 - COS_THETA_MAX, 6.0)); - - + float x = clamp(cosTheta, 0.0, 1.0); + vec3 a = mix(fd.F0, fd.F90, pow(1.0 - COS_THETA_MAX, fd.exponent)) * (vec3(1.0) - fd.F82) * COS_THETA_FACTOR; + return mix(fd.F0, fd.F90, pow(1.0 - x, fd.exponent)) - a * x * mx_pow6(1.0 - x); +} - - - +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +float mx_fresnel_dielectric(float cosTheta, float ior) +{ + float c = cosTheta; + float g2 = ior*ior + c*c - 1.0; + if (g2 < 0.0) + { + // Total internal reflection + return 1.0; + } - - + float g = sqrt(g2); + return 0.5 * mx_square((g - c) / (g + c)) * + (1.0 + mx_square(((g + c) * c - 1.0) / ((g - c) * c + 1.0))); +} - - +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +vec2 mx_fresnel_dielectric_polarized(float cosTheta, float ior) +{ + float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); + float sinTheta2 = 1.0 - cosTheta2; - - + float t0 = max(ior * ior - sinTheta2, 0.0); + float t1 = t0 + cosTheta2; + float t2 = 2.0 * sqrt(t0) * cosTheta; + float Rs = (t1 - t2) / (t1 + t2); - - + float t3 = cosTheta2 * t0 + sinTheta2 * sinTheta2; + float t4 = t2 * sinTheta2; + float Rp = Rs * (t3 - t4) / (t3 + t4); - - + return vec2(Rp, Rs); +} - - +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +void mx_fresnel_conductor_polarized(float cosTheta, vec3 n, vec3 k, out vec3 Rp, out vec3 Rs) +{ + float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); + float sinTheta2 = 1.0 - cosTheta2; + vec3 n2 = n * n; + vec3 k2 = k * k; - - + vec3 t0 = n2 - k2 - vec3(sinTheta2); + vec3 a2plusb2 = sqrt(t0 * t0 + 4.0 * n2 * k2); + vec3 t1 = a2plusb2 + vec3(cosTheta2); + vec3 a = sqrt(max(0.5 * (a2plusb2 + t0), 0.0)); + vec3 t2 = 2.0 * a * cosTheta; + Rs = (t1 - t2) / (t1 + t2); - - + vec3 t3 = cosTheta2 * a2plusb2 + vec3(sinTheta2 * sinTheta2); + vec3 t4 = t2 * sinTheta2; + Rp = Rs * (t3 - t4) / (t3 + t4); +} - - +vec3 mx_fresnel_conductor(float cosTheta, vec3 n, vec3 k) +{ + vec3 Rp, Rs; + mx_fresnel_conductor_polarized(cosTheta, n, k, Rp, Rs); + return 0.5 * (Rp + Rs); +} - - +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +void mx_fresnel_conductor_phase_polarized(float cosTheta, float eta1, vec3 eta2, vec3 kappa2, out vec3 phiP, out vec3 phiS) +{ + vec3 k2 = kappa2 / eta2; + vec3 sinThetaSqr = vec3(1.0) - cosTheta * cosTheta; + vec3 A = eta2*eta2*(vec3(1.0)-k2*k2) - eta1*eta1*sinThetaSqr; + vec3 B = sqrt(A*A + mx_square(2.0*eta2*eta2*k2)); + vec3 U = sqrt((A+B)/2.0); + vec3 V = max(vec3(0.0), sqrt((B-A)/2.0)); - - + phiS = atan(2.0*eta1*V*cosTheta, U*U + V*V - mx_square(eta1*cosTheta)); + phiP = atan(2.0*eta1*eta2*eta2*cosTheta * (2.0*k2*U - (vec3(1.0)-k2*k2) * V), + mx_square(eta2*eta2*(vec3(1.0)+k2*k2)*cosTheta) - eta1*eta1*(U*U+V*V)); +} - - +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +vec3 mx_eval_sensitivity(float opd, vec3 shift) +{ + // Use Gaussian fits, given by 3 parameters: val, pos and var + float phase = 2.0*M_PI * opd; + vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13); + vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06); + vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09); + vec3 xyz = val * sqrt(2.0*M_PI * var) * cos(pos * phase + shift) * exp(- var * phase*phase); + xyz.x += 9.7470e-14 * sqrt(2.0*M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(- 4.5282e+09 * phase*phase); + return xyz / 1.0685e-7; +} - - +// A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +vec3 mx_fresnel_airy(float cosTheta, FresnelData fd) +{ + // XYZ to CIE 1931 RGB color space (using neutral E illuminant) + const mat3 XYZ_TO_RGB = mat3(2.3706743, -0.5138850, 0.0052982, -0.9000405, 1.4253036, -0.0146949, -0.4706338, 0.0885814, 1.0093968); - - + // Assume vacuum on the outside + float eta1 = 1.0; + float eta2 = max(fd.tf_ior, eta1); + vec3 eta3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? mx_f0_to_ior(fd.F0) : fd.ior; + vec3 kappa3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? vec3(0.0) : fd.extinction; + float cosThetaT = sqrt(1.0 - (1.0 - mx_square(cosTheta)) * mx_square(eta1 / eta2)); + + // First interface + vec2 R12 = mx_fresnel_dielectric_polarized(cosTheta, eta2 / eta1); + if (cosThetaT <= 0.0) + { + // Total internal reflection + R12 = vec2(1.0); + } + vec2 T121 = vec2(1.0) - R12; - - + // Second interface + vec3 R23p, R23s; + if (fd.model == FRESNEL_MODEL_SCHLICK) + { + vec3 f = mx_fresnel_hoffman_schlick(cosThetaT, fd); + R23p = 0.5 * f; + R23s = 0.5 * f; + } + else + { + mx_fresnel_conductor_polarized(cosThetaT, eta3 / eta2, kappa3 / eta2, R23p, R23s); + } - - + // Phase shift + float cosB = cos(atan(eta2 / eta1)); + vec2 phi21 = vec2(cosTheta < cosB ? 0.0 : M_PI, M_PI); + vec3 phi23p, phi23s; + if (fd.model == FRESNEL_MODEL_SCHLICK) + { + phi23p = vec3((eta3[0] < eta2) ? M_PI : 0.0, + (eta3[1] < eta2) ? M_PI : 0.0, + (eta3[2] < eta2) ? M_PI : 0.0); + phi23s = phi23p; + } + else + { + mx_fresnel_conductor_phase_polarized(cosThetaT, eta2, eta3, kappa3, phi23p, phi23s); + } + vec3 r123p = max(sqrt(R12.x*R23p), 0.0); + vec3 r123s = max(sqrt(R12.y*R23s), 0.0); - - + // Iridescence term + vec3 I = vec3(0.0); + vec3 Cm, Sm; - - + // Optical path difference + float distMeters = fd.tf_thickness * 1.0e-9; + float opd = 2.0 * eta2 * cosThetaT * distMeters; - - - + // Iridescence term using spectral antialiasing for Parallel polarization - - - + // Reflectance term for m=0 (DC term amplitude) + vec3 Rs = (mx_square(T121.x) * R23p) / (vec3(1.0) - R12.x*R23p); + I += R12.x + Rs; - - - - + // Reflectance term for m>0 (pairs of diracs) + Cm = Rs - T121.x; + for (int m=1; m<=2; m++) + { + Cm *= r123p; + Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23p+vec3(phi21.x))); + I += Cm*Sm; + } - - - - + // Iridescence term using spectral antialiasing for Perpendicular polarization - - - - - - - + // Reflectance term for m=0 (DC term amplitude) + vec3 Rp = (mx_square(T121.y) * R23s) / (vec3(1.0) - R12.y*R23s); + I += R12.y + Rp; - - + // Reflectance term for m>0 (pairs of diracs) + Cm = Rp - T121.y; + for (int m=1; m<=2; m++) + { + Cm *= r123s; + Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23s+vec3(phi21.y))); + I += Cm*Sm; + } - - + // Average parallel and perpendicular polarization + I *= 0.5; - - + // Convert back to RGB reflectance + I = clamp(XYZ_TO_RGB * I, 0.0, 1.0); - - + return I; +} - -#include "lib/mx_microfacet_sheen.glsl" +FresnelData mx_init_fresnel_dielectric(float ior, float tf_thickness, float tf_ior) +{ + FresnelData fd; + fd.model = FRESNEL_MODEL_DIELECTRIC; + fd.airy = tf_thickness > 0.0; + fd.ior = vec3(ior); + fd.extinction = vec3(0.0); + fd.F0 = vec3(0.0); + fd.F82 = vec3(0.0); + fd.F90 = vec3(0.0); + fd.exponent = 0.0; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; +} -void mx_sheen_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +FresnelData mx_init_fresnel_conductor(vec3 ior, vec3 extinction, float tf_thickness, float tf_ior) { - if (weight < M_FLOAT_EPS) - { - return; - } - - N = mx_forward_facing_normal(N, V); - - vec3 H = normalize(L + V); - - float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float NdotH = clamp(dot(N, H), M_FLOAT_EPS, 1.0); - - vec3 fr = color * mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); - float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); - bsdf.throughput = vec3(1.0 - dirAlbedo * weight); + FresnelData fd; + fd.model = FRESNEL_MODEL_CONDUCTOR; + fd.airy = tf_thickness > 0.0; + fd.ior = ior; + fd.extinction = extinction; + fd.F0 = vec3(0.0); + fd.F82 = vec3(0.0); + fd.F90 = vec3(0.0); + fd.exponent = 0.0; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; +} - // We need to include NdotL from the light integral here - // as in this case it's not cancelled out by the BRDF denominator. - bsdf.response = fr * NdotL * occlusion * weight; +FresnelData mx_init_fresnel_schlick(vec3 F0, vec3 F82, vec3 F90, float exponent, float tf_thickness, float tf_ior) +{ + FresnelData fd; + fd.model = FRESNEL_MODEL_SCHLICK; + fd.airy = tf_thickness > 0.0; + fd.ior = vec3(0.0); + fd.extinction = vec3(0.0); + fd.F0 = F0; + fd.F82 = F82; + fd.F90 = F90; + fd.exponent = exponent; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; } -void mx_sheen_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +vec3 mx_compute_fresnel(float cosTheta, FresnelData fd) { - if (weight < M_FLOAT_EPS) + if (fd.airy) { - return; + return mx_fresnel_airy(cosTheta, fd); + } + else if (fd.model == FRESNEL_MODEL_DIELECTRIC) + { + return vec3(mx_fresnel_dielectric(cosTheta, fd.ior.x)); } + else if (fd.model == FRESNEL_MODEL_CONDUCTOR) + { + return mx_fresnel_conductor(cosTheta, fd.ior, fd.extinction); + } + else + { + return mx_fresnel_hoffman_schlick(cosTheta, fd); + } +} - N = mx_forward_facing_normal(N, V); +// Compute the refraction of a ray through a solid sphere. +vec3 mx_refraction_solid_sphere(vec3 R, vec3 N, float ior) +{ + R = refract(R, N, 1.0 / ior); + vec3 N1 = normalize(R * dot(R, N) - N * 0.5); + return refract(R, N1, ior); +} - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); +vec2 mx_latlong_projection(vec3 dir) +{ + float latitude = -asin(dir.y) * M_PI_INV + 0.5; + float longitude = atan(dir.x, -dir.z) * M_PI_INV * 0.5 + 0.5; + return vec2(longitude, latitude); +} - float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); - bsdf.throughput = vec3(1.0 - dirAlbedo * weight); +vec3 mx_latlong_map_lookup(vec3 dir, mat4 transform, float lod, sampler2D envSampler) +{ + vec3 envDir = normalize((transform * vec4(dir,0.0)).xyz); + vec2 uv = mx_latlong_projection(envDir); + return textureLod(envSampler, uv, lod).rgb; +} - vec3 Li = mx_environment_irradiance(N); - bsdf.response = Li * color * dirAlbedo * weight; +// Return the mip level with the appropriate coverage for a filtered importance sample. +// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch20.html +// Section 20.4 Equation 13 +float mx_latlong_compute_lod(vec3 dir, float pdf, float maxMipLevel, int envSamples) +{ + const float MIP_LEVEL_OFFSET = 1.5; + float effectiveMaxMipLevel = maxMipLevel - MIP_LEVEL_OFFSET; + float distortion = sqrt(1.0 - mx_square(dir.y)); + return max(effectiveMaxMipLevel - 0.5 * log2(float(envSamples) * pdf * distortion), 0.0); } -// We fake diffuse transmission by using diffuse reflection from the opposite side. -// So this BTDF is really a BRDF. -void mx_translucent_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 normal, inout BSDF bsdf) +// https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps +float mx_variance_shadow_occlusion(vec2 moments, float fragmentDepth) { - bsdf.throughput = vec3(0.0); + const float MIN_VARIANCE = 0.00001; - // Invert normal since we're transmitting light from the other side - float NdotL = dot(L, -normal); - if (NdotL <= 0.0 || weight < M_FLOAT_EPS) - { - return; - } + // One-tailed inequality valid if fragmentDepth > moments.x. + float p = (fragmentDepth <= moments.x) ? 1.0 : 0.0; - bsdf.response = color * weight * NdotL * M_PI_INV; + // Compute variance. + float variance = moments.y - mx_square(moments.x); + variance = max(variance, MIN_VARIANCE); + + // Compute probabilistic upper bound. + float d = fragmentDepth - moments.x; + float pMax = variance / (variance + mx_square(d)); + return max(p, pMax); } -void mx_translucent_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 normal, inout BSDF bsdf) +vec2 mx_compute_depth_moments() { - bsdf.throughput = vec3(0.0); + float depth = gl_FragCoord.z; + return vec2(depth, mx_square(depth)); +} +#include "mx_microfacet_specular.glsl" - if (weight < M_FLOAT_EPS) - { - return; - } +// Construct an orthonormal basis from a unit vector. +// https://graphics.pixar.com/library/OrthonormalB/paper.pdf +mat3 mx_orthonormal_basis(vec3 N) +{ + float sign = (N.z < 0.0) ? -1.0 : 1.0; + float a = -1.0 / (sign + N.z); + float b = N.x * N.y * a; + vec3 X = vec3(1.0 + sign * N.x * N.x * a, sign * b, -sign * N.x); + vec3 Y = vec3(b, sign + N.y * N.y * a, -N.y); + return mat3(X, Y, N); +} - // Invert normal since we're transmitting light from the other side - vec3 Li = mx_environment_irradiance(-normal); - bsdf.response = Li * color * weight; +// Return the alpha associated with the given mip level in a prefiltered environment. +float mx_latlong_lod_to_alpha(float lod) +{ + float lodBias = lod / float($envRadianceMips - 1); + return (lodBias < 0.5) ? mx_square(lodBias) : 2.0 * (lodBias - 0.375); } -#include "lib/mx_microfacet_specular.glsl" -void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +// The inverse of mx_latlong_projection. +vec3 mx_latlong_map_projection_inverse(vec2 uv) { - if (weight < M_FLOAT_EPS) - { - return; - } + float latitude = (uv.y - 0.5) * M_PI; + float longitude = (uv.x - 0.5) * M_PI * 2.0; - N = mx_forward_facing_normal(N, V); + float x = -cos(latitude) * sin(longitude); + float y = -sin(latitude); + float z = cos(latitude) * cos(longitude); - X = normalize(X - dot(X, N) * N); - vec3 Y = cross(N, X); - vec3 H = normalize(L + V); + return vec3(x, y, z); +} - float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); +vec3 mx_generate_prefilter_env() +{ + // The tangent view vector is aligned with the normal. + vec3 V = vec3(0.0, 0.0, 1.0); + float NdotV = 1.0; - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + // Compute derived properties. + vec2 uv = gl_FragCoord.xy * pow(2.0, $envPrefilterMip) / vec2(textureSize($envRadiance, 0)); + vec3 worldN = mx_latlong_map_projection_inverse(uv); + mat3 tangentToWorld = mx_orthonormal_basis(worldN); + float alpha = mx_latlong_lod_to_alpha(float($envPrefilterMip)); + float G1V = mx_ggx_smith_G1(NdotV, alpha); - FresnelData fd; - vec3 safeTint = max(tint, 0.0); - if (thinfilm_thickness > 0.0) - { - fd = mx_init_fresnel_dielectric_airy(ior, thinfilm_thickness, thinfilm_ior); - } - else + // Integrate the LD term for the given environment and alpha. + vec3 radiance = vec3(0.0, 0.0, 0.0); + float weight = 0.0; + int envRadianceSamples = 1024; + for (int i = 0; i < envRadianceSamples; i++) { - fd = mx_init_fresnel_dielectric(ior); - } - vec3 F = mx_compute_fresnel(VdotH, fd); - float D = mx_ggx_NDF(Ht, safeAlpha); - float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); - float F0 = mx_ior_to_f0(ior); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); + vec3 L = -V + 2.0 * H.z * H; - // Note: NdotL is cancelled out - bsdf.response = D * F * G * comp * safeTint * occlusion * weight / (4.0 * NdotV); -} + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); -void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) -{ - if (weight < M_FLOAT_EPS) - { - return; - } + // Compute the geometric term. + float G = mx_ggx_smith_G2(NdotL, NdotV, alpha); - N = mx_forward_facing_normal(N, V); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + // Sample the environment light from the given direction. + vec3 Lw = tangentToWorld * L; + float pdf = mx_ggx_NDF(H, vec2(alpha)) * G1V / (4.0 * NdotV); + float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); + vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); - FresnelData fd; - vec3 safeTint = max(tint, 0.0); - if (thinfilm_thickness > 0.0) - { - fd = mx_init_fresnel_dielectric_airy(ior, thinfilm_thickness, thinfilm_ior); - } - else - { - fd = mx_init_fresnel_dielectric(ior); + // Add the radiance contribution of this sample. + radiance += G * sampleColor; + weight += G; } - vec3 F = mx_compute_fresnel(NdotV, fd); - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); + return radiance / weight; +} +#include "mx_microfacet_sheen.glsl" +#include "mx_microfacet_specular.glsl" - float F0 = mx_ior_to_f0(ior); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; +vec3 mx_generate_dir_albedo_table() +{ + vec2 uv = gl_FragCoord.xy / $albedoTableSize; + vec2 ggxDirAlbedo = mx_ggx_dir_albedo(uv.x, uv.y, vec3(1, 0, 0), vec3(0, 1, 0)).xy; + float sheenDirAlbedo = mx_imageworks_sheen_dir_albedo(uv.x, uv.y); + return vec3(ggxDirAlbedo, sheenDirAlbedo); +} +#include "mx_microfacet_specular.glsl" - if (scatter_mode != 0) - { - bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeTint) * weight; - } +vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) +{ + return tint; } +#include "mx_microfacet.glsl" -void mx_dielectric_bsdf_indirect(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +// Based on the implementation of Oren-Nayar diffuse in Open Shading Language. +// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/testrender/shading.cpp +float mx_oren_nayar_diffuse(float NdotV, float NdotL, float LdotV, float roughness) { - if (weight < M_FLOAT_EPS) - { - return; - } + float s = LdotV - NdotL * NdotV; + float stinv = (s > 0.0f) ? s / max(NdotL, NdotV) : 0.0; - N = mx_forward_facing_normal(N, V); - - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - FresnelData fd; - vec3 safeTint = max(tint, 0.0); - if (thinfilm_thickness > 0.0) - { - fd = mx_init_fresnel_dielectric_airy(ior, thinfilm_thickness, thinfilm_ior); - } - else - { - fd = mx_init_fresnel_dielectric(ior); - } - vec3 F = mx_compute_fresnel(NdotV, fd); - - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); + float sigma2 = mx_square(roughness); + float A = 1.0 - 0.5 * (sigma2 / (sigma2 + 0.33)); + float B = 0.45 * sigma2 / (sigma2 + 0.09); - float F0 = mx_ior_to_f0(ior); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; + return A + B * stinv; +} - vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); - bsdf.response = Li * safeTint * comp * weight; +// Rational quadratic fit to Monte Carlo data for Oren-Nayar directional albedo. +float mx_oren_nayar_diffuse_dir_albedo_analytic(float NdotV, float roughness) +{ + vec2 r = vec2(1.0, 1.0) + + vec2(-0.4297, -0.6076) * roughness + + vec2(-0.7632, -0.4993) * NdotV * roughness + + vec2(1.4385, 2.0315) * mx_square(roughness); + return r.x / r.y; } -#include "lib/mx_microfacet_specular.glsl" -void mx_generalized_schlick_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +float mx_oren_nayar_diffuse_dir_albedo_table_lookup(float NdotV, float roughness) { - if (weight < M_FLOAT_EPS) +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) { - return; + return texture($albedoTable, vec2(NdotV, roughness)).b; } +#endif + return 0.0; +} - N = mx_forward_facing_normal(N, V); +float mx_oren_nayar_diffuse_dir_albedo_monte_carlo(float NdotV, float roughness) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); - X = normalize(X - dot(X, N) * N); - vec3 Y = cross(N, X); - vec3 H = normalize(L + V); + float radiance = 0.0; + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); - float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + // Compute the incoming light direction. + vec3 L = mx_uniform_sample_hemisphere(Xi); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + // Compute diffuse reflectance. + float reflectance = mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); - FresnelData fd; - vec3 safeColor0 = max(color0, 0.0); - vec3 safeColor82 = max(color82, 0.0); - vec3 safeColor90 = max(color90, 0.0); - if (thinfilm_thickness > 0.0) - { - fd = mx_init_fresnel_schlick_airy(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); - } - else - { - fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent); + // Add the radiance contribution of this sample. + // uniform_pdf = 1 / (2 * PI) + // radiance = (reflectance * NdotL) / (uniform_pdf * PI); + radiance += reflectance * NdotL; } - vec3 F = mx_compute_fresnel(VdotH, fd); - float D = mx_ggx_NDF(Ht, safeAlpha); - float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; - float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); - bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); + // Apply global components and normalize. + radiance *= 2.0 / float(SAMPLE_COUNT); - // Note: NdotL is cancelled out - bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); + // Return the final directional albedo. + return radiance; } -void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +float mx_oren_nayar_diffuse_dir_albedo(float NdotV, float roughness) { - if (weight < M_FLOAT_EPS) - { - return; - } - - N = mx_forward_facing_normal(N, V); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - FresnelData fd; - vec3 safeColor0 = max(color0, 0.0); - vec3 safeColor82 = max(color82, 0.0); - vec3 safeColor90 = max(color90, 0.0); - if (thinfilm_thickness > 0.0) - { - fd = mx_init_fresnel_schlick_airy(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_thickness); - } - else - { - fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent); - } - vec3 F = mx_compute_fresnel(NdotV, fd); +#if DIRECTIONAL_ALBEDO_METHOD == 2 + float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_monte_carlo(NdotV, roughness); +#else + float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_analytic(NdotV, roughness); +#endif + return clamp(dirAlbedo, 0.0, 1.0); +} - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); +// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf +// Section 5.3 +float mx_burley_diffuse(float NdotV, float NdotL, float LdotH, float roughness) +{ + float F90 = 0.5 + (2.0 * roughness * mx_square(LdotH)); + float refL = mx_fresnel_schlick(NdotL, 1.0, F90); + float refV = mx_fresnel_schlick(NdotV, 1.0, F90); + return refL * refV; +} - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; - float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); - bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); +// Compute the directional albedo component of Burley diffuse for the given +// view angle and roughness. Curve fit provided by Stephen Hill. +float mx_burley_diffuse_dir_albedo(float NdotV, float roughness) +{ + float x = NdotV; + float fit0 = 0.97619 - 0.488095 * mx_pow5(1.0 - x); + float fit1 = 1.55754 + (-2.02221 + (2.56283 - 1.06244 * x) * x) * x; + return mix(fit0, fit1, roughness); +} - if (scatter_mode != 0) - { - float avgF0 = dot(safeColor0, vec3(1.0 / 3.0)); - fd.ior = vec3(mx_f0_to_ior(avgF0)); - bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeColor0) * weight; - } +// Evaluate the Burley diffusion profile for the given distance and diffusion shape. +// Based on https://graphics.pixar.com/library/ApproxBSSRDF/ +vec3 mx_burley_diffusion_profile(float dist, vec3 shape) +{ + vec3 num1 = exp(-shape * dist); + vec3 num2 = exp(-shape * dist / 3.0); + float denom = max(dist, M_FLOAT_EPS); + return (num1 + num2) / denom; } -void mx_generalized_schlick_bsdf_indirect(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +// Integrate the Burley diffusion profile over a sphere of the given radius. +// Inspired by Eric Penner's presentation in http://advances.realtimerendering.com/s2011/ +vec3 mx_integrate_burley_diffusion(vec3 N, vec3 L, float radius, vec3 mfp) { - if (weight < M_FLOAT_EPS) - { - return; - } + float theta = acos(dot(N, L)); - N = mx_forward_facing_normal(N, V); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + // Estimate the Burley diffusion shape from mean free path. + vec3 shape = vec3(1.0) / max(mfp, 0.1); - FresnelData fd; - vec3 safeColor0 = max(color0, 0.0); - vec3 safeColor82 = max(color82, 0.0); - vec3 safeColor90 = max(color90, 0.0); - if (thinfilm_thickness > 0.0) - { - fd = mx_init_fresnel_schlick_airy(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); - } - else + // Integrate the profile over the sphere. + vec3 sumD = vec3(0.0); + vec3 sumR = vec3(0.0); + const int SAMPLE_COUNT = 32; + const float SAMPLE_WIDTH = (2.0 * M_PI) / float(SAMPLE_COUNT); + for (int i = 0; i < SAMPLE_COUNT; i++) { - fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent); + float x = -M_PI + (float(i) + 0.5) * SAMPLE_WIDTH; + float dist = radius * abs(2.0 * sin(x * 0.5)); + vec3 R = mx_burley_diffusion_profile(dist, shape); + sumD += R * max(cos(theta + x), 0.0); + sumR += R; } - vec3 F = mx_compute_fresnel(NdotV, fd); - - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; - float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); - bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); - bsdf.response = Li * comp * weight; + return sumD / sumR; } -/// XYZ to Rec.709 RGB colorspace conversion -const mat3 XYZ_to_RGB = mat3( 3.2406, -0.9689, 0.0557, - -1.5372, 1.8758, -0.2040, - -0.4986, 0.0415, 1.0570); -void mx_blackbody(float temperatureKelvin, out vec3 colorValue) +vec3 mx_subsurface_scattering_approx(vec3 N, vec3 L, vec3 P, vec3 albedo, vec3 mfp) { - float xc, yc; - float t, t2, t3, xc2, xc3; - - // if value outside valid range of approximation clamp to accepted temperature range - temperatureKelvin = clamp(temperatureKelvin, 1667.0, 25000.0); + float curvature = length(fwidth(N)) / length(fwidth(P)); + float radius = 1.0 / max(curvature, 0.01); + return albedo * mx_integrate_burley_diffusion(N, L, radius, mfp) / vec3(M_PI); +} +#include "mx_microfacet_specular.glsl" - t = 1000.0 / temperatureKelvin; - t2 = t * t; - t3 = t * t * t; +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 roughness, int distribution, FresnelData fd) +{ + return vec3(0.0); +} - // Cubic spline approximation for Kelvin temperature to sRGB conversion - // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) - if (temperatureKelvin < 4000.0) { // 1667K <= temperatureKelvin < 4000K - xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; - } - else { // 4000K <= temperatureKelvin <= 25000K - xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; - } - xc2 = xc * xc; - xc3 = xc * xc * xc; +vec3 mx_environment_irradiance(vec3 N) +{ + return vec3(0.0); +} +#include "mx_microfacet.glsl" - if (temperatureKelvin < 2222.0) { // 1667K <= temperatureKelvin < 2222K - yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; - } - else if (temperatureKelvin < 4000.0) { // 2222K <= temperatureKelvin < 4000K - yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; - } - else { // 4000K <= temperatureKelvin <= 25000K - yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; - } +// http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf +// Equation 2 +float mx_imageworks_sheen_NDF(float NdotH, float roughness) +{ + float invRoughness = 1.0 / max(roughness, 0.005); + float cos2 = NdotH * NdotH; + float sin2 = 1.0 - cos2; + return (2.0 + invRoughness) * pow(sin2, invRoughness * 0.5) / (2.0 * M_PI); +} - if (yc <= 0.0) { // avoid division by zero - colorValue = vec3(1.0); - return; - } +float mx_imageworks_sheen_brdf(float NdotL, float NdotV, float NdotH, float roughness) +{ + // Microfacet distribution. + float D = mx_imageworks_sheen_NDF(NdotH, roughness); - vec3 XYZ = vec3(xc / yc, 1.0, (1.0 - xc - yc) / yc); + // Fresnel and geometry terms are ignored. + float F = 1.0; + float G = 1.0; - colorValue = XYZ_to_RGB * XYZ; - colorValue = max(colorValue, vec3(0.0)); + // We use a smoother denominator, as in: + // https://blog.selfshadow.com/publications/s2013-shading-course/rad/s2013_pbs_rad_notes.pdf + return D * F * G / (4.0 * (NdotL + NdotV - NdotL*NdotV)); } -#include "lib/mx_microfacet_diffuse.glsl" -void mx_oren_nayar_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +// Rational quadratic fit to Monte Carlo data for Imageworks sheen directional albedo. +float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) { - bsdf.throughput = vec3(0.0); - - if (weight < M_FLOAT_EPS) + vec2 r = vec2(13.67300, 1.0) + + vec2(-68.78018, 61.57746) * NdotV + + vec2(799.08825, 442.78211) * roughness + + vec2(-905.00061, 2597.49308) * NdotV * roughness + + vec2(60.28956, 121.81241) * mx_square(NdotV) + + vec2(1086.96473, 3045.55075) * mx_square(roughness); + return r.x / r.y; +} + +float mx_imageworks_sheen_dir_albedo_table_lookup(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) { - return; + return texture($albedoTable, vec2(NdotV, roughness)).b; } +#endif + return 0.0; +} - normal = mx_forward_facing_normal(normal, V); - - float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); +float mx_imageworks_sheen_dir_albedo_monte_carlo(float NdotV, float roughness) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); - bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; - if (roughness > 0.0) + float radiance = 0.0; + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) { - bsdf.response *= mx_oren_nayar_diffuse(L, V, normal, NdotL, roughness); + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); + + // Compute the incoming light direction and half vector. + vec3 L = mx_uniform_sample_hemisphere(Xi); + vec3 H = normalize(L + V); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float NdotH = clamp(H.z, M_FLOAT_EPS, 1.0); + + // Compute sheen reflectance. + float reflectance = mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); + + // Add the radiance contribution of this sample. + // uniform_pdf = 1 / (2 * PI) + // radiance = reflectance * NdotL / uniform_pdf; + radiance += reflectance * NdotL * 2.0 * M_PI; } + + // Return the final directional albedo. + return radiance / float(SAMPLE_COUNT); } -void mx_oren_nayar_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) { - bsdf.throughput = vec3(0.0); +#if DIRECTIONAL_ALBEDO_METHOD == 0 + float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); +#elif DIRECTIONAL_ALBEDO_METHOD == 1 + float dirAlbedo = mx_imageworks_sheen_dir_albedo_table_lookup(NdotV, roughness); +#else + float dirAlbedo = mx_imageworks_sheen_dir_albedo_monte_carlo(NdotV, roughness); +#endif + return clamp(dirAlbedo, 0.0, 1.0); +} +#include "mx_microfacet_specular.glsl" - if (weight < M_FLOAT_EPS) - { - return; - } +// Return the mip level associated with the given alpha in a prefiltered environment. +float mx_latlong_alpha_to_lod(float alpha) +{ + float lodBias = (alpha < 0.25) ? sqrt(alpha) : 0.5 * alpha + 0.375; + return lodBias * float($envRadianceMips - 1); +} - normal = mx_forward_facing_normal(normal, V); +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) +{ + N = mx_forward_facing_normal(N, V); + vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, N, fd.ior.x) : -reflect(V, N); - vec3 Li = mx_environment_irradiance(normal); - bsdf.response = Li * color * weight; + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + float avgAlpha = mx_average_alpha(alpha); + vec3 F = mx_compute_fresnel(NdotV, fd); + float G = mx_ggx_smith_G2(NdotV, NdotV, avgAlpha); + vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; + + vec3 Li = mx_latlong_map_lookup(L, $envMatrix, mx_latlong_alpha_to_lod(avgAlpha), $envRadiance); + return Li * FG * $envLightIntensity; +} + +vec3 mx_environment_irradiance(vec3 N) +{ + vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + return Li * $envLightIntensity; } - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - - - + + + + - - - - + - + - - + + - + - + - + - + - + -#include "lib/mx_microfacet_diffuse.glsl" - -void mx_burley_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) { - bsdf.throughput = vec3(0.0); - - if (weight < M_FLOAT_EPS) - { - return; - } + // TODO: Need to remap parameters to match the new closure, + // or change the MaterialX spec to OSL parameterization. + vdf = 0; +} +void mx_displacement_float(float displacement, float scale, output displacementshader result) +{ + result = vector(displacement * scale); +} +void mx_blackbody(float temp, output color color_value) +{ + float xc, yc; + float t, t2, t3, xc2, xc3; - normal = mx_forward_facing_normal(normal, V); + // if value outside valid range of approximation clamp to accepted temperature range + float temperature = clamp(temp, 1667.0, 25000.0); - float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + t = 1000.0 / temperature; + t2 = t * t; + t3 = t * t * t; - bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; - bsdf.response *= mx_burley_diffuse(L, V, normal, NdotL, roughness); -} + // Cubic spline approximation for Kelvin temperature to sRGB conversion + // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) + if (temperature < 4000.0) { // 1667K <= temperature < 4000K + xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; + } + else { // 4000K <= temperature <= 25000K + xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; + } + xc2 = xc * xc; + xc3 = xc * xc * xc; -void mx_burley_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) -{ - bsdf.throughput = vec3(0.0); + if (temperature < 2222.0) { // 1667K <= temperature < 2222K + yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; + } + else if (temperature < 4000.0) { // 2222K <= temperature < 4000K + yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; + } + else { // 4000K <= temperature <= 25000K + yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; + } - if (weight < M_FLOAT_EPS) - { - return; + if (yc <= 0.0) { // avoid division by zero + color_value = color(1.0); + return; } - normal = mx_forward_facing_normal(normal, V); + vector XYZ = vector(xc / yc, 1.0, (1 - xc - yc) / yc); - float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + /// XYZ to Rec.709 RGB colorspace conversion + matrix XYZ_to_RGB = matrix( 3.2406, -0.9689, 0.0557, 0.0, + -1.5372, 1.8758, -0.2040, 0.0, + -0.4986, 0.0415, 1.0570, 0.0, + 0.0, 0.0, 0.0, 1.0); - vec3 Li = mx_environment_irradiance(normal) * - mx_burley_diffuse_dir_albedo(NdotV, roughness); - bsdf.response = Li * color * weight; + color_value = transform(XYZ_to_RGB, XYZ); + color_value = max(color_value, vector(0.0)); } -void mx_uniform_edf(vec3 N, vec3 L, vec3 color, out EDF result) +void mx_displacement_vector3(vector displacement, float scale, output displacementshader result) { - result = color; + result = displacement * scale; } -void mx_add_edf(vec3 N, vec3 L, EDF in1, EDF in2, out EDF result) +#include "lib/mx_microfacet.osl" + +void mx_generalized_schlick_edf(color color0, color color90, float exponent, EDF base, output EDF result) { - result = in1 + in2; + float NdotV = fabs(dot(N,-I)); + color f = mx_fresnel_schlick(NdotV, color0, color90, exponent); + result = base * f; } -#include "lib/mx_microfacet_specular.glsl" + + -void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) -{ - bsdf.throughput = vec3(0.0); + + - if (weight < M_FLOAT_EPS) - { - return; - } + + - N = mx_forward_facing_normal(N, V); + + - X = normalize(X - dot(X, N) * N); - vec3 Y = cross(N, X); - vec3 H = normalize(L + V); + + - float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + + - FresnelData fd; - if (thinfilm_thickness > 0.0) - fd = mx_init_fresnel_conductor_airy(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); - else - fd = mx_init_fresnel_conductor(ior_n, ior_k); + + - vec3 F = mx_compute_fresnel(VdotH, fd); - float D = mx_ggx_NDF(Ht, safeAlpha); - float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + + - // Note: NdotL is cancelled out - bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); -} + + -void mx_conductor_bsdf_indirect(vec3 V, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) -{ - bsdf.throughput = vec3(0.0); + + - if (weight < M_FLOAT_EPS) - { - return; - } + + + - N = mx_forward_facing_normal(N, V); + + + - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + + - FresnelData fd; - if (thinfilm_thickness > 0.0) - fd = mx_init_fresnel_conductor_airy(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); - else - fd = mx_init_fresnel_conductor(ior_n, ior_k); + + + + + - vec3 F = mx_compute_fresnel(NdotV, fd); + + - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + + + - vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); + + - bsdf.response = Li * comp * weight; -} -void mx_roughness_anisotropy(float roughness, float anisotropy, out vec2 result) + + + + + + + + + + +void mx_roughness_anisotropy(float roughness, float anisotropy, output vector2 result) { float roughness_sqr = clamp(roughness*roughness, M_FLOAT_EPS, 1.0); if (anisotropy > 0.0) @@ -2858,370 +2576,208 @@ void mx_roughness_anisotropy(float roughness, float anisotropy, out vec2 result) result.y = roughness_sqr; } } -void mx_roughness_dual(vec2 roughness, out vec2 result) +void mx_roughness_dual(vector2 roughness, output vector2 result) { + result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); if (roughness.y < 0.0) { - roughness.y = roughness.x; + result.y = result.x; + } + else + { + result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); } - result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); - result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); } -void mx_displacement_vector3(vec3 disp, float scale, out displacementshader result) +void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { - result.offset = disp; - result.scale = scale; + if (scatter_mode == "R") + { + bsdf = weight * dielectric_bsdf(N, U, tint, color(0.0), roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else if (scatter_mode == "T") + { + bsdf = weight * dielectric_bsdf(N, U, color(0.0), tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else + { + bsdf = weight * dielectric_bsdf(N, U, tint, tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } } -void mx_artistic_ior(vec3 reflectivity, vec3 edge_color, out vec3 ior, out vec3 extinction) -{ - // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 - // http://jcgt.org/published/0003/04/03/paper.pdf - - vec3 r = clamp(reflectivity, 0.0, 0.99); - vec3 r_sqrt = sqrt(r); - vec3 n_min = (1.0 - r) / (1.0 + r); - vec3 n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); - ior = mix(n_max, n_min, edge_color); + + - vec3 np1 = ior + 1.0; - vec3 nm1 = ior - 1.0; - vec3 k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); - k2 = max(k2, 0.0); - extinction = sqrt(k2); -} -#include "lib/mx_microfacet.glsl" + + -void mx_generalized_schlick_edf(vec3 N, vec3 V, vec3 color0, vec3 color90, float exponent, EDF base, out EDF result) -{ - N = mx_forward_facing_normal(N, V); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - vec3 f = mx_fresnel_schlick(NdotV, color0, color90, exponent); - result = base * f; -} -#include "lib/mx_microfacet_diffuse.glsl" + + -void mx_subsurface_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) -{ - bsdf.throughput = vec3(0.0); + + - if (weight < M_FLOAT_EPS) - { - return; - } + + - normal = mx_forward_facing_normal(normal, V); + + - vec3 sss = mx_subsurface_scattering_approx(normal, L, P, color, radius); - float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); - float visibleOcclusion = 1.0 - NdotL * (1.0 - occlusion); - bsdf.response = sss * visibleOcclusion * weight; -} + + -void mx_subsurface_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) -{ - bsdf.throughput = vec3(0.0); + + - if (weight < M_FLOAT_EPS) - { - return; - } + + - normal = mx_forward_facing_normal(normal, V); + + - // For now, we render indirect subsurface as simple indirect diffuse. - vec3 Li = mx_environment_irradiance(normal); - bsdf.response = Li * color * weight; -} -void mx_anisotropic_vdf(vec3 absorption, vec3 scattering, float anisotropy, inout BSDF bsdf) -{ - // TODO: Add some approximation for volumetric light absorption. -} -void mx_displacement_float(float disp, float scale, out displacementshader result) -{ - result.offset = vec3(disp); - result.scale = scale; -} -#include "mx_microfacet.glsl" + + -// Based on the OSL implementation of Oren-Nayar diffuse, which is in turn -// based on https://mimosa-pudica.net/improved-oren-nayar.html. -float mx_oren_nayar_diffuse(vec3 L, vec3 V, vec3 N, float NdotL, float roughness) -{ - float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float s = LdotV - NdotL * NdotV; - float stinv = (s > 0.0f) ? s / max(NdotL, NdotV) : 0.0; + + - float sigma2 = mx_square(roughness * M_PI); - float A = 1.0 - 0.5 * (sigma2 / (sigma2 + 0.33)); - float B = 0.45 * sigma2 / (sigma2 + 0.09); + + + - return A + B * stinv; -} + + + -// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf -// Section 5.3 -float mx_burley_diffuse(vec3 L, vec3 V, vec3 N, float NdotL, float roughness) -{ - vec3 H = normalize(L + V); - float LdotH = clamp(dot(L, H), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + + - float F90 = 0.5 + (2.0 * roughness * mx_square(LdotH)); - float refL = mx_fresnel_schlick(NdotL, 1.0, F90); - float refV = mx_fresnel_schlick(NdotV, 1.0, F90); - return refL * refV; -} + + + + + -// Compute the directional albedo component of Burley diffuse for the given -// view angle and roughness. Curve fit provided by Stephen Hill. -float mx_burley_diffuse_dir_albedo(float NdotV, float roughness) -{ - float x = NdotV; - float fit0 = 0.97619 - 0.488095 * mx_pow5(1.0 - x); - float fit1 = 1.55754 + (-2.02221 + (2.56283 - 1.06244 * x) * x) * x; - return mix(fit0, fit1, roughness); -} + + -// Evaluate the Burley diffusion profile for the given distance and diffusion shape. -// Based on https://graphics.pixar.com/library/ApproxBSSRDF/ -vec3 mx_burley_diffusion_profile(float dist, vec3 shape) -{ - vec3 num1 = exp(-shape * dist); - vec3 num2 = exp(-shape * dist / 3.0); - float denom = max(dist, M_FLOAT_EPS); - return (num1 + num2) / denom; -} + + + -// Integrate the Burley diffusion profile over a sphere of the given radius. -// Inspired by Eric Penner's presentation in http://advances.realtimerendering.com/s2011/ -vec3 mx_integrate_burley_diffusion(vec3 N, vec3 L, float radius, vec3 mfp) -{ - float theta = acos(dot(N, L)); + + - // Estimate the Burley diffusion shape from mean free path. - vec3 shape = vec3(1.0) / max(mfp, 0.1); + + - // Integrate the profile over the sphere. - vec3 sumD = vec3(0.0); - vec3 sumR = vec3(0.0); - const int SAMPLE_COUNT = 32; - const float SAMPLE_WIDTH = (2.0 * M_PI) / float(SAMPLE_COUNT); - for (int i = 0; i < SAMPLE_COUNT; i++) - { - float x = -M_PI + (float(i) + 0.5) * SAMPLE_WIDTH; - float dist = radius * abs(2.0 * sin(x * 0.5)); - vec3 R = mx_burley_diffusion_profile(dist, shape); - sumD += R * max(cos(theta + x), 0.0); - sumR += R; - } + + - return sumD / sumR; -} + + -vec3 mx_subsurface_scattering_approx(vec3 N, vec3 L, vec3 P, vec3 albedo, vec3 mfp) + +void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) { - float curvature = length(fwidth(N)) / length(fwidth(P)); - float radius = 1.0 / max(curvature, 0.01); - return albedo * mx_integrate_burley_diffusion(N, L, radius, mfp) / vec3(M_PI); + result.bsdf = bsdf; + result.edf = edf; + result.opacity = clamp(opacity, 0.0, 1.0); } -#include "mx_microfacet.glsl" - -// Fresnel model options. -const int FRESNEL_MODEL_DIELECTRIC = 0; -const int FRESNEL_MODEL_CONDUCTOR = 1; -const int FRESNEL_MODEL_SCHLICK = 2; -const int FRESNEL_MODEL_AIRY = 3; -const int FRESNEL_MODEL_SCHLICK_AIRY = 4; - -// XYZ to CIE 1931 RGB color space (using neutral E illuminant) -const mat3 XYZ_TO_RGB = mat3(2.3706743, -0.5138850, 0.0052982, -0.9000405, 1.4253036, -0.0146949, -0.4706338, 0.0885814, 1.0093968); - -// Parameters for Fresnel calculations. -struct FresnelData +void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { - int model; - - // Physical Fresnel - vec3 ior; - vec3 extinction; - - // Generalized Schlick Fresnel - vec3 F0; - vec3 F82; - vec3 F90; - float exponent; - - // Thin film - float tf_thickness; - float tf_ior; - - // Refraction - bool refraction; - -#ifdef __METAL__ -FresnelData(int _model = 0, - vec3 _ior = vec3(0.0f), - vec3 _extinction = vec3(0.0f), - vec3 _F0 = vec3(0.0f), - vec3 _F82 = vec3(0.0f), - vec3 _F90 = vec3(0.0f), - float _exponent = 0.0f, - float _tf_thickness = 0.0f, - float _tf_ior = 0.0f, - bool _refraction = false) : - model(_model), - ior(_ior), - extinction(_extinction), - F0(_F0), F90(_F90), exponent(_exponent), - tf_thickness(_tf_thickness), - tf_ior(_tf_ior), - refraction(_refraction) {} -#endif - -}; - -// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf -// Appendix B.2 Equation 13 -float mx_ggx_NDF(vec3 H, vec2 alpha) + if (scatter_mode == "R") + { + bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(0.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else if (scatter_mode == "T") + { + bsdf = weight * generalized_schlick_bsdf(N, U, color(0.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else + { + bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } +} +void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) { - vec2 He = H.xy / alpha; - float denom = dot(He, He) + mx_square(H.z); - return 1.0 / (M_PI * alpha.x * alpha.y * mx_square(denom)); + // TODO: Subsurface closure is not supported by vanilla OSL. + bsdf = _color * weight * diffuse(N); } - -// https://ggx-research.github.io/publication/2023/06/09/publication-ggx.html -vec3 mx_ggx_importance_sample_VNDF(vec2 Xi, vec3 V, vec2 alpha) +void mx_artistic_ior(color reflectivity, color edge_color, output vector ior, output vector extinction) { - // Transform the view direction to the hemisphere configuration. - V = normalize(vec3(V.xy * alpha, V.z)); - - // Sample a spherical cap in (-V.z, 1]. - float phi = 2.0 * M_PI * Xi.x; - float z = (1.0 - Xi.y) * (1.0 + V.z) - V.z; - float sinTheta = sqrt(clamp(1.0 - z * z, 0.0, 1.0)); - float x = sinTheta * cos(phi); - float y = sinTheta * sin(phi); - vec3 c = vec3(x, y, z); + // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 + // http://jcgt.org/published/0003/04/03/paper.pdf - // Compute the microfacet normal. - vec3 H = c + V; + color r = clamp(reflectivity, 0.0, 0.99); + color r_sqrt = sqrt(r); + color n_min = (1.0 - r) / (1.0 + r); + color n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); + ior = mix(n_max, n_min, edge_color); - // Transform the microfacet normal back to the ellipsoid configuration. - H = normalize(vec3(H.xy * alpha, max(H.z, 0.0))); + color np1 = ior + 1.0; + color nm1 = ior - 1.0; + color k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); + k2 = max(k2, 0.0); + extinction = sqrt(k2); +} +#include "mx_microfacet.osl" - return H; +// Compute the average of an anisotropic alpha pair. +float mx_average_alpha(vector2 alpha) +{ + return sqrt(alpha.x * alpha.y); } -// https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf -// Equation 34 -float mx_ggx_smith_G1(float cosTheta, float alpha) +// Convert a real-valued index of refraction to normal-incidence reflectivity. +float mx_ior_to_f0(float ior) { - float cosTheta2 = mx_square(cosTheta); - float tanTheta2 = (1.0 - cosTheta2) / cosTheta2; - return 2.0 / (1.0 + sqrt(1.0 + mx_square(alpha) * tanTheta2)); + return mx_square((ior - 1.0) / (ior + 1.0)); } -// Height-correlated Smith masking-shadowing -// http://jcgt.org/published/0003/02/03/paper.pdf -// Equations 72 and 99 -float mx_ggx_smith_G2(float NdotL, float NdotV, float alpha) +// Convert normal-incidence reflectivity to real-valued index of refraction. +float mx_f0_to_ior(float F0) { - float alpha2 = mx_square(alpha); - float lambdaL = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotL)); - float lambdaV = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotV)); - return 2.0 / (lambdaL / NdotL + lambdaV / NdotV); + float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (1.0 + sqrtF0) / (1.0 - sqrtF0); } // Rational quadratic fit to Monte Carlo data for GGX directional albedo. -vec3 mx_ggx_dir_albedo_analytic(float NdotV, float alpha, vec3 F0, vec3 F90) +color mx_ggx_dir_albedo(float NdotV, float alpha, color F0, color F90) { float x = NdotV; float y = alpha; float x2 = mx_square(x); float y2 = mx_square(y); - vec4 r = vec4(0.1003, 0.9345, 1.0, 1.0) + - vec4(-0.6303, -2.323, -1.765, 0.2281) * x + - vec4(9.748, 2.229, 8.263, 15.94) * y + - vec4(-2.038, -3.748, 11.53, -55.83) * x * y + - vec4(29.34, 1.424, 28.96, 13.08) * x2 + - vec4(-8.245, -0.7684, -7.507, 41.26) * y2 + - vec4(-26.44, 1.436, -36.11, 54.9) * x2 * y + - vec4(19.99, 0.2913, 15.86, 300.2) * x * y2 + - vec4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; - vec2 AB = clamp(r.xy / r.zw, 0.0, 1.0); - return F0 * AB.x + F90 * AB.y; -} - -vec3 mx_ggx_dir_albedo_table_lookup(float NdotV, float alpha, vec3 F0, vec3 F90) -{ -#if DIRECTIONAL_ALBEDO_METHOD == 1 - if (textureSize($albedoTable, 0).x > 1) - { - vec2 AB = texture($albedoTable, vec2(NdotV, alpha)).rg; - return F0 * AB.x + F90 * AB.y; - } -#endif - return vec3(0.0); -} - -// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf -vec3 mx_ggx_dir_albedo_monte_carlo(float NdotV, float alpha, vec3 F0, vec3 F90) -{ - NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); - vec3 V = vec3(sqrt(1.0 - mx_square(NdotV)), 0, NdotV); - - vec2 AB = vec2(0.0); - const int SAMPLE_COUNT = 64; - for (int i = 0; i < SAMPLE_COUNT; i++) - { - vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); - - // Compute the half vector and incoming light direction. - vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); - vec3 L = -reflect(V, H); - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); - - // Compute the Fresnel term. - float Fc = mx_fresnel_schlick(VdotH, 0.0, 1.0); - - // Compute the per-sample geometric term. - // https://hal.inria.fr/hal-00996995v2/document, Algorithm 2 - float G2 = mx_ggx_smith_G2(NdotL, NdotV, alpha); - - // Add the contribution of this sample. - AB += vec2(G2 * (1.0 - Fc), G2 * Fc); - } - - // Apply the global component of the geometric term and normalize. - AB /= mx_ggx_smith_G1(NdotV, alpha) * float(SAMPLE_COUNT); - - // Return the final directional albedo. + vector4 r = vector4(0.1003, 0.9345, 1.0, 1.0) + + vector4(-0.6303, -2.323, -1.765, 0.2281) * x + + vector4(9.748, 2.229, 8.263, 15.94) * y + + vector4(-2.038, -3.748, 11.53, -55.83) * x * y + + vector4(29.34, 1.424, 28.96, 13.08) * x2 + + vector4(-8.245, -0.7684, -7.507, 41.26) * y2 + + vector4(-26.44, 1.436, -36.11, 54.9) * x2 * y + + vector4(19.99, 0.2913, 15.86, 300.2) * x * y2 + + vector4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; + vector2 AB = vector2(r.x, r.y) / vector2(r.z, r.w); + AB.x = clamp(AB.x, 0.0, 1.0); + AB.y = clamp(AB.y, 0.0, 1.0); return F0 * AB.x + F90 * AB.y; } -vec3 mx_ggx_dir_albedo(float NdotV, float alpha, vec3 F0, vec3 F90) +float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) { -#if DIRECTIONAL_ALBEDO_METHOD == 0 - return mx_ggx_dir_albedo_analytic(NdotV, alpha, F0, F90); -#elif DIRECTIONAL_ALBEDO_METHOD == 1 - return mx_ggx_dir_albedo_table_lookup(NdotV, alpha, F0, F90); -#else - return mx_ggx_dir_albedo_monte_carlo(NdotV, alpha, F0, F90); -#endif + color result = mx_ggx_dir_albedo(NdotV, alpha, color(F0), color(F90)); + return result[0]; } -float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) +float mx_ggx_dir_albedo(float NdotV, float alpha, float ior) { - return mx_ggx_dir_albedo(NdotV, alpha, vec3(F0), vec3(F90)).x; + color result = mx_ggx_dir_albedo(NdotV, alpha, color(mx_ior_to_f0(ior)), color(1.0)); + return result[0]; } // https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf // Equations 14 and 16 -vec3 mx_ggx_energy_compensation(float NdotV, float alpha, vec3 Fss) +color mx_ggx_energy_compensation(float NdotV, float alpha, color Fss) { float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); return 1.0 + Fss * (1.0 - Ess) / Ess; @@ -3229,836 +2785,872 @@ vec3 mx_ggx_energy_compensation(float NdotV, float alpha, vec3 Fss) float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) { - return mx_ggx_energy_compensation(NdotV, alpha, vec3(Fss)).x; + color result = mx_ggx_energy_compensation(NdotV, alpha, color(Fss)); + return result[0]; } +#include "mx_microfacet.osl" -// Compute the average of an anisotropic alpha pair. -float mx_average_alpha(vec2 alpha) +// Rational curve fit approximation for the directional albedo of Imageworks sheen. +float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) { - return sqrt(alpha.x * alpha.y); + float a = 5.25248 - 7.66024 * NdotV + 14.26377 * roughness; + float b = 1.0 + 30.66449 * NdotV + 32.53420 * roughness; + return a / b; } -// Convert a real-valued index of refraction to normal-incidence reflectivity. -float mx_ior_to_f0(float ior) +float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) { - return mx_square((ior - 1.0) / (ior + 1.0)); + float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); + return clamp(dirAlbedo, 0.0, 1.0); } - -// Convert normal-incidence reflectivity to real-valued index of refraction. -float mx_f0_to_ior(float F0) +float mx_square(float x) { - float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); - return (1.0 + sqrtF0) / (1.0 - sqrtF0); + return x*x; } -vec3 mx_f0_to_ior_colored(vec3 F0) +vector2 mx_square(vector2 x) { - vec3 sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); - return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0); + return x*x; } -// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ -float mx_fresnel_dielectric(float cosTheta, float ior) +vector mx_square(vector x) { - if (cosTheta < 0.0) - return 1.0; - - float g = ior*ior + cosTheta*cosTheta - 1.0; - // Check for total internal reflection - if (g < 0.0) - return 1.0; - - g = sqrt(g); - float gmc = g - cosTheta; - float gpc = g + cosTheta; - float x = gmc / gpc; - float y = (gpc * cosTheta - 1.0) / (gmc * cosTheta + 1.0); - return 0.5 * x * x * (1.0 + y * y); + return x*x; } -// https://renderwonk.com/publications/wp-generalization-adobe/gen-adobe.pdf -vec3 mx_fresnel_hoffman_schlick(float cosTheta, vec3 F0, vec3 F82, vec3 F90, float exponent) +vector4 mx_square(vector4 x) { - const float COS_THETA_MAX = 1.0 / 7.0; - const float COS_THETA_FACTOR = 1.0 / (COS_THETA_MAX * pow(1.0 - COS_THETA_MAX, 6.0)); - - float x = clamp(cosTheta, 0.0, 1.0); - vec3 a = mix(F0, F90, pow(1.0 - COS_THETA_MAX, exponent)) * (vec3(1.0) - F82) * COS_THETA_FACTOR; - return mix(F0, F90, pow(1.0 - x, exponent)) - a * x * mx_pow6(1.0 - x); + return x*x; } -void mx_fresnel_dielectric_polarized(float cosTheta, float n, out float Rp, out float Rs) +float mx_pow5(float x) { - if (cosTheta < 0.0) { - Rp = 1.0; - Rs = 1.0; - return; - } + return mx_square(mx_square(x)) * x; +} - float cosTheta2 = cosTheta * cosTheta; - float sinTheta2 = 1.0 - cosTheta2; - float n2 = n * n; +color mx_fresnel_conductor(float cosTheta, vector n, vector k) +{ + float c2 = cosTheta*cosTheta; + vector n2_k2 = n*n + k*k; + vector nc2 = 2.0 * n * cosTheta; - float t0 = n2 - sinTheta2; - float a2plusb2 = sqrt(t0 * t0); - float t1 = a2plusb2 + cosTheta2; - float a = sqrt(max(0.5 * (a2plusb2 + t0), 0.0)); - float t2 = 2.0 * a * cosTheta; - Rs = (t1 - t2) / (t1 + t2); + vector rs_a = n2_k2 + c2; + vector rp_a = n2_k2 * c2 + 1.0; + vector rs = (rs_a - nc2) / (rs_a + nc2); + vector rp = (rp_a - nc2) / (rp_a + nc2); - float t3 = cosTheta2 * a2plusb2 + sinTheta2 * sinTheta2; - float t4 = t2 * sinTheta2; - Rp = Rs * (t3 - t4) / (t3 + t4); + return 0.5 * (rs + rp); } -void mx_fresnel_dielectric_polarized(float cosTheta, float eta1, float eta2, out float Rp, out float Rs) +// Standard Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0) { - float n = eta2 / eta1; - mx_fresnel_dielectric_polarized(cosTheta, n, Rp, Rs); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; } - -void mx_fresnel_conductor_polarized(float cosTheta, vec3 n, vec3 k, out vec3 Rp, out vec3 Rs) +color mx_fresnel_schlick(float cosTheta, color F0) { - cosTheta = clamp(cosTheta, 0.0, 1.0); - float cosTheta2 = cosTheta * cosTheta; - float sinTheta2 = 1.0 - cosTheta2; - vec3 n2 = n * n; - vec3 k2 = k * k; - - vec3 t0 = n2 - k2 - vec3(sinTheta2); - vec3 a2plusb2 = sqrt(t0 * t0 + 4.0 * n2 * k2); - vec3 t1 = a2plusb2 + vec3(cosTheta2); - vec3 a = sqrt(max(0.5 * (a2plusb2 + t0), 0.0)); - vec3 t2 = 2.0 * a * cosTheta; - Rs = (t1 - t2) / (t1 + t2); - - vec3 t3 = cosTheta2 * a2plusb2 + vec3(sinTheta2 * sinTheta2); - vec3 t4 = t2 * sinTheta2; - Rp = Rs * (t3 - t4) / (t3 + t4); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; } -void mx_fresnel_conductor_polarized(float cosTheta, float eta1, vec3 eta2, vec3 kappa2, out vec3 Rp, out vec3 Rs) +// Generalized Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0, float F90) { - vec3 n = eta2 / eta1; - vec3 k = kappa2 / eta1; - mx_fresnel_conductor_polarized(cosTheta, n, k, Rp, Rs); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); } - -vec3 mx_fresnel_conductor(float cosTheta, vec3 n, vec3 k) +color mx_fresnel_schlick(float cosTheta, color F0, color F90) { - vec3 Rp, Rs; - mx_fresnel_conductor_polarized(cosTheta, n, k, Rp, Rs); - return 0.5 * (Rp + Rs); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); } -// Phase shift due to a dielectric material -void mx_fresnel_dielectric_phase_polarized(float cosTheta, float eta1, float eta2, out float phiP, out float phiS) +// Generalized Schlick Fresnel with a variable exponent +color mx_fresnel_schlick(float cosTheta, float f0, float f90, float exponent) { - float cosB = cos(atan(eta2 / eta1)); // Brewster's angle - if (eta2 > eta1) { - phiP = cosTheta < cosB ? M_PI : 0.0f; - phiS = 0.0f; - } else { - phiP = cosTheta < cosB ? 0.0f : M_PI; - phiS = M_PI; - } + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(f0, f90, pow(x, exponent)); } - -// Phase shift due to a conducting material -void mx_fresnel_conductor_phase_polarized(float cosTheta, float eta1, vec3 eta2, vec3 kappa2, out vec3 phiP, out vec3 phiS) +color mx_fresnel_schlick(float cosTheta, color f0, color f90, float exponent) { - if (dot(kappa2, kappa2) == 0.0 && eta2.x == eta2.y && eta2.y == eta2.z) { - // Use dielectric formula to increase performance - float phiPx, phiSx; - mx_fresnel_dielectric_phase_polarized(cosTheta, eta1, eta2.x, phiPx, phiSx); - phiP = vec3(phiPx, phiPx, phiPx); - phiS = vec3(phiSx, phiSx, phiSx); - return; - } - vec3 k2 = kappa2 / eta2; - vec3 sinThetaSqr = vec3(1.0) - cosTheta * cosTheta; - vec3 A = eta2*eta2*(vec3(1.0)-k2*k2) - eta1*eta1*sinThetaSqr; - vec3 B = sqrt(A*A + mx_square(2.0*eta2*eta2*k2)); - vec3 U = sqrt((A+B)/2.0); - vec3 V = max(vec3(0.0), sqrt((B-A)/2.0)); - - phiS = atan(2.0*eta1*V*cosTheta, U*U + V*V - mx_square(eta1*cosTheta)); - phiP = atan(2.0*eta1*eta2*eta2*cosTheta * (2.0*k2*U - (vec3(1.0)-k2*k2) * V), - mx_square(eta2*eta2*(vec3(1.0)+k2*k2)*cosTheta) - eta1*eta1*(U*U+V*V)); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(f0, f90, pow(x, exponent)); } - -// Evaluation XYZ sensitivity curves in Fourier space -vec3 mx_eval_sensitivity(float opd, vec3 shift) +void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) { - // Use Gaussian fits, given by 3 parameters: val, pos and var - float phase = 2.0*M_PI * opd; - vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13); - vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06); - vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09); - vec3 xyz = val * sqrt(2.0*M_PI * var) * cos(pos * phase + shift) * exp(- var * phase*phase); - xyz.x += 9.7470e-14 * sqrt(2.0*M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(- 4.5282e+09 * phase*phase); - return xyz / 1.0685e-7; + // Not implemented in vanilla OSL + vdf = 0; // volume_henyey_greenstein(color(absorption), color(scattering), color(0.0), anisotropy); } - -// A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence -// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html -vec3 mx_fresnel_airy(float cosTheta, vec3 ior, vec3 extinction, float tf_thickness, float tf_ior, - vec3 F0, vec3 F82, vec3 F90, float exponent, bool use_schlick) +void mx_burley_diffuse_bsdf(float weight, color reflectance, float roughness, normal N, output BSDF bsdf) { - // Convert nm -> m - float d = tf_thickness * 1.0e-9; - - // Assume vacuum on the outside - float eta1 = 1.0; - float eta2 = max(tf_ior, eta1); - vec3 eta3 = use_schlick ? mx_f0_to_ior_colored(F0) : ior; - vec3 kappa3 = use_schlick ? vec3(0.0) : extinction; + // TODO: Implement properly. + bsdf.response = reflectance * weight * oren_nayar(N, roughness); + bsdf.throughput = color(0.0); +} +#include "../lib/mx_microfacet_specular.osl" - // Compute the Spectral versions of the Fresnel reflectance and - // transmitance for each interface. - float R12p, T121p, R12s, T121s; - vec3 R23p, R23s; - - // Reflected and transmitted parts in the thin film - mx_fresnel_dielectric_polarized(cosTheta, eta1, eta2, R12p, R12s); - - // Reflected part by the base - float scale = eta1 / eta2; - float cosThetaTSqr = 1.0 - (1.0-cosTheta*cosTheta) * scale*scale; - float cosTheta2 = sqrt(cosThetaTSqr); - if (use_schlick) - { - vec3 f = mx_fresnel_hoffman_schlick(cosTheta2, F0, F82, F90, exponent); - R23p = 0.5 * f; - R23s = 0.5 * f; - } - else - { - mx_fresnel_conductor_polarized(cosTheta2, eta2, eta3, kappa3, R23p, R23s); - } +void mx_conductor_bsdf(float weight, color ior_n, color ior_k, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, output BSDF bsdf) +{ + bsdf.throughput = color(0.0); - // Check for total internal reflection - if (cosThetaTSqr <= 0.0f) + if (weight < M_FLOAT_EPS) { - R12s = 1.0; - R12p = 1.0; + bsdf.response = 0; + return; } - // Compute the transmission coefficients - T121p = 1.0 - R12p; - T121s = 1.0 - R12s; + // Calculate conductor fresnel + // + // Fresnel should be based on microfacet normal + // but we have no access to that from here, so just use + // view direction and surface normal instead + // + float NdotV = fabs(dot(N,-I)); + color F = mx_fresnel_conductor(NdotV, ior_n, ior_k); - // Optical path difference - float D = 2.0 * eta2 * d * cosTheta2; + // Calculate compensation for multiple scattering. + // This should normally be done inside the closure + // but since vanilla OSL doesen't support this we + // add it here in shader code instead. + vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - float phi21p, phi21s; - vec3 phi23p, phi23s, r123s, r123p; + // Set ior to 0.0 to disable the internal dielectric fresnel + bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, false); +} +#include "../lib/mx_microfacet_specular.osl" - // Evaluate the phase shift - mx_fresnel_dielectric_phase_polarized(cosTheta, eta1, eta2, phi21p, phi21s); - if (use_schlick) - { - phi23p = vec3( - (eta3[0] < eta2) ? M_PI : 0.0, - (eta3[1] < eta2) ? M_PI : 0.0, - (eta3[2] < eta2) ? M_PI : 0.0); - phi23s = phi23p; - } - else +void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +{ + if (scatter_mode == "T") { - mx_fresnel_conductor_phase_polarized(cosTheta2, eta2, eta3, kappa3, phi23p, phi23s); + bsdf.response = tint * weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); + bsdf.throughput = tint * weight; + return; } - phi21p = M_PI - phi21p; - phi21s = M_PI - phi21s; - - r123p = max(vec3(0.0), sqrt(R12p*R23p)); - r123s = max(vec3(0.0), sqrt(R12s*R23s)); - - // Evaluate iridescence term - vec3 I = vec3(0.0); - vec3 C0, Cm, Sm; - - // Iridescence term using spectral antialiasing for Parallel polarization + float NdotV = clamp(dot(N,-I), M_FLOAT_EPS, 1.0); + float F0 = mx_ior_to_f0(ior); + float F = mx_fresnel_schlick(NdotV, F0); - vec3 S0 = vec3(1.0); + // Calculate compensation for multiple scattering. + // This should normally be done inside the closure + // but since vanilla OSL doesen't support this we + // add it here in shader code instead. + vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + float comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - // Reflectance term for m=0 (DC term amplitude) - vec3 Rs = (T121p*T121p*R23p) / (vec3(1.0) - R12p*R23p); - C0 = R12p + Rs; - I += C0 * S0; + // Calculate throughput from directional albedo. + float dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, ior) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; - // Reflectance term for m>0 (pairs of diracs) - Cm = Rs - T121p; - for (int m=1; m<=2; ++m) + if (scatter_mode == "R") { - Cm *= r123p; - Sm = 2.0 * mx_eval_sensitivity(float(m)*D, float(m)*(phi23p+vec3(phi21p))); - I += Cm*Sm; + bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 0); } - - // Iridescence term using spectral antialiasing for Perpendicular polarization - - // Reflectance term for m=0 (DC term amplitude) - vec3 Rp = (T121s*T121s*R23s) / (vec3(1.0) - R12s*R23s); - C0 = R12s + Rp; - I += C0 * S0; - - // Reflectance term for m>0 (pairs of diracs) - Cm = Rp - T121s ; - for (int m=1; m<=2; ++m) + else { - Cm *= r123s; - Sm = 2.0 * mx_eval_sensitivity(float(m)*D, float(m)*(phi23s+vec3(phi21s))); - I += Cm*Sm; + bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 2); } +} +#include "../lib/mx_microfacet_sheen.osl" - // Average parallel and perpendicular polarization - I *= 0.5; +// TODO: Vanilla OSL doesn't have a proper sheen closure, +// so use 'diffuse' scaled by sheen directional albedo for now. +void mx_sheen_bsdf(float weight, color Ks, float roughness, vector N, output BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + bsdf.response = 0; + bsdf.throughput = color(1.0); + return; + } - // Convert back to RGB reflectance - I = clamp(XYZ_TO_RGB * I, vec3(0.0), vec3(1.0)); + // TODO: Normalization should not be needed. My suspicion is that + // BSDF sampling of new outgoing direction in 'testrender' needs + // to be fixed. + vector V = normalize(-I); - return I; + float NdotV = fabs(dot(N,V)); + float alpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float albedo = weight * mx_imageworks_sheen_dir_albedo(NdotV, alpha); + bsdf.response = albedo * Ks * diffuse(N); + bsdf.throughput = 1.0 - albedo; } - -FresnelData mx_init_fresnel_data(int model) +void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) { - return FresnelData(model, vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0), 0.0, 0.0, 0.0, false); + result.bsdf = bsdf.response; + result.edf = edf; + result.opacity = clamp(opacity, 0.0, 1.0); } - -FresnelData mx_init_fresnel_dielectric(float ior) +void mx_translucent_bsdf(float weight, color _color, normal N, output BSDF bsdf) { - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_DIELECTRIC); - fd.ior = vec3(ior); - return fd; + bsdf.response = _color * weight * translucent(N); + bsdf.throughput = color(0.0); } +#include "../lib/mx_microfacet_specular.osl" -FresnelData mx_init_fresnel_conductor(vec3 ior, vec3 extinction) +void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_CONDUCTOR); - fd.ior = ior; - fd.extinction = extinction; - return fd; -} + float avgF0 = dot(color0, color(1.0 / 3.0)); + float ior = mx_f0_to_ior(avgF0); -FresnelData mx_init_fresnel_schlick(vec3 F0) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_SCHLICK); - fd.F0 = F0; - fd.F90 = vec3(1.0); - fd.exponent = 5.0f; - return fd; -} + if (scatter_mode == "T") + { + bsdf.response = weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); + bsdf.throughput = weight; + return; + } -FresnelData mx_init_fresnel_schlick(vec3 F0, vec3 F82, vec3 F90, float exponent) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_SCHLICK); - fd.F0 = F0; - fd.F82 = F82; - fd.F90 = F90; - fd.exponent = exponent; - return fd; -} + float NdotV = fabs(dot(N,-I)); + color F = mx_fresnel_schlick(NdotV, color0, color90, exponent); -FresnelData mx_init_fresnel_schlick_airy(vec3 F0, vec3 F82, vec3 F90, float exponent, float tf_thickness, float tf_ior) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_SCHLICK_AIRY); - fd.F0 = F0; - fd.F82 = F82; - fd.F90 = F90; - fd.exponent = exponent; - fd.tf_thickness = tf_thickness; - fd.tf_ior = tf_ior; - return fd; -} + // Calculate compensation for multiple scattering. + // This should normally be done inside the closure + // but since vanilla OSL doesen't support this we + // add it here in shader code instead. + vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); -FresnelData mx_init_fresnel_dielectric_airy(float ior, float tf_thickness, float tf_ior) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_AIRY); - fd.ior = vec3(ior); - fd.tf_thickness = tf_thickness; - fd.tf_ior = tf_ior; - return fd; -} + // Calculate throughput from directional albedo. + color dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, color0, color90) * comp; + float avgDirAlbedo = dot(dirAlbedo, color(1.0 / 3.0)); + bsdf.throughput = 1.0 - avgDirAlbedo * weight; -FresnelData mx_init_fresnel_conductor_airy(vec3 ior, vec3 extinction, float tf_thickness, float tf_ior) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_AIRY); - fd.ior = ior; - fd.extinction = extinction; - fd.tf_thickness = tf_thickness; - fd.tf_ior = tf_ior; - return fd; -} + // Calculate the reflection response, setting IOR to zero to disable internal Fresnel. + bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, 0); -vec3 mx_compute_fresnel(float cosTheta, FresnelData fd) -{ - if (fd.model == FRESNEL_MODEL_DIELECTRIC) - { - return vec3(mx_fresnel_dielectric(cosTheta, fd.ior.x)); - } - else if (fd.model == FRESNEL_MODEL_CONDUCTOR) - { - return mx_fresnel_conductor(cosTheta, fd.ior, fd.extinction); - } - else if (fd.model == FRESNEL_MODEL_SCHLICK) - { - return mx_fresnel_hoffman_schlick(cosTheta, fd.F0, fd.F82, fd.F90, fd.exponent); - } - else + if (scatter_mode == "RT") { - return mx_fresnel_airy(cosTheta, fd.ior, fd.extinction, fd.tf_thickness, fd.tf_ior, - fd.F0, fd.F82, fd.F90, fd.exponent, - fd.model == FRESNEL_MODEL_SCHLICK_AIRY); + bsdf.response += bsdf.throughput * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 1); } } - -// Compute the refraction of a ray through a solid sphere. -vec3 mx_refraction_solid_sphere(vec3 R, vec3 N, float ior) -{ - R = refract(R, N, 1.0 / ior); - vec3 N1 = normalize(R * dot(R, N) - N * 0.5); - return refract(R, N1, ior); -} - -vec2 mx_latlong_projection(vec3 dir) +void mx_oren_nayar_diffuse_bsdf(float weight, color _color, float roughness, normal N, output BSDF bsdf) { - float latitude = -asin(dir.y) * M_PI_INV + 0.5; - float longitude = atan(dir.x, -dir.z) * M_PI_INV * 0.5 + 0.5; - return vec2(longitude, latitude); + bsdf.response = _color * weight * oren_nayar(N, roughness); + bsdf.throughput = color(0.0); } - -vec3 mx_latlong_map_lookup(vec3 dir, mat4 transform, float lod, sampler2D envSampler) +void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) { - vec3 envDir = normalize((transform * vec4(dir,0.0)).xyz); - vec2 uv = mx_latlong_projection(envDir); - return textureLod(envSampler, uv, lod).rgb; + // TODO: Subsurface closure is not supported by vanilla OSL. + bsdf.response = _color * weight * diffuse(N); + bsdf.throughput = color(0.0); } + + + -// Return the mip level associated with the given alpha in a prefiltered environment. -float mx_latlong_alpha_to_lod(float alpha) -{ - float lodBias = (alpha < 0.25) ? sqrt(alpha) : 0.5 * alpha + 0.375; - return lodBias * float($envRadianceMips - 1); -} + + + + -// Return the alpha associated with the given mip level in a prefiltered environment. -float mx_latlong_lod_to_alpha(float lod) -{ - float lodBias = lod / float($envRadianceMips - 1); - return (lodBias < 0.5) ? mx_square(lodBias) : 2.0 * (lodBias - 0.375); -} -#include "mx_microfacet_specular.glsl" + + + + -vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) -{ - // Approximate the appearance of surface transmission as glossy - // environment map refraction, ignoring any scene geometry that might - // be visible through the surface. - fd.refraction = true; - if ($refractionTwoSided) - { - tint = mx_square(tint); - } - return mx_environment_radiance(N, V, X, alpha, distribution, fd) * tint; -} -#include "mx_microfacet_specular.glsl" + + + + -vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) -{ - N = mx_forward_facing_normal(N, V); - vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, N, fd.ior.x) : -reflect(V, N); + + + + - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + + + - float avgAlpha = mx_average_alpha(alpha); - vec3 F = mx_compute_fresnel(NdotV, fd); - float G = mx_ggx_smith_G2(NdotV, NdotV, avgAlpha); - vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; + + + + - vec3 Li = mx_latlong_map_lookup(L, $envMatrix, mx_latlong_alpha_to_lod(avgAlpha), $envRadiance); - return Li * FG; -} + + + + -vec3 mx_environment_irradiance(vec3 N) -{ - return mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); -} -#include "mx_microfacet.glsl" + + + + -// http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf -// Equation 2 -float mx_imageworks_sheen_NDF(float NdotH, float roughness) -{ - float invRoughness = 1.0 / max(roughness, 0.005); - float cos2 = NdotH * NdotH; - float sin2 = 1.0 - cos2; - return (2.0 + invRoughness) * pow(sin2, invRoughness * 0.5) / (2.0 * M_PI); -} + + + + -float mx_imageworks_sheen_brdf(float NdotL, float NdotV, float NdotH, float roughness) -{ - // Microfacet distribution. - float D = mx_imageworks_sheen_NDF(NdotH, roughness); + + + + - // Fresnel and geometry terms are ignored. - float F = 1.0; - float G = 1.0; + + + + - // We use a smoother denominator, as in: - // https://blog.selfshadow.com/publications/s2013-shading-course/rad/s2013_pbs_rad_notes.pdf - return D * F * G / (4.0 * (NdotL + NdotV - NdotL*NdotV)); -} + + + + -// Rational quadratic fit to Monte Carlo data for Imageworks sheen directional albedo. -float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) -{ - vec2 r = vec2(13.67300, 1.0) + - vec2(-68.78018, 61.57746) * NdotV + - vec2(799.08825, 442.78211) * roughness + - vec2(-905.00061, 2597.49308) * NdotV * roughness + - vec2(60.28956, 121.81241) * mx_square(NdotV) + - vec2(1086.96473, 3045.55075) * mx_square(roughness); - return r.x / r.y; -} + + + + -float mx_imageworks_sheen_dir_albedo_table_lookup(float NdotV, float roughness) -{ -#if DIRECTIONAL_ALBEDO_METHOD == 1 - if (textureSize($albedoTable, 0).x > 1) - { - return texture($albedoTable, vec2(NdotV, roughness)).b; - } -#endif - return 0.0; -} + + + + -float mx_imageworks_sheen_dir_albedo_monte_carlo(float NdotV, float roughness) -{ - NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); - vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); + + + + - float radiance = 0.0; - const int SAMPLE_COUNT = 64; - for (int i = 0; i < SAMPLE_COUNT; i++) - { - vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); + + + + - // Compute the incoming light direction and half vector. - vec3 L = mx_uniform_sample_hemisphere(Xi); - vec3 H = normalize(L + V); - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); - float NdotH = clamp(H.z, M_FLOAT_EPS, 1.0); + + + + - // Compute sheen reflectance. - float reflectance = mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); + + + + - // Add the radiance contribution of this sample. - // uniform_pdf = 1 / (2 * PI) - // radiance = reflectance * NdotL / uniform_pdf; - radiance += reflectance * NdotL * 2.0 * M_PI; - } + + + + - // Return the final directional albedo. - return radiance / float(SAMPLE_COUNT); -} + + + + -float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) -{ -#if DIRECTIONAL_ALBEDO_METHOD == 0 - float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); -#elif DIRECTIONAL_ALBEDO_METHOD == 1 - float dirAlbedo = mx_imageworks_sheen_dir_albedo_table_lookup(NdotV, roughness); -#else - float dirAlbedo = mx_imageworks_sheen_dir_albedo_monte_carlo(NdotV, roughness); -#endif - return clamp(dirAlbedo, 0.0, 1.0); -} -#include "mx_microfacet_specular.glsl" + + + + -vec3 mx_environment_irradiance(vec3 N) -{ - return vec3(0.0); -} -#define M_PI 3.1415926535897932 -#define M_PI_INV (1.0 / M_PI) + + + + + + + + + + + -float mx_pow5(float x) -{ - return mx_square(mx_square(x)) * x; -} + + + + + + + + + + + + + + + -float mx_pow6(float x) -{ - float x2 = mx_square(x); - return mx_square(x2) * x2; -} + + + + + + + + + + + -// Standard Schlick Fresnel -float mx_fresnel_schlick(float cosTheta, float F0) -{ - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return F0 + (1.0 - F0) * x5; -} -vec3 mx_fresnel_schlick(float cosTheta, vec3 F0) -{ - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return F0 + (1.0 - F0) * x5; -} + + + + + + + + + + + + + + + -// Generalized Schlick Fresnel -float mx_fresnel_schlick(float cosTheta, float F0, float F90) -{ - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return mix(F0, F90, x5); -} -vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90) -{ - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return mix(F0, F90, x5); -} + + + + + + + + + + + -// Generalized Schlick Fresnel with a variable exponent -float mx_fresnel_schlick(float cosTheta, float F0, float F90, float exponent) -{ - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - return mix(F0, F90, pow(x, exponent)); -} -vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90, float exponent) -{ - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - return mix(F0, F90, pow(x, exponent)); -} + + + + + + + + + + + + + + + -// Enforce that the given normal is forward-facing from the specified view direction. -vec3 mx_forward_facing_normal(vec3 N, vec3 V) -{ - return (dot(N, V) < 0.0) ? -N : N; -} + + + + + + + + + + + + + + + + -// https://www.graphics.rwth-aachen.de/publication/2/jgt.pdf -float mx_golden_ratio_sequence(int i) -{ - const float GOLDEN_RATIO = 1.6180339887498948; - return fract((float(i) + 1.0) * GOLDEN_RATIO); -} + + + + + + + + + + + + + + + -// https://people.irisa.fr/Ricardo.Marques/articles/2013/SF_CGF.pdf -vec2 mx_spherical_fibonacci(int i, int numSamples) -{ - return vec2((float(i) + 0.5) / float(numSamples), mx_golden_ratio_sequence(i)); -} + + + + + + + + + + + + + + -// Generate a uniform-weighted sample in the unit hemisphere. -vec3 mx_uniform_sample_hemisphere(vec2 Xi) -{ - float phi = 2.0 * M_PI * Xi.x; - float cosTheta = 1.0 - Xi.y; - float sinTheta = sqrt(1.0 - mx_square(cosTheta)); - return vec3(cos(phi) * sinTheta, - sin(phi) * sinTheta, - cosTheta); -} -#include "mx_microfacet_sheen.glsl" -#include "mx_microfacet_specular.glsl" + + + + + + + + + + + + + + + -vec3 mx_generate_dir_albedo_table() -{ - vec2 uv = gl_FragCoord.xy / $albedoTableSize; - vec2 ggxDirAlbedo = mx_ggx_dir_albedo(uv.x, uv.y, vec3(1, 0, 0), vec3(0, 1, 0)).xy; - float sheenDirAlbedo = mx_imageworks_sheen_dir_albedo(uv.x, uv.y); - return vec3(ggxDirAlbedo, sheenDirAlbedo); -} -#include "mx_microfacet_specular.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) -{ - // Generate tangent frame. - X = normalize(X - dot(X, N) * N); - vec3 Y = cross(N, X); - mat3 tangentToWorld = mat3(X, Y, N); + + + + + + + + + + + + + + + - // Transform the view vector to tangent space. - V = vec3(dot(V, X), dot(V, Y), dot(V, N)); + + + + + + + + + + + + + + + + - // Compute derived properties. - float NdotV = clamp(V.z, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(alpha); - float G1V = mx_ggx_smith_G1(NdotV, avgAlpha); - - // Integrate outgoing radiance using filtered importance sampling. - // http://cgg.mff.cuni.cz/~jaroslav/papers/2008-egsr-fis/2008-egsr-fis-final-embedded.pdf - vec3 radiance = vec3(0.0); - int envRadianceSamples = $envRadianceSamples; - for (int i = 0; i < envRadianceSamples; i++) - { - vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); + + + + + + + + + + + + + + + - // Compute the half vector and incoming light direction. - vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, alpha); - vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, H, fd.ior.x) : -reflect(V, H); - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + + + + + + + + + + + + + + + + + - // Sample the environment light from the given direction. - vec3 Lw = tangentToWorld * L; - float pdf = mx_ggx_NDF(H, alpha) * G1V / (4.0 * NdotV); - float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); - vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); + + + + + + + + + + + + + + + - // Compute the Fresnel term. - vec3 F = mx_compute_fresnel(VdotH, fd); + + + + + + + + + + + + + + + + + + + + - // Compute the geometric term. - float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + + + + + + + + + + + + + + - // Compute the combined FG term, which is inverted for refraction. - vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; + + + + + + + + + + + + + + + + - // Add the radiance contribution of this sample. - // From https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf - // incidentLight = sampleColor * NdotL - // microfacetSpecular = D * F * G / (4 * NdotL * NdotV) - // pdf = D * G1V / (4 * NdotV); - // radiance = incidentLight * microfacetSpecular / pdf - radiance += sampleColor * FG; - } - - // Apply the global component of the geometric term and normalize. - radiance /= G1V * float(envRadianceSamples); + + + + + + + + + + + + + + + - // Return the final radiance. - return radiance; -} + + + + -// Construct an orthonormal basis from a unit vector. -// https://graphics.pixar.com/library/OrthonormalB/paper.pdf -mat3 mx_orthonormal_basis(vec3 N) -{ - float sign = (N.z < 0.0) ? -1.0 : 1.0; - float a = -1.0 / (sign + N.z); - float b = N.x * N.y * a; - vec3 X = vec3(1.0 + sign * N.x * N.x * a, sign * b, -sign * N.x); - vec3 Y = vec3(b, sign + N.y * N.y * a, -N.y); - return mat3(X, Y, N); -} + + + -// The inverse of mx_latlong_projection. -vec3 mx_latlong_map_projection_inverse(vec2 uv) -{ - float latitude = (uv.y - 0.5) * M_PI; - float longitude = (uv.x - 0.5) * M_PI * 2.0; + + + + + + + + - float x = -cos(latitude) * sin(longitude); - float y = -sin(latitude); - float z = cos(latitude) * cos(longitude); + + + + + + + - return vec3(x, y, z); -} + + + + + + + + + + + -vec3 mx_generate_prefilter_env() + +void mx_point_light(LightData light, vec3 position, out lightshader result) { - // The tangent view vector is aligned with the normal. - vec3 V = vec3(0.0, 0.0, 1.0); - float NdotV = 1.0; - - // Compute derived properties. - vec2 uv = gl_FragCoord.xy * pow(2.0, $envPrefilterMip) / vec2(textureSize($envRadiance, 0)); - vec3 worldN = mx_latlong_map_projection_inverse(uv); - mat3 tangentToWorld = mx_orthonormal_basis(worldN); - float alpha = mx_latlong_lod_to_alpha(float($envPrefilterMip)); - float G1V = mx_ggx_smith_G1(NdotV, alpha); - - // Integrate the LD term for the given environment and alpha. - vec3 radiance = vec3(0.0, 0.0, 0.0); - float weight = 0.0; - int envRadianceSamples = 1024; - for (int i = 0; i < envRadianceSamples; i++) - { - vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); - - // Compute the half vector and incoming light direction. - vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); - vec3 L = -V + 2.0 * H.z * H; - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; +} + + - // Compute the geometric term. - float G = mx_ggx_smith_G2(NdotL, NdotV, alpha); + + - // Sample the environment light from the given direction. - vec3 Lw = tangentToWorld * L; - float pdf = mx_ggx_NDF(H, vec2(alpha)) * G1V / (4.0 * NdotV); - float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); - vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); + + - // Add the radiance contribution of this sample. - radiance += G * sampleColor; - weight += G; - } + + - return radiance / weight; + +void mx_directional_light(LightData light, vec3 position, out lightshader result) +{ + result.direction = -light.direction; + result.intensity = light.color * light.intensity; } -// https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps -float mx_variance_shadow_occlusion(vec2 moments, float fragmentDepth) +void mx_spot_light(LightData light, vec3 position, out lightshader result) { - const float MIN_VARIANCE = 0.00001; + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; + float low = min(light.inner_angle, light.outer_angle); + float high = light.inner_angle; + float cosDir = dot(result.direction, -light.direction); + float spotAttenuation = smoothstep(low, high, cosDir); + result.intensity *= spotAttenuation; +} +void mx_directional_light(LightData light, float3 position, thread lightshader& result) +{ + result.direction = -light.direction; + result.intensity = light.color * light.intensity; +} +void mx_point_light(LightData light, float3 position, thread lightshader& result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; +} + + - // One-tailed inequality valid if fragmentDepth > moments.x. - float p = (fragmentDepth <= moments.x) ? 1.0 : 0.0; + + - // Compute variance. - float variance = moments.y - mx_square(moments.x); - variance = max(variance, MIN_VARIANCE); + + - // Compute probabilistic upper bound. - float d = fragmentDepth - moments.x; - float pMax = variance / (variance + mx_square(d)); - return max(p, pMax); -} + + -vec2 mx_compute_depth_moments() + +void mx_spot_light(LightData light, float3 position, thread lightshader& result) { - float depth = gl_FragCoord.z; - return vec2(depth, mx_square(depth)); + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; + float low = min(light.inner_angle, light.outer_angle); + float high = light.inner_angle; + float cosDir = dot(result.direction, -light.direction); + float spotAttenuation = smoothstep(low, high, cosDir); + result.intensity *= spotAttenuation; } @@ -4066,4899 +3658,439 @@ vec2 mx_compute_depth_moments() Copyright Contributors to the MaterialX Project SPDX-License-Identifier: Apache-2.0 - Declarations of standard data types and nodes included in the MaterialX specification. + Graph definitions of standard nodes included in the MaterialX specification. --> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + - + - - - - - - - - - + - + - - - - - + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -12199,4181 +7331,8421 @@ vec2 mx_compute_depth_moments() - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - + - - - - - - - + + + + + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - - - - + + + + + + - - - - + + + + - - - + + + - + - - - + + + - + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void mx_time_float(float fps, output float result) -{ - float frame; - getattribute("frame", frame); - result = frame / fps; -} -void mx_fractal3d_vector4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result) -{ - vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} -void mx_worleynoise2d_vector2(vector2 texcoord, float jitter, output vector2 result) -{ - result = mx_worley_noise_vector2(texcoord, jitter, 0); -} -void mx_disjointover_color4(color4 fg, color4 bg, float mix, output color4 result) -{ - float summedAlpha = fg.a + bg.a; - - if (summedAlpha <= 1) - { - result.rgb = fg.rgb + bg.rgb; - } - else - { - if (abs(bg.a) < M_FLOAT_EPS) - { - result.rgb = 0.0; - } - else - { - float x = (1 - fg.a) / bg.a; - result.rgb = fg.rgb + bg.rgb * x; - } - } - result.a = min(summedAlpha, 1.0); - - result.rgb = result.rgb * mix + (1.0 - mix) * bg.rgb; - result.a = result.a * mix + (1.0 - mix) * bg.a; -} -matrix rotationMatrix(vector axis, float angle) -{ - vector nAxis = normalize(axis); - float s = sin(angle); - float c = cos(angle); - float oc = 1.0 - c; - - return matrix(oc * nAxis[0] * nAxis[0] + c, oc * nAxis[0] * nAxis[1] - nAxis[2] * s, oc * nAxis[2] * nAxis[0] + nAxis[1] * s, 0.0, - oc * nAxis[0] * nAxis[1] + nAxis[2] * s, oc * nAxis[1] * nAxis[1] + c, oc * nAxis[1] * nAxis[2] - nAxis[0] * s, 0.0, - oc * nAxis[2] * nAxis[0] - nAxis[1] * s, oc * nAxis[1] * nAxis[2] + nAxis[0] * s, oc * nAxis[2] * nAxis[2] + c, 0.0, - 0.0, 0.0, 0.0, 1.0); -} - -void mx_rotate_vector3(vector _in, float amount, vector axis, output vector result) -{ - float rotationRadians = radians(amount); - matrix m = rotationMatrix(axis, rotationRadians); - vector4 trans = transform(m, vector4(_in[0], _in[1], _in[2], 1.0)); - result = vector(trans.x, trans.y, trans.z); -} -void mx_noise2d_vector2(vector2 amplitude, float pivot, vector2 texcoord, output vector2 result) -{ - vector2 value = mx_noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} -void mx_worleynoise3d_vector3(vector position, float jitter, output vector result) -{ - result = mx_worley_noise_vector3(position, jitter, 0); -} -void mx_luminance_color3(color in, color lumacoeffs, output color result) -{ - result = dot(in, lumacoeffs); -} -void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, output surfaceshader result) -{ - result.bsdf = mix(bg.bsdf, fg.bsdf, w); - result.edf = mix(bg.edf, fg.edf, w); - result.opacity = mix(bg.opacity, fg.opacity, w); -} -#include "lib/$fileTransformUv" - -void mx_image_vector3(textureresource file, string layer, vector default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } - - color missingColor = default_value; - vector2 st = mx_transform_uv(texcoord); - out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); -} -void mx_rotate_vector2(vector2 _in, float amount, output vector2 result) -{ - float rotationRadians = radians(amount); - float sa = sin(rotationRadians); - float ca = cos(rotationRadians); - result = vector2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y); -} -#include "lib/$fileTransformUv" - -void mx_image_vector4(textureresource file, string layer, vector4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector4 out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } - - color missingColor = color(default_value.x, default_value.y, default_value.z); - float missingAlpha = default_value.w; - vector2 st = mx_transform_uv(texcoord); - float alpha; - color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, - "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - out = vector4(rgb[0], rgb[1], rgb[2], alpha); -} -void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vector position, output float result) -{ - float f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + - - - + + + + + + - - + + + + + + + - - - + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - + + + + + + + + + - - - + + + + + + + + + - - - - + + + + + + - - - - - - - - - - + + + + + + + - - - + + + + + + + + + + - - + + + + + - - + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + - - - - - + + + + + - - - - - - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - - - - + + + + + + + - - - + + + + + + + - - - + + + + + + + - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - + Declarations for MDL implementations of standard nodes included in the MaterialX specification. + --> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + - + - - - - - - - + + + + + + + + + + + + + + + + + + + - - + + + + + - + - - - - - - - - - - - - - - - - - - -#include "mx_dodge_float.osl" - -void mx_dodge_color4(color4 fg , color4 bg , float mix , output color4 result) -{ - mx_dodge_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); - mx_dodge_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); - mx_dodge_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); - mx_dodge_float(fg.a, bg.a, mix, result.a); -} -void mx_premult_color4(color4 in, output color4 result) -{ - result = color4(in.rgb * in.a, in.a); -} -void mx_hsvtorgb_color4(color4 _in, output color4 result) -{ - result = color4(transformc("hsv","rgb", _in.rgb), 1.0); -} -void mx_geompropvalue_color(string geomprop, color defaultVal, output color out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_geompropvalue_vector2(string geomprop, vector2 defaultVal, output vector2 out) -{ - float value[2]; - if (getattribute(geomprop, value) == 0) - { - out = defaultVal; - } - else - { - out.x = value[0]; - out.y = value[1]; - } -} -void mx_geompropvalue_vector4(string geomprop, vector4 defaultVal, output vector4 out) -{ - float value[4]; - if (getattribute(geomprop, value) == 0) - { - out = defaultVal; - } - else - { - out.x = value[0]; - out.y = value[1]; - out.z = value[2]; - out.w = value[3]; - } -} -void mx_surface_unlit(float emission_weight, color emission_color, float transmission_weight, color transmission_color, float opacity, output surfaceshader result) -{ - float trans = clamp(transmission_weight, 0.0, 1.0); - result.bsdf = trans * transmission_color * transparent(); - result.edf = (1.0 - trans) * emission_weight * emission_color * emission(); - result.opacity = clamp(opacity, 0.0, 1.0); -} -void mx_creatematrix_vector3_matrix33(vector in1, vector in2, vector in3, output matrix result) -{ - result = matrix(in1.x, in1.y, in1.z, 0.0, - in2.x, in2.y, in2.z, 0.0, - in3.x, in3.y, in3.z, 0.0, - 0.0, 0.0, 0.0, 1.0); -} - -void mx_creatematrix_vector3_matrix44(vector in1, vector in2, vector in3, vector in4, output matrix result) -{ - result = matrix(in1.x, in1.y, in1.z, 0.0, - in2.x, in2.y, in2.z, 0.0, - in3.x, in3.y, in3.z, 0.0, - in4.x, in4.y, in4.z, 1.0); -} - -void mx_creatematrix_vector4_matrix44(vector4 in1, vector4 in2, vector4 in3, vector4 in4, output matrix result) -{ - result = matrix(in1.x, in1.y, in1.z, in1.w, - in2.x, in2.y, in2.z, in2.w, - in3.x, in3.y, in3.z, in3.w, - in4.x, in4.y, in4.z, in4.w); -} -void mx_worleynoise2d_vector3(vector2 texcoord, float jitter, output vector result) -{ - result = mx_worley_noise_vector3(texcoord, jitter, 0); -} -void mx_luminance_color4(color4 in, color lumacoeffs, output color4 result) -{ - result = color4(dot(in.rgb, lumacoeffs), in.a); -} -void mx_geompropvalue_integer(string geomprop, int defaultVal, output int out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_frame_float(output float result) -{ - getattribute("frame", result); -} -void mx_hsvtorgb_color3(vector _in, output vector result) -{ - result = transformc("hsv","rgb", _in); -} -#include "lib/$fileTransformUv" + + + + + + + + + + + + + -void mx_image_vector2(textureresource file, string layer, vector2 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector2 out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + + + + + + - color missingColor = color(default_value.x, default_value.y, 0.0); - vector2 st = mx_transform_uv(texcoord); - color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); - out.x = rgb[0]; - out.y = rgb[1]; -} -void mx_unpremult_color4(color4 in, output color4 result) -{ - result = color4(in.rgb / in.a, in.a); -} -void mx_geomcolor_color3(int index, output color result) -{ - getattribute("color", result); -} -void mx_noise3d_float(float amplitude, float pivot, vector position, output float result) -{ - float value = noise("snoise", position); - result = value * amplitude + pivot; -} -#include "mx_burn_float.osl" + + + + + + + -void mx_burn_color4(color4 fg, color4 bg, float mix, output color4 result) -{ - mx_burn_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); - mx_burn_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); - mx_burn_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); - mx_burn_float(fg.a, bg.a, mix, result.a); -} -void mx_worleynoise2d_float(vector2 texcoord, float jitter, output float result) -{ - result = mx_worley_noise_float(texcoord, jitter, 0); -} -void mx_worleynoise3d_vector2(vector position, float jitter, output vector2 result) -{ - result = mx_worley_noise_vector2(position, jitter, 0); -} -#include "lib/$fileTransformUv" + + + + + + + -void mx_image_color3(textureresource file, string layer, color default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + + + + + + - color missingColor = default_value; - vector2 st = mx_transform_uv(texcoord); - out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); -} -void mx_normalmap_vector2(vector value, string map_space, vector2 normal_scale, vector N, vector U, output vector result) -{ - // Tangent space - if (map_space == "tangent") - { - vector v = value * 2.0 - 1.0; - vector T = normalize(U - dot(U, N) * N); - vector B = normalize(cross(N, T)); - result = normalize(T * v[0] * normal_scale.x + B * v[1] * normal_scale.y + N * v[2]); - } - // Object space - else - { - vector n = value * 2.0 - 1.0; - result = normalize(n); - } -} + + + + + -void mx_normalmap_float(vector value, string map_space, float normal_scale, vector N, vector U, output vector result) -{ - mx_normalmap_vector2(value, map_space, vector2(normal_scale, normal_scale), N, U, result); -} -void mx_geomcolor_float(int index, output float result) -{ - getattribute("color", result); -} -void mx_noise3d_vector3(vector amplitude, float pivot, vector position, output vector result) -{ - vector value = noise("snoise", position); - result = value * amplitude + pivot; -} -#include "mx_burn_float.osl" + + + + + -void mx_burn_color3(color fg, color bg, float mix, output color result) -{ - mx_burn_float(fg[0], bg[0], mix, result[0]); - mx_burn_float(fg[1], bg[1], mix, result[1]); - mx_burn_float(fg[2], bg[2], mix, result[2]); -} -void mx_fractal3d_vector2(vector2 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result) -{ - vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} -void mx_geompropvalue_string(string geomprop, string defaultVal, output string out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_noise2d_float(float amplitude, float pivot, vector2 texcoord, output float result) -{ - float value = noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} -#include "lib/$fileTransformUv" + + + + + -void mx_image_float(textureresource file, string layer, float default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output float out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + - color missingColor = color(default_value); - vector2 st = mx_transform_uv(texcoord); - color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); - out = rgb[0]; -} -void mx_geomcolor_color4(int index, output color4 result) -{ - float value[4]; - getattribute("color", value); - result.rgb[0] = value[0]; - result.rgb[1] = value[1]; - result.rgb[2] = value[2]; - result.a = value[3]; -} -void mx_fractal3d_vector3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result) -{ - vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} -void mx_heighttonormal_vector3(float in, float scale, output vector result) -{ - point htP = P + normalize(N) * in * scale; - result = normalize(calculatenormal(htP)); -} -void mx_cellnoise3d_float(vector position, output float result) -{ - result = cellnoise(position); -} -void mx_noise3d_vector2(vector2 amplitude, float pivot, vector position, output vector2 result) -{ - vector2 value = mx_noise("snoise", position); - result = value * amplitude + pivot; -} -void mx_cellnoise2d_float(vector2 texcoord, output float result) -{ - result = cellnoise(texcoord.x, texcoord.y); -} -void mx_noise2d_vector3(vector amplitude, float pivot, vector2 texcoord, output vector result) -{ - vector value = noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} -void mx_dodge_float(float fg, float bg, float mix, output float out) -{ - if (abs(1.0 - fg) < M_FLOAT_EPS) - { - out = 0.0; - return; - } - out = mix*(bg / (1.0 - fg)) + ((1.0-mix)*bg); -} -void mx_noise3d_vector4(vector4 amplitude, float pivot, vector position, output vector4 result) -{ - vector4 value = mx_noise("snoise", position); - result = value * amplitude + pivot; -} -void mx_geompropvalue_color4(string geomprop, color4 defaultVal, output color4 out) -{ - float value[4]; - if (getattribute(geomprop, value) == 0) - { - out.rgb = defaultVal.rgb; - out.a = defaultVal.a; - } - else - { - out.rgb[0] = value[0]; - out.rgb[1] = value[1]; - out.rgb[2] = value[2]; - out.a = value[3]; - } -} -#include "lib/$fileTransformUv" + + + + + + + + + + + + + + + + -void mx_image_color4(textureresource file, string layer, color4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color4 out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + - color missingColor = default_value.rgb; - float missingAlpha = default_value.a; - vector2 st = mx_transform_uv(texcoord); - float alpha; - color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, - "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); + + + - out = color4(rgb, alpha); -} -void mx_transformmatrix_vector2M3(vector2 val, matrix m, output vector2 result) -{ - point res = transform(m, point(val.x, val.y, 1.0)); - result.x = res[0]; - result.y = res[1]; -} -void mx_geompropvalue_boolean(string geomprop, int defaultVal, output int out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_burn_float(float fg, float bg, float mix, output float result) -{ - if (abs(fg) < M_FLOAT_EPS) - { - result = 0.0; - return; - } - result = mix*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mix)*bg); -} -void mx_noise2d_vector4(vector4 amplitude, float pivot, vector2 texcoord, output vector4 result) -{ - vector4 value = mx_noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} -#include "mx_dodge_float.osl" + + -void mx_dodge_color3(color fg, color bg, float mix, output color result) -{ - mx_dodge_float(fg[0], bg[0], mix, result[0]); - mx_dodge_float(fg[1], bg[1], mix, result[1]); - mx_dodge_float(fg[2], bg[2], mix, result[2]); -} -void mx_rgbtohsv_color3(vector _in, output vector result) -{ - result = transformc("rgb","hsv", _in); -} -void mx_rgbtohsv_color4(color4 _in, output color4 result) -{ - result = color4(transformc("rgb","hsv", _in.rgb), 1.0); -} -void mx_worleynoise3d_float(vector position, float jitter, output float result) -{ - result = mx_worley_noise_float(position, jitter, 0); -} -void mx_geompropvalue_vector(string geomprop, vector defaultVal, output vector out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_ambientocclusion_float(float coneangle, float maxdistance, output float result) -{ - // This node is a stub and does not currently operate to specification - result = 0; -} -void mx_geompropvalue_float(string geomprop, float defaultVal, output float result) -{ - if (getattribute(geomprop, result) == 0) - { - result = defaultVal; - } -} -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE -// -// MaterialX specification (c) 2017 Lucasfilm Ltd. -// http://www.materialx.org/ + + -#pragma once + + -#include "color4.h" -#include "vector2.h" -#include "vector4.h" -#include "matrix33.h" + + -// -// Support functions for OSL implementations of the MaterialX nodes. -// + + + -float mx_ternary(int expr, float v1, float v2) { if (expr) return v1; else return v2; } -color mx_ternary(int expr, color v1, color v2) { if (expr) return v1; else return v2; } -color4 mx_ternary(int expr, color4 v1, color4 v2) { if (expr) return v1; else return v2; } -vector mx_ternary(int expr, vector v1, vector v2) { if (expr) return v1; else return v2; } -vector2 mx_ternary(int expr, vector2 v1, vector2 v2) { if (expr) return v1; else return v2; } -vector4 mx_ternary(int expr, vector4 v1, vector4 v2) { if (expr) return v1; else return v2; } -matrix mx_ternary(int expr, matrix v1, matrix v2) { if (expr) return v1; else return v2; } -matrix33 mx_ternary(int expr, matrix33 v1, matrix33 v2) { if (expr) return v1; else return v2; } + + + + + + + + + + + + + + + + + + -matrix33 mx_add(matrix33 a, matrix33 b) -{ - return matrix33(matrix( - a.m[0][0]+b.m[0][0], a.m[0][1]+b.m[0][1], a.m[0][2]+b.m[0][2], 0.0, - a.m[1][0]+b.m[1][0], a.m[1][1]+b.m[1][1], a.m[1][2]+b.m[1][2], 0.0, - a.m[2][0]+b.m[2][0], a.m[2][1]+b.m[2][1], a.m[2][2]+b.m[2][2], 0.0, - 0.0, 0.0, 0.0, 1.0)); -} + + -matrix33 mx_add(matrix33 a, float b) -{ - return matrix33(matrix( - a.m[0][0]+b, a.m[0][1]+b, a.m[0][2]+b, 0.0, - a.m[1][0]+b, a.m[1][1]+b, a.m[1][2]+b, 0.0, - a.m[2][0]+b, a.m[2][1]+b, a.m[2][2]+b, 0.0, - 0.0, 0.0, 0.0, 1.0)); -} + + -matrix mx_add(matrix a, matrix b) -{ - return matrix( - a[0][0]+b[0][0], a[0][1]+b[0][1], a[0][2]+b[0][2], a[0][3]+b[0][3], - a[1][0]+b[1][0], a[1][1]+b[1][1], a[1][2]+b[1][2], a[1][3]+b[1][3], - a[2][0]+b[2][0], a[2][1]+b[2][1], a[2][2]+b[2][2], a[2][3]+b[2][3], - a[3][0]+b[3][0], a[3][1]+b[3][1], a[3][2]+b[3][2], a[3][3]+b[3][3]); -} + + + -matrix mx_add(matrix a, float b) -{ - return matrix( - a[0][0]+b, a[0][1]+b, a[0][2]+b, a[0][3]+b, - a[1][0]+b, a[1][1]+b, a[1][2]+b, a[1][3]+b, - a[2][0]+b, a[2][1]+b, a[2][2]+b, a[2][3]+b, - a[3][0]+b, a[3][1]+b, a[3][2]+b, a[3][3]+b); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -matrix33 mx_subtract(matrix33 a, matrix33 b) -{ - return matrix33(matrix( - a.m[0][0]-b.m[0][0], a.m[0][1]-b.m[0][1], a.m[0][2]-b.m[0][2], 0.0, - a.m[1][0]-b.m[1][0], a.m[1][1]-b.m[1][1], a.m[1][2]-b.m[1][2], 0.0, - a.m[2][0]-b.m[2][0], a.m[2][1]-b.m[2][1], a.m[2][2]-b.m[2][2], 0.0, - 0.0, 0.0, 0.0, 1.0)); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -matrix33 mx_subtract(matrix33 a, float b) -{ - return matrix33(matrix( - a.m[0][0]-b, a.m[0][1]-b, a.m[0][2]-b, 0.0, - a.m[1][0]-b, a.m[1][1]-b, a.m[1][2]-b, 0.0, - a.m[2][0]-b, a.m[2][1]-b, a.m[2][2]-b, 0.0, - 0.0, 0.0, 0.0, 1.0)); -} + + + + + + + -matrix mx_subtract(matrix a, matrix b) -{ - return matrix( - a[0][0]-b[0][0], a[0][1]-b[0][1], a[0][2]-b[0][2], a[0][3]-b[0][3], - a[1][0]-b[1][0], a[1][1]-b[1][1], a[1][2]-b[1][2], a[1][3]-b[1][3], - a[2][0]-b[2][0], a[2][1]-b[2][1], a[2][2]-b[2][2], a[2][3]-b[2][3], - a[3][0]-b[3][0], a[3][1]-b[3][1], a[3][2]-b[3][2], a[3][3]-b[3][3]); -} + + + + + + + + -matrix mx_subtract(matrix a, float b) -{ - return matrix( - a[0][0]-b, a[0][1]-b, a[0][2]-b, a[0][3]-b, - a[1][0]-b, a[1][1]-b, a[1][2]-b, a[1][3]-b, - a[2][0]-b, a[2][1]-b, a[2][2]-b, a[2][3]-b, - a[3][0]-b, a[3][1]-b, a[3][2]-b, a[3][3]-b); -} + + + + + + + + + + + + + + + + -float mx_remap(float in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - float x = (in - inLow)/(inHigh-inLow); - if (doClamp == 1) { - x = clamp(x, 0, 1); - } - return outLow + (outHigh - outLow) * x; -} + + + + + + + + + + + + -color mx_remap(color in, color inLow, color inHigh, color outLow, color outHigh, int doClamp) -{ - color x = (in - inLow) / (inHigh - inLow); - if (doClamp == 1) { - x = clamp(x, 0, 1); - } - return outLow + (outHigh - outLow) * x; -} + + + + + + + -color mx_remap(color in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - color x = (in - inLow) / (inHigh - inLow); - if (doClamp == 1) { - x = clamp(x, 0, 1); - } - return outLow + (outHigh - outLow) * x; -} + + + + + + -color4 mx_remap(color4 c, color4 inLow, color4 inHigh, color4 outLow, color4 outHigh, int doClamp) -{ - return color4(mx_remap(c.rgb, inLow.rgb, inHigh.rgb, outLow.rgb, outHigh.rgb, doClamp), - mx_remap(c.a, inLow.a, inHigh.a, outLow.a, outHigh.a, doClamp)); -} + + + + + + -color4 mx_remap(color4 c, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - color4 c4_inLow = color4(color(inLow), inLow); - color4 c4_inHigh = color4(color(inHigh), inHigh); - color4 c4_outLow = color4(color(outLow), outLow); - color4 c4_outHigh = color4(color(outHigh), outHigh); - return mx_remap(c, c4_inLow, c4_inHigh, c4_outLow, c4_outHigh, doClamp); -} + + + + + + -vector2 mx_remap(vector2 in, vector2 inLow, vector2 inHigh, vector2 outLow, vector2 outHigh, int doClamp) -{ - return vector2(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp), - mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp)); -} + + + + + -vector2 mx_remap(vector2 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - return vector2(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp), - mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp)); -} + + + + + -vector4 mx_remap(vector4 in, vector4 inLow, vector4 inHigh, vector4 outLow, vector4 outHigh, int doClamp) -{ - return vector4(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp), - mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp), - mx_remap(in.z, inLow.z, inHigh.z, outLow.z, outHigh.z, doClamp), - mx_remap(in.w, inLow.w, inHigh.w, outLow.w, outHigh.w, doClamp)); -} + + + + + -vector4 mx_remap(vector4 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - return vector4(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp), - mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp), - mx_remap(in.z, inLow, inHigh, outLow, outHigh, doClamp), - mx_remap(in.w, inLow, inHigh, outLow, outHigh, doClamp)); -} + + + + + + + + + + + + + + + + + + + -float mx_contrast(float in, float amount, float pivot) -{ - float out = in - pivot; - out *= amount; - out += pivot; - return out; -} + + + + + + + + + + + + -color mx_contrast(color in, color amount, color pivot) -{ - color out = in - pivot; - out *= amount; - out += pivot; - return out; -} + + + + + + + + + + + + -color mx_contrast(color in, float amount, float pivot) -{ - color out = in - pivot; - out *= amount; - out += pivot; - return out; -} + + + + -color4 mx_contrast(color4 c, color4 amount, color4 pivot) -{ - return color4(mx_contrast(c.rgb, amount.rgb, pivot.rgb), - mx_contrast(c.a, amount.a, pivot.a)); -} + + + + -color4 mx_contrast(color4 c, float amount, float pivot) -{ - return mx_contrast(c, color4(color(amount), amount), color4(color(pivot), pivot)); -} + + + + -vector2 mx_contrast(vector2 in, vector2 amount, vector2 pivot) -{ - return vector2 (mx_contrast(in.x, amount.x, pivot.x), - mx_contrast(in.y, amount.y, pivot.y)); -} + + -vector2 mx_contrast(vector2 in, float amount, float pivot) -{ - return mx_contrast(in, vector2(amount, amount), vector2(pivot, pivot)); -} + + -vector4 mx_contrast(vector4 in, vector4 amount, vector4 pivot) -{ - return vector4(mx_contrast(in.x, amount.x, pivot.x), - mx_contrast(in.y, amount.y, pivot.y), - mx_contrast(in.z, amount.z, pivot.z), - mx_contrast(in.w, amount.w, pivot.w)); -} + + -vector4 mx_contrast(vector4 in, float amount, float pivot) -{ - return vector4(mx_contrast(in.x, amount, pivot), - mx_contrast(in.y, amount, pivot), - mx_contrast(in.z, amount, pivot), - mx_contrast(in.w, amount, pivot)); -} + + + + + + + -vector2 mx_noise(string noisetype, float x, float y) -{ - color cnoise = (color) noise(noisetype, x, y); - return vector2 (cnoise[0], cnoise[1]); -} + + + -color4 mx_noise(string noisetype, float x, float y) -{ - color cnoise = (color) noise(noisetype, x, y); - float fnoise = (float) noise(noisetype, x + 19, y + 73); - return color4 (cnoise, fnoise); -} + + + -vector4 mx_noise(string noisetype, float x, float y) -{ - color cnoise = (color) noise(noisetype, x, y); - float fnoise = (float) noise(noisetype, x + 19, y + 73); - return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise); -} + + + -vector2 mx_noise(string noisetype, point position) -{ - color cnoise = (color) noise(noisetype, position); - return vector2 (cnoise[0], cnoise[1]); -} + + -color4 mx_noise(string noisetype, point position) -{ - color cnoise = (color) noise(noisetype, position); - float fnoise = (float) noise(noisetype, position+vector(19,73,29)); - return color4 (cnoise, fnoise); -} + + -vector4 mx_noise(string noisetype, point position) -{ - color cnoise = (color) noise(noisetype, position); - float fnoise = (float) noise(noisetype, position+vector(19,73,29)); - return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise); -} + + + + -float mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) -{ - float out = 0; - float amp = 1.0; - point p = position; + + + + + + + + + + + + - for (int i = 0; i < octaves; i += 1) { - out += amp * noise(noisetype, p); - amp *= diminish; - p *= lacunarity; - } - return out; -} + + + + + -color mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) -{ - color out = 0; - float amp = 1.0; - point p = position; + - for (int i = 0; i < octaves; i += 1) { - out += amp * (color)noise(noisetype, p); - amp *= diminish; - p *= lacunarity; - } - return out; -} + + + -vector2 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) -{ - return vector2((float) mx_fbm(position, octaves, lacunarity, diminish, noisetype), - (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype)); -} + + + -color4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) -{ - color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype); - float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype); - return color4 (c, f); -} + + + -vector4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) -{ - color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype); - float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype); - return vector4 (c[0], c[1], c[2], f); -} + + + + + -void mx_split_float(output float x, output int ix) -{ - ix = int(floor(x)); - x -= ix; -} + + -float mx_worley_distance(vector2 p, int x, int y, int X, int Y, float jitter, int metric) -{ - vector o = cellnoise(x+X, y+Y); - o = (o - .5)*jitter + .5; - float cposx = x + o[0]; - float cposy = y + o[1]; - float diffx = cposx - p.x; - float diffy = cposy - p.y; + + + + - if (metric == 2) - return abs(diffx) + abs(diffy); // Manhattan distance - if (metric == 3) - return max(abs(diffx), abs(diffy)); // Chebyshev distance - return diffx*diffx + diffy*diffy; // Euclidean or distance^2 -} + + + + -float mx_worley_distance(vector p, int x, int y, int z, int X, int Y, int Z, float jitter, int metric) -{ - vector o = cellnoise(vector(x+X, y+Y, z+Z)); - o = (o - .5)*jitter + .5; - vector cpos = vector(x, y, z) + o; - vector diff = cpos - p; + + + + - if (metric == 2) - return abs(diff[0]) + abs(diff[1]); // Manhattan distance - if (metric == 3) - return max(abs(diff[0]), abs(diff[1])); // Chebyshev distance - return dot(diff, diff); // Eucldean or distance^2 -} + + + + -void mx_sort_distance(float dist, output vector2 result) -{ - if (dist < result.x) - { - result.y = result.x; - result.x = dist; - } - else if (dist < result.y) - { - result.y = dist; - } -} + + + + -void mx_sort_distance(float dist, output vector result) -{ - if (dist < result[0]) - { - result[2] = result[1]; - result[1] = result[0]; - result[0] = dist; - } - else if (dist < result[1]) - { - result[2] = result[1]; - result[1] = dist; - } - else if (dist < result[2]) - { - result[2] = dist; - } -} + + + + -float mx_worley_noise_float(vector2 p, float jitter, int metric) -{ - int X, Y; - vector2 seed = p; - float result = 1e6; + + - mx_split_float(seed.x, X); - mx_split_float(seed.y, Y); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); - result = min(result, d); - } - } - if (metric == 0) - result = sqrt(result); - return result; -} + + -vector2 mx_worley_noise_vector2(vector2 p, float jitter, int metric) -{ - int X, Y; - vector2 seed = p; - vector2 result = vector2(1e6, 1e6); + + - mx_split_float(seed.x, X); - mx_split_float(seed.y, Y); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); - mx_sort_distance(d, result); - } - } - if (metric == 0) - result = sqrt(result); - return result; -} + + -vector mx_worley_noise_vector3(vector2 p, float jitter, int metric) -{ - int X, Y; - vector2 seed = p; - vector result = vector(1e6, 1e6, 1e6); + + - mx_split_float(seed.x, X); - mx_split_float(seed.y, Y); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); - mx_sort_distance(d, result); - } - } - if (metric == 0) - result = sqrt(result); - return result; -} + + -float mx_worley_noise_float(vector p, float jitter, int metric) -{ - int X, Y, Z; - vector seed = p; - float result = 1e6; + + + + - mx_split_float(seed[0], X); - mx_split_float(seed[1], Y); - mx_split_float(seed[2], Z); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); - result = min(result, d); - } - } - } - if (metric == 0) - result = sqrt(result); - return result; -} + + + + -vector2 mx_worley_noise_vector2(vector p, float jitter, int metric) -{ - int X, Y, Z; - vector seed = p; - vector2 result = vector2(1e6, 1e6); + + + + + + + + + + + + + + + - mx_split_float(seed[0], X); - mx_split_float(seed[1], Y); - mx_split_float(seed[2], Z); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); - mx_sort_distance(d, result); - } - } - } - if (metric == 0) - result = sqrt(result); - return result; -} + + + -vector mx_worley_noise_vector3(vector p, float jitter, int metric) -{ - int X, Y, Z; - vector result = 1e6; - vector seed = p; + + + + + + + + + + + + + + + + + + + - mx_split_float(seed[0], X); - mx_split_float(seed[1], Y); - mx_split_float(seed[2], Z); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); - mx_sort_distance(d, result); - } - } - } - if (metric == 0) - result = sqrt(result); - return result; -} -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -#pragma once -#define VECTOR4_H + + + + + + -// vector4 is a 4D vector -struct vector4 -{ - float x; - float y; - float z; - float w; -}; + + + + + + + + + + + + + -// -// For vector4, define math operators to match vector -// + + + + + + + -vector4 __operator__neg__(vector4 a) + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "mx_aastep.glsl" + +void mx_splitlr_vector2(vec2 valuel, vec2 valuer, float center, vec2 texcoord, out vec2 result) { - return vector4(-a.x, -a.y, -a.z, -a.w); + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); } - -vector4 __operator__add__(vector4 a, vector4 b) +float mx_aastep(float threshold, float value) { - return vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + float afwidth = length(vec2(dFdx(value), dFdy(value))) * 0.70710678118654757; + return smoothstep(threshold-afwidth, threshold+afwidth, value); } - -vector4 __operator__add__(vector4 a, int b) +void mx_dodge_float(float fg, float bg, float mixval, out float result) { - return a + vector4(b, b, b, b); + if (abs(1.0 - fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(bg / (1.0 - fg)) + ((1.0-mixval)*bg); } +#include "mx_aastep.glsl" -vector4 __operator__add__(vector4 a, float b) +void mx_splittb_vector4(vec4 valuet, vec4 valueb, float center, vec2 texcoord, out vec4 result) { - return a + vector4(b, b, b, b); + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); } - -vector4 __operator__add__(int a, vector4 b) +void mx_luminance_color3(vec3 _in, vec3 lumacoeffs, out vec3 result) { - return vector4(a, a, a, a) + b; + result = vec3(dot(_in, lumacoeffs)); } +#include "lib/mx_noise.glsl" -vector4 __operator__add__(float a, vector4 b) +void mx_worleynoise2d_vector2(vec2 texcoord, float jitter, out vec2 result) { - return vector4(a, a, a, a) + b; + result = mx_worley_noise_vec2(texcoord, jitter, 0); } +#include "lib/mx_noise.glsl" -vector4 __operator__sub__(vector4 a, vector4 b) +void mx_fractal3d_vector3(vec3 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec3 result) { - return vector4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + vec3 value = mx_fractal_noise_vec3(position, octaves, lacunarity, diminish); + result = value * amplitude; } +#include "lib/mx_noise.glsl" -vector4 __operator__sub__(vector4 a, int b) +void mx_noise2d_vector4(vec4 amplitude, float pivot, vec2 texcoord, out vec4 result) { - return a - vector4(b, b, b, b); + vec3 xyz = mx_perlin_noise_vec3(texcoord); + float w = mx_perlin_noise_float(texcoord + vec2(19, 73)); + result = vec4(xyz, w) * amplitude + pivot; } - -vector4 __operator__sub__(vector4 a, float b) +void mx_ramptb_vector3(vec3 valuet, vec3 valueb, vec2 texcoord, out vec3 result) { - return a - vector4(b, b, b, b); + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); } +#include "mx_smoothstep_float.glsl" -vector4 __operator__sub__(int a, vector4 b) +void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) { - return vector4(a, a, a, a) - b; + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); } - -vector4 __operator__sub__(float a, vector4 b) +void mx_ramplr_vector2(vec2 valuel, vec2 valuer, vec2 texcoord, out vec2 result) { - return vector4(a, a, a, a) - b; + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); } +#include "lib/mx_noise.glsl" -vector4 __operator__mul__(vector4 a, vector4 b) +void mx_noise2d_float(float amplitude, float pivot, vec2 texcoord, out float result) { - return vector4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + float value = mx_perlin_noise_float(texcoord); + result = value * amplitude + pivot; } +#include "mx_dodge_float.glsl" -vector4 __operator__mul__(vector4 a, int b) +void mx_dodge_color4(vec4 fg , vec4 bg , float mixval, out vec4 result) { - return a * vector4(b, b, b, b); + mx_dodge_float(fg.x, bg.x, mixval, result.x); + mx_dodge_float(fg.y, bg.y, mixval, result.y); + mx_dodge_float(fg.z, bg.z, mixval, result.z); + mx_dodge_float(fg.w, bg.w, mixval, result.w); } +#include "mx_aastep.glsl" -vector4 __operator__mul__(vector4 a, float b) +void mx_splitlr_float(float valuel, float valuer, float center, vec2 texcoord, out float result) { - return a * vector4(b, b, b, b); + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); } +#include "lib/mx_noise.glsl" -vector4 __operator__mul__(int a, vector4 b) +void mx_cellnoise3d_float(vec3 position, out float result) { - return vector4(a, a, a, a) * b; + result = mx_cell_noise_float(position); } +#include "mx_smoothstep_float.glsl" -vector4 __operator__mul__(float a, vector4 b) +void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, out vec3 result) { - return vector4(a, a, a, a) * b; + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); + mx_smoothstep_float(val.z, low.z, high.z, result.z); } +#include "lib/mx_noise.glsl" -vector4 __operator__div__(vector4 a, vector4 b) +void mx_noise3d_vector2(vec2 amplitude, float pivot, vec3 position, out vec2 result) { - return vector4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + vec3 value = mx_perlin_noise_vec3(position); + result = value.xy * amplitude + pivot; } - -vector4 __operator__div__(vector4 a, int b) +void mx_transformmatrix_vector3M4(vec3 val, mat4 transform, out vec3 result) { - float b_inv = 1.0/b; - return a * vector4(b_inv, b_inv, b_inv, b_inv); + vec4 res = transform * vec4(val, 1.0); + result = res.xyz; } +#include "lib/mx_hsv.glsl" -vector4 __operator__div__(vector4 a, float b) +void mx_rgbtohsv_color3(vec3 _in, out vec3 result) { - float b_inv = 1.0/b; - return a * vector4(b_inv, b_inv, b_inv, b_inv); + result = mx_rgbtohsv(_in); } - -vector4 __operator__div__(int a, vector4 b) +void mx_ramplr_vector3(vec3 valuel, vec3 valuer, vec2 texcoord, out vec3 result) { - return vector4(a, a, a, a) / b; + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); } - -vector4 __operator__div__(float a, vector4 b) +void mx_disjointover_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) { - return vector4(a, a, a, a) / b; + float summedAlpha = fg.w + bg.w; + + if (summedAlpha <= 1.0) + { + result.xyz = fg.xyz + bg.xyz; + } + else + { + if (abs(bg.w) < M_FLOAT_EPS) + { + result.xyz = vec3(0.0); + } + else + { + float x = (1.0 - fg.w) / bg.w; + result.xyz = fg.xyz + bg.xyz * x; + } + } + result.w = min(summedAlpha, 1.0); + + result.xyz = result.xyz * mixval + (1.0 - mixval) * bg.xyz; + result.w = result.w * mixval + (1.0 - mixval) * bg.w; } +#include "lib/mx_noise.glsl" -int __operator__eq__(vector4 a, vector4 b) +void mx_cellnoise2d_float(vec2 texcoord, out float result) { - return (a.x == b.x) && (a.y == b.y) && (a.z == b.z) && (a.w == b.w); + result = mx_cell_noise_float(texcoord); } +#include "mx_aastep.glsl" -int __operator__ne__(vector4 a, vector4 b) +void mx_splitlr_vector4(vec4 valuel, vec4 valuer, float center, vec2 texcoord, out vec4 result) { - return (a.x != b.x) || (a.y != b.y) || (a.z != b.z) || (a.w != b.w); + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); } +#include "lib/$fileTransformUv" - - - -// -// For vector4, define most of the stdosl functions to match vector -// - -vector4 abs(vector4 in) +void mx_image_vector2(sampler2D tex_sampler, int layer, vec2 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec2 result) { - return vector4 (abs(in.x), - abs(in.y), - abs(in.z), - abs(in.w)); + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rg; } +#include "mx_dodge_float.glsl" -vector4 ceil(vector4 in) +void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) { - return vector4 (ceil(in.x), - ceil(in.y), - ceil(in.z), - ceil(in.w)); + mx_dodge_float(fg.x, bg.x, mixval, result.x); + mx_dodge_float(fg.y, bg.y, mixval, result.y); + mx_dodge_float(fg.z, bg.z, mixval, result.z); +} +void mx_ramptb_vector2(vec2 valuet, vec2 valueb, vec2 texcoord, out vec2 result) +{ + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); } +#include "lib/mx_hsv.glsl" -vector4 round(vector4 in) +void mx_rgbtohsv_color4(vec4 _in, out vec4 result) { - return vector4 (round(in.x), - round(in.y), - round(in.z), - round(in.w)); + result = vec4(mx_rgbtohsv(_in.rgb), 1.0); } +#include "lib/mx_noise.glsl" -vector4 floor(vector4 in) +void mx_worleynoise3d_float(vec3 position, float jitter, out float result) { - return vector4 (floor(in.x), - floor(in.y), - floor(in.z), - floor(in.w)); + result = mx_worley_noise_float(position, jitter, 0); } +#include "lib/mx_hsv.glsl" -vector4 sqrt(vector4 in) +void mx_hsvtorgb_color3(vec3 _in, out vec3 result) { - return vector4 (sqrt(in.x), - sqrt(in.y), - sqrt(in.z), - sqrt(in.w)); + result = mx_hsvtorgb(_in); } +#include "lib/mx_noise.glsl" -vector4 exp(vector4 in) +void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out float result) { - return vector4 (exp(in.x), - exp(in.y), - exp(in.z), - exp(in.w)); + float value = mx_fractal_noise_float(position, octaves, lacunarity, diminish); + result = value * amplitude; } +#include "lib/mx_noise.glsl" -vector4 log(vector4 in) +void mx_noise3d_vector3(vec3 amplitude, float pivot, vec3 position, out vec3 result) { - return vector4 (log(in.x), - log(in.y), - log(in.z), - log(in.w)); + vec3 value = mx_perlin_noise_vec3(position); + result = value * amplitude + pivot; } - -vector4 log2(vector4 in) +void mx_ramplr_float(float valuel, float valuer, vec2 texcoord, out float result) { - return vector4 (log2(in.x), - log2(in.y), - log2(in.z), - log2(in.w)); + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); } - -vector4 mix(vector4 value1, vector4 value2, float x ) +void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, out surfaceshader returnshader) { - return vector4 (mix( value1.x, value2.x, x), - mix( value1.y, value2.y, x), - mix( value1.z, value2.z, x), - mix( value1.w, value2.w, x)); + returnshader.color = mix(bg.color, fg.color, w); + returnshader.transparency = mix(bg.transparency, fg.transparency, w); } - -vector4 mix(vector4 value1, vector4 value2, vector4 x ) +void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) { - return vector4 (mix( value1.x, value2.x, x.x), - mix( value1.y, value2.y, x.y), - mix( value1.z, value2.z, x.z), - mix( value1.w, value2.w, x.w)); + // Decode the normal map. + value = (value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0; + + // Transform from tangent space if needed. + if (map_space == 0) + { + vec3 B = normalize(cross(N, T)); + value.xy *= normal_scale; + value = T * value.x + B * value.y + N * value.z; + } + + // Normalize the result. + result = normalize(value); } -vector vec4ToVec3(vector4 v) +void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result) { - return vector(v.x, v.y, v.z) / v.w; + mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); } +#include "lib/mx_noise.glsl" -float dot(vector4 a, vector4 b) +void mx_worleynoise2d_vector3(vec2 texcoord, float jitter, out vec3 result) { - return ((a.x * b.x) + (a.y * b.y) + (a.z * b.z) + (a.w * b.w)); + result = mx_worley_noise_vec3(texcoord, jitter, 0); } +#include "mx_aastep.glsl" -float length (vector4 a) +void mx_splittb_vector2(vec2 valuet, vec2 valueb, float center, vec2 texcoord, out vec2 result) { - return sqrt (a.x*a.x + a.y*a.y + a.z*a.z + a.w*a.w); + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); +} +void mx_creatematrix_vector4_matrix44(vec4 in1, vec4 in2, vec4 in3, vec4 in4, out mat4 result) +{ + result = mat4(in1.x, in1.y, in1.z, in1.w, + in2.x, in2.y, in2.z, in2.w, + in3.x, in3.y, in3.z, in3.w, + in4.x, in4.y, in4.z, in4.w); } +#include "lib/mx_noise.glsl" -vector4 smoothstep(vector4 low, vector4 high, vector4 in) +void mx_worleynoise3d_vector2(vec3 position, float jitter, out vec2 result) { - return vector4 (smoothstep(low.x, high.x, in.x), - smoothstep(low.y, high.y, in.y), - smoothstep(low.z, high.z, in.z), - smoothstep(low.w, high.w, in.w)); + result = mx_worley_noise_vec2(position, jitter, 0); } +#include "lib/mx_hsv.glsl" -vector4 smoothstep(float low, float high, vector4 in) +void mx_hsvtorgb_color4(vec4 _in, out vec4 result) { - return vector4 (smoothstep(low, high, in.x), - smoothstep(low, high, in.y), - smoothstep(low, high, in.z), - smoothstep(low, high, in.w)); + result = vec4(mx_hsvtorgb(_in.rgb), 1.0); } +#include "mx_aastep.glsl" -vector4 clamp(vector4 in, vector4 low, vector4 high) +void mx_splittb_float(float valuet, float valueb, float center, vec2 texcoord, out float result) { - return vector4 (clamp(in.x, low.x, high.x), - clamp(in.y, low.y, high.y), - clamp(in.z, low.z, high.z), - clamp(in.w, low.w, high.w)); + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vector4 clamp(vector4 in, float low, float high) -{ - return vector4 (clamp(in.x, low, high), - clamp(in.y, low, high), - clamp(in.z, low, high), - clamp(in.w, low, high)); -} + + -vector4 max(vector4 a, vector4 b) -{ - return vector4 (max(a.x, b.x), - max(a.y, b.y), - max(a.z, b.z), - max(a.w, b.w)); -} + + -vector4 max(vector4 a, float b) -{ - return max(a, vector4(b, b, b, b)); -} + + -vector4 normalize(vector4 a) -{ - return a / length(a); -} + + + -vector4 min(vector4 a, vector4 b) -{ - return vector4 (min(a.x, b.x), - min(a.y, b.y), - min(a.z, b.z), - min(a.w, b.w)); -} + + + + -vector4 min(vector4 a, float b) -{ - return min(a, vector4(b, b, b, b)); -} + + + + + + + + + + -vector4 mod(vector4 a, vector4 b) -{ - return vector4(mod(a.x, b.x), - mod(a.y, b.y), - mod(a.z, b.z), - mod(a.w, b.w)); -} + + + -vector4 mod(vector4 a, float b) -{ - return mod(a, vector4(b, b, b, b)); -} + + -vector4 fmod(vector4 a, vector4 b) -{ - return vector4 (fmod(a.x, b.x), - fmod(a.y, b.y), - fmod(a.z, b.z), - fmod(a.w, b.w)); -} + + -vector4 fmod(vector4 a, float b) -{ - return fmod(a, vector4(b, b, b, b)); -} + + + -vector4 pow(vector4 in, vector4 amount) -{ - return vector4 (pow(in.x, amount.x), - pow(in.y, amount.y), - pow(in.z, amount.z), - pow(in.w, amount.w)); -} + + + + + + + + + + + + + + + + + -vector4 pow(vector4 in, float amount) -{ - return vector4 (pow(in.x, amount), - pow(in.y, amount), - pow(in.z, amount), - pow(in.w, amount)); -} + + + + + + + + + + + + + + + + + -vector4 sign(vector4 a) -{ - return vector4(sign(a.x), - sign(a.y), - sign(a.z), - sign(a.w)); -} + + + + + + + + + + + + + + -vector4 sin(vector4 a) -{ - return vector4(sin(a.x), - sin(a.y), - sin(a.z), - sin(a.w)); -} + + + + + + + + + + + + + + -vector4 cos(vector4 a) -{ - return vector4(cos(a.x), - cos(a.y), - cos(a.z), - cos(a.w)); -} + + + + + + + + + + + + -vector4 tan(vector4 a) -{ - return vector4(tan(a.x), - tan(a.y), - tan(a.z), - tan(a.w)); -} + + + + + + + + + + + + -vector4 asin(vector4 a) -{ - return vector4(asin(a.x), - asin(a.y), - asin(a.z), - asin(a.w)); -} + + + + + + + -vector4 acos(vector4 a) -{ - return vector4(acos(a.x), - acos(a.y), - acos(a.z), - acos(a.w)); -} + + + + + + + + -vector4 atan2(vector4 a, float f) -{ - return vector4(atan2(a.x, f), - atan2(a.y, f), - atan2(a.z, f), - atan2(a.w, f)); -} + + + + + + + + -vector4 atan2(vector4 a, vector4 b) -{ - return vector4(atan2(a.x, b.x), - atan2(a.y, b.y), - atan2(a.z, b.z), - atan2(a.w, b.w)); -} + + + + + + + + + + + + + + + + + + + + -vector4 transform (matrix M, vector4 p) -{ - return vector4 (M[0][0]*p.x + M[1][0]*p.y + M[2][0]*p.z + M[3][0]*p.w, - M[0][1]*p.x + M[1][1]*p.y + M[2][1]*p.z + M[3][1]*p.w, - M[0][2]*p.x + M[1][2]*p.y + M[2][2]*p.z + M[3][2]*p.w, - M[0][3]*p.x + M[1][3]*p.y + M[2][3]*p.z + M[3][3]*p.w); -} + + + + + + + + + + + + + + + + + + + + + + + + + -vector4 transform (string fromspace, string tospace, vector4 p) -{ - return transform (matrix(fromspace,tospace), p); -} -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE + + + + + -#pragma once -#define COLOR4_H + + + + + + + + + + -// color4 is a color + alpha -struct color4 -{ - color rgb; - float a; -}; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -// -// For color4, define math operators to match color -// + + + + + + + + + + + + -color4 __operator__neg__(color4 a) -{ - return color4(-a.rgb, -a.a); -} + + + + -color4 __operator__add__(color4 a, color4 b) -{ - return color4(a.rgb + b.rgb, a.a + b.a); -} + + + + -color4 __operator__add__(color4 a, int b) -{ - return a + color4(color(b), b); -} + + + + -color4 __operator__add__(color4 a, float b) -{ - return a + color4(color(b), b); -} + + -color4 __operator__add__(int a, color4 b) -{ - return color4(color(a), a) + b; -} + + -color4 __operator__add__(float a, color4 b) -{ - return color4(color(a), a) + b; -} + + -color4 __operator__sub__(color4 a, color4 b) -{ - return color4(a.rgb - b.rgb, a.a - b.a); -} + + -color4 __operator__sub__(color4 a, int b) -{ - return a - color4(color(b), b); -} + + + + + -color4 __operator__sub__(color4 a, float b) -{ - return a - color4(color(b), b); -} + + + -color4 __operator__sub__(int a, color4 b) -{ - return color4(color(a), a) - b; -} + + + -color4 __operator__sub__(float a, color4 b) -{ - return color4(color(a), a) - b; -} + + + -color4 __operator__mul__(color4 a, color4 b) -{ - return color4(a.rgb * b.rgb, a.a * b.a); -} + + -color4 __operator__mul__(color4 a, int b) -{ - return a * color4(color(b), b); -} + + -color4 __operator__mul__(color4 a, float b) -{ - return a * color4(color(b), b); -} + + + -color4 __operator__mul__(int a, color4 b) -{ - return color4(color(a), a) * b; -} + -color4 __operator__mul__(float a, color4 b) -{ - return color4(color(a), a) * b; -} + + + + + + + + + + + + -color4 __operator__div__(color4 a, color4 b) -{ - return color4(a.rgb / b.rgb, a.a / b.a); -} + + + + + -color4 __operator__div__(color4 a, int b) -{ - float b_inv = 1.0/b; - return a * color4(color(b_inv), b_inv); -} + + + -color4 __operator__div__(color4 a, float b) -{ - float b_inv = 1.0/b; - return a * color4(color(b_inv), b_inv); -} + + + -color4 __operator_div__(int a, color4 b) -{ - return color4(color(a), a) / b; -} + + + -color4 __operator__div__(float a, color4 b) -{ - return color4(color(a), a) / b; -} + + + -int __operator__eq__(color4 a, color4 b) -{ - return (a.rgb == b.rgb) && (a.a == b.a); -} + + -int __operator__ne__(color4 a, color4 b) -{ - return (a.rgb != b.rgb) || (a.a != b.a); -} + + + + + + + + + + -// -// For color4, define most of the stdosl functions to match color -// + + + + -color4 abs(color4 a) -{ - return color4(abs(a.rgb), abs(a.a)); -} + + + + -color4 ceil(color4 a) -{ - return color4(ceil(a.rgb), ceil(a.a)); -} + + + + -color4 round(color4 a) -{ - return color4(round(a.rgb), round(a.a)); -} + + + + -color4 floor(color4 a) -{ - return color4(floor(a.rgb), floor(a.a)); -} + + -color4 sqrt(color4 a) -{ - return color4(sqrt(a.rgb), sqrt(a.a)); -} + + -color4 exp(color4 a) -{ - return color4(exp(a.rgb), exp(a.a)); -} + + -color4 log(color4 a) -{ - return color4(log(a.rgb), log(a.a)); -} + + -color4 log2(color4 a) -{ - return color4(log2(a.rgb), log2(a.a)); -} + + -color4 mix(color4 a, color4 b, float x ) -{ - return color4(mix(a.rgb, b.rgb, x), - mix(a.a, b.a, x)); -} + + -color4 mix(color4 a, color4 b, color4 x ) -{ - return color4(mix(a.rgb, b.rgb, x.rgb), - mix(a.a, b.a, x.a)); -} + + + + -float dot(color4 a, color b) -{ - return dot(a.rgb, b); -} + + + + -color4 smoothstep(color4 edge0, color4 edge1, color4 c) -{ - return color4(smoothstep(edge0.rgb, edge1.rgb, c.rgb), - smoothstep(edge0.a, edge1.a, c.a)); -} + + + + + + + + + + + + + -color4 smoothstep(float edge0, float edge1, color4 c) -{ - return smoothstep(color4(color(edge0), edge0), color4(color(edge1), edge1), c); -} + + + -color4 clamp(color4 c, color4 minval, color4 maxval) -{ - return color4(clamp(c.rgb, minval.rgb, maxval.rgb), - clamp(c.a, minval.a, maxval.a)); -} + + + + + + + + + + + + + + + + + + + -color4 clamp(color4 c, float minval, float maxval) -{ - return clamp(c, color4(color(minval), minval), color4(color(maxval), maxval)); -} + + + + + + + + + + + + + + + + + + + -color4 max(color4 a, color4 b) -{ - return color4(max(a.rgb, b.rgb), - max(a.a, b.a)); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + -color4 max(color4 a, float b) -{ - return color4(max(a.rgb, b), - max(a.a, b)); -} + -color4 min(color4 a, color4 b) -{ - return color4(min(a.rgb, b.rgb), - min(a.a, b.a)); -} + + + + + + + + + -color4 min(color4 a, float b) -{ - return color4(min(a.rgb, b), - min(a.a, b)); -} + + + + + + + + + -color4 mod(color4 a, color4 b) -{ - return color4(mod(a.rgb, b.rgb), - mod(a.a, b.a)); -} + + + -color4 mod(color4 a, int b) -{ - return mod(a, color4(color(b), b)); -} + + + + + + + + + + + + + + + + + + -color4 mod(color4 a, float b) -{ - return mod(a, color4(color(b), b)); -} + + + + + + + + + -color4 fmod(color4 a, color4 b) -{ - return color4(fmod(a.rgb, b.rgb), - fmod(a.a, b.a)); -} + + + + -color4 fmod(color4 a, int b) -{ - return fmod(a, color4(color(b), b)); -} + + + + + + -color4 fmod(color4 a, float b) -{ - return fmod(a, color4(color(b), b)); -} + + + -color4 pow(color4 base, color4 power) -{ - return color4(pow(base.rgb, power.rgb), - pow(base.a, power.a)); -} + + + + + + + -color4 pow(color4 base, float power) -{ - return color4(pow(base.rgb, power), - pow(base.a, power)); -} + + -color4 sign(color4 a) -{ - return color4(sign(a.rgb), - sign(a.a)); -} + + + -color4 sin(color4 a) -{ - return color4(sin(a.rgb), - sin(a.a)); -} + + + + + + + + + + + + + + + + + + +#include "lib/$fileTransformUv" -color4 cos(color4 a) +void mx_image_vector4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) { - return color4(cos(a.rgb), - cos(a.a)); + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv); } +#include "lib/mx_noise.glsl" -color4 tan(color4 a) +void mx_noise2d_vector3(vec3 amplitude, float pivot, vec2 texcoord, out vec3 result) { - return color4(tan(a.rgb), - tan(a.a)); + vec3 value = mx_perlin_noise_vec3(texcoord); + result = value * amplitude + pivot; } +#include "lib/mx_noise.glsl" -color4 asin(color4 a) +void mx_worleynoise2d_float(vec2 texcoord, float jitter, out float result) { - return color4(asin(a.rgb), - asin(a.a)); + result = mx_worley_noise_float(texcoord, jitter, 0); } - -color4 acos(color4 a) +void mx_ramptb_vector4(vec4 valuet, vec4 valueb, vec2 texcoord, out vec4 result) { - return color4(acos(a.rgb), - acos(a.a)); + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); } - -color4 atan2(color4 a, float f) +void mx_luminance_color4(vec4 _in, vec3 lumacoeffs, out vec4 result) { - return color4(atan2(a.rgb, f), - atan2(a.a, f)); + result = vec4(vec3(dot(_in.rgb, lumacoeffs)), _in.a); } - -color4 atan2(color4 a, color4 b) +void mx_creatematrix_vector3_matrix44(vec3 in1, vec3 in2, vec3 in3, vec3 in4, out mat4 result) { - return color4(atan2(a.rgb, b.rgb), - atan2(a.a, b.a)); + result = mat4(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + in4.x, in4.y, in4.z, 1.0); } +#include "lib/mx_noise.glsl" - -color4 transformc (string fromspace, string tospace, color4 C) +void mx_worleynoise3d_vector3(vec3 position, float jitter, out vec3 result) { - return color4 (transformc (fromspace, tospace, C.rgb), C.a); + result = mx_worley_noise_vec3(position, jitter, 0); } -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE -// -// MaterialX specification (c) 2017 Lucasfilm Ltd. -// http://www.materialx.org/ - -#pragma once -#define MATRIX33_H - - -struct matrix33 -{ - matrix m; -}; +#include "lib/mx_noise.glsl" -int isValidAs33(matrix m44) +void mx_noise2d_vector2(vec2 amplitude, float pivot, vec2 texcoord, out vec2 result) { - return m44[0][3] == 0 && - m44[1][3] == 0 && - m44[2][3] == 0 && - m44[3][0] == 0 && - m44[3][1] == 0 && - m44[3][2] == 0 && - m44[3][3] == 1; + vec3 value = mx_perlin_noise_vec3(texcoord); + result = value.xy * amplitude + pivot; } - -matrix matrix33To44 (matrix33 m33) +void mx_ramplr_vector4(vec4 valuel, vec4 valuer, vec2 texcoord, out vec4 result) { - return m33.m; + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); } - -// Convert an arbitrary m44 to m33 by removing the translation -//QUESTION: should we check if it's valid to represent the 4x4 as a 3x3? -matrix33 matrix44To33 (matrix m44) +void mx_smoothstep_float(float val, float low, float high, out float result) { - matrix33 m33; - m33.m = m44; - m33.m[0][3] = 0; - m33.m[1][3] = 0; - m33.m[2][3] = 0; - m33.m[3][0] = 0; - m33.m[3][1] = 0; - m33.m[3][2] = 0; - m33.m[3][3] = 1; - - return m33; + if (val <= low) + result = 0.0; + else if (val >= high) + result = 1.0; + else + result = smoothstep(low, high, val); } - -matrix33 __operator__neg__(matrix33 a) +void mx_transformmatrix_vector2M3(vec2 val, mat3 transform, out vec2 result) { - matrix33 m33; - m33.m = -a.m; - return m33; + vec3 res = transform * vec3(val, 1.0); + result = res.xy; } +#include "lib/$fileTransformUv" - -matrix33 __operator__mul__(int a, matrix33 b) +void mx_image_color4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) { - matrix33 m33; - m33.m = a * b.m; - return m33; + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv); } +#include "lib/$fileTransformUv" -matrix33 __operator__mul__(float a, matrix33 b) +void mx_image_float(sampler2D tex_sampler, int layer, float defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out float result) { - matrix33 m33; - m33.m = a * b.m; - return m33; + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).r; } +#include "lib/mx_noise.glsl" -matrix33 __operator__mul__(matrix33 a, int b) +void mx_noise3d_float(float amplitude, float pivot, vec3 position, out float result) { - matrix33 m33; - m33.m = a.m * b; - return m33; + float value = mx_perlin_noise_float(position); + result = value * amplitude + pivot; } - -matrix33 __operator__mul__(matrix33 a, float b) +void mx_creatematrix_vector3_matrix33(vec3 in1, vec3 in2, vec3 in3, out mat3 result) { - matrix33 m33; - m33.m = a.m * b; - return m33; + result = mat3(in1.x, in1.y, in1.z, + in2.x, in2.y, in2.z, + in3.x, in3.y, in3.z); } +#include "mx_aastep.glsl" -matrix33 __operator__mul__(matrix33 a, matrix33 b) +void mx_splitlr_vector3(vec3 valuel, vec3 valuer, float center, vec2 texcoord, out vec3 result) { - matrix33 m33; - m33.m = a.m * b.m; - return m33; + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); } +#include "mx_burn_float.glsl" -matrix33 __operator__div__(int a, matrix33 b) +void mx_burn_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) { - matrix33 m33; - m33.m = a / b.m; - return m33; + mx_burn_float(fg.x, bg.x, mixval, result.x); + mx_burn_float(fg.y, bg.y, mixval, result.y); + mx_burn_float(fg.z, bg.z, mixval, result.z); } - -matrix33 __operator__div__(float a, matrix33 b) +mat4 mx_rotationMatrix(vec3 axis, float angle) { - matrix33 m33; - m33.m = a / b.m; - return m33; + axis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; + + return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, + oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, + oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, + 0.0, 0.0, 0.0, 1.0); } -matrix33 __operator__div__(matrix33 a, int b) +void mx_rotate_vector3(vec3 _in, float amount, vec3 axis, out vec3 result) { - matrix33 m33; - m33.m = a.m / b; - return m33; + float rotationRadians = radians(amount); + mat4 m = mx_rotationMatrix(axis, rotationRadians); + result = (m * vec4(_in, 1.0)).xyz; } +#include "lib/mx_noise.glsl" -matrix33 __operator__div__(matrix33 a, float b) +void mx_noise3d_vector4(vec4 amplitude, float pivot, vec3 position, out vec4 result) { - matrix33 m33; - m33.m = a.m / b; - return m33; + vec3 xyz = mx_perlin_noise_vec3(position); + float w = mx_perlin_noise_float(position + vec3(19, 73, 29)); + result = vec4(xyz, w) * amplitude + pivot; } +#include "mx_smoothstep_float.glsl" -matrix33 __operator__div__(matrix33 a, matrix33 b) +void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) { - matrix33 m33; - m33.m = a.m / b.m; - return m33; + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); + mx_smoothstep_float(val.z, low.z, high.z, result.z); + mx_smoothstep_float(val.w, low.w, high.w, result.w); } +#include "lib/mx_noise.glsl" -int __operator__eq__(matrix33 a, matrix33 b) +void mx_fractal3d_vector2(vec2 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec2 result) { - return a.m == b.m; + vec2 value = mx_fractal_noise_vec2(position, octaves, lacunarity, diminish); + result = value * amplitude; } - -int __operator__ne__(matrix33 a, matrix33 b) +void mx_ramptb_float(float valuet, float valueb, vec2 texcoord, out float result) { - return a.m != b.m; + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); } +#include "lib/$fileTransformUv" -float determinant (matrix33 a) +void mx_image_color3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) { - return determinant(a.m); + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rgb; } +#include "mx_burn_float.glsl" -matrix33 transpose(matrix33 a) +void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) { - matrix33 m33; - m33.m = transpose(a.m); - return m33; + mx_burn_float(fg.x, bg.x, mixval, result.x); + mx_burn_float(fg.y, bg.y, mixval, result.y); + mx_burn_float(fg.z, bg.z, mixval, result.z); + mx_burn_float(fg.w, bg.w, mixval, result.w); } - -point transform(matrix33 a, point b) +void mx_unpremult_color4(vec4 _in, out vec4 result) { - return transform(a.m, b); + result = vec4(_in.rgb / _in.a, _in.a); } +#include "lib/mx_noise.glsl" -vector transform(matrix33 a, vector b) +void mx_fractal3d_vector4(vec4 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec4 result) { - return transform(a.m, b); + vec4 value = mx_fractal_noise_vec4(position, octaves, lacunarity, diminish); + result = value * amplitude; } +#include "lib/$fileTransformUv" -normal transform(matrix33 a, normal b) +void mx_image_vector3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) { - return transform(a.m, b); + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rgb; } - - - -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE - -#pragma once -#define VECTOR2_H - -// vector2 is a 2D vector -struct vector2 +void mx_premult_color4(vec4 _in, out vec4 result) { - float x; - float y; -}; - - - -// -// For vector2, define math operators to match vector -// + result = vec4(_in.rgb * _in.a, _in.a); +} +#include "mx_aastep.glsl" -vector2 __operator__neg__(vector2 a) +void mx_splittb_vector3(vec3 valuet, vec3 valueb, float center, vec2 texcoord, out vec3 result) { - return vector2(-a.x, -a.y); + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); } - -vector2 __operator__add__(vector2 a, vector2 b) +void mx_rotate_vector2(vec2 _in, float amount, out vec2 result) { - return vector2(a.x + b.x, a.y + b.y); + float rotationRadians = radians(amount); + float sa = sin(rotationRadians); + float ca = cos(rotationRadians); + result = vec2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y); } - -vector2 __operator__add__(vector2 a, int b) +void mx_burn_float(float fg, float bg, float mixval, out float result) { - return a + vector2(b, b); + if (abs(fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); } - -vector2 __operator__add__(vector2 a, float b) +vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) { - return a + vector2(b, b); + uv = uv * uv_scale + uv_offset; + return uv; +} +vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) +{ + uv = uv * uv_scale + uv_offset; + return vec2(uv.x, 1.0 - uv.y); } +#define M_FLOAT_EPS 1e-8 -vector2 __operator__add__(int a, vector2 b) +float mx_square(float x) { - return vector2(a, a) + b; + return x*x; } -vector2 __operator__add__(float a, vector2 b) +vec2 mx_square(vec2 x) { - return vector2(a, a) + b; + return x*x; } -vector2 __operator__sub__(vector2 a, vector2 b) +vec3 mx_square(vec3 x) { - return vector2(a.x - b.x, a.y - b.y); + return x*x; } +// Restrict to 7x7 kernel size for performance reasons +#define MX_MAX_SAMPLE_COUNT 49 +// Size of all weights for all levels (including level 1) +#define MX_WEIGHT_ARRAY_SIZE 84 -vector2 __operator__sub__(vector2 a, int b) +// +// Function to compute the sample size relative to a texture coordinate +// +vec2 mx_compute_sample_size_uv(vec2 uv, float filterSize, float filterOffset) { - return a - vector2(b, b); + vec2 derivUVx = dFdx(uv) * 0.5f; + vec2 derivUVy = dFdy(uv) * 0.5f; + float derivX = abs(derivUVx.x) + abs(derivUVy.x); + float derivY = abs(derivUVx.y) + abs(derivUVy.y); + float sampleSizeU = 2.0f * filterSize * derivX + filterOffset; + if (sampleSizeU < 1.0E-05f) + sampleSizeU = 1.0E-05f; + float sampleSizeV = 2.0f * filterSize * derivY + filterOffset; + if (sampleSizeV < 1.0E-05f) + sampleSizeV = 1.0E-05f; + return vec2(sampleSizeU, sampleSizeV); } -vector2 __operator__sub__(vector2 a, float b) +// +// Compute a normal mapped to 0..1 space based on a set of input +// samples using a Sobel filter. +// +vec3 mx_normal_from_samples_sobel(float S[9], float _scale) { - return a - vector2(b, b); + float nx = S[0] - S[2] + (2.0*S[3]) - (2.0*S[5]) + S[6] - S[8]; + float ny = S[0] + (2.0*S[1]) + S[2] - S[6] - (2.0*S[7]) - S[8]; + float nz = max(_scale, M_FLOAT_EPS) * sqrt(max(1.0 - nx * nx - ny * ny, M_FLOAT_EPS)); + vec3 norm = normalize(vec3(nx, ny, nz)); + return (norm + 1.0) * 0.5; } -vector2 __operator__sub__(int a, vector2 b) +// +// Apply filter for float samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) { - return vector2(a, a) - b; + float result = 0.0; + for (int i = 0; i < sampleCount; i++) + { + result += S[i]*W[i+offset]; + } + return result; } -vector2 __operator__sub__(float a, vector2 b) +// +// Apply filter for vec2 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vec2 mx_convolution_vec2(vec2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) { - return vector2(a, a) - b; + vec2 result = vec2(0.0); + for (int i=0; i>(32-k)); } -vector2 log2(vector2 a) +void mx_bjmix(inout uint a, inout uint b, inout uint c) { - return vector2 (log2(a.x), log2(a.y)); + a -= c; a ^= mx_rotl32(c, 4); c += b; + b -= a; b ^= mx_rotl32(a, 6); a += c; + c -= b; c ^= mx_rotl32(b, 8); b += a; + a -= c; a ^= mx_rotl32(c,16); c += b; + b -= a; b ^= mx_rotl32(a,19); a += c; + c -= b; c ^= mx_rotl32(b, 4); b += a; } -vector2 mix(vector2 a, vector2 b, float x ) +// Mix up and combine the bits of a, b, and c (doesn't change them, but +// returns a hash of those three original values). +uint mx_bjfinal(uint a, uint b, uint c) { - return vector2 (mix(a.x, b.x, x), mix(a.y, b.y, x)); + c ^= b; c -= mx_rotl32(b,14); + a ^= c; a -= mx_rotl32(c,11); + b ^= a; b -= mx_rotl32(a,25); + c ^= b; c -= mx_rotl32(b,16); + a ^= c; a -= mx_rotl32(c,4); + b ^= a; b -= mx_rotl32(a,14); + c ^= b; c -= mx_rotl32(b,24); + return c; } -vector2 mix(vector2 a, vector2 b, vector2 x ) +// Convert a 32 bit integer into a floating point number in [0,1] +float mx_bits_to_01(uint bits) { - return vector2 (mix(a.x, b.x, x.x), mix(a.y, b.y, x.y)); + return float(bits) / float(uint(0xffffffff)); } -float dot(vector2 a, vector2 b) +float mx_fade(float t) { - return (a.x * b.x + a.y * b.y); + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); } -float length (vector2 a) +uint mx_hash_int(int x) { - return hypot (a.x, a.y); + uint len = 1u; + uint seed = uint(0xdeadbeef) + (len << 2u) + 13u; + return mx_bjfinal(seed+uint(x), seed, seed); } -vector2 smoothstep(vector2 low, vector2 high, vector2 in) +uint mx_hash_int(int x, int y) { - return vector2 (smoothstep(low.x, high.x, in.x), - smoothstep(low.y, high.y, in.y)); + uint len = 2u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + return mx_bjfinal(a, b, c); } -vector2 smoothstep(float low, float high, vector2 in) +uint mx_hash_int(int x, int y, int z) { - return vector2 (smoothstep(low, high, in.x), - smoothstep(low, high, in.y)); + uint len = 3u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + return mx_bjfinal(a, b, c); } -vector2 clamp(vector2 in, vector2 low, vector2 high) +uint mx_hash_int(int x, int y, int z, int xx) { - return vector2 (clamp(in.x, low.x, high.x), - clamp(in.y, low.y, high.y)); + uint len = 4u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + mx_bjmix(a, b, c); + a += uint(xx); + return mx_bjfinal(a, b, c); } -vector2 clamp(vector2 in, float low, float high) +uint mx_hash_int(int x, int y, int z, int xx, int yy) { - return clamp(in, vector2(low, low), vector2(high, high)); + uint len = 5u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + mx_bjmix(a, b, c); + a += uint(xx); + b += uint(yy); + return mx_bjfinal(a, b, c); } -vector2 max(vector2 a, vector2 b) +uvec3 mx_hash_vec3(int x, int y) { - return vector2 (max(a.x, b.x), - max(a.y, b.y)); + uint h = mx_hash_int(x, y); + // we only need the low-order bits to be random, so split out + // the 32 bit result into 3 parts for each channel + uvec3 result; + result.x = (h ) & 0xFFu; + result.y = (h >> 8 ) & 0xFFu; + result.z = (h >> 16) & 0xFFu; + return result; } -vector2 max(vector2 a, float b) +uvec3 mx_hash_vec3(int x, int y, int z) { - return max(a, vector2(b, b)); + uint h = mx_hash_int(x, y, z); + // we only need the low-order bits to be random, so split out + // the 32 bit result into 3 parts for each channel + uvec3 result; + result.x = (h ) & 0xFFu; + result.y = (h >> 8 ) & 0xFFu; + result.z = (h >> 16) & 0xFFu; + return result; } -vector2 normalize(vector2 a) +float mx_perlin_noise_float(vec2 p) { - return a / length(a); + int X, Y; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float u = mx_fade(fx); + float v = mx_fade(fy); + float result = mx_bilerp( + mx_gradient_float(mx_hash_int(X , Y ), fx , fy ), + mx_gradient_float(mx_hash_int(X+1, Y ), fx-1.0, fy ), + mx_gradient_float(mx_hash_int(X , Y+1), fx , fy-1.0), + mx_gradient_float(mx_hash_int(X+1, Y+1), fx-1.0, fy-1.0), + u, v); + return mx_gradient_scale2d(result); } -vector2 min(vector2 a, vector2 b) +float mx_perlin_noise_float(vec3 p) { - return vector2 (min(a.x, a.x), - min(b.y, b.y)); + int X, Y, Z; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float fz = mx_floorfrac(p.z, Z); + float u = mx_fade(fx); + float v = mx_fade(fy); + float w = mx_fade(fz); + float result = mx_trilerp( + mx_gradient_float(mx_hash_int(X , Y , Z ), fx , fy , fz ), + mx_gradient_float(mx_hash_int(X+1, Y , Z ), fx-1.0, fy , fz ), + mx_gradient_float(mx_hash_int(X , Y+1, Z ), fx , fy-1.0, fz ), + mx_gradient_float(mx_hash_int(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), + mx_gradient_float(mx_hash_int(X , Y , Z+1), fx , fy , fz-1.0), + mx_gradient_float(mx_hash_int(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), + mx_gradient_float(mx_hash_int(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), + mx_gradient_float(mx_hash_int(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), + u, v, w); + return mx_gradient_scale3d(result); } -vector2 min(vector2 a, float b) +vec3 mx_perlin_noise_vec3(vec2 p) { - return min(a, vector2(b, b)); + int X, Y; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float u = mx_fade(fx); + float v = mx_fade(fy); + vec3 result = mx_bilerp( + mx_gradient_vec3(mx_hash_vec3(X , Y ), fx , fy ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y ), fx-1.0, fy ), + mx_gradient_vec3(mx_hash_vec3(X , Y+1), fx , fy-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1), fx-1.0, fy-1.0), + u, v); + return mx_gradient_scale2d(result); } -vector2 mod(vector2 a, vector2 b) +vec3 mx_perlin_noise_vec3(vec3 p) { - return vector2(mod(a.x, b.x), - mod(a.y, b.y)); + int X, Y, Z; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float fz = mx_floorfrac(p.z, Z); + float u = mx_fade(fx); + float v = mx_fade(fy); + float w = mx_fade(fz); + vec3 result = mx_trilerp( + mx_gradient_vec3(mx_hash_vec3(X , Y , Z ), fx , fy , fz ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z ), fx-1.0, fy , fz ), + mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z ), fx , fy-1.0, fz ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), + mx_gradient_vec3(mx_hash_vec3(X , Y , Z+1), fx , fy , fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), + u, v, w); + return mx_gradient_scale3d(result); } -vector2 mod(vector2 a, float b) +float mx_cell_noise_float(float p) { - return mod(a, vector2(b, b)); + int ix = mx_floor(p); + return mx_bits_to_01(mx_hash_int(ix)); } -vector2 fmod(vector2 a, vector2 b) +float mx_cell_noise_float(vec2 p) { - return vector2 (fmod(a.x, b.x), - fmod(a.y, b.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + return mx_bits_to_01(mx_hash_int(ix, iy)); } -vector2 fmod(vector2 a, float b) +float mx_cell_noise_float(vec3 p) { - return fmod(a, vector2(b, b)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + return mx_bits_to_01(mx_hash_int(ix, iy, iz)); } -vector2 pow(vector2 in, vector2 amount) +float mx_cell_noise_float(vec4 p) { - return vector2(pow(in.x, amount.x), - pow(in.y, amount.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + int iw = mx_floor(p.w); + return mx_bits_to_01(mx_hash_int(ix, iy, iz, iw)); } -vector2 pow(vector2 in, float amount) +vec3 mx_cell_noise_vec3(float p) { - return vector2(pow(in.x, amount), - pow(in.y, amount)); + int ix = mx_floor(p); + return vec3( + mx_bits_to_01(mx_hash_int(ix, 0)), + mx_bits_to_01(mx_hash_int(ix, 1)), + mx_bits_to_01(mx_hash_int(ix, 2)) + ); } -vector2 sign(vector2 a) +vec3 mx_cell_noise_vec3(vec2 p) { - return vector2(sign(a.x), - sign(a.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, 2)) + ); } -vector2 sin(vector2 a) +vec3 mx_cell_noise_vec3(vec3 p) { - return vector2(sin(a.x), - sin(a.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, iz, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, 2)) + ); } -vector2 cos(vector2 a) +vec3 mx_cell_noise_vec3(vec4 p) { - return vector2(cos(a.x), - cos(a.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + int iw = mx_floor(p.w); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 2)) + ); } -vector2 tan(vector2 a) +float mx_fractal_noise_float(vec3 p, int octaves, float lacunarity, float diminish) { - return vector2(tan(a.x), - tan(a.y)); + float result = 0.0; + float amplitude = 1.0; + for (int i = 0; i < octaves; ++i) + { + result += amplitude * mx_perlin_noise_float(p); + amplitude *= diminish; + p *= lacunarity; + } + return result; } -vector2 asin(vector2 a) +vec3 mx_fractal_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish) { - return vector2(asin(a.x), - asin(a.y)); + vec3 result = vec3(0.0); + float amplitude = 1.0; + for (int i = 0; i < octaves; ++i) + { + result += amplitude * mx_perlin_noise_vec3(p); + amplitude *= diminish; + p *= lacunarity; + } + return result; } -vector2 acos(vector2 a) +vec2 mx_fractal_noise_vec2(vec3 p, int octaves, float lacunarity, float diminish) { - return vector2(acos(a.x), - acos(a.y)); + return vec2(mx_fractal_noise_float(p, octaves, lacunarity, diminish), + mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish)); } -vector2 atan2(vector2 a, float f) +vec4 mx_fractal_noise_vec4(vec3 p, int octaves, float lacunarity, float diminish) { - return vector2(atan2(a.x, f), - atan2(a.y, f)); + vec3 c = mx_fractal_noise_vec3(p, octaves, lacunarity, diminish); + float f = mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish); + return vec4(c, f); } -vector2 atan2(vector2 a, vector2 b) +float mx_worley_distance(vec2 p, int x, int y, int xoff, int yoff, float jitter, int metric) { - return vector2(atan2(a.x, b.x), - atan2(a.y, b.y)); -} + vec3 tmp = mx_cell_noise_vec3(vec2(x+xoff, y+yoff)); + vec2 off = vec2(tmp.x, tmp.y); + off -= 0.5f; + off *= jitter; + off += 0.5f; -vector2 mx_transform_uv(vector2 texcoord) -{ - return texcoord; + vec2 cellpos = vec2(float(x), float(y)) + off; + vec2 diff = cellpos - p; + if (metric == 2) + return abs(diff.x) + abs(diff.y); // Manhattan distance + if (metric == 3) + return max(abs(diff.x), abs(diff.y)); // Chebyshev distance + // Either Euclidian or Distance^2 + return dot(diff, diff); } -// Restrict to 7x7 kernel size for performance reasons -#define MX_MAX_SAMPLE_COUNT 49 -// Size of all weights for all levels (including level 1) -#define MX_WEIGHT_ARRAY_SIZE 84 -// -// Function to compute the sample size relative to a texture coordinate -// -vector2 mx_compute_sample_size_uv(vector2 uv, float filterSize, float filterOffset) +float mx_worley_distance(vec3 p, int x, int y, int z, int xoff, int yoff, int zoff, float jitter, int metric) { - vector derivUVx = Dx(vector(uv.x, uv.y, 0.0)) * 0.5; - vector derivUVy = Dy(vector(uv.x, uv.y, 0.0)) * 0.5; - float derivX = abs(derivUVx[0]) + abs(derivUVy[0]); - float derivY = abs(derivUVx[1]) + abs(derivUVy[1]); - float sampleSizeU = filterSize * derivX + filterOffset; - if (sampleSizeU < 1.0E-05) - sampleSizeU = 1.0E-05; - float sampleSizeV = filterSize * derivY + filterOffset; - if (sampleSizeV < 1.0E-05) - sampleSizeV = 1.0E-05; - return vector2(sampleSizeU, sampleSizeV); -} + vec3 off = mx_cell_noise_vec3(vec3(x+xoff, y+yoff, z+zoff)); -// Kernel weights for box filter -void mx_get_box_weights(output float W[MX_MAX_SAMPLE_COUNT], int filterSize) -{ - int sampleCount = filterSize*filterSize; - float value = 1.0 / float(sampleCount); - for (int i=0; i= 7) - { - W[0] = 0.000036; W[1] = 0.000363; W[2] = 0.001446; W[3] = 0.002291; W[4] = 0.001446; W[5] = 0.000363; W[6] = 0.000036; - W[7] = 0.000363; W[8] = 0.003676; W[9] = 0.014662; W[10] = 0.023226; W[11] = 0.014662; W[12] = 0.003676; W[13] = 0.000363; - W[14] = 0.001446; W[15] = 0.014662; W[16] = 0.058488; W[17] = 0.092651; W[18] = 0.058488; W[19] = 0.014662; W[20] = 0.001446; - W[21] = 0.002291; W[22] = 0.023226; W[23] = 0.092651; W[24] = 0.146768; W[25] = 0.092651; W[26] = 0.023226; W[27] = 0.002291; - W[28] = 0.001446; W[29] = 0.014662; W[30] = 0.058488; W[31] = 0.092651; W[32] = 0.058488; W[33] = 0.014662; W[34] = 0.001446; - W[35] = 0.000363; W[36] = 0.003676; W[37] = 0.014662; W[38] = 0.023226; W[39] = 0.014662; W[40] = 0.003676; W[41] = 0.000363; - W[42] = 0.000036; W[43] = 0.000363; W[44] = 0.001446; W[45] = 0.002291; W[46] = 0.001446; W[47] = 0.000363; W[48] = 0.000036; - } - else if (filterSize >= 5) - { - W[0] = 0.003765; W[1] = 0.015019; W[2] = 0.023792; W[3] = 0.015019; W[4] = 0.003765; - W[5] = 0.015019; W[6] = 0.059912; W[7] = 0.094907; W[8] = 0.059912; W[9] = 0.015019; - W[10] = 0.023792; W[11] = 0.094907; W[12] = 0.150342; W[13] = 0.094907; W[14] = 0.023792; - W[15] = 0.015019; W[16] = 0.059912; W[17] = 0.094907; W[18] = 0.059912; W[19] = 0.015019; - W[20] = 0.003765; W[21] = 0.015019; W[22] = 0.023792; W[23] = 0.015019; W[24] = 0.003765; - } - else if (filterSize >= 3) + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + float sqdist = 1e6f; // Some big number for jitter > 1 (not all GPUs may be IEEE) + for (int x = -1; x <= 1; ++x) { - W[0] = 0.0625; W[1] = 0.125; W[2] = 0.0625; - W[3] = 0.125; W[4] = 0.25; W[5] = 0.125; - W[6] = 0.0625; W[7] = 0.125; W[8] = 0.0625; + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + sqdist = min(sqdist, dist); + } } - else + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; +} + +vec2 mx_worley_noise_vec2(vec2 p, float jitter, int metric) +{ + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + vec2 sqdist = vec2(1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) { - W[0] = 1.0; + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + if (dist < sqdist.x) + { + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.y = dist; + } + } } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; } -// -// Apply filter for float samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +vec3 mx_worley_noise_vec3(vec2 p, float jitter, int metric) { - float result = 0.0; - for (int i = 0; i < sampleCount; i++) + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) { - result += S[i]*W[i+offset]; + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + if (dist < sqdist.x) + { + sqdist.z = sqdist.y; + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.z = sqdist.y; + sqdist.y = dist; + } + else if (dist < sqdist.z) + { + sqdist.z = dist; + } + } } - return result; + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; } -// -// Apply filter for vector2 samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -vector2 mx_convolution_vector2(vector2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +float mx_worley_noise_float(vec3 p, float jitter, int metric) { - vector2 result = vector2(0.0, 0.0); - for (int i=0; i 0.0f) + s = delta / maxcomp; + else s = 0.0f; + if (s <= 0.0f) + h = 0.0f; + else { + if (r >= maxcomp) h = (g-b) / delta; + else if (g >= maxcomp) h = 2.0f + (b-r) / delta; + else h = 4.0f + (r-g) / delta; + h *= (1.0f/6.0f); + if (h < 0.0f) + h += 1.0f; } - return result; -} -vector2 mx_transform_uv(vector2 texcoord) -{ - return vector2(texcoord.x, 1.0 - texcoord.y); + return vec3(h, s, v); } -void mx_burn_float(float fg, float bg, float mixval, out float result) +#include "mx_smoothstep_float.metal" + +void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) { - if (abs(fg) < M_FLOAT_EPS) - { - result = 0.0; - return; - } - result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); + float f; + mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; + mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; } void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) { @@ -16396,6 +15768,32 @@ void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, v { mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); } +void mx_burn_float(float fg, float bg, float mixval, out float result) +{ + if (abs(fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); +} +#include "mx_smoothstep_float.metal" + +void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, thread vec3& result) + { + float f; + mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; + mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; + mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; + }#include "mx_burn_float.metal" + +void mx_burn_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) +{ + float f; + mx_burn_float(fg.x, bg.x, mixval, f); result.x = f; + mx_burn_float(fg.y, bg.y, mixval, f); result.y = f; + mx_burn_float(fg.z, bg.z, mixval, f); result.z = f; +} #include "mx_smoothstep_float.metal" void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) @@ -16406,6 +15804,34 @@ void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; mx_smoothstep_float(val.w, low.w, high.w, f); result.w = f; } +void mx_dodge_float(float fg, float bg, float mixval, out float result) +{ + if (abs(1.0 - fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(bg / (1.0 - fg)) + ((1.0-mixval)*bg); +} +#include "mx_burn_float.metal" + +void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) +{ + float f; + mx_burn_float(fg.x, bg.x, mixval, f); result.x = f; + mx_burn_float(fg.y, bg.y, mixval, f); result.y = f; + mx_burn_float(fg.z, bg.z, mixval, f); result.z = f; + mx_burn_float(fg.w, bg.w, mixval, f); result.w = f; +} +void mx_smoothstep_float(float val, float low, float high, out float result) +{ + if (val <= low) + result = 0.0; + else if (val >= high) + result = 1.0; + else + result = smoothstep(low, high, val); +} + @@ -16613,6 +16040,7 @@ void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) + @@ -16998,51 +16426,72 @@ void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) + + + + + + + + + + + + + + + + + + + + + @@ -17053,6 +16502,8 @@ void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) + + @@ -17061,6 +16512,8 @@ void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) + + @@ -17085,49 +16538,6 @@ void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -17143,6 +16553,13 @@ void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) + + + + + + + @@ -17190,15 +16607,7 @@ void mx_dodge_color4(vec4 fg , vec4 bg , float mixval, out vec4 result) mx_dodge_float(fg.z, bg.z, mixval, f); result.z = f; mx_dodge_float(fg.w, bg.w, mixval, f); result.w = f; } -#include "mx_smoothstep_float.metal" - -void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, thread vec3& result) - { - float f; - mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; - mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; - mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; - }#include "mx_dodge_float.metal" +#include "mx_dodge_float.metal" void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) { @@ -17207,81 +16616,143 @@ void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) mx_dodge_float(fg.y, bg.y, mixval, f); result.y = f; mx_dodge_float(fg.z, bg.z, mixval, f); result.z = f; } -#include "mx_burn_float.metal" +struct MetalTexture +{ + texture2d tex; + sampler s; + int get_width() { return tex.get_width(); } + int get_height() { return tex.get_height(); } + int get_num_mip_levels() { return tex.get_num_mip_levels(); } +}; -void mx_burn_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) +int get_width(MetalTexture mtlTex) { return mtlTex.get_width(); } + +float4 texture(MetalTexture mtlTex, float2 uv) { - float f; - mx_burn_float(fg.x, bg.x, mixval, f); result.x = f; - mx_burn_float(fg.y, bg.y, mixval, f); result.y = f; - mx_burn_float(fg.z, bg.z, mixval, f); result.z = f; + return mtlTex.tex.sample(mtlTex.s, uv); } -void mx_smoothstep_float(float val, float low, float high, out float result) + +float4 textureLod(MetalTexture mtlTex, float2 uv, float lod) { - if (val <= low) - result = 0.0; - else if (val >= high) - result = 1.0; - else - result = smoothstep(low, high, val); + return mtlTex.tex.sample(mtlTex.s, uv, level(lod)); } -#include "mx_burn_float.metal" -void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) +int2 textureSize(MetalTexture mtlTex, int mipLevel) { - float f; - mx_burn_float(fg.x, bg.x, mixval, f); result.x = f; - mx_burn_float(fg.y, bg.y, mixval, f); result.y = f; - mx_burn_float(fg.z, bg.z, mixval, f); result.z = f; - mx_burn_float(fg.w, bg.w, mixval, f); result.w = f; + return int2(mtlTex.get_width(), mtlTex.get_height()); } -void mx_dodge_float(float fg, float bg, float mixval, out float result) + +int texture_mips(MetalTexture mtlTex) { - if (abs(1.0 - fg) < M_FLOAT_EPS) - { - result = 0.0; - return; - } - result = mixval*(bg / (1.0 - fg)) + ((1.0-mixval)*bg); + return mtlTex.tex.get_num_mip_levels(); } -#include "mx_smoothstep_float.metal" +#define M_FLOAT_EPS 1e-8 -void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) +float mx_square(float x) { - float f; - mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; - mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; + return x*x; } -struct MetalTexture + +vec2 mx_square(vec2 x) { - texture2d tex; - sampler s; - int get_width() { return tex.get_width(); } - int get_height() { return tex.get_height(); } - int get_num_mip_levels() { return tex.get_num_mip_levels(); } -}; + return x*x; +} + +vec3 mx_square(vec3 x) +{ + return x*x; +} + +#ifdef __DECL_GL_MATH_FUNCTIONS__ + +float radians(float degree) { return (degree * M_PI_F / 180.0f); } + +float3x3 inverse(float3x3 m) +{ + float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0]; + float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1]; + float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2]; + + float det = determinant(m); + float idet = 1.0f / det; + + float3x3 ret; + + ret[0][0] = idet * (n22 * n33 - n32 * n23); + ret[1][0] = idet * (n32 * n13 - n12 * n33); + ret[2][0] = idet * (n12 * n23 - n22 * n13); + + ret[0][1] = idet * (n31 * n23 - n21 * n33); + ret[1][1] = idet * (n11 * n33 - n31 * n13); + ret[2][1] = idet * (n21 * n13 - n11 * n23); + + ret[0][2] = idet * (n21 * n32 - n31 * n22); + ret[1][2] = idet * (n31 * n12 - n11 * n32); + ret[2][2] = idet * (n11 * n22 - n21 * n12); + + return ret; +} + +float4x4 inverse(float4x4 m) +{ + float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0]; + float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1]; + float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2]; + float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3]; + + float t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44; + float t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44; + float t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44; + float t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; + + float det = determinant(m); + float idet = 1.0f / det; + + float4x4 ret; + + ret[0][0] = t11 * idet; + ret[0][1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * idet; + ret[0][2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * idet; + ret[0][3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * idet; + + ret[1][0] = t12 * idet; + ret[1][1] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * idet; + ret[1][2] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * idet; + ret[1][3] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * idet; + + ret[2][0] = t13 * idet; + ret[2][1] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * idet; + ret[2][2] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * idet; + ret[2][3] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * idet; -int get_width(MetalTexture mtlTex) { return mtlTex.get_width(); } + ret[3][0] = t14 * idet; + ret[3][1] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * idet; + ret[3][2] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * idet; + ret[3][3] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * idet; -float4 texture(MetalTexture mtlTex, float2 uv) -{ - return mtlTex.tex.sample(mtlTex.s, uv); + return ret; } -float4 textureLod(MetalTexture mtlTex, float2 uv, float lod) +template +T1 mod(T1 x, T2 y) { - return mtlTex.tex.sample(mtlTex.s, uv, level(lod)); + return x - y * floor(x/y); } -int2 textureSize(MetalTexture mtlTex, int mipLevel) -{ - return int2(mtlTex.get_width(), mtlTex.get_height()); -} +template +T atan(T y_over_x) { return ::atan(y_over_x); } -int texture_mips(MetalTexture mtlTex) -{ - return mtlTex.tex.get_num_mip_levels(); -} +template +T atan(T y, T x) { return ::atan2(y, x); } + +#define lessThan(a, b) ((a) < (b)) +#define lessThanEqual(a, b) ((a) <= (b)) +#define greaterThan(a, b) ((a) > (b)) +#define greaterThanEqual(a, b) ((a) >= (b)) +#define equal(a, b) ((a) == (b)) +#define notEqual(a, b) ((a) != (b)) + +#endif // Restrict to 7x7 kernel size for performance reasons #define MX_MAX_SAMPLE_COUNT 49 // Size of all weights for all levels (including level 1) @@ -17357,183 +16828,323 @@ vec3 mx_convolution_vec3(vec3 S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT { result += S[i]*W[i+offset]; } - return result; + return result; +} + +// +// Apply filter for vec4 samples S, using weights W. +// sampleCount should be a square of a odd number { 1, 3, 5, 7 } +// +vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vec4 result = vec4(0.0); + for (int i=0; i1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = default_value; + vector2 st = mx_transform_uv(texcoord); + out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); +} +#include "lib/$fileTransformUv" + +void mx_image_float(textureresource file, string layer, float default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output float out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = color(default_value); + vector2 st = mx_transform_uv(texcoord); + color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); + out = rgb[0]; +} +void mx_worleynoise3d_vector2(vector position, float jitter, output vector2 result) +{ + result = mx_worley_noise_vector2(position, jitter, 0); +} +void mx_worleynoise2d_float(vector2 texcoord, float jitter, output float result) +{ + result = mx_worley_noise_float(texcoord, jitter, 0); +} +void mx_frame_float(output float result) +{ + getattribute("frame", result); +} +void mx_hsvtorgb_color3(vector _in, output vector result) +{ + result = transformc("hsv","rgb", _in); +} +void mx_fractal3d_vector2(vector2 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result) +{ + vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_geompropvalue_vector4(string geomprop, vector4 defaultVal, output vector4 out) +{ + float value[4]; + if (getattribute(geomprop, value) == 0) + { + out = defaultVal; + } + else + { + out.x = value[0]; + out.y = value[1]; + out.z = value[2]; + out.w = value[3]; + } +} +#include "mx_dodge_float.osl" + +void mx_dodge_color4(color4 fg , color4 bg , float mix , output color4 result) +{ + mx_dodge_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); + mx_dodge_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); + mx_dodge_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); + mx_dodge_float(fg.a, bg.a, mix, result.a); +} +#include "lib/$fileTransformUv" + +void mx_image_vector2(textureresource file, string layer, vector2 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector2 out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = color(default_value.x, default_value.y, 0.0); + vector2 st = mx_transform_uv(texcoord); + color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); + out.x = rgb[0]; + out.y = rgb[1]; +} +void mx_geompropvalue_vector(string geomprop, vector defaultVal, output vector out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +void mx_unpremult_color4(color4 in, output color4 result) +{ + result = color4(in.rgb / in.a, in.a); +} +void mx_normalmap_vector2(vector value, string map_space, vector2 normal_scale, vector N, vector U, output vector result) +{ + // Tangent space + if (map_space == "tangent") + { + vector v = value * 2.0 - 1.0; + vector T = normalize(U - dot(U, N) * N); + vector B = normalize(cross(N, T)); + result = normalize(T * v[0] * normal_scale.x + B * v[1] * normal_scale.y + N * v[2]); + } + // Object space + else + { + vector n = value * 2.0 - 1.0; + result = normalize(n); + } } -// -// Apply filter for vec4 samples S, using weights W. -// sampleCount should be a square of a odd number { 1, 3, 5, 7 } -// -vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +void mx_normalmap_float(vector value, string map_space, float normal_scale, vector N, vector U, output vector result) { - vec4 result = vec4(0.0); - for (int i=0; i -T1 mod(T1 x, T2 y) +void mx_worleynoise2d_vector2(vector2 texcoord, float jitter, output vector2 result) { - return x - y * floor(x/y); + result = mx_worley_noise_vector2(texcoord, jitter, 0); } - -template -T atan(T y_over_x) { return ::atan(y_over_x); } - -template -T atan(T y, T x) { return ::atan2(y, x); } - -#define lessThan(a, b) ((a) < (b)) -#define lessThanEqual(a, b) ((a) <= (b)) -#define greaterThan(a, b) ((a) > (b)) -#define greaterThanEqual(a, b) ((a) >= (b)) -#define equal(a, b) ((a) == (b)) -#define notEqual(a, b) ((a) != (b)) - -#endif -float3x3 operator+(float3x3 a, float b) +void mx_ambientocclusion_float(float coneangle, float maxdistance, output float result) { - return a + float3x3(b,b,b,b,b,b,b,b,b); + // This node is a stub and does not currently operate to specification + result = 0; } +#include "mx_dodge_float.osl" -float4x4 operator+(float4x4 a, float b) +void mx_dodge_color3(color fg, color bg, float mix, output color result) { - return a + float4x4(b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b); + mx_dodge_float(fg[0], bg[0], mix, result[0]); + mx_dodge_float(fg[1], bg[1], mix, result[1]); + mx_dodge_float(fg[2], bg[2], mix, result[2]); } - -float3x3 operator-(float3x3 a, float b) +void mx_fractal3d_vector3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result) { - return a - float3x3(b,b,b,b,b,b,b,b,b); + vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; } - -float4x4 operator-(float4x4 a, float b) +void mx_geompropvalue_string(string geomprop, string defaultVal, output string out) { - return a - float4x4(b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b); + if (getattribute(geomprop, out) == 0) + out = defaultVal; } - -float3x3 operator/(float3x3 a, float3x3 b) +void mx_geompropvalue_boolean(string geomprop, int defaultVal, output int out) { - for(int i = 0; i < 3; ++i) - for(int j = 0; j < 3; ++j) - a[i][j] /= b[i][j]; - - return a; + if (getattribute(geomprop, out) == 0) + out = defaultVal; } - -float4x4 operator/(float4x4 a, float4x4 b) +void mx_worleynoise2d_vector3(vector2 texcoord, float jitter, output vector result) { - for(int i = 0; i < 4; ++i) - for(int j = 0; j < 4; ++j) - a[i][j] /= b[i][j]; - - return a; + result = mx_worley_noise_vector3(texcoord, jitter, 0); } - -float3x3 operator/(float3x3 a, float b) +void mx_transformmatrix_vector2M3(vector2 val, matrix m, output vector2 result) { - for(int i = 0; i < 3; ++i) - for(int j = 0; j < 3; ++j) - a[i][j] /= b; - - return a; + point res = transform(m, point(val.x, val.y, 1.0)); + result.x = res[0]; + result.y = res[1]; } - -float4x4 operator/(float4x4 a, float b) +void mx_burn_float(float fg, float bg, float mix, output float result) { - for(int i = 0; i < 4; ++i) - for(int j = 0; j < 4; ++j) - a[i][j] /= b; - - return a; + if (abs(fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mix*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mix)*bg); +} +void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vector position, output float result) +{ + float f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_cellnoise3d_float(vector position, output float result) +{ + result = cellnoise(position); +} +void mx_premult_color4(color4 in, output color4 result) +{ + result = color4(in.rgb * in.a, in.a); } @@ -17541,7 +17152,7 @@ float4x4 operator/(float4x4 a, float b) Copyright Contributors to the MaterialX Project SPDX-License-Identifier: Apache-2.0 - Declarations for MDL implementations of standard nodes included in the MaterialX specification. + Declarations for OSL implementations of standard nodes included in the MaterialX specification. --> @@ -17549,3909 +17160,3085 @@ float4x4 operator/(float4x4 a, float b) - + - + - + - + - + - + - + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - + - - - + + + - - - + + + - + - + - + - + - + - - + + - - - + + + - - - - - - - - - + + + + + + + + + - + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - - - - + + + + - - + + - - + + - - + + - + - + - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + - - - + + + - - + + - - + + - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + - - + + + + + + + + + + + + + + + + + + - - + + + + + - - + + + - - + + + - - + + + + - - + + + + + + - - - - + + + - - - - + + + + + + + - - - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +void mx_geompropvalue_vector2(string geomprop, vector2 defaultVal, output vector2 out) +{ + float value[2]; + if (getattribute(geomprop, value) == 0) + { + out = defaultVal; + } + else + { + out.x = value[0]; + out.y = value[1]; + } +} +void mx_geompropvalue_color(string geomprop, color defaultVal, output color out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +#include "lib/$fileTransformUv" - - - - - - - - - - - - - +void mx_image_color4(textureresource file, string layer, color4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color4 out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } - - - - - - - - - - - - - - - - - - - + color missingColor = default_value.rgb; + float missingAlpha = default_value.a; + vector2 st = mx_transform_uv(texcoord); + float alpha; + color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, + "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); - - - - - - - - - - - - - - - + out = color4(rgb, alpha); +} +void mx_noise2d_float(float amplitude, float pivot, vector2 texcoord, output float result) +{ + float value = noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_time_float(float fps, output float result) +{ + float frame; + getattribute("frame", frame); + result = frame / fps; +} +void mx_noise3d_vector3(vector amplitude, float pivot, vector position, output vector result) +{ + vector value = noise("snoise", position); + result = value * amplitude + pivot; +} +#include "lib/$fileTransformUv" + +void mx_image_vector4(textureresource file, string layer, vector4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector4 out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = color(default_value.x, default_value.y, default_value.z); + float missingAlpha = default_value.w; + vector2 st = mx_transform_uv(texcoord); + float alpha; + color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, + "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode); + + out = vector4(rgb[0], rgb[1], rgb[2], alpha); +} +void mx_noise2d_vector3(vector amplitude, float pivot, vector2 texcoord, output vector result) +{ + vector value = noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_luminance_color3(color in, color lumacoeffs, output color result) +{ + result = dot(in, lumacoeffs); +} +void mx_geompropvalue_integer(string geomprop, int defaultVal, output int out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +matrix rotationMatrix(vector axis, float angle) +{ + vector nAxis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; - - - + return matrix(oc * nAxis[0] * nAxis[0] + c, oc * nAxis[0] * nAxis[1] - nAxis[2] * s, oc * nAxis[2] * nAxis[0] + nAxis[1] * s, 0.0, + oc * nAxis[0] * nAxis[1] + nAxis[2] * s, oc * nAxis[1] * nAxis[1] + c, oc * nAxis[1] * nAxis[2] - nAxis[0] * s, 0.0, + oc * nAxis[2] * nAxis[0] - nAxis[1] * s, oc * nAxis[1] * nAxis[2] + nAxis[0] * s, oc * nAxis[2] * nAxis[2] + c, 0.0, + 0.0, 0.0, 0.0, 1.0); +} - - - - - - - - - - - - - - - - - - +void mx_rotate_vector3(vector _in, float amount, vector axis, output vector result) +{ + float rotationRadians = radians(amount); + matrix m = rotationMatrix(axis, rotationRadians); + vector4 trans = transform(m, vector4(_in[0], _in[1], _in[2], 1.0)); + result = vector(trans.x, trans.y, trans.z); +} +void mx_geompropvalue_float(string geomprop, float defaultVal, output float result) +{ + if (getattribute(geomprop, result) == 0) + { + result = defaultVal; + } +} +void mx_geomcolor_float(int index, output float result) +{ + getattribute("color", result); +} +void mx_worleynoise3d_vector3(vector position, float jitter, output vector result) +{ + result = mx_worley_noise_vector3(position, jitter, 0); +} +#include "mx_burn_float.osl" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void mx_burn_color4(color4 fg, color4 bg, float mix, output color4 result) +{ + mx_burn_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); + mx_burn_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); + mx_burn_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); + mx_burn_float(fg.a, bg.a, mix, result.a); +} +void mx_noise3d_vector4(vector4 amplitude, float pivot, vector position, output vector4 result) +{ + vector4 value = mx_noise("snoise", position); + result = value * amplitude + pivot; +} +void mx_noise2d_vector2(vector2 amplitude, float pivot, vector2 texcoord, output vector2 result) +{ + vector2 value = mx_noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_noise3d_vector2(vector2 amplitude, float pivot, vector position, output vector2 result) +{ + vector2 value = mx_noise("snoise", position); + result = value * amplitude + pivot; +} +void mx_luminance_color4(color4 in, color lumacoeffs, output color4 result) +{ + result = color4(dot(in.rgb, lumacoeffs), in.a); +} +#include "lib/$fileTransformUv" - - - - - +void mx_image_color3(textureresource file, string layer, color default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } - - - + color missingColor = default_value; + vector2 st = mx_transform_uv(texcoord); + out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); +} +void mx_worleynoise3d_float(vector position, float jitter, output float result) +{ + result = mx_worley_noise_float(position, jitter, 0); +} +void mx_fractal3d_vector4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result) +{ + vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, output surfaceshader result) +{ + result.bsdf = mix(bg.bsdf, fg.bsdf, w); + result.edf = mix(bg.edf, fg.edf, w); + result.opacity = mix(bg.opacity, fg.opacity, w); +} +void mx_rgbtohsv_color3(vector _in, output vector result) +{ + result = transformc("rgb","hsv", _in); +} +void mx_rgbtohsv_color4(color4 _in, output color4 result) +{ + result = color4(transformc("rgb","hsv", _in.rgb), 1.0); +} +void mx_disjointover_color4(color4 fg, color4 bg, float mix, output color4 result) +{ + float summedAlpha = fg.a + bg.a; - - - + if (summedAlpha <= 1) + { + result.rgb = fg.rgb + bg.rgb; + } + else + { + if (abs(bg.a) < M_FLOAT_EPS) + { + result.rgb = 0.0; + } + else + { + float x = (1 - fg.a) / bg.a; + result.rgb = fg.rgb + bg.rgb * x; + } + } + result.a = min(summedAlpha, 1.0); - - - - + result.rgb = result.rgb * mix + (1.0 - mix) * bg.rgb; + result.a = result.a * mix + (1.0 - mix) * bg.a; +} +void mx_creatematrix_vector3_matrix33(vector in1, vector in2, vector in3, output matrix result) +{ + result = matrix(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + 0.0, 0.0, 0.0, 1.0); +} - - - +void mx_creatematrix_vector3_matrix44(vector in1, vector in2, vector in3, vector in4, output matrix result) +{ + result = matrix(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + in4.x, in4.y, in4.z, 1.0); +} - - - - - - - +void mx_creatematrix_vector4_matrix44(vector4 in1, vector4 in2, vector4 in3, vector4 in4, output matrix result) +{ + result = matrix(in1.x, in1.y, in1.z, in1.w, + in2.x, in2.y, in2.z, in2.w, + in3.x, in3.y, in3.z, in3.w, + in4.x, in4.y, in4.z, in4.w); +} +void mx_surface_unlit(float emission_weight, color emission_color, float transmission_weight, color transmission_color, float opacity, output surfaceshader result) +{ + float trans = clamp(transmission_weight, 0.0, 1.0); + result.bsdf = trans * transmission_color * transparent(); + result.edf = (1.0 - trans) * emission_weight * emission_color * emission(); + result.opacity = clamp(opacity, 0.0, 1.0); +} +void mx_geompropvalue_color4(string geomprop, color4 defaultVal, output color4 out) +{ + float value[4]; + if (getattribute(geomprop, value) == 0) + { + out.rgb = defaultVal.rgb; + out.a = defaultVal.a; + } + else + { + out.rgb[0] = value[0]; + out.rgb[1] = value[1]; + out.rgb[2] = value[2]; + out.a = value[3]; + } +} +void mx_cellnoise2d_float(vector2 texcoord, output float result) +{ + result = cellnoise(texcoord.x, texcoord.y); +} +// Restrict to 7x7 kernel size for performance reasons +#define MX_MAX_SAMPLE_COUNT 49 +// Size of all weights for all levels (including level 1) +#define MX_WEIGHT_ARRAY_SIZE 84 - - +// +// Function to compute the sample size relative to a texture coordinate +// +vector2 mx_compute_sample_size_uv(vector2 uv, float filterSize, float filterOffset) +{ + vector derivUVx = Dx(vector(uv.x, uv.y, 0.0)) * 0.5; + vector derivUVy = Dy(vector(uv.x, uv.y, 0.0)) * 0.5; + float derivX = abs(derivUVx[0]) + abs(derivUVy[0]); + float derivY = abs(derivUVx[1]) + abs(derivUVy[1]); + float sampleSizeU = filterSize * derivX + filterOffset; + if (sampleSizeU < 1.0E-05) + sampleSizeU = 1.0E-05; + float sampleSizeV = filterSize * derivY + filterOffset; + if (sampleSizeV < 1.0E-05) + sampleSizeV = 1.0E-05; + return vector2(sampleSizeU, sampleSizeV); +} - - - +// Kernel weights for box filter +void mx_get_box_weights(output float W[MX_MAX_SAMPLE_COUNT], int filterSize) +{ + int sampleCount = filterSize*filterSize; + float value = 1.0 / float(sampleCount); + for (int i=0; i= 7) + { + W[0] = 0.000036; W[1] = 0.000363; W[2] = 0.001446; W[3] = 0.002291; W[4] = 0.001446; W[5] = 0.000363; W[6] = 0.000036; + W[7] = 0.000363; W[8] = 0.003676; W[9] = 0.014662; W[10] = 0.023226; W[11] = 0.014662; W[12] = 0.003676; W[13] = 0.000363; + W[14] = 0.001446; W[15] = 0.014662; W[16] = 0.058488; W[17] = 0.092651; W[18] = 0.058488; W[19] = 0.014662; W[20] = 0.001446; + W[21] = 0.002291; W[22] = 0.023226; W[23] = 0.092651; W[24] = 0.146768; W[25] = 0.092651; W[26] = 0.023226; W[27] = 0.002291; + W[28] = 0.001446; W[29] = 0.014662; W[30] = 0.058488; W[31] = 0.092651; W[32] = 0.058488; W[33] = 0.014662; W[34] = 0.001446; + W[35] = 0.000363; W[36] = 0.003676; W[37] = 0.014662; W[38] = 0.023226; W[39] = 0.014662; W[40] = 0.003676; W[41] = 0.000363; + W[42] = 0.000036; W[43] = 0.000363; W[44] = 0.001446; W[45] = 0.002291; W[46] = 0.001446; W[47] = 0.000363; W[48] = 0.000036; + } + else if (filterSize >= 5) + { + W[0] = 0.003765; W[1] = 0.015019; W[2] = 0.023792; W[3] = 0.015019; W[4] = 0.003765; + W[5] = 0.015019; W[6] = 0.059912; W[7] = 0.094907; W[8] = 0.059912; W[9] = 0.015019; + W[10] = 0.023792; W[11] = 0.094907; W[12] = 0.150342; W[13] = 0.094907; W[14] = 0.023792; + W[15] = 0.015019; W[16] = 0.059912; W[17] = 0.094907; W[18] = 0.059912; W[19] = 0.015019; + W[20] = 0.003765; W[21] = 0.015019; W[22] = 0.023792; W[23] = 0.015019; W[24] = 0.003765; + } + else if (filterSize >= 3) + { + W[0] = 0.0625; W[1] = 0.125; W[2] = 0.0625; + W[3] = 0.125; W[4] = 0.25; W[5] = 0.125; + W[6] = 0.0625; W[7] = 0.125; W[8] = 0.0625; + } + else + { + W[0] = 1.0; + } +} - - - - - - - - - - - - - - - - - +// +// Apply filter for float samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + float result = 0.0; + for (int i = 0; i < sampleCount; i++) + { + result += S[i]*W[i+offset]; + } + return result; +} - -#include "lib/mx_noise.glsl" +// +// Apply filter for vector2 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vector2 mx_convolution_vector2(vector2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vector2 result = vector2(0.0, 0.0); + for (int i=0; i= high) - result = 1.0; - else - result = smoothstep(low, high, val); + return texcoord; } -#include "mx_aastep.glsl" +vector2 mx_transform_uv(vector2 texcoord) +{ + return vector2(texcoord.x, 1.0 - texcoord.y); +} +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE +// +// MaterialX specification (c) 2017 Lucasfilm Ltd. +// http://www.materialx.org/ -void mx_splittb_vector2(vec2 valuet, vec2 valueb, float center, vec2 texcoord, out vec2 result) +#pragma once + +#include "color4.h" +#include "vector2.h" +#include "vector4.h" +#include "matrix33.h" + +// +// Support functions for OSL implementations of the MaterialX nodes. +// + +float mx_ternary(int expr, float v1, float v2) { if (expr) return v1; else return v2; } +int mx_ternary(int expr, int v1, int v2) { if (expr) return v1; else return v2; } +color mx_ternary(int expr, color v1, color v2) { if (expr) return v1; else return v2; } +color4 mx_ternary(int expr, color4 v1, color4 v2) { if (expr) return v1; else return v2; } +vector mx_ternary(int expr, vector v1, vector v2) { if (expr) return v1; else return v2; } +vector2 mx_ternary(int expr, vector2 v1, vector2 v2) { if (expr) return v1; else return v2; } +vector4 mx_ternary(int expr, vector4 v1, vector4 v2) { if (expr) return v1; else return v2; } +matrix mx_ternary(int expr, matrix v1, matrix v2) { if (expr) return v1; else return v2; } +matrix33 mx_ternary(int expr, matrix33 v1, matrix33 v2) { if (expr) return v1; else return v2; } + + +matrix33 mx_add(matrix33 a, matrix33 b) { - result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); + return matrix33(matrix( + a.m[0][0]+b.m[0][0], a.m[0][1]+b.m[0][1], a.m[0][2]+b.m[0][2], 0.0, + a.m[1][0]+b.m[1][0], a.m[1][1]+b.m[1][1], a.m[1][2]+b.m[1][2], 0.0, + a.m[2][0]+b.m[2][0], a.m[2][1]+b.m[2][1], a.m[2][2]+b.m[2][2], 0.0, + 0.0, 0.0, 0.0, 1.0)); } -#include "mx_smoothstep_float.glsl" -void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) +matrix33 mx_add(matrix33 a, float b) { - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); + return matrix33(matrix( + a.m[0][0]+b, a.m[0][1]+b, a.m[0][2]+b, 0.0, + a.m[1][0]+b, a.m[1][1]+b, a.m[1][2]+b, 0.0, + a.m[2][0]+b, a.m[2][1]+b, a.m[2][2]+b, 0.0, + 0.0, 0.0, 0.0, 1.0)); } -#include "lib/mx_noise.glsl" -void mx_cellnoise3d_float(vec3 position, out float result) +matrix mx_add(matrix a, matrix b) { - result = mx_cell_noise_float(position); + return matrix( + a[0][0]+b[0][0], a[0][1]+b[0][1], a[0][2]+b[0][2], a[0][3]+b[0][3], + a[1][0]+b[1][0], a[1][1]+b[1][1], a[1][2]+b[1][2], a[1][3]+b[1][3], + a[2][0]+b[2][0], a[2][1]+b[2][1], a[2][2]+b[2][2], a[2][3]+b[2][3], + a[3][0]+b[3][0], a[3][1]+b[3][1], a[3][2]+b[3][2], a[3][3]+b[3][3]); } -void mx_transformmatrix_vector2M3(vec2 val, mat3 transform, out vec2 result) + +matrix mx_add(matrix a, float b) { - vec3 res = transform * vec3(val, 1.0); - result = res.xy; + return matrix( + a[0][0]+b, a[0][1]+b, a[0][2]+b, a[0][3]+b, + a[1][0]+b, a[1][1]+b, a[1][2]+b, a[1][3]+b, + a[2][0]+b, a[2][1]+b, a[2][2]+b, a[2][3]+b, + a[3][0]+b, a[3][1]+b, a[3][2]+b, a[3][3]+b); } -void mx_ramptb_vector4(vec4 valuet, vec4 valueb, vec2 texcoord, out vec4 result) + + +matrix33 mx_subtract(matrix33 a, matrix33 b) { - result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); + return matrix33(matrix( + a.m[0][0]-b.m[0][0], a.m[0][1]-b.m[0][1], a.m[0][2]-b.m[0][2], 0.0, + a.m[1][0]-b.m[1][0], a.m[1][1]-b.m[1][1], a.m[1][2]-b.m[1][2], 0.0, + a.m[2][0]-b.m[2][0], a.m[2][1]-b.m[2][1], a.m[2][2]-b.m[2][2], 0.0, + 0.0, 0.0, 0.0, 1.0)); } -#include "mx_burn_float.glsl" -void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) +matrix33 mx_subtract(matrix33 a, float b) { - mx_burn_float(fg.x, bg.x, mixval, result.x); - mx_burn_float(fg.y, bg.y, mixval, result.y); - mx_burn_float(fg.z, bg.z, mixval, result.z); - mx_burn_float(fg.w, bg.w, mixval, result.w); + return matrix33(matrix( + a.m[0][0]-b, a.m[0][1]-b, a.m[0][2]-b, 0.0, + a.m[1][0]-b, a.m[1][1]-b, a.m[1][2]-b, 0.0, + a.m[2][0]-b, a.m[2][1]-b, a.m[2][2]-b, 0.0, + 0.0, 0.0, 0.0, 1.0)); } -#include "lib/$fileTransformUv" -void mx_image_vector2(sampler2D tex_sampler, int layer, vec2 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec2 result) +matrix mx_subtract(matrix a, matrix b) { - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv).rg; + return matrix( + a[0][0]-b[0][0], a[0][1]-b[0][1], a[0][2]-b[0][2], a[0][3]-b[0][3], + a[1][0]-b[1][0], a[1][1]-b[1][1], a[1][2]-b[1][2], a[1][3]-b[1][3], + a[2][0]-b[2][0], a[2][1]-b[2][1], a[2][2]-b[2][2], a[2][3]-b[2][3], + a[3][0]-b[3][0], a[3][1]-b[3][1], a[3][2]-b[3][2], a[3][3]-b[3][3]); } -#include "mx_aastep.glsl" -void mx_splittb_vector4(vec4 valuet, vec4 valueb, float center, vec2 texcoord, out vec4 result) +matrix mx_subtract(matrix a, float b) { - result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); + return matrix( + a[0][0]-b, a[0][1]-b, a[0][2]-b, a[0][3]-b, + a[1][0]-b, a[1][1]-b, a[1][2]-b, a[1][3]-b, + a[2][0]-b, a[2][1]-b, a[2][2]-b, a[2][3]-b, + a[3][0]-b, a[3][1]-b, a[3][2]-b, a[3][3]-b); } -#include "lib/mx_noise.glsl" -void mx_noise3d_float(float amplitude, float pivot, vec3 position, out float result) + +float mx_extract(color in, int index) { - float value = mx_perlin_noise_float(position); - result = value * amplitude + pivot; + return in[index]; } -#include "lib/$fileTransformUv" -void mx_image_float(sampler2D tex_sampler, int layer, float defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out float result) +float mx_extract(color4 in, int index) { - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv).r; + if (index == 0) return in.rgb.r; + else if (index == 1) return in.rgb.g; + else if (index == 2) return in.rgb.b; + else return in.a; } -#include "lib/mx_noise.glsl" -void mx_noise2d_float(float amplitude, float pivot, vec2 texcoord, out float result) +float mx_extract(vector2 in, int index) { - float value = mx_perlin_noise_float(texcoord); - result = value * amplitude + pivot; + if (index == 0) return in.x; + else return in.y; } -void mx_ramptb_float(float valuet, float valueb, vec2 texcoord, out float result) + +float mx_extract(vector in, int index) { - result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); + return in[index]; } -#include "lib/mx_noise.glsl" -void mx_worleynoise2d_vector2(vec2 texcoord, float jitter, out vec2 result) +float mx_extract(vector4 in, int index) { - result = mx_worley_noise_vec2(texcoord, jitter, 0); + if (index == 0) return in.x; + else if (index == 1) return in.y; + else if (index == 2) return in.z; + else return in.w; } -#include "mx_dodge_float.glsl" -void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) + +float mx_remap(float in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) { - mx_dodge_float(fg.x, bg.x, mixval, result.x); - mx_dodge_float(fg.y, bg.y, mixval, result.y); - mx_dodge_float(fg.z, bg.z, mixval, result.z); + float x = (in - inLow)/(inHigh-inLow); + if (doClamp == 1) { + x = clamp(x, 0, 1); + } + return outLow + (outHigh - outLow) * x; } -#include "lib/mx_noise.glsl" -void mx_noise3d_vector3(vec3 amplitude, float pivot, vec3 position, out vec3 result) +color mx_remap(color in, color inLow, color inHigh, color outLow, color outHigh, int doClamp) { - vec3 value = mx_perlin_noise_vec3(position); - result = value * amplitude + pivot; + color x = (in - inLow) / (inHigh - inLow); + if (doClamp == 1) { + x = clamp(x, 0, 1); + } + return outLow + (outHigh - outLow) * x; } -void mx_ramptb_vector2(vec2 valuet, vec2 valueb, vec2 texcoord, out vec2 result) + +color mx_remap(color in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) { - result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); + color x = (in - inLow) / (inHigh - inLow); + if (doClamp == 1) { + x = clamp(x, 0, 1); + } + return outLow + (outHigh - outLow) * x; } -void mx_ramplr_float(float valuel, float valuer, vec2 texcoord, out float result) + +color4 mx_remap(color4 c, color4 inLow, color4 inHigh, color4 outLow, color4 outHigh, int doClamp) { - result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); + return color4(mx_remap(c.rgb, inLow.rgb, inHigh.rgb, outLow.rgb, outHigh.rgb, doClamp), + mx_remap(c.a, inLow.a, inHigh.a, outLow.a, outHigh.a, doClamp)); } -void mx_disjointover_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) + +color4 mx_remap(color4 c, float inLow, float inHigh, float outLow, float outHigh, int doClamp) { - float summedAlpha = fg.w + bg.w; + color4 c4_inLow = color4(color(inLow), inLow); + color4 c4_inHigh = color4(color(inHigh), inHigh); + color4 c4_outLow = color4(color(outLow), outLow); + color4 c4_outHigh = color4(color(outHigh), outHigh); + return mx_remap(c, c4_inLow, c4_inHigh, c4_outLow, c4_outHigh, doClamp); +} - if (summedAlpha <= 1.0) - { - result.xyz = fg.xyz + bg.xyz; - } - else - { - if (abs(bg.w) < M_FLOAT_EPS) - { - result.xyz = vec3(0.0); - } - else - { - float x = (1.0 - fg.w) / bg.w; - result.xyz = fg.xyz + bg.xyz * x; - } - } - result.w = min(summedAlpha, 1.0); +vector2 mx_remap(vector2 in, vector2 inLow, vector2 inHigh, vector2 outLow, vector2 outHigh, int doClamp) +{ + return vector2(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp), + mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp)); +} - result.xyz = result.xyz * mixval + (1.0 - mixval) * bg.xyz; - result.w = result.w * mixval + (1.0 - mixval) * bg.w; +vector2 mx_remap(vector2 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) +{ + return vector2(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp), + mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp)); } -#include "lib/mx_noise.glsl" -void mx_noise2d_vector2(vec2 amplitude, float pivot, vec2 texcoord, out vec2 result) +vector4 mx_remap(vector4 in, vector4 inLow, vector4 inHigh, vector4 outLow, vector4 outHigh, int doClamp) { - vec3 value = mx_perlin_noise_vec3(texcoord); - result = value.xy * amplitude + pivot; + return vector4(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp), + mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp), + mx_remap(in.z, inLow.z, inHigh.z, outLow.z, outHigh.z, doClamp), + mx_remap(in.w, inLow.w, inHigh.w, outLow.w, outHigh.w, doClamp)); } -#include "lib/$fileTransformUv" -void mx_image_color3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) +vector4 mx_remap(vector4 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) { - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv).rgb; + return vector4(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp), + mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp), + mx_remap(in.z, inLow, inHigh, outLow, outHigh, doClamp), + mx_remap(in.w, inLow, inHigh, outLow, outHigh, doClamp)); } -void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) + + +float mx_contrast(float in, float amount, float pivot) { - // Decode the normal map. - value = (value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0; + float out = in - pivot; + out *= amount; + out += pivot; + return out; +} - // Transform from tangent space if needed. - if (map_space == 0) - { - vec3 B = normalize(cross(N, T)); - value.xy *= normal_scale; - value = T * value.x + B * value.y + N * value.z; - } +color mx_contrast(color in, color amount, color pivot) +{ + color out = in - pivot; + out *= amount; + out += pivot; + return out; +} - // Normalize the result. - result = normalize(value); +color mx_contrast(color in, float amount, float pivot) +{ + color out = in - pivot; + out *= amount; + out += pivot; + return out; } -void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result) +color4 mx_contrast(color4 c, color4 amount, color4 pivot) { - mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); + return color4(mx_contrast(c.rgb, amount.rgb, pivot.rgb), + mx_contrast(c.a, amount.a, pivot.a)); } -#include "lib/mx_noise.glsl" -void mx_fractal3d_vector4(vec4 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec4 result) +color4 mx_contrast(color4 c, float amount, float pivot) { - vec4 value = mx_fractal_noise_vec4(position, octaves, lacunarity, diminish); - result = value * amplitude; + return mx_contrast(c, color4(color(amount), amount), color4(color(pivot), pivot)); } -#include "lib/$fileTransformUv" -void mx_image_vector3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) +vector2 mx_contrast(vector2 in, vector2 amount, vector2 pivot) { - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv).rgb; + return vector2 (mx_contrast(in.x, amount.x, pivot.x), + mx_contrast(in.y, amount.y, pivot.y)); } -void mx_ramplr_vector2(vec2 valuel, vec2 valuer, vec2 texcoord, out vec2 result) + +vector2 mx_contrast(vector2 in, float amount, float pivot) { - result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); + return mx_contrast(in, vector2(amount, amount), vector2(pivot, pivot)); } -void mx_dodge_float(float fg, float bg, float mixval, out float result) + +vector4 mx_contrast(vector4 in, vector4 amount, vector4 pivot) { - if (abs(1.0 - fg) < M_FLOAT_EPS) - { - result = 0.0; - return; - } - result = mixval*(bg / (1.0 - fg)) + ((1.0-mixval)*bg); + return vector4(mx_contrast(in.x, amount.x, pivot.x), + mx_contrast(in.y, amount.y, pivot.y), + mx_contrast(in.z, amount.z, pivot.z), + mx_contrast(in.w, amount.w, pivot.w)); } -#include "mx_smoothstep_float.glsl" -void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, out vec3 result) +vector4 mx_contrast(vector4 in, float amount, float pivot) { - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); - mx_smoothstep_float(val.z, low.z, high.z, result.z); + return vector4(mx_contrast(in.x, amount, pivot), + mx_contrast(in.y, amount, pivot), + mx_contrast(in.z, amount, pivot), + mx_contrast(in.w, amount, pivot)); } -void mx_ramplr_vector4(vec4 valuel, vec4 valuer, vec2 texcoord, out vec4 result) + + +vector2 mx_noise(string noisetype, float x, float y) { - result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); + color cnoise = (color) noise(noisetype, x, y); + return vector2 (cnoise[0], cnoise[1]); } -#include "lib/mx_hsv.glsl" -void mx_rgbtohsv_color3(vec3 _in, out vec3 result) +color4 mx_noise(string noisetype, float x, float y) { - result = mx_rgbtohsv(_in); + color cnoise = (color) noise(noisetype, x, y); + float fnoise = (float) noise(noisetype, x + 19, y + 73); + return color4 (cnoise, fnoise); } -#include "mx_aastep.glsl" -void mx_splittb_float(float valuet, float valueb, float center, vec2 texcoord, out float result) +vector4 mx_noise(string noisetype, float x, float y) { - result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); + color cnoise = (color) noise(noisetype, x, y); + float fnoise = (float) noise(noisetype, x + 19, y + 73); + return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise); } -#include "lib/mx_noise.glsl" -void mx_noise2d_vector3(vec3 amplitude, float pivot, vec2 texcoord, out vec3 result) +vector2 mx_noise(string noisetype, point position) { - vec3 value = mx_perlin_noise_vec3(texcoord); - result = value * amplitude + pivot; + color cnoise = (color) noise(noisetype, position); + return vector2 (cnoise[0], cnoise[1]); } -#include "mx_dodge_float.glsl" -void mx_dodge_color4(vec4 fg , vec4 bg , float mixval, out vec4 result) +color4 mx_noise(string noisetype, point position) { - mx_dodge_float(fg.x, bg.x, mixval, result.x); - mx_dodge_float(fg.y, bg.y, mixval, result.y); - mx_dodge_float(fg.z, bg.z, mixval, result.z); - mx_dodge_float(fg.w, bg.w, mixval, result.w); + color cnoise = (color) noise(noisetype, position); + float fnoise = (float) noise(noisetype, position+vector(19,73,29)); + return color4 (cnoise, fnoise); } -float mx_aastep(float threshold, float value) + +vector4 mx_noise(string noisetype, point position) { - float afwidth = length(vec2(dFdx(value), dFdy(value))) * 0.70710678118654757; - return smoothstep(threshold-afwidth, threshold+afwidth, value); + color cnoise = (color) noise(noisetype, position); + float fnoise = (float) noise(noisetype, position+vector(19,73,29)); + return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise); } -void mx_premult_color4(vec4 _in, out vec4 result) + + +float mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - result = vec4(_in.rgb * _in.a, _in.a); + float out = 0; + float amp = 1.0; + point p = position; + + for (int i = 0; i < octaves; i += 1) { + out += amp * noise(noisetype, p); + amp *= diminish; + p *= lacunarity; + } + return out; } -#include "lib/mx_hsv.glsl" -void mx_rgbtohsv_color4(vec4 _in, out vec4 result) +color mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - result = vec4(mx_rgbtohsv(_in.rgb), 1.0); + color out = 0; + float amp = 1.0; + point p = position; + + for (int i = 0; i < octaves; i += 1) { + out += amp * (color)noise(noisetype, p); + amp *= diminish; + p *= lacunarity; + } + return out; } -#include "lib/mx_noise.glsl" -void mx_worleynoise3d_float(vec3 position, float jitter, out float result) +vector2 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - result = mx_worley_noise_float(position, jitter, 0); + return vector2((float) mx_fbm(position, octaves, lacunarity, diminish, noisetype), + (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype)); } -#include "lib/mx_hsv.glsl" -void mx_hsvtorgb_color3(vec3 _in, out vec3 result) +color4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - result = mx_hsvtorgb(_in); + color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype); + float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype); + return color4 (c, f); } -#include "lib/mx_noise.glsl" -void mx_cellnoise2d_float(vec2 texcoord, out float result) +vector4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - result = mx_cell_noise_float(texcoord); + color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype); + float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype); + return vector4 (c[0], c[1], c[2], f); } -#include "lib/mx_noise.glsl" -void mx_fractal3d_vector2(vec2 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec2 result) + +void mx_split_float(output float x, output int ix) { - vec2 value = mx_fractal_noise_vec2(position, octaves, lacunarity, diminish); - result = value * amplitude; + ix = int(floor(x)); + x -= ix; } -#include "lib/mx_noise.glsl" -void mx_noise2d_vector4(vec4 amplitude, float pivot, vec2 texcoord, out vec4 result) +float mx_worley_distance(vector2 p, int x, int y, int X, int Y, float jitter, int metric) { - vec3 xyz = mx_perlin_noise_vec3(texcoord); - float w = mx_perlin_noise_float(texcoord + vec2(19, 73)); - result = vec4(xyz, w) * amplitude + pivot; + vector o = cellnoise(x+X, y+Y); + o = (o - .5)*jitter + .5; + float cposx = x + o[0]; + float cposy = y + o[1]; + float diffx = cposx - p.x; + float diffy = cposy - p.y; + + if (metric == 2) + return abs(diffx) + abs(diffy); // Manhattan distance + if (metric == 3) + return max(abs(diffx), abs(diffy)); // Chebyshev distance + return diffx*diffx + diffy*diffy; // Euclidean or distance^2 } -mat4 mx_rotationMatrix(vec3 axis, float angle) + +float mx_worley_distance(vector p, int x, int y, int z, int X, int Y, int Z, float jitter, int metric) { - axis = normalize(axis); - float s = sin(angle); - float c = cos(angle); - float oc = 1.0 - c; + vector o = cellnoise(vector(x+X, y+Y, z+Z)); + o = (o - .5)*jitter + .5; + vector cpos = vector(x, y, z) + o; + vector diff = cpos - p; - return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, - oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, - oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, - 0.0, 0.0, 0.0, 1.0); + if (metric == 2) + return abs(diff[0]) + abs(diff[1]); // Manhattan distance + if (metric == 3) + return max(abs(diff[0]), abs(diff[1])); // Chebyshev distance + return dot(diff, diff); // Eucldean or distance^2 } -void mx_rotate_vector3(vec3 _in, float amount, vec3 axis, out vec3 result) +void mx_sort_distance(float dist, output vector2 result) { - float rotationRadians = radians(amount); - mat4 m = mx_rotationMatrix(axis, rotationRadians); - result = (m * vec4(_in, 1.0)).xyz; + if (dist < result.x) + { + result.y = result.x; + result.x = dist; + } + else if (dist < result.y) + { + result.y = dist; + } } -void mx_creatematrix_vector4_matrix44(vec4 in1, vec4 in2, vec4 in3, vec4 in4, out mat4 result) + +void mx_sort_distance(float dist, output vector result) { - result = mat4(in1.x, in1.y, in1.z, in1.w, - in2.x, in2.y, in2.z, in2.w, - in3.x, in3.y, in3.z, in3.w, - in4.x, in4.y, in4.z, in4.w); + if (dist < result[0]) + { + result[2] = result[1]; + result[1] = result[0]; + result[0] = dist; + } + else if (dist < result[1]) + { + result[2] = result[1]; + result[1] = dist; + } + else if (dist < result[2]) + { + result[2] = dist; + } } -void mx_ramplr_vector3(vec3 valuel, vec3 valuer, vec2 texcoord, out vec3 result) + +float mx_worley_noise_float(vector2 p, float jitter, int metric) { - result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); + int X, Y; + vector2 seed = p; + float result = 1e6; + + mx_split_float(seed.x, X); + mx_split_float(seed.y, Y); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); + result = min(result, d); + } + } + if (metric == 0) + result = sqrt(result); + return result; } -void mx_transformmatrix_vector3M4(vec3 val, mat4 transform, out vec3 result) + +vector2 mx_worley_noise_vector2(vector2 p, float jitter, int metric) { - vec4 res = transform * vec4(val, 1.0); - result = res.xyz; + int X, Y; + vector2 seed = p; + vector2 result = vector2(1e6, 1e6); + + mx_split_float(seed.x, X); + mx_split_float(seed.y, Y); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); + mx_sort_distance(d, result); + } + } + if (metric == 0) + result = sqrt(result); + return result; } -void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, out surfaceshader returnshader) + +vector mx_worley_noise_vector3(vector2 p, float jitter, int metric) { - returnshader.color = mix(bg.color, fg.color, w); - returnshader.transparency = mix(bg.transparency, fg.transparency, w); + int X, Y; + vector2 seed = p; + vector result = vector(1e6, 1e6, 1e6); + + mx_split_float(seed.x, X); + mx_split_float(seed.y, Y); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); + mx_sort_distance(d, result); + } + } + if (metric == 0) + result = sqrt(result); + return result; } -void mx_luminance_color3(vec3 _in, vec3 lumacoeffs, out vec3 result) + +float mx_worley_noise_float(vector p, float jitter, int metric) { - result = vec3(dot(_in, lumacoeffs)); + int X, Y, Z; + vector seed = p; + float result = 1e6; + + mx_split_float(seed[0], X); + mx_split_float(seed[1], Y); + mx_split_float(seed[2], Z); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); + result = min(result, d); + } + } + } + if (metric == 0) + result = sqrt(result); + return result; } -#include "mx_smoothstep_float.glsl" -void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) +vector2 mx_worley_noise_vector2(vector p, float jitter, int metric) { - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); - mx_smoothstep_float(val.z, low.z, high.z, result.z); - mx_smoothstep_float(val.w, low.w, high.w, result.w); + int X, Y, Z; + vector seed = p; + vector2 result = vector2(1e6, 1e6); + + mx_split_float(seed[0], X); + mx_split_float(seed[1], Y); + mx_split_float(seed[2], Z); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); + mx_sort_distance(d, result); + } + } + } + if (metric == 0) + result = sqrt(result); + return result; } -void mx_burn_float(float fg, float bg, float mixval, out float result) + +vector mx_worley_noise_vector3(vector p, float jitter, int metric) { - if (abs(fg) < M_FLOAT_EPS) + int X, Y, Z; + vector result = 1e6; + vector seed = p; + + mx_split_float(seed[0], X); + mx_split_float(seed[1], Y); + mx_split_float(seed[2], Z); + for (int x = -1; x <= 1; ++x) { - result = 0.0; - return; + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); + mx_sort_distance(d, result); + } + } } - result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); + if (metric == 0) + result = sqrt(result); + return result; } -void mx_unpremult_color4(vec4 _in, out vec4 result) +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE +// +// MaterialX specification (c) 2017 Lucasfilm Ltd. +// http://www.materialx.org/ + +#pragma once +#define MATRIX33_H + + +struct matrix33 { - result = vec4(_in.rgb / _in.a, _in.a); -} -void mx_creatematrix_vector3_matrix44(vec3 in1, vec3 in2, vec3 in3, vec3 in4, out mat4 result) + matrix m; +}; + +int isValidAs33(matrix m44) { - result = mat4(in1.x, in1.y, in1.z, 0.0, - in2.x, in2.y, in2.z, 0.0, - in3.x, in3.y, in3.z, 0.0, - in4.x, in4.y, in4.z, 1.0); + return m44[0][3] == 0 && + m44[1][3] == 0 && + m44[2][3] == 0 && + m44[3][0] == 0 && + m44[3][1] == 0 && + m44[3][2] == 0 && + m44[3][3] == 1; } -void mx_rotate_vector2(vec2 _in, float amount, out vec2 result) + +matrix matrix33To44 (matrix33 m33) { - float rotationRadians = radians(amount); - float sa = sin(rotationRadians); - float ca = cos(rotationRadians); - result = vec2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y); + return m33.m; } -void mx_creatematrix_vector3_matrix33(vec3 in1, vec3 in2, vec3 in3, out mat3 result) + +// Convert an arbitrary m44 to m33 by removing the translation +//QUESTION: should we check if it's valid to represent the 4x4 as a 3x3? +matrix33 matrix44To33 (matrix m44) { - result = mat3(in1.x, in1.y, in1.z, - in2.x, in2.y, in2.z, - in3.x, in3.y, in3.z); + matrix33 m33; + m33.m = m44; + m33.m[0][3] = 0; + m33.m[1][3] = 0; + m33.m[2][3] = 0; + m33.m[3][0] = 0; + m33.m[3][1] = 0; + m33.m[3][2] = 0; + m33.m[3][3] = 1; + + return m33; } -#include "lib/mx_noise.glsl" -void mx_noise3d_vector2(vec2 amplitude, float pivot, vec3 position, out vec2 result) +matrix33 __operator__neg__(matrix33 a) { - vec3 value = mx_perlin_noise_vec3(position); - result = value.xy * amplitude + pivot; + matrix33 m33; + m33.m = -a.m; + return m33; } -#include "mx_aastep.glsl" -void mx_splittb_vector3(vec3 valuet, vec3 valueb, float center, vec2 texcoord, out vec3 result) + +matrix33 __operator__mul__(int a, matrix33 b) { - result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); + matrix33 m33; + m33.m = a * b.m; + return m33; } -#include "lib/mx_noise.glsl" -void mx_noise3d_vector4(vec4 amplitude, float pivot, vec3 position, out vec4 result) +matrix33 __operator__mul__(float a, matrix33 b) { - vec3 xyz = mx_perlin_noise_vec3(position); - float w = mx_perlin_noise_float(position + vec3(19, 73, 29)); - result = vec4(xyz, w) * amplitude + pivot; + matrix33 m33; + m33.m = a * b.m; + return m33; } -#include "lib/$fileTransformUv" -void mx_image_color4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) +matrix33 __operator__mul__(matrix33 a, int b) { - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv); + matrix33 m33; + m33.m = a.m * b; + return m33; } -#include "lib/mx_noise.glsl" -void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out float result) +matrix33 __operator__mul__(matrix33 a, float b) { - float value = mx_fractal_noise_float(position, octaves, lacunarity, diminish); - result = value * amplitude; + matrix33 m33; + m33.m = a.m * b; + return m33; } -#include "lib/mx_noise.glsl" -void mx_worleynoise2d_float(vec2 texcoord, float jitter, out float result) +matrix33 __operator__mul__(matrix33 a, matrix33 b) { - result = mx_worley_noise_float(texcoord, jitter, 0); + matrix33 m33; + m33.m = a.m * b.m; + return m33; } -#include "mx_aastep.glsl" -void mx_splitlr_vector3(vec3 valuel, vec3 valuer, float center, vec2 texcoord, out vec3 result) +matrix33 __operator__div__(int a, matrix33 b) { - result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); + matrix33 m33; + m33.m = a / b.m; + return m33; } -#include "mx_aastep.glsl" -void mx_splitlr_float(float valuel, float valuer, float center, vec2 texcoord, out float result) +matrix33 __operator__div__(float a, matrix33 b) { - result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); + matrix33 m33; + m33.m = a / b.m; + return m33; } -#include "lib/mx_noise.glsl" -void mx_fractal3d_vector3(vec3 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec3 result) +matrix33 __operator__div__(matrix33 a, int b) { - vec3 value = mx_fractal_noise_vec3(position, octaves, lacunarity, diminish); - result = value * amplitude; + matrix33 m33; + m33.m = a.m / b; + return m33; } -#include "lib/$fileTransformUv" -void mx_image_vector4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) +matrix33 __operator__div__(matrix33 a, float b) { - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv); + matrix33 m33; + m33.m = a.m / b; + return m33; } -void mx_ramptb_vector3(vec3 valuet, vec3 valueb, vec2 texcoord, out vec3 result) + +matrix33 __operator__div__(matrix33 a, matrix33 b) { - result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); + matrix33 m33; + m33.m = a.m / b.m; + return m33; } -#include "lib/mx_hsv.glsl" -void mx_hsvtorgb_color4(vec4 _in, out vec4 result) +int __operator__eq__(matrix33 a, matrix33 b) { - result = vec4(mx_hsvtorgb(_in.rgb), 1.0); + return a.m == b.m; } -#include "lib/mx_noise.glsl" -void mx_worleynoise3d_vector2(vec3 position, float jitter, out vec2 result) +int __operator__ne__(matrix33 a, matrix33 b) { - result = mx_worley_noise_vec2(position, jitter, 0); + return a.m != b.m; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +float determinant (matrix33 a) +{ + return determinant(a.m); +} - - +matrix33 transpose(matrix33 a) +{ + matrix33 m33; + m33.m = transpose(a.m); + return m33; +} - - +point transform(matrix33 a, point b) +{ + return transform(a.m, b); +} - - - - +vector transform(matrix33 a, vector b) +{ + return transform(a.m, b); +} - - - - +normal transform(matrix33 a, normal b) +{ + return transform(a.m, b); +} - - - - - - - +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE - - +#pragma once +#define COLOR4_H - - - - +// color4 is a color + alpha +struct color4 +{ + color rgb; + float a; +}; - - - - - - - - - +// +// For color4, define math operators to match color +// - - - - - - - - - - +color4 __operator__neg__(color4 a) +{ + return color4(-a.rgb, -a.a); +} - - - +color4 __operator__add__(color4 a, color4 b) +{ + return color4(a.rgb + b.rgb, a.a + b.a); +} - - +color4 __operator__add__(color4 a, int b) +{ + return a + color4(color(b), b); +} - - +color4 __operator__add__(color4 a, float b) +{ + return a + color4(color(b), b); +} - - - +color4 __operator__add__(int a, color4 b) +{ + return color4(color(a), a) + b; +} - - - - - - - - - - - - - - - - +color4 __operator__add__(float a, color4 b) +{ + return color4(color(a), a) + b; +} - - - - - - - - - - - - - - - - +color4 __operator__sub__(color4 a, color4 b) +{ + return color4(a.rgb - b.rgb, a.a - b.a); +} - - - - - - - - - - - - - - +color4 __operator__sub__(color4 a, int b) +{ + return a - color4(color(b), b); +} - - - - - - - - - - - - - - +color4 __operator__sub__(color4 a, float b) +{ + return a - color4(color(b), b); +} - - - - - - - - - - - - +color4 __operator__sub__(int a, color4 b) +{ + return color4(color(a), a) - b; +} - - - - - - - - - - - - +color4 __operator__sub__(float a, color4 b) +{ + return color4(color(a), a) - b; +} - - - - - - - +color4 __operator__mul__(color4 a, color4 b) +{ + return color4(a.rgb * b.rgb, a.a * b.a); +} - - - - - - - - +color4 __operator__mul__(color4 a, int b) +{ + return a * color4(color(b), b); +} - - - - - - - - +color4 __operator__mul__(color4 a, float b) +{ + return a * color4(color(b), b); +} + +color4 __operator__mul__(int a, color4 b) +{ + return color4(color(a), a) * b; +} - - - - - - - - +color4 __operator__mul__(float a, color4 b) +{ + return color4(color(a), a) * b; +} - - - - - - - - - - - - +color4 __operator__div__(color4 a, color4 b) +{ + return color4(a.rgb / b.rgb, a.a / b.a); +} - - - - - - - - - - - - - - - - - - - - - - - - - +color4 __operator__div__(color4 a, int b) +{ + float b_inv = 1.0/b; + return a * color4(color(b_inv), b_inv); +} - - - - - +color4 __operator__div__(color4 a, float b) +{ + float b_inv = 1.0/b; + return a * color4(color(b_inv), b_inv); +} - - - - - +color4 __operator_div__(int a, color4 b) +{ + return color4(color(a), a) / b; +} - - - - - +color4 __operator__div__(float a, color4 b) +{ + return color4(color(a), a) / b; +} - - - - - - - +int __operator__eq__(color4 a, color4 b) +{ + return (a.rgb == b.rgb) && (a.a == b.a); +} - - - - - - - - - - - - +int __operator__ne__(color4 a, color4 b) +{ + return (a.rgb != b.rgb) || (a.a != b.a); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// +// For color4, define most of the stdosl functions to match color +// - - - - +color4 abs(color4 a) +{ + return color4(abs(a.rgb), abs(a.a)); +} - - - - +color4 ceil(color4 a) +{ + return color4(ceil(a.rgb), ceil(a.a)); +} - - +color4 round(color4 a) +{ + return color4(round(a.rgb), round(a.a)); +} - - +color4 floor(color4 a) +{ + return color4(floor(a.rgb), floor(a.a)); +} - - +color4 sqrt(color4 a) +{ + return color4(sqrt(a.rgb), sqrt(a.a)); +} - - +color4 exp(color4 a) +{ + return color4(exp(a.rgb), exp(a.a)); +} - - - - - +color4 log(color4 a) +{ + return color4(log(a.rgb), log(a.a)); +} - - - +color4 log2(color4 a) +{ + return color4(log2(a.rgb), log2(a.a)); +} - - - +color4 mix(color4 a, color4 b, float x ) +{ + return color4(mix(a.rgb, b.rgb, x), + mix(a.a, b.a, x)); +} - - - +color4 mix(color4 a, color4 b, color4 x ) +{ + return color4(mix(a.rgb, b.rgb, x.rgb), + mix(a.a, b.a, x.a)); +} - - +float dot(color4 a, color b) +{ + return dot(a.rgb, b); +} - - +color4 smoothstep(color4 edge0, color4 edge1, color4 c) +{ + return color4(smoothstep(edge0.rgb, edge1.rgb, c.rgb), + smoothstep(edge0.a, edge1.a, c.a)); +} - - - +color4 smoothstep(float edge0, float edge1, color4 c) +{ + return smoothstep(color4(color(edge0), edge0), color4(color(edge1), edge1), c); +} - +color4 clamp(color4 c, color4 minval, color4 maxval) +{ + return color4(clamp(c.rgb, minval.rgb, maxval.rgb), + clamp(c.a, minval.a, maxval.a)); +} - - - - - - - - - - - - +color4 clamp(color4 c, float minval, float maxval) +{ + return clamp(c, color4(color(minval), minval), color4(color(maxval), maxval)); +} - - - - - +color4 max(color4 a, color4 b) +{ + return color4(max(a.rgb, b.rgb), + max(a.a, b.a)); +} - - - +color4 max(color4 a, float b) +{ + return color4(max(a.rgb, b), + max(a.a, b)); +} - - - +color4 min(color4 a, color4 b) +{ + return color4(min(a.rgb, b.rgb), + min(a.a, b.a)); +} - - - +color4 min(color4 a, float b) +{ + return color4(min(a.rgb, b), + min(a.a, b)); +} - - - +color4 mod(color4 a, color4 b) +{ + return color4(mod(a.rgb, b.rgb), + mod(a.a, b.a)); +} - - +color4 mod(color4 a, int b) +{ + return mod(a, color4(color(b), b)); +} - - +color4 mod(color4 a, float b) +{ + return mod(a, color4(color(b), b)); +} - - - - +color4 fmod(color4 a, color4 b) +{ + return color4(fmod(a.rgb, b.rgb), + fmod(a.a, b.a)); +} - - - - +color4 fmod(color4 a, int b) +{ + return fmod(a, color4(color(b), b)); +} - - - - +color4 fmod(color4 a, float b) +{ + return fmod(a, color4(color(b), b)); +} - - - - +color4 pow(color4 base, color4 power) +{ + return color4(pow(base.rgb, power.rgb), + pow(base.a, power.a)); +} - - - - +color4 pow(color4 base, float power) +{ + return color4(pow(base.rgb, power), + pow(base.a, power)); +} - - - - +color4 sign(color4 a) +{ + return color4(sign(a.rgb), + sign(a.a)); +} - - +color4 sin(color4 a) +{ + return color4(sin(a.rgb), + sin(a.a)); +} - - +color4 cos(color4 a) +{ + return color4(cos(a.rgb), + cos(a.a)); +} - - +color4 tan(color4 a) +{ + return color4(tan(a.rgb), + tan(a.a)); +} - - +color4 asin(color4 a) +{ + return color4(asin(a.rgb), + asin(a.a)); +} - - +color4 acos(color4 a) +{ + return color4(acos(a.rgb), + acos(a.a)); +} - - +color4 atan2(color4 a, float f) +{ + return color4(atan2(a.rgb, f), + atan2(a.a, f)); +} - - - - +color4 atan2(color4 a, color4 b) +{ + return color4(atan2(a.rgb, b.rgb), + atan2(a.a, b.a)); +} - - - - - - - - - - - - - - - - - +color4 transformc (string fromspace, string tospace, color4 C) +{ + return color4 (transformc (fromspace, tospace, C.rgb), C.a); +} +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE - - - +#pragma once +#define VECTOR2_H - - - - - - - - - - - - - +// vector2 is a 2D vector +struct vector2 +{ + float x; + float y; +}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// +// For vector2, define math operators to match vector +// - - - - - - - +vector2 __operator__neg__(vector2 a) +{ + return vector2(-a.x, -a.y); +} + +vector2 __operator__add__(vector2 a, vector2 b) +{ + return vector2(a.x + b.x, a.y + b.y); +} - - - - - - - +vector2 __operator__add__(vector2 a, int b) +{ + return a + vector2(b, b); +} - - - +vector2 __operator__add__(vector2 a, float b) +{ + return a + vector2(b, b); +} - - - - - - - - - - - - - - - - - - +vector2 __operator__add__(int a, vector2 b) +{ + return vector2(a, a) + b; +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector2 __operator__add__(float a, vector2 b) +{ + return vector2(a, a) + b; +} - - - - - - - - - +vector2 __operator__sub__(vector2 a, vector2 b) +{ + return vector2(a.x - b.x, a.y - b.y); +} - - - - +vector2 __operator__sub__(vector2 a, int b) +{ + return a - vector2(b, b); +} - - - +vector2 __operator__sub__(vector2 a, float b) +{ + return a - vector2(b, b); +} - - - - - - - +vector2 __operator__sub__(int a, vector2 b) +{ + return vector2(a, a) - b; +} - - +vector2 __operator__sub__(float a, vector2 b) +{ + return vector2(a, a) - b; +} - - - +vector2 __operator__mul__(vector2 a, vector2 b) +{ + return vector2(a.x * b.x, a.y * b.y); +} - - - - - - - - - - - - - - - - - - -#include "lib/mx_noise.glsl" +vector2 __operator__mul__(vector2 a, int b) +{ + return a * vector2(b, b); +} -void mx_worleynoise2d_vector3(vec2 texcoord, float jitter, out vec3 result) +vector2 __operator__mul__(vector2 a, float b) { - result = mx_worley_noise_vec3(texcoord, jitter, 0); + return a * vector2(b, b); } -#include "mx_aastep.glsl" -void mx_splitlr_vector2(vec2 valuel, vec2 valuer, float center, vec2 texcoord, out vec2 result) +vector2 __operator__mul__(int a, vector2 b) { - result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); + return b * vector2(a, a); } -vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) + +vector2 __operator__mul__(float a, vector2 b) { - uv = uv * uv_scale + uv_offset; - return uv; + return b * vector2(a, a); } -vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) + +vector2 __operator__div__(vector2 a, vector2 b) { - uv = uv * uv_scale + uv_offset; - return vec2(uv.x, 1.0 - uv.y); + return vector2(a.x / b.x, a.y / b.y); } -/* -Color transform functions. -These funcions are modified versions of the color operators found in Open Shading Language: -github.com/imageworks/OpenShadingLanguage/blob/master/src/liboslexec/opcolor.cpp +vector2 __operator__div__(vector2 a, int b) +{ + float b_inv = 1.0/b; + return a * vector2(b_inv, b_inv); +} -It contains the subset of color operators needed to implement the MaterialX -standard library. The modifications are for conversions from C++ to GLSL. +vector2 __operator__div__(vector2 a, float b) +{ + float b_inv = 1.0/b; + return a * vector2(b_inv, b_inv); +} -Original copyright notice: ------------------------------------------------------------------------- -Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. -All Rights Reserved. +vector2 __operator__div__(int a, vector2 b) +{ + return vector2(a, a) / b; +} -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of Sony Pictures Imageworks nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------- -*/ +vector2 __operator__div__(float a, vector2 b) +{ + return vector2(a, a) / b; +} -vec3 mx_hsvtorgb(vec3 hsv) +int __operator__eq__(vector2 a, vector2 b) { - // Reference for this technique: Foley & van Dam - float h = hsv.x; float s = hsv.y; float v = hsv.z; - if (s < 0.0001f) { - return vec3 (v, v, v); - } else { - h = 6.0f * (h - floor(h)); // expand to [0..6) - int hi = int(trunc(h)); - float f = h - float(hi); - float p = v * (1.0f-s); - float q = v * (1.0f-s*f); - float t = v * (1.0f-s*(1.0f-f)); - if (hi == 0) - return vec3 (v, t, p); - else if (hi == 1) - return vec3 (q, v, p); - else if (hi == 2) - return vec3 (p, v, t); - else if (hi == 3) - return vec3 (p, q, v); - else if (hi == 4) - return vec3 (t, p, v); - return vec3 (v, p, q); - } + return (a.x == b.x) && (a.y == b.y); +} + +int __operator__ne__(vector2 a, vector2 b) +{ + return (a.x != b.x) || (a.y != b.y); } -vec3 mx_rgbtohsv(vec3 c) + + +// +// For vector2, define most of the stdosl functions to match vector +// + +vector2 abs(vector2 a) { - // See Foley & van Dam - float r = c.x; float g = c.y; float b = c.z; - float mincomp = min (r, min(g, b)); - float maxcomp = max (r, max(g, b)); - float delta = maxcomp - mincomp; // chroma - float h, s, v; - v = maxcomp; - if (maxcomp > 0.0f) - s = delta / maxcomp; - else s = 0.0f; - if (s <= 0.0f) - h = 0.0f; - else { - if (r >= maxcomp) h = (g-b) / delta; - else if (g >= maxcomp) h = 2.0f + (b-r) / delta; - else h = 4.0f + (r-g) / delta; - h *= (1.0f/6.0f); - if (h < 0.0f) - h += 1.0f; - } - return vec3(h, s, v); + return vector2 (abs(a.x), abs(a.y)); } -#define M_FLOAT_EPS 1e-8 -float mx_square(float x) +vector2 ceil(vector2 a) { - return x*x; + return vector2 (ceil(a.x), ceil(a.y)); } -vec2 mx_square(vec2 x) +vector2 round(vector2 a) { - return x*x; + return vector2 (round(a.x), round(a.y)); } -vec3 mx_square(vec3 x) +vector2 floor(vector2 a) { - return x*x; + return vector2 (floor(a.x), floor(a.y)); } -/* -Noise Library. - -This library is a modified version of the noise library found in -Open Shading Language: -github.com/imageworks/OpenShadingLanguage/blob/master/src/include/OSL/oslnoise.h - -It contains the subset of noise types needed to implement the MaterialX -standard library. The modifications are mainly conversions from C++ to GLSL. -Produced results should be identical to the OSL noise functions. - -Original copyright notice: ------------------------------------------------------------------------- -Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. -All Rights Reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of Sony Pictures Imageworks nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------- -*/ -float mx_select(bool b, float t, float f) +vector2 sqrt(vector2 a) { - return b ? t : f; + return vector2 (sqrt(a.x), sqrt(a.y)); } -float mx_negate_if(float val, bool b) +vector2 exp(vector2 a) { - return b ? -val : val; + return vector2 (exp(a.x), exp(a.y)); } -int mx_floor(float x) +vector2 log(vector2 a) { - return int(floor(x)); + return vector2 (log(a.x), log(a.y)); } -// return mx_floor as well as the fractional remainder -float mx_floorfrac(float x, out int i) +vector2 log2(vector2 a) { - i = mx_floor(x); - return x - float(i); + return vector2 (log2(a.x), log2(a.y)); } -float mx_bilerp(float v0, float v1, float v2, float v3, float s, float t) +vector2 mix(vector2 a, vector2 b, float x ) { - float s1 = 1.0 - s; - return (1.0 - t) * (v0*s1 + v1*s) + t * (v2*s1 + v3*s); + return vector2 (mix(a.x, b.x, x), mix(a.y, b.y, x)); } -vec3 mx_bilerp(vec3 v0, vec3 v1, vec3 v2, vec3 v3, float s, float t) + +vector2 mix(vector2 a, vector2 b, vector2 x ) { - float s1 = 1.0 - s; - return (1.0 - t) * (v0*s1 + v1*s) + t * (v2*s1 + v3*s); + return vector2 (mix(a.x, b.x, x.x), mix(a.y, b.y, x.y)); } -float mx_trilerp(float v0, float v1, float v2, float v3, float v4, float v5, float v6, float v7, float s, float t, float r) + +float dot(vector2 a, vector2 b) { - float s1 = 1.0 - s; - float t1 = 1.0 - t; - float r1 = 1.0 - r; - return (r1*(t1*(v0*s1 + v1*s) + t*(v2*s1 + v3*s)) + - r*(t1*(v4*s1 + v5*s) + t*(v6*s1 + v7*s))); + return (a.x * b.x + a.y * b.y); } -vec3 mx_trilerp(vec3 v0, vec3 v1, vec3 v2, vec3 v3, vec3 v4, vec3 v5, vec3 v6, vec3 v7, float s, float t, float r) + +float length (vector2 a) { - float s1 = 1.0 - s; - float t1 = 1.0 - t; - float r1 = 1.0 - r; - return (r1*(t1*(v0*s1 + v1*s) + t*(v2*s1 + v3*s)) + - r*(t1*(v4*s1 + v5*s) + t*(v6*s1 + v7*s))); + return hypot (a.x, a.y); } -// 2 and 3 dimensional gradient functions - perform a dot product against a -// randomly chosen vector. Note that the gradient vector is not normalized, but -// this only affects the overal "scale" of the result, so we simply account for -// the scale by multiplying in the corresponding "perlin" function. -float mx_gradient_float(uint hash, float x, float y) +vector2 smoothstep(vector2 low, vector2 high, vector2 in) { - // 8 possible directions (+-1,+-2) and (+-2,+-1) - uint h = hash & 7u; - float u = mx_select(h<4u, x, y); - float v = 2.0 * mx_select(h<4u, y, x); - // compute the dot product with (x,y). - return mx_negate_if(u, bool(h&1u)) + mx_negate_if(v, bool(h&2u)); + return vector2 (smoothstep(low.x, high.x, in.x), + smoothstep(low.y, high.y, in.y)); } -float mx_gradient_float(uint hash, float x, float y, float z) + +vector2 smoothstep(float low, float high, vector2 in) { - // use vectors pointing to the edges of the cube - uint h = hash & 15u; - float u = mx_select(h<8u, x, y); - float v = mx_select(h<4u, y, mx_select((h==12u)||(h==14u), x, z)); - return mx_negate_if(u, bool(h&1u)) + mx_negate_if(v, bool(h&2u)); + return vector2 (smoothstep(low, high, in.x), + smoothstep(low, high, in.y)); } -vec3 mx_gradient_vec3(uvec3 hash, float x, float y) + +vector2 clamp(vector2 in, vector2 low, vector2 high) { - return vec3(mx_gradient_float(hash.x, x, y), mx_gradient_float(hash.y, x, y), mx_gradient_float(hash.z, x, y)); + return vector2 (clamp(in.x, low.x, high.x), + clamp(in.y, low.y, high.y)); } -vec3 mx_gradient_vec3(uvec3 hash, float x, float y, float z) + +vector2 clamp(vector2 in, float low, float high) { - return vec3(mx_gradient_float(hash.x, x, y, z), mx_gradient_float(hash.y, x, y, z), mx_gradient_float(hash.z, x, y, z)); + return clamp(in, vector2(low, low), vector2(high, high)); } -// Scaling factors to normalize the result of gradients above. -// These factors were experimentally calculated to be: -// 2D: 0.6616 -// 3D: 0.9820 -float mx_gradient_scale2d(float v) { return 0.6616 * v; } -float mx_gradient_scale3d(float v) { return 0.9820 * v; } -vec3 mx_gradient_scale2d(vec3 v) { return 0.6616 * v; } -vec3 mx_gradient_scale3d(vec3 v) { return 0.9820 * v; } -/// Bitwise circular rotation left by k bits (for 32 bit unsigned integers) -uint mx_rotl32(uint x, int k) +vector2 max(vector2 a, vector2 b) { - return (x<>(32-k)); + return vector2 (max(a.x, b.x), + max(a.y, b.y)); } -void mx_bjmix(inout uint a, inout uint b, inout uint c) +vector2 max(vector2 a, float b) { - a -= c; a ^= mx_rotl32(c, 4); c += b; - b -= a; b ^= mx_rotl32(a, 6); a += c; - c -= b; c ^= mx_rotl32(b, 8); b += a; - a -= c; a ^= mx_rotl32(c,16); c += b; - b -= a; b ^= mx_rotl32(a,19); a += c; - c -= b; c ^= mx_rotl32(b, 4); b += a; + return max(a, vector2(b, b)); } -// Mix up and combine the bits of a, b, and c (doesn't change them, but -// returns a hash of those three original values). -uint mx_bjfinal(uint a, uint b, uint c) +vector2 normalize(vector2 a) { - c ^= b; c -= mx_rotl32(b,14); - a ^= c; a -= mx_rotl32(c,11); - b ^= a; b -= mx_rotl32(a,25); - c ^= b; c -= mx_rotl32(b,16); - a ^= c; a -= mx_rotl32(c,4); - b ^= a; b -= mx_rotl32(a,14); - c ^= b; c -= mx_rotl32(b,24); - return c; + return a / length(a); } -// Convert a 32 bit integer into a floating point number in [0,1] -float mx_bits_to_01(uint bits) +vector2 min(vector2 a, vector2 b) { - return float(bits) / float(uint(0xffffffff)); + return vector2 (min(a.x, a.x), + min(b.y, b.y)); } -float mx_fade(float t) +vector2 min(vector2 a, float b) { - return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); + return min(a, vector2(b, b)); } -uint mx_hash_int(int x) +vector2 mod(vector2 a, vector2 b) { - uint len = 1u; - uint seed = uint(0xdeadbeef) + (len << 2u) + 13u; - return mx_bjfinal(seed+uint(x), seed, seed); + return vector2(mod(a.x, b.x), + mod(a.y, b.y)); } -uint mx_hash_int(int x, int y) +vector2 mod(vector2 a, float b) { - uint len = 2u; - uint a, b, c; - a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; - a += uint(x); - b += uint(y); - return mx_bjfinal(a, b, c); + return mod(a, vector2(b, b)); } -uint mx_hash_int(int x, int y, int z) +vector2 fmod(vector2 a, vector2 b) { - uint len = 3u; - uint a, b, c; - a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; - a += uint(x); - b += uint(y); - c += uint(z); - return mx_bjfinal(a, b, c); + return vector2 (fmod(a.x, b.x), + fmod(a.y, b.y)); } -uint mx_hash_int(int x, int y, int z, int xx) +vector2 fmod(vector2 a, float b) { - uint len = 4u; - uint a, b, c; - a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; - a += uint(x); - b += uint(y); - c += uint(z); - mx_bjmix(a, b, c); - a += uint(xx); - return mx_bjfinal(a, b, c); + return fmod(a, vector2(b, b)); } -uint mx_hash_int(int x, int y, int z, int xx, int yy) +vector2 pow(vector2 in, vector2 amount) { - uint len = 5u; - uint a, b, c; - a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; - a += uint(x); - b += uint(y); - c += uint(z); - mx_bjmix(a, b, c); - a += uint(xx); - b += uint(yy); - return mx_bjfinal(a, b, c); + return vector2(pow(in.x, amount.x), + pow(in.y, amount.y)); } -uvec3 mx_hash_vec3(int x, int y) +vector2 pow(vector2 in, float amount) { - uint h = mx_hash_int(x, y); - // we only need the low-order bits to be random, so split out - // the 32 bit result into 3 parts for each channel - uvec3 result; - result.x = (h ) & 0xFFu; - result.y = (h >> 8 ) & 0xFFu; - result.z = (h >> 16) & 0xFFu; - return result; + return vector2(pow(in.x, amount), + pow(in.y, amount)); } -uvec3 mx_hash_vec3(int x, int y, int z) -{ - uint h = mx_hash_int(x, y, z); - // we only need the low-order bits to be random, so split out - // the 32 bit result into 3 parts for each channel - uvec3 result; - result.x = (h ) & 0xFFu; - result.y = (h >> 8 ) & 0xFFu; - result.z = (h >> 16) & 0xFFu; - return result; +vector2 sign(vector2 a) +{ + return vector2(sign(a.x), + sign(a.y)); } -float mx_perlin_noise_float(vec2 p) +vector2 sin(vector2 a) { - int X, Y; - float fx = mx_floorfrac(p.x, X); - float fy = mx_floorfrac(p.y, Y); - float u = mx_fade(fx); - float v = mx_fade(fy); - float result = mx_bilerp( - mx_gradient_float(mx_hash_int(X , Y ), fx , fy ), - mx_gradient_float(mx_hash_int(X+1, Y ), fx-1.0, fy ), - mx_gradient_float(mx_hash_int(X , Y+1), fx , fy-1.0), - mx_gradient_float(mx_hash_int(X+1, Y+1), fx-1.0, fy-1.0), - u, v); - return mx_gradient_scale2d(result); + return vector2(sin(a.x), + sin(a.y)); } -float mx_perlin_noise_float(vec3 p) +vector2 cos(vector2 a) { - int X, Y, Z; - float fx = mx_floorfrac(p.x, X); - float fy = mx_floorfrac(p.y, Y); - float fz = mx_floorfrac(p.z, Z); - float u = mx_fade(fx); - float v = mx_fade(fy); - float w = mx_fade(fz); - float result = mx_trilerp( - mx_gradient_float(mx_hash_int(X , Y , Z ), fx , fy , fz ), - mx_gradient_float(mx_hash_int(X+1, Y , Z ), fx-1.0, fy , fz ), - mx_gradient_float(mx_hash_int(X , Y+1, Z ), fx , fy-1.0, fz ), - mx_gradient_float(mx_hash_int(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), - mx_gradient_float(mx_hash_int(X , Y , Z+1), fx , fy , fz-1.0), - mx_gradient_float(mx_hash_int(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), - mx_gradient_float(mx_hash_int(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), - mx_gradient_float(mx_hash_int(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), - u, v, w); - return mx_gradient_scale3d(result); + return vector2(cos(a.x), + cos(a.y)); } -vec3 mx_perlin_noise_vec3(vec2 p) +vector2 tan(vector2 a) { - int X, Y; - float fx = mx_floorfrac(p.x, X); - float fy = mx_floorfrac(p.y, Y); - float u = mx_fade(fx); - float v = mx_fade(fy); - vec3 result = mx_bilerp( - mx_gradient_vec3(mx_hash_vec3(X , Y ), fx , fy ), - mx_gradient_vec3(mx_hash_vec3(X+1, Y ), fx-1.0, fy ), - mx_gradient_vec3(mx_hash_vec3(X , Y+1), fx , fy-1.0), - mx_gradient_vec3(mx_hash_vec3(X+1, Y+1), fx-1.0, fy-1.0), - u, v); - return mx_gradient_scale2d(result); + return vector2(tan(a.x), + tan(a.y)); } -vec3 mx_perlin_noise_vec3(vec3 p) +vector2 asin(vector2 a) { - int X, Y, Z; - float fx = mx_floorfrac(p.x, X); - float fy = mx_floorfrac(p.y, Y); - float fz = mx_floorfrac(p.z, Z); - float u = mx_fade(fx); - float v = mx_fade(fy); - float w = mx_fade(fz); - vec3 result = mx_trilerp( - mx_gradient_vec3(mx_hash_vec3(X , Y , Z ), fx , fy , fz ), - mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z ), fx-1.0, fy , fz ), - mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z ), fx , fy-1.0, fz ), - mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), - mx_gradient_vec3(mx_hash_vec3(X , Y , Z+1), fx , fy , fz-1.0), - mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), - mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), - mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), - u, v, w); - return mx_gradient_scale3d(result); + return vector2(asin(a.x), + asin(a.y)); } -float mx_cell_noise_float(float p) +vector2 acos(vector2 a) { - int ix = mx_floor(p); - return mx_bits_to_01(mx_hash_int(ix)); + return vector2(acos(a.x), + acos(a.y)); } -float mx_cell_noise_float(vec2 p) +vector2 atan2(vector2 a, float f) { - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - return mx_bits_to_01(mx_hash_int(ix, iy)); + return vector2(atan2(a.x, f), + atan2(a.y, f)); } -float mx_cell_noise_float(vec3 p) +vector2 atan2(vector2 a, vector2 b) { - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - int iz = mx_floor(p.z); - return mx_bits_to_01(mx_hash_int(ix, iy, iz)); + return vector2(atan2(a.x, b.x), + atan2(a.y, b.y)); } -float mx_cell_noise_float(vec4 p) + +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE + +#pragma once +#define VECTOR4_H + + +// vector4 is a 4D vector +struct vector4 { - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - int iz = mx_floor(p.z); - int iw = mx_floor(p.w); - return mx_bits_to_01(mx_hash_int(ix, iy, iz, iw)); + float x; + float y; + float z; + float w; +}; + + + +// +// For vector4, define math operators to match vector +// + +vector4 __operator__neg__(vector4 a) +{ + return vector4(-a.x, -a.y, -a.z, -a.w); } -vec3 mx_cell_noise_vec3(float p) +vector4 __operator__add__(vector4 a, vector4 b) { - int ix = mx_floor(p); - return vec3( - mx_bits_to_01(mx_hash_int(ix, 0)), - mx_bits_to_01(mx_hash_int(ix, 1)), - mx_bits_to_01(mx_hash_int(ix, 2)) - ); + return vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); } -vec3 mx_cell_noise_vec3(vec2 p) +vector4 __operator__add__(vector4 a, int b) { - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - return vec3( - mx_bits_to_01(mx_hash_int(ix, iy, 0)), - mx_bits_to_01(mx_hash_int(ix, iy, 1)), - mx_bits_to_01(mx_hash_int(ix, iy, 2)) - ); + return a + vector4(b, b, b, b); } -vec3 mx_cell_noise_vec3(vec3 p) +vector4 __operator__add__(vector4 a, float b) { - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - int iz = mx_floor(p.z); - return vec3( - mx_bits_to_01(mx_hash_int(ix, iy, iz, 0)), - mx_bits_to_01(mx_hash_int(ix, iy, iz, 1)), - mx_bits_to_01(mx_hash_int(ix, iy, iz, 2)) - ); + return a + vector4(b, b, b, b); } -vec3 mx_cell_noise_vec3(vec4 p) +vector4 __operator__add__(int a, vector4 b) { - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - int iz = mx_floor(p.z); - int iw = mx_floor(p.w); - return vec3( - mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 0)), - mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 1)), - mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 2)) - ); + return vector4(a, a, a, a) + b; } -float mx_fractal_noise_float(vec3 p, int octaves, float lacunarity, float diminish) +vector4 __operator__add__(float a, vector4 b) { - float result = 0.0; - float amplitude = 1.0; - for (int i = 0; i < octaves; ++i) - { - result += amplitude * mx_perlin_noise_float(p); - amplitude *= diminish; - p *= lacunarity; - } - return result; + return vector4(a, a, a, a) + b; } -vec3 mx_fractal_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish) +vector4 __operator__sub__(vector4 a, vector4 b) { - vec3 result = vec3(0.0); - float amplitude = 1.0; - for (int i = 0; i < octaves; ++i) - { - result += amplitude * mx_perlin_noise_vec3(p); - amplitude *= diminish; - p *= lacunarity; - } - return result; + return vector4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); } -vec2 mx_fractal_noise_vec2(vec3 p, int octaves, float lacunarity, float diminish) +vector4 __operator__sub__(vector4 a, int b) { - return vec2(mx_fractal_noise_float(p, octaves, lacunarity, diminish), - mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish)); + return a - vector4(b, b, b, b); } -vec4 mx_fractal_noise_vec4(vec3 p, int octaves, float lacunarity, float diminish) +vector4 __operator__sub__(vector4 a, float b) { - vec3 c = mx_fractal_noise_vec3(p, octaves, lacunarity, diminish); - float f = mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish); - return vec4(c, f); + return a - vector4(b, b, b, b); } -float mx_worley_distance(vec2 p, int x, int y, int xoff, int yoff, float jitter, int metric) +vector4 __operator__sub__(int a, vector4 b) { - vec3 tmp = mx_cell_noise_vec3(vec2(x+xoff, y+yoff)); - vec2 off = vec2(tmp.x, tmp.y); + return vector4(a, a, a, a) - b; +} - off -= 0.5f; - off *= jitter; - off += 0.5f; +vector4 __operator__sub__(float a, vector4 b) +{ + return vector4(a, a, a, a) - b; +} - vec2 cellpos = vec2(float(x), float(y)) + off; - vec2 diff = cellpos - p; - if (metric == 2) - return abs(diff.x) + abs(diff.y); // Manhattan distance - if (metric == 3) - return max(abs(diff.x), abs(diff.y)); // Chebyshev distance - // Either Euclidian or Distance^2 - return dot(diff, diff); +vector4 __operator__mul__(vector4 a, vector4 b) +{ + return vector4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); } -float mx_worley_distance(vec3 p, int x, int y, int z, int xoff, int yoff, int zoff, float jitter, int metric) +vector4 __operator__mul__(vector4 a, int b) { - vec3 off = mx_cell_noise_vec3(vec3(x+xoff, y+yoff, z+zoff)); + return a * vector4(b, b, b, b); +} - off -= 0.5f; - off *= jitter; - off += 0.5f; +vector4 __operator__mul__(vector4 a, float b) +{ + return a * vector4(b, b, b, b); +} - vec3 cellpos = vec3(float(x), float(y), float(z)) + off; - vec3 diff = cellpos - p; - if (metric == 2) - return abs(diff.x) + abs(diff.y) + abs(diff.z); // Manhattan distance - if (metric == 3) - return max(max(abs(diff.x), abs(diff.y)), abs(diff.z)); // Chebyshev distance - // Either Euclidian or Distance^2 - return dot(diff, diff); +vector4 __operator__mul__(int a, vector4 b) +{ + return vector4(a, a, a, a) * b; +} + +vector4 __operator__mul__(float a, vector4 b) +{ + return vector4(a, a, a, a) * b; } -float mx_worley_noise_float(vec2 p, float jitter, int metric) +vector4 __operator__div__(vector4 a, vector4 b) { - int X, Y; - vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); - float sqdist = 1e6f; // Some big number for jitter > 1 (not all GPUs may be IEEE) - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); - sqdist = min(sqdist, dist); - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; + return vector4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); } -vec2 mx_worley_noise_vec2(vec2 p, float jitter, int metric) +vector4 __operator__div__(vector4 a, int b) { - int X, Y; - vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); - vec2 sqdist = vec2(1e6f, 1e6f); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); - if (dist < sqdist.x) - { - sqdist.y = sqdist.x; - sqdist.x = dist; - } - else if (dist < sqdist.y) - { - sqdist.y = dist; - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; + float b_inv = 1.0/b; + return a * vector4(b_inv, b_inv, b_inv, b_inv); } -vec3 mx_worley_noise_vec3(vec2 p, float jitter, int metric) +vector4 __operator__div__(vector4 a, float b) { - int X, Y; - vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); - vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); - if (dist < sqdist.x) - { - sqdist.z = sqdist.y; - sqdist.y = sqdist.x; - sqdist.x = dist; - } - else if (dist < sqdist.y) - { - sqdist.z = sqdist.y; - sqdist.y = dist; - } - else if (dist < sqdist.z) - { - sqdist.z = dist; - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; + float b_inv = 1.0/b; + return a * vector4(b_inv, b_inv, b_inv, b_inv); } -float mx_worley_noise_float(vec3 p, float jitter, int metric) +vector4 __operator__div__(int a, vector4 b) { - int X, Y, Z; - vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); - float sqdist = 1e6f; - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); - sqdist = min(sqdist, dist); - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; + return vector4(a, a, a, a) / b; } -vec2 mx_worley_noise_vec2(vec3 p, float jitter, int metric) +vector4 __operator__div__(float a, vector4 b) { - int X, Y, Z; - vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); - vec2 sqdist = vec2(1e6f, 1e6f); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); - if (dist < sqdist.x) - { - sqdist.y = sqdist.x; - sqdist.x = dist; - } - else if (dist < sqdist.y) - { - sqdist.y = dist; - } - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; + return vector4(a, a, a, a) / b; } -vec3 mx_worley_noise_vec3(vec3 p, float jitter, int metric) +int __operator__eq__(vector4 a, vector4 b) { - int X, Y, Z; - vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); - vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); - if (dist < sqdist.x) - { - sqdist.z = sqdist.y; - sqdist.y = sqdist.x; - sqdist.x = dist; - } - else if (dist < sqdist.y) - { - sqdist.z = sqdist.y; - sqdist.y = dist; - } - else if (dist < sqdist.z) - { - sqdist.z = dist; - } - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; + return (a.x == b.x) && (a.y == b.y) && (a.z == b.z) && (a.w == b.w); } -// Restrict to 7x7 kernel size for performance reasons -#define MX_MAX_SAMPLE_COUNT 49 -// Size of all weights for all levels (including level 1) -#define MX_WEIGHT_ARRAY_SIZE 84 -// -// Function to compute the sample size relative to a texture coordinate -// -vec2 mx_compute_sample_size_uv(vec2 uv, float filterSize, float filterOffset) +int __operator__ne__(vector4 a, vector4 b) { - vec2 derivUVx = dFdx(uv) * 0.5f; - vec2 derivUVy = dFdy(uv) * 0.5f; - float derivX = abs(derivUVx.x) + abs(derivUVy.x); - float derivY = abs(derivUVx.y) + abs(derivUVy.y); - float sampleSizeU = 2.0f * filterSize * derivX + filterOffset; - if (sampleSizeU < 1.0E-05f) - sampleSizeU = 1.0E-05f; - float sampleSizeV = 2.0f * filterSize * derivY + filterOffset; - if (sampleSizeV < 1.0E-05f) - sampleSizeV = 1.0E-05f; - return vec2(sampleSizeU, sampleSizeV); + return (a.x != b.x) || (a.y != b.y) || (a.z != b.z) || (a.w != b.w); } + + + // -// Compute a normal mapped to 0..1 space based on a set of input -// samples using a Sobel filter. +// For vector4, define most of the stdosl functions to match vector // -vec3 mx_normal_from_samples_sobel(float S[9], float _scale) + +vector4 abs(vector4 in) { - float nx = S[0] - S[2] + (2.0*S[3]) - (2.0*S[5]) + S[6] - S[8]; - float ny = S[0] + (2.0*S[1]) + S[2] - S[6] - (2.0*S[7]) - S[8]; - float nz = max(_scale, M_FLOAT_EPS) * sqrt(max(1.0 - nx * nx - ny * ny, M_FLOAT_EPS)); - vec3 norm = normalize(vec3(nx, ny, nz)); - return (norm + 1.0) * 0.5; + return vector4 (abs(in.x), + abs(in.y), + abs(in.z), + abs(in.w)); } -// -// Apply filter for float samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +vector4 ceil(vector4 in) { - float result = 0.0; - for (int i = 0; i < sampleCount; i++) - { - result += S[i]*W[i+offset]; - } - return result; + return vector4 (ceil(in.x), + ceil(in.y), + ceil(in.z), + ceil(in.w)); } -// -// Apply filter for vec2 samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -vec2 mx_convolution_vec2(vec2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +vector4 round(vector4 in) { - vec2 result = vec2(0.0); - for (int i=0; i - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 mix(vector4 value1, vector4 value2, float x ) +{ + return vector4 (mix( value1.x, value2.x, x), + mix( value1.y, value2.y, x), + mix( value1.z, value2.z, x), + mix( value1.w, value2.w, x)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 mix(vector4 value1, vector4 value2, vector4 x ) +{ + return vector4 (mix( value1.x, value2.x, x.x), + mix( value1.y, value2.y, x.y), + mix( value1.z, value2.z, x.z), + mix( value1.w, value2.w, x.w)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector vec4ToVec3(vector4 v) +{ + return vector(v.x, v.y, v.z) / v.w; +} - - - - - - - - - - - +float dot(vector4 a, vector4 b) +{ + return ((a.x * b.x) + (a.y * b.y) + (a.z * b.z) + (a.w * b.w)); +} - - - - - - - - - - - - - - - - +float length (vector4 a) +{ + return sqrt (a.x*a.x + a.y*a.y + a.z*a.z + a.w*a.w); +} - - - - - - - - - - - - - - - +vector4 smoothstep(vector4 low, vector4 high, vector4 in) +{ + return vector4 (smoothstep(low.x, high.x, in.x), + smoothstep(low.y, high.y, in.y), + smoothstep(low.z, high.z, in.z), + smoothstep(low.w, high.w, in.w)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 smoothstep(float low, float high, vector4 in) +{ + return vector4 (smoothstep(low, high, in.x), + smoothstep(low, high, in.y), + smoothstep(low, high, in.z), + smoothstep(low, high, in.w)); +} - - - - - - - - - +vector4 clamp(vector4 in, vector4 low, vector4 high) +{ + return vector4 (clamp(in.x, low.x, high.x), + clamp(in.y, low.y, high.y), + clamp(in.z, low.z, high.z), + clamp(in.w, low.w, high.w)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 clamp(vector4 in, float low, float high) +{ + return vector4 (clamp(in.x, low, high), + clamp(in.y, low, high), + clamp(in.z, low, high), + clamp(in.w, low, high)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 max(vector4 a, vector4 b) +{ + return vector4 (max(a.x, b.x), + max(a.y, b.y), + max(a.z, b.z), + max(a.w, b.w)); +} + +vector4 max(vector4 a, float b) +{ + return max(a, vector4(b, b, b, b)); +} + +vector4 normalize(vector4 a) +{ + return a / length(a); +} + +vector4 min(vector4 a, vector4 b) +{ + return vector4 (min(a.x, b.x), + min(a.y, b.y), + min(a.z, b.z), + min(a.w, b.w)); +} - - - - - - - - - - +vector4 min(vector4 a, float b) +{ + return min(a, vector4(b, b, b, b)); +} - - +vector4 mod(vector4 a, vector4 b) +{ + return vector4(mod(a.x, b.x), + mod(a.y, b.y), + mod(a.z, b.z), + mod(a.w, b.w)); +} - +vector4 mod(vector4 a, float b) +{ + return mod(a, vector4(b, b, b, b)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 fmod(vector4 a, vector4 b) +{ + return vector4 (fmod(a.x, b.x), + fmod(a.y, b.y), + fmod(a.z, b.z), + fmod(a.w, b.w)); +} - - +vector4 fmod(vector4 a, float b) +{ + return fmod(a, vector4(b, b, b, b)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 pow(vector4 in, vector4 amount) +{ + return vector4 (pow(in.x, amount.x), + pow(in.y, amount.y), + pow(in.z, amount.z), + pow(in.w, amount.w)); +} - - - - - - - - - - - - - - - - - - - +vector4 pow(vector4 in, float amount) +{ + return vector4 (pow(in.x, amount), + pow(in.y, amount), + pow(in.z, amount), + pow(in.w, amount)); +} - - - - - - - - - - - - - - - - - - - +vector4 sign(vector4 a) +{ + return vector4(sign(a.x), + sign(a.y), + sign(a.z), + sign(a.w)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 sin(vector4 a) +{ + return vector4(sin(a.x), + sin(a.y), + sin(a.z), + sin(a.w)); +} + +vector4 cos(vector4 a) +{ + return vector4(cos(a.x), + cos(a.y), + cos(a.z), + cos(a.w)); +} + +vector4 tan(vector4 a) +{ + return vector4(tan(a.x), + tan(a.y), + tan(a.z), + tan(a.w)); +} + +vector4 asin(vector4 a) +{ + return vector4(asin(a.x), + asin(a.y), + asin(a.z), + asin(a.w)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 acos(vector4 a) +{ + return vector4(acos(a.x), + acos(a.y), + acos(a.z), + acos(a.w)); +} - - - - - - - - - - - - - - - +vector4 atan2(vector4 a, float f) +{ + return vector4(atan2(a.x, f), + atan2(a.y, f), + atan2(a.z, f), + atan2(a.w, f)); +} - - - - - - - - - - - - - - - - - - - - +vector4 atan2(vector4 a, vector4 b) +{ + return vector4(atan2(a.x, b.x), + atan2(a.y, b.y), + atan2(a.z, b.z), + atan2(a.w, b.w)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vector4 transform (matrix M, vector4 p) +{ + return vector4 (M[0][0]*p.x + M[1][0]*p.y + M[2][0]*p.z + M[3][0]*p.w, + M[0][1]*p.x + M[1][1]*p.y + M[2][1]*p.z + M[3][1]*p.w, + M[0][2]*p.x + M[1][2]*p.y + M[2][2]*p.z + M[3][2]*p.w, + M[0][3]*p.x + M[1][3]*p.y + M[2][3]*p.z + M[3][3]*p.w); +} - - - - - - - - - - - - - - +vector4 transform (string fromspace, string tospace, vector4 p) +{ + return transform (matrix(fromspace,tospace), p); +} + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - + + + - - + - + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + @@ -21847,33 +20634,143 @@ vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SI - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + @@ -21883,12 +20780,12 @@ vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SI - + - - + + - + @@ -21914,36 +20811,35 @@ vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SI - - - + + + - + - + - - + - + - + - - + + - + @@ -21969,867 +20865,1766 @@ vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SI - - - - - + - + - - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - + + - - - - - - - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + - - - + + + - - - + + + + + + + + + + + + + + + + - - - - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - + + + - - - - - - - - - - - - - - - - - - + + - - + + - - + + + + - - - - + + + + - - - - - - + + + + + + + + + - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + - - - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - + - + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + - - - + + + + + + + - - - + + + + + + - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + - - - - - - - - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - + - + doc="Translucent color (aka albedo), defining what ratio of light is transmitted for each color channel." /> + - - - - - - - - - - - + + - - - + + - - + + + + + + + + doc="Micro-facet distribution roughness." /> + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + - + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -23066,400 +22969,419 @@ vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SI - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - + + + + - - - - - - - - - - - + + + + + - - - + + - - - + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + - - - - - + - + + + + + + + + + + + + + + + - - - - + + + + + + + + + + - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - + + + + + + + - - - + + + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + diff --git a/javascript/JsMaterialXGenShader.js b/javascript/JsMaterialXGenShader.js index 6c3450a8..c86cae3d 100644 --- a/javascript/JsMaterialXGenShader.js +++ b/javascript/JsMaterialXGenShader.js @@ -6,7 +6,7 @@ var MaterialX = (function() { function(MaterialX) { MaterialX = MaterialX || {}; -var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){var loadPackage=function(metadata){var PACKAGE_PATH;if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}else{throw"using preloaded data can only be done on a web page or in a web worker"}var PACKAGE_NAME="../../bin/JsMaterialXGenShader.data";var REMOTE_PACKAGE_BASE="JsMaterialXGenShader.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];var PACKAGE_UUID=metadata["package_uuid"];function fetchRemotePackage(packageName,packageSize,callback,errback){var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","libraries",true,true);Module["FS_createPath"]("/libraries","cmlib",true,true);Module["FS_createPath"]("/libraries","nprlib",true,true);Module["FS_createPath"]("/libraries/nprlib","genosl",true,true);Module["FS_createPath"]("/libraries/nprlib","genmsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genmdl",true,true);Module["FS_createPath"]("/libraries/nprlib","genglsl",true,true);Module["FS_createPath"]("/libraries","lights",true,true);Module["FS_createPath"]("/libraries/lights","genmsl",true,true);Module["FS_createPath"]("/libraries/lights","genglsl",true,true);Module["FS_createPath"]("/libraries","targets",true,true);Module["FS_createPath"]("/libraries","pbrlib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genosl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","legacy",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmsl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmdl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genglsl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries","stdlib",true,true);Module["FS_createPath"]("/libraries/stdlib","genosl",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","include",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genmsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmdl",true,true);Module["FS_createPath"]("/libraries/stdlib","genglsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries","bxdf",true,true);Module["FS_createPath"]("/libraries/bxdf","translation",true,true);Module["FS_createPath"]("/libraries/bxdf","lama",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null}};var files=metadata["files"];for(var i=0;i1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXGenShader.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Wa"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Za"];addOnInit(Module["asm"]["Xa"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={208516:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},208600:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},208685:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"B":___assert_fail,"n":___cxa_allocate_exception,"q":___cxa_begin_catch,"A":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"h":___cxa_find_matching_catch_3,"Ka":___cxa_find_matching_catch_4,"p":___cxa_free_exception,"da":___cxa_rethrow,"K":___cxa_throw,"va":___cxa_uncaught_exceptions,"e":___resumeException,"ga":___sys_fcntl64,"Da":___sys_getdents64,"Ba":___sys_ioctl,"ia":___sys_open,"Ca":___sys_stat64,"Qa":__embind_finalize_value_array,"Va":__embind_register_bigint,"Fa":__embind_register_bool,"t":__embind_register_class,"z":__embind_register_class_class_function,"s":__embind_register_class_class_property,"y":__embind_register_class_constructor,"j":__embind_register_class_function,"H":__embind_register_class_property,"S":__embind_register_constant,"Ea":__embind_register_emval,"P":__embind_register_enum,"O":__embind_register_enum_value,"ja":__embind_register_float,"F":__embind_register_function,"N":__embind_register_integer,"M":__embind_register_memory_view,"r":__embind_register_smart_ptr,"ka":__embind_register_std_string,"$":__embind_register_std_wstring,"oa":__embind_register_value_array,"Z":__embind_register_value_array_element,"Ga":__embind_register_void,"Q":__emval_as,"Ra":__emval_call,"Y":__emval_call_void_method,"ha":__emval_decref,"X":__emval_get_method_caller,"Pa":__emval_get_property,"la":__emval_incref,"Ta":__emval_new_array,"Oa":__emval_new_cstring,"La":__emval_new_object,"Na":__emval_run_destructors,"Sa":__emval_set_property,"C":__emval_take_value,"Ma":__emval_typeof,"ua":_abort,"ca":_emscripten_asm_const_int,"ta":_emscripten_memcpy_big,"_":_emscripten_resize_heap,"xa":_environ_get,"ya":_environ_sizes_get,"V":_fd_close,"Aa":_fd_read,"Ua":_fd_seek,"za":_fd_write,"a":_getTempRet0,"Ha":invoke_di,"ba":invoke_fi,"Ja":invoke_fifii,"ra":invoke_fii,"na":invoke_fiii,"w":invoke_i,"g":invoke_ii,"Ia":invoke_iid,"L":invoke_iif,"ma":invoke_iiff,"W":invoke_iifff,"d":invoke_iii,"i":invoke_iiii,"v":invoke_iiiii,"ea":invoke_iiiiid,"x":invoke_iiiiii,"D":invoke_iiiiiii,"I":invoke_iiiiiiii,"U":invoke_iiiiiiiiiiii,"l":invoke_v,"m":invoke_vi,"sa":invoke_vid,"J":invoke_vif,"f":invoke_vii,"qa":invoke_viif,"c":invoke_viii,"k":invoke_viiii,"aa":invoke_viiiiffiiii,"o":invoke_viiiii,"u":invoke_viiiiii,"G":invoke_viiiiiii,"fa":invoke_viiiiiiiii,"R":invoke_viiiiiiiiii,"T":invoke_viiiiiiiiiiiiiii,"E":_llvm_eh_typeid_for,"pa":_setTempRet0,"wa":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Xa"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["_a"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["$a"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["ab"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["bb"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["cb"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["db"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["eb"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["fb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["gb"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["ib"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["jb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["kb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["lb"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["mb"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iifff(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiff(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiffiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); +var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){var loadPackage=function(metadata){var PACKAGE_PATH;if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}else{throw"using preloaded data can only be done on a web page or in a web worker"}var PACKAGE_NAME="../../bin/JsMaterialXGenShader.data";var REMOTE_PACKAGE_BASE="JsMaterialXGenShader.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];var PACKAGE_UUID=metadata["package_uuid"];function fetchRemotePackage(packageName,packageSize,callback,errback){var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","libraries",true,true);Module["FS_createPath"]("/libraries","pbrlib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmdl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genglsl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmsl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genosl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","legacy",true,true);Module["FS_createPath"]("/libraries","cmlib",true,true);Module["FS_createPath"]("/libraries","lights",true,true);Module["FS_createPath"]("/libraries/lights","genglsl",true,true);Module["FS_createPath"]("/libraries/lights","genmsl",true,true);Module["FS_createPath"]("/libraries","nprlib",true,true);Module["FS_createPath"]("/libraries/nprlib","genmdl",true,true);Module["FS_createPath"]("/libraries/nprlib","genglsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genmsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genosl",true,true);Module["FS_createPath"]("/libraries","stdlib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmdl",true,true);Module["FS_createPath"]("/libraries/stdlib","genglsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genmsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genosl",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","include",true,true);Module["FS_createPath"]("/libraries","targets",true,true);Module["FS_createPath"]("/libraries","bxdf",true,true);Module["FS_createPath"]("/libraries/bxdf","lama",true,true);Module["FS_createPath"]("/libraries/bxdf","translation",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null}};var files=metadata["files"];for(var i=0;i1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXGenShader.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Wa"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Za"];addOnInit(Module["asm"]["Xa"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={199384:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},199468:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},199553:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"B":___assert_fail,"n":___cxa_allocate_exception,"q":___cxa_begin_catch,"z":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"h":___cxa_find_matching_catch_3,"Ka":___cxa_find_matching_catch_4,"o":___cxa_free_exception,"da":___cxa_rethrow,"K":___cxa_throw,"wa":___cxa_uncaught_exceptions,"e":___resumeException,"ga":___sys_fcntl64,"Da":___sys_getdents64,"Ca":___sys_ioctl,"ia":___sys_open,"za":___sys_stat64,"Qa":__embind_finalize_value_array,"Va":__embind_register_bigint,"Fa":__embind_register_bool,"u":__embind_register_class,"A":__embind_register_class_class_function,"s":__embind_register_class_class_property,"y":__embind_register_class_constructor,"j":__embind_register_class_function,"H":__embind_register_class_property,"S":__embind_register_constant,"Ea":__embind_register_emval,"R":__embind_register_enum,"Q":__embind_register_enum_value,"ja":__embind_register_float,"F":__embind_register_function,"N":__embind_register_integer,"M":__embind_register_memory_view,"r":__embind_register_smart_ptr,"ka":__embind_register_std_string,"$":__embind_register_std_wstring,"oa":__embind_register_value_array,"Z":__embind_register_value_array_element,"Ga":__embind_register_void,"O":__emval_as,"Ra":__emval_call,"Y":__emval_call_void_method,"ha":__emval_decref,"X":__emval_get_method_caller,"Pa":__emval_get_property,"la":__emval_incref,"Ta":__emval_new_array,"Oa":__emval_new_cstring,"La":__emval_new_object,"Na":__emval_run_destructors,"Sa":__emval_set_property,"C":__emval_take_value,"Ma":__emval_typeof,"ua":_abort,"ca":_emscripten_asm_const_int,"ta":_emscripten_memcpy_big,"_":_emscripten_resize_heap,"xa":_environ_get,"ya":_environ_sizes_get,"V":_fd_close,"Aa":_fd_read,"Ua":_fd_seek,"Ba":_fd_write,"a":_getTempRet0,"Ha":invoke_di,"ba":invoke_fi,"Ja":invoke_fifii,"ra":invoke_fii,"na":invoke_fiii,"x":invoke_i,"g":invoke_ii,"Ia":invoke_iid,"L":invoke_iif,"ma":invoke_iiff,"W":invoke_iifff,"d":invoke_iii,"i":invoke_iiii,"t":invoke_iiiii,"ea":invoke_iiiiid,"w":invoke_iiiiii,"E":invoke_iiiiiii,"I":invoke_iiiiiiii,"U":invoke_iiiiiiiiiiii,"l":invoke_v,"m":invoke_vi,"sa":invoke_vid,"J":invoke_vif,"f":invoke_vii,"qa":invoke_viif,"c":invoke_viii,"k":invoke_viiii,"aa":invoke_viiiiffiiii,"p":invoke_viiiii,"v":invoke_viiiiii,"G":invoke_viiiiiii,"fa":invoke_viiiiiiiii,"P":invoke_viiiiiiiiii,"T":invoke_viiiiiiiiiiiiiii,"D":_llvm_eh_typeid_for,"pa":_setTempRet0,"va":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Xa"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["_a"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["$a"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["ab"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["bb"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["cb"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["db"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["eb"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["fb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["gb"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["ib"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["jb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["kb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["lb"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["mb"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iifff(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiff(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiffiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); return MaterialX.ready diff --git a/javascript/JsMaterialXGenShader.wasm b/javascript/JsMaterialXGenShader.wasm index a78d277a..4fe7b990 100644 Binary files a/javascript/JsMaterialXGenShader.wasm and b/javascript/JsMaterialXGenShader.wasm differ diff --git a/javascript/materialxtoy/Definitions/maya_surfaces.mtlx b/javascript/materialxtoy/Definitions/maya_surfaces.mtlx new file mode 100644 index 00000000..b9789b4f --- /dev/null +++ b/javascript/materialxtoy/Definitions/maya_surfaces.mtlx @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Images/adsk.png b/javascript/materialxtoy/Images/adsk.png new file mode 100644 index 00000000..df1176f8 Binary files /dev/null and b/javascript/materialxtoy/Images/adsk.png differ diff --git a/javascript/materialxtoy/Images/arrow_down.svg b/javascript/materialxtoy/Images/arrow_down.svg new file mode 100644 index 00000000..37c4cd5d --- /dev/null +++ b/javascript/materialxtoy/Images/arrow_down.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/javascript/materialxtoy/Images/arrow_down_white.svg b/javascript/materialxtoy/Images/arrow_down_white.svg new file mode 100644 index 00000000..50264ac5 --- /dev/null +++ b/javascript/materialxtoy/Images/arrow_down_white.svg @@ -0,0 +1,44 @@ + + + + + + + diff --git a/javascript/materialxtoy/Images/arrow_up.svg b/javascript/materialxtoy/Images/arrow_up.svg new file mode 100644 index 00000000..1c827e91 --- /dev/null +++ b/javascript/materialxtoy/Images/arrow_up.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/javascript/materialxtoy/Images/arrow_up_white.svg b/javascript/materialxtoy/Images/arrow_up_white.svg new file mode 100644 index 00000000..ce0e9425 --- /dev/null +++ b/javascript/materialxtoy/Images/arrow_up_white.svg @@ -0,0 +1,44 @@ + + + + + + + diff --git a/javascript/materialxtoy/Images/clipboard.svg b/javascript/materialxtoy/Images/clipboard.svg new file mode 100644 index 00000000..b92f42a5 --- /dev/null +++ b/javascript/materialxtoy/Images/clipboard.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/javascript/materialxtoy/Images/clipboard_white.svg b/javascript/materialxtoy/Images/clipboard_white.svg new file mode 100644 index 00000000..a4541705 --- /dev/null +++ b/javascript/materialxtoy/Images/clipboard_white.svg @@ -0,0 +1,44 @@ + + + + + + + diff --git a/javascript/materialxtoy/Images/copy-regular.svg b/javascript/materialxtoy/Images/copy-regular.svg new file mode 100644 index 00000000..b5906802 --- /dev/null +++ b/javascript/materialxtoy/Images/copy-regular.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/javascript/materialxtoy/Images/copy-regular_white.svg b/javascript/materialxtoy/Images/copy-regular_white.svg new file mode 100644 index 00000000..743f2d82 --- /dev/null +++ b/javascript/materialxtoy/Images/copy-regular_white.svg @@ -0,0 +1,41 @@ + + + + + + diff --git a/javascript/materialxtoy/Images/gltf_logo.webp b/javascript/materialxtoy/Images/gltf_logo.webp new file mode 100644 index 00000000..fbca7f41 Binary files /dev/null and b/javascript/materialxtoy/Images/gltf_logo.webp differ diff --git a/javascript/materialxtoy/Images/houdini_icon.webp b/javascript/materialxtoy/Images/houdini_icon.webp new file mode 100644 index 00000000..071cbf5e Binary files /dev/null and b/javascript/materialxtoy/Images/houdini_icon.webp differ diff --git a/javascript/materialxtoy/Images/logo3d_2_small.png b/javascript/materialxtoy/Images/logo3d_2_small.png new file mode 100644 index 00000000..2dd13e19 Binary files /dev/null and b/javascript/materialxtoy/Images/logo3d_2_small.png differ diff --git a/javascript/materialxtoy/Images/logo_toon.png b/javascript/materialxtoy/Images/logo_toon.png new file mode 100644 index 00000000..a6c5151b Binary files /dev/null and b/javascript/materialxtoy/Images/logo_toon.png differ diff --git a/javascript/materialxtoy/Images/logo_toon2.png b/javascript/materialxtoy/Images/logo_toon2.png new file mode 100644 index 00000000..06ad261a Binary files /dev/null and b/javascript/materialxtoy/Images/logo_toon2.png differ diff --git a/javascript/materialxtoy/Images/logo_toon3.png b/javascript/materialxtoy/Images/logo_toon3.png new file mode 100644 index 00000000..70ebb008 Binary files /dev/null and b/javascript/materialxtoy/Images/logo_toon3.png differ diff --git a/javascript/materialxtoy/Images/materialtoy_ai_3.svg b/javascript/materialxtoy/Images/materialtoy_ai_3.svg new file mode 100644 index 00000000..a5a71dd4 --- /dev/null +++ b/javascript/materialxtoy/Images/materialtoy_ai_3.svg @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Images/materialtoy_ai_variant3.png b/javascript/materialxtoy/Images/materialtoy_ai_variant3.png new file mode 100644 index 00000000..33d57551 Binary files /dev/null and b/javascript/materialxtoy/Images/materialtoy_ai_variant3.png differ diff --git a/javascript/materialxtoy/Images/materialx_logo.png b/javascript/materialxtoy/Images/materialx_logo.png new file mode 100644 index 00000000..21d8ee99 Binary files /dev/null and b/javascript/materialxtoy/Images/materialx_logo.png differ diff --git a/javascript/materialxtoy/Images/materialx_logo.webp b/javascript/materialxtoy/Images/materialx_logo.webp new file mode 100644 index 00000000..6b2e6854 Binary files /dev/null and b/javascript/materialxtoy/Images/materialx_logo.webp differ diff --git a/javascript/materialxtoy/Images/materialxtoy_node_editor.svg b/javascript/materialxtoy/Images/materialxtoy_node_editor.svg new file mode 100644 index 00000000..a784a7f6 --- /dev/null +++ b/javascript/materialxtoy/Images/materialxtoy_node_editor.svg @@ -0,0 +1,3 @@ + + +
                            g





                            Definition Registration (JS)
                            ThreeJS
                            Renderer






                            Definitions (XML / JSON)
                            MaterialXLogo







                            Data Model
                            MaterialXLogo




                            Connectivity API





                             Javascript ?





                            Serialize (JS)






                            Functional Definitions (Javascript)
                            MaterialXLogo







                            Data Model





                            Mermaid Generator





                            3D Canvas







                            JSON






                            Code Generation
                            MaterialXLogo





                            Connectivity (Python / Javascript)
                            MaterialXLogo





                            Definition Creation
                            MaterialXLogo
                            Ed



                            Node Editor





                            Converter
                            MaterialXLogo





                            Shader Reflection
                            MaterialXLogo




                            Property Panel
                            Javascript




                            Graph Visualizer (litegraph)




                            Style / Interactions
                            (Javascript)
                            Graphing Module
                            \ No newline at end of file diff --git a/javascript/materialxtoy/Images/maya_surfaces.webp b/javascript/materialxtoy/Images/maya_surfaces.webp new file mode 100644 index 00000000..57111a25 Binary files /dev/null and b/javascript/materialxtoy/Images/maya_surfaces.webp differ diff --git a/javascript/materialxtoy/Images/no_image.png b/javascript/materialxtoy/Images/no_image.png new file mode 100644 index 00000000..b6d7462a Binary files /dev/null and b/javascript/materialxtoy/Images/no_image.png differ diff --git a/javascript/materialxtoy/Images/nodegraph.svg b/javascript/materialxtoy/Images/nodegraph.svg new file mode 100644 index 00000000..464b051d --- /dev/null +++ b/javascript/materialxtoy/Images/nodegraph.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/javascript/materialxtoy/Images/nodegraph_white.svg b/javascript/materialxtoy/Images/nodegraph_white.svg new file mode 100644 index 00000000..12d66920 --- /dev/null +++ b/javascript/materialxtoy/Images/nodegraph_white.svg @@ -0,0 +1,41 @@ + + + + + + diff --git a/javascript/materialxtoy/Images/openpbr_logo.webp b/javascript/materialxtoy/Images/openpbr_logo.webp new file mode 100644 index 00000000..16f610ad Binary files /dev/null and b/javascript/materialxtoy/Images/openpbr_logo.webp differ diff --git a/javascript/materialxtoy/Images/openusd_logo.webp b/javascript/materialxtoy/Images/openusd_logo.webp new file mode 100644 index 00000000..acdd9698 Binary files /dev/null and b/javascript/materialxtoy/Images/openusd_logo.webp differ diff --git a/javascript/materialxtoy/JsMaterialXCore.js b/javascript/materialxtoy/JsMaterialXCore.js new file mode 100644 index 00000000..10205181 --- /dev/null +++ b/javascript/materialxtoy/JsMaterialXCore.js @@ -0,0 +1,21 @@ + +var MaterialX = (function() { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( +function(MaterialX) { + MaterialX = MaterialX || {}; + +var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXCore.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Ta"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Wa"];addOnInit(Module["asm"]["Ua"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={130504:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},130588:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},130673:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"x":___assert_fail,"r":___cxa_allocate_exception,"n":___cxa_begin_catch,"y":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"i":___cxa_find_matching_catch_3,"Ha":___cxa_find_matching_catch_4,"s":___cxa_free_exception,"ha":___cxa_rethrow,"D":___cxa_throw,"sa":___cxa_uncaught_exceptions,"c":___resumeException,"aa":___sys_fcntl64,"za":___sys_getdents64,"ya":___sys_ioctl,"ba":___sys_open,"va":___sys_stat64,"Pa":__embind_finalize_value_array,"ja":__embind_register_bigint,"Ba":__embind_register_bool,"t":__embind_register_class,"z":__embind_register_class_class_function,"o":__embind_register_class_class_property,"w":__embind_register_class_constructor,"h":__embind_register_class_function,"L":__embind_register_class_property,"M":__embind_register_constant,"Aa":__embind_register_emval,"Ja":__embind_register_enum,"Ia":__embind_register_enum_value,"da":__embind_register_float,"C":__embind_register_function,"H":__embind_register_integer,"F":__embind_register_memory_view,"p":__embind_register_smart_ptr,"ea":__embind_register_std_string,"U":__embind_register_std_wstring,"ga":__embind_register_value_array,"S":__embind_register_value_array_element,"Ca":__embind_register_void,"J":__emval_as,"Qa":__emval_call,"R":__emval_call_void_method,"$":__emval_decref,"Q":__emval_get_method_caller,"Oa":__emval_get_property,"ca":__emval_incref,"Sa":__emval_new_array,"Na":__emval_new_cstring,"Ka":__emval_new_object,"Ma":__emval_run_destructors,"Ra":__emval_set_property,"A":__emval_take_value,"La":__emval_typeof,"qa":_abort,"X":_emscripten_asm_const_int,"pa":_emscripten_memcpy_big,"T":_emscripten_resize_heap,"ta":_environ_get,"ua":_environ_sizes_get,"P":_fd_close,"wa":_fd_read,"ia":_fd_seek,"xa":_fd_write,"a":_getTempRet0,"Da":invoke_di,"W":invoke_fi,"Ga":invoke_fifii,"ma":invoke_fii,"oa":invoke_fiii,"u":invoke_i,"g":invoke_ii,"Ea":invoke_iid,"Fa":invoke_iif,"d":invoke_iii,"j":invoke_iiii,"v":invoke_iiiii,"Z":invoke_iiiiid,"V":invoke_iiiiii,"G":invoke_iiiiiii,"Y":invoke_iiiiiiii,"O":invoke_iiiiiiiiiiii,"k":invoke_v,"l":invoke_vi,"na":invoke_vid,"fa":invoke_vif,"e":invoke_vii,"la":invoke_viif,"f":invoke_viii,"m":invoke_viiii,"q":invoke_viiiii,"I":invoke_viiiiii,"E":invoke_viiiiiii,"_":invoke_viiiiiiiii,"K":invoke_viiiiiiiiii,"N":invoke_viiiiiiiiiiiiiii,"B":_llvm_eh_typeid_for,"ka":_setTempRet0,"ra":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Ua"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Va"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["Xa"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["Za"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["_a"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["$a"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["ab"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["bb"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["cb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["db"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["eb"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["fb"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["gb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["ib"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["jb"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); + + + return MaterialX.ready +} +); +})(); +if (typeof exports === 'object' && typeof module === 'object') + module.exports = MaterialX; +else if (typeof define === 'function' && define['amd']) + define([], function() { return MaterialX; }); +else if (typeof exports === 'object') + exports["MaterialX"] = MaterialX; diff --git a/javascript/materialxtoy/JsMaterialXCore.wasm b/javascript/materialxtoy/JsMaterialXCore.wasm new file mode 100644 index 00000000..8e4bb349 Binary files /dev/null and b/javascript/materialxtoy/JsMaterialXCore.wasm differ diff --git a/javascript/materialxtoy/JsMaterialXGenShader.data b/javascript/materialxtoy/JsMaterialXGenShader.data new file mode 100644 index 00000000..29f9cb9d --- /dev/null +++ b/javascript/materialxtoy/JsMaterialXGenShader.data @@ -0,0 +1,23387 @@ +# MaterialX Data Libraries + +This folder contains the standard data libraries for MaterialX, providing declarations and graph definitions for the MaterialX nodes, and source code for all supported shader generators. + +## Standard Pattern Library +- [stdlib](stdlib) + - [stdlib_defs.mtlx](stdlib/stdlib_defs.mtlx) : Nodedef declarations. + - [stdlib_ng.mtlx](stdlib/stdlib_ng.mtlx) : Nodegraph definitions. + - [genglsl](stdlib/genglsl): GLSL language support. + - [lib](stdlib/genglsl/lib) : Shader utility files. + - [stdlib_genglsl_impl.mtlx](stdlib/genglsl/stdlib_genglsl_impl.mtlx) : Mapping from declarations to implementations. + - [genosl](stdlib/genosl): OSL language support. + - [lib](stdlib/genosl/lib) : Shader utility files. + - [stdlib_genosl_impl.mtlx](stdlib/genosl/stdlib_genosl_impl.mtlx) : Mapping from declarations to implementations. + - [genmdl](stdlib/genmdl): MDL language support. + - [stdlib_genmdl_impl.mtlx](stdlib/genmdl/stdlib_genmdl_impl.mtlx) : Mapping from declarations to implementations. + - Additional MaterialX support libraries for MDL are located in the [source/MaterialXGenMdl/mdl/materialx](../source/MaterialXGenMdl/mdl/materialx) package folder + - [genmsl](stdlib/genmsl): MSL language support. + - [lib](stdlib/genmsl/lib) : Shader utility files. + - [stdlib_genmsl_impl.mtlx](stdlib/genmsl/stdlib_genmsl_impl.mtlx) : Mapping from declarations to implementations. + +## Physically Based Shading Library +- [pbrlib](pbrlib) + - [pbrlib_defs.mtlx](pbrlib/pbrlib_defs.mtlx) : Nodedef declarations. + - [pbrlib_ng.mtlx](pbrlib/pbrlib_ng.mtlx) : Nodegraph definitions. + - [genglsl](pbrlib/genglsl) : GLSL language support + - [lib](pbrlib/genglsl/lib) : Shader utility files. + - [pbrlib_genglsl_impl.mtlx](pbrlib/genglsl/pbrlib_genglsl_impl.mtlx) : Mapping from declarations to implementations. + - [genosl](pbrlib/genosl) : OSL language support + - [lib](pbrlib/genosl/lib) : Shader utility files. + - [pbrlib_genosl_impl.mtlx](pbrlib/genosl/pbrlib_genosl_impl.mtlx) : Mapping from declarations to implementations. + - [genmdl](pbrlib/genmdl) : MDL language support + - [pbrlib_genmdl_impl.mtlx](pbrlib/genmdl/pbrlib_genmdl_impl.mtlx) : Mapping from declarations to implementations. + - [genmsl](pbrlib/genmsl) : MSL language support + - [pbrlib_genmsl_impl.mtlx](pbrlib/genmsl/pbrlib_genmsl_impl.mtlx) : Mapping from declarations to implementations. + +## BxDF Graph Library +- [bxdf](bxdf) + - [standard_surface.mtlx](bxdf/standard_surface.mtlx) : Graph definition of the [Autodesk Standard Surface](https://autodesk.github.io/standard-surface/) shading model. + - [gltf_pbr.mtlx](bxdf/gltf_pbr.mtlx) : Graph definition of the [glTF PBR](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#appendix-b-brdf-implementation) shading model. + - [usd_preview_surface.mtlx](bxdf/usd_preview_surface.mtlx) : Graph definition of the [UsdPreviewSurface](https://openusd.org/release/spec_usdpreviewsurface.html) shading model. + - [lama](bxdf/lama) : Graph definitions of the [MaterialX Lama](https://rmanwiki.pixar.com/display/REN24/MaterialX+Lama) node set. + +## Color Management Library +- MaterialX shader generation natively supports a small set of common spaces for input colors, with all color transforms implemented as language-independent MaterialX graphs.The canonical definitions of these color transforms may be found in the OpenColorIO configuration for [ACES 1.2](https://github.com/colour-science/OpenColorIO-Configs/tree/feature/aces-1.2-config/aces_1.2). + - lin_rec709 + - g18_rec709 + - g22_rec709 + - rec709_display + - acescg (lin_ap1) + - g22_ap1 + - srgb_texture + - lin_adobergb + - adobergb + - srgb_displayp3 + - lin_displayp3 +- [cmlib](cmlib) + - [cmlib_defs.mtlx](cmlib/cmlib_defs.mtlx) : Nodedef declarations. + - [cmlib_ng.mtlx](cmlib/cmlib_ng.mtlx) : Nodegraph definitions. + +## Target Definitions +- Each target implementation requires a target definition for declaration / implementation correspondence to work. +- The [targets](targets) folder contains definition files for the following core targets: + - GLSL : `genglsl` + - OSL : `genosl` + - MDL : `genmdl` + - MSL : `genmsl` +- Any additional target files should be added under this folder and loaded in as required. + +### Target Support +- GLSL target support is for version 4.0 or higher. +- OSL target support is for version 1.9.10 or higher. +- MDL target support is for version 1.7. +- Basic GLSL and MSL `lightshader` node definitions and implementations are provided for the following light types: + - point, directional, spot +- Shader generation does not currently support: + - `ambientocclusion` node. + - `arrayappend` node. + - `curveadjust` node. + - `displacementshader` and `volumeshader` nodes for hardware shading targets (GLSL, MSL). +if (MATERIALX_OSL_LEGACY_CLOSURES) + set(PBRLIB_SUFFIX "legacy") +else() + set(PBRLIB_SUFFIX "mtlx") +endif() + +if(NOT SKBUILD) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}" + PATTERN "CMakeLists.txt" EXCLUDE + PATTERN "pbrlib_genosl_impl.*" EXCLUDE) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.${PBRLIB_SUFFIX}" + DESTINATION "${MATERIALX_INSTALL_STDLIB_PATH}/pbrlib/genosl/" RENAME pbrlib_genosl_impl.mtlx) +endif() + +set(MATERIALX_PYTHON_LIBRARIES_PATH "${MATERIALX_PYTHON_FOLDER_NAME}/${MATERIALX_INSTALL_STDLIB_PATH}") +if(SKBUILD) + set(MATERIALX_PYTHON_LIBRARIES_PATH "${SKBUILD_PLATLIB_DIR}/MaterialX/libraries") +endif() + +if(MATERIALX_BUILD_PYTHON) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}" + PATTERN "CMakeLists.txt" EXCLUDE + PATTERN "pbrlib_genosl_impl.*" EXCLUDE) + install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/pbrlib/genosl/pbrlib_genosl_impl.${PBRLIB_SUFFIX}" + DESTINATION "${MATERIALX_PYTHON_LIBRARIES_PATH}/pbrlib/genosl/" RENAME pbrlib_genosl_impl.mtlx) +endif() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +void mx_displacement_float(float disp, float scale, out displacementshader result) +{ + result.offset = vec3(disp); + result.scale = scale; +} +void mx_artistic_ior(vec3 reflectivity, vec3 edge_color, out vec3 ior, out vec3 extinction) +{ + // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 + // http://jcgt.org/published/0003/04/03/paper.pdf + + vec3 r = clamp(reflectivity, 0.0, 0.99); + vec3 r_sqrt = sqrt(r); + vec3 n_min = (1.0 - r) / (1.0 + r); + vec3 n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); + ior = mix(n_max, n_min, edge_color); + + vec3 np1 = ior + 1.0; + vec3 nm1 = ior - 1.0; + vec3 k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); + k2 = max(k2, 0.0); + extinction = sqrt(k2); +} +#include "lib/mx_microfacet_sheen.glsl" + +void mx_sheen_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + vec3 H = normalize(L + V); + + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float NdotH = clamp(dot(N, H), M_FLOAT_EPS, 1.0); + + vec3 fr = color * mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); + float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); + bsdf.throughput = vec3(1.0 - dirAlbedo * weight); + + // We need to include NdotL from the light integral here + // as in this case it's not cancelled out by the BRDF denominator. + bsdf.response = fr * NdotL * occlusion * weight; +} + +void mx_sheen_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); + bsdf.throughput = vec3(1.0 - dirAlbedo * weight); + + vec3 Li = mx_environment_irradiance(N); + bsdf.response = Li * color * dirAlbedo * weight; +} +#include "lib/mx_microfacet.glsl" + +void mx_generalized_schlick_edf(vec3 N, vec3 V, vec3 color0, vec3 color90, float exponent, EDF base, out EDF result) +{ + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + vec3 f = mx_fresnel_schlick(NdotV, color0, color90, exponent); + result = base * f; +} +#include "lib/mx_microfacet_specular.glsl" + +void mx_generalized_schlick_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); + + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); + + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); +} + +void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); + + if (scatter_mode != 0) + { + float avgF0 = dot(safeColor0, vec3(1.0 / 3.0)); + fd.ior = vec3(mx_f0_to_ior(avgF0)); + bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeColor0) * weight; + } +} + +void mx_generalized_schlick_bsdf_indirect(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); + + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); + bsdf.response = Li * comp * weight; +} +void mx_displacement_vector3(vec3 disp, float scale, out displacementshader result) +{ + result.offset = disp; + result.scale = scale; +} +#include "lib/mx_microfacet_diffuse.glsl" + +void mx_burley_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + normal = mx_forward_facing_normal(normal, V); + + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float LdotH = clamp(dot(L, normalize(L + V)), M_FLOAT_EPS, 1.0); + + bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; + bsdf.response *= mx_burley_diffuse(NdotV, NdotL, LdotH, roughness); +} + +void mx_burley_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + normal = mx_forward_facing_normal(normal, V); + + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + + vec3 Li = mx_environment_irradiance(normal) * + mx_burley_diffuse_dir_albedo(NdotV, roughness); + bsdf.response = Li * color * weight; +} +void mx_anisotropic_vdf(vec3 absorption, vec3 scattering, float anisotropy, inout BSDF bsdf) +{ + // TODO: Add some approximation for volumetric light absorption. +} +void mx_roughness_dual(vec2 roughness, out vec2 result) +{ + if (roughness.y < 0.0) + { + roughness.y = roughness.x; + } + result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); + result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); +} +#include "lib/mx_microfacet_diffuse.glsl" + +void mx_oren_nayar_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + normal = mx_forward_facing_normal(normal, V); + + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); + + bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; + if (roughness > 0.0) + { + bsdf.response *= mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); + } +} + +void mx_oren_nayar_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + normal = mx_forward_facing_normal(normal, V); + + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + + vec3 Li = mx_environment_irradiance(normal) * + mx_oren_nayar_diffuse_dir_albedo(NdotV, roughness); + bsdf.response = Li * color * weight; +} +void mx_roughness_anisotropy(float roughness, float anisotropy, out vec2 result) +{ + float roughness_sqr = clamp(roughness*roughness, M_FLOAT_EPS, 1.0); + if (anisotropy > 0.0) + { + float aspect = sqrt(1.0 - clamp(anisotropy, 0.0, 0.98)); + result.x = min(roughness_sqr / aspect, 1.0); + result.y = roughness_sqr * aspect; + } + else + { + result.x = roughness_sqr; + result.y = roughness_sqr; + } +} +#include "lib/mx_microfacet_diffuse.glsl" + +void mx_subsurface_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + normal = mx_forward_facing_normal(normal, V); + + vec3 sss = mx_subsurface_scattering_approx(normal, L, P, color, radius); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float visibleOcclusion = 1.0 - NdotL * (1.0 - occlusion); + bsdf.response = sss * visibleOcclusion * weight; +} + +void mx_subsurface_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + normal = mx_forward_facing_normal(normal, V); + + // For now, we render indirect subsurface as simple indirect diffuse. + vec3 Li = mx_environment_irradiance(normal); + bsdf.response = Li * color * weight; +} +void mx_add_edf(vec3 N, vec3 L, EDF in1, EDF in2, out EDF result) +{ + result = in1 + in2; +} +#include "lib/mx_microfacet_specular.glsl" + +void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); + + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + + FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); +} + +void mx_conductor_bsdf_indirect(vec3 V, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); + + bsdf.response = Li * comp * weight; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +void mx_uniform_edf(vec3 N, vec3 L, vec3 color, out EDF result) +{ + result = color; +} +// We fake diffuse transmission by using diffuse reflection from the opposite side. +// So this BTDF is really a BRDF. +void mx_translucent_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + // Invert normal since we're transmitting light from the other side + float NdotL = dot(L, -normal); + if (NdotL <= 0.0 || weight < M_FLOAT_EPS) + { + return; + } + + bsdf.response = color * weight * NdotL * M_PI_INV; +} + +void mx_translucent_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + // Invert normal since we're transmitting light from the other side + vec3 Li = mx_environment_irradiance(-normal); + bsdf.response = Li * color * weight; +} +#include "lib/mx_microfacet_specular.glsl" + +void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); + + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * safeTint * occlusion * weight / (4.0 * NdotV); +} + +void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + if (scatter_mode != 0) + { + bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeTint) * weight; + } +} + +void mx_dielectric_bsdf_indirect(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); + bsdf.response = Li * safeTint * comp * weight; +} +/// XYZ to Rec.709 RGB colorspace conversion +const mat3 XYZ_to_RGB = mat3( 3.2406, -0.9689, 0.0557, + -1.5372, 1.8758, -0.2040, + -0.4986, 0.0415, 1.0570); + +void mx_blackbody(float temperatureKelvin, out vec3 colorValue) +{ + float xc, yc; + float t, t2, t3, xc2, xc3; + + // if value outside valid range of approximation clamp to accepted temperature range + temperatureKelvin = clamp(temperatureKelvin, 1667.0, 25000.0); + + t = 1000.0 / temperatureKelvin; + t2 = t * t; + t3 = t * t * t; + + // Cubic spline approximation for Kelvin temperature to sRGB conversion + // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) + if (temperatureKelvin < 4000.0) { // 1667K <= temperatureKelvin < 4000K + xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; + } + else { // 4000K <= temperatureKelvin <= 25000K + xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; + } + xc2 = xc * xc; + xc3 = xc * xc * xc; + + if (temperatureKelvin < 2222.0) { // 1667K <= temperatureKelvin < 2222K + yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; + } + else if (temperatureKelvin < 4000.0) { // 2222K <= temperatureKelvin < 4000K + yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; + } + else { // 4000K <= temperatureKelvin <= 25000K + yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; + } + + if (yc <= 0.0) { // avoid division by zero + colorValue = vec3(1.0); + return; + } + + vec3 XYZ = vec3(xc / yc, 1.0, (1.0 - xc - yc) / yc); + + colorValue = XYZ_to_RGB * XYZ; + colorValue = max(colorValue, vec3(0.0)); +} +#include "mx_microfacet_specular.glsl" + +vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) +{ + // Approximate the appearance of surface transmission as glossy + // environment map refraction, ignoring any scene geometry that might + // be visible through the surface. + fd.refraction = true; + if ($refractionTwoSided) + { + tint = mx_square(tint); + } + return mx_environment_radiance(N, V, X, alpha, distribution, fd) * tint; +} +#include "mx_microfacet_specular.glsl" + +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) +{ + // Generate tangent frame. + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + mat3 tangentToWorld = mat3(X, Y, N); + + // Transform the view vector to tangent space. + V = vec3(dot(V, X), dot(V, Y), dot(V, N)); + + // Compute derived properties. + float NdotV = clamp(V.z, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(alpha); + float G1V = mx_ggx_smith_G1(NdotV, avgAlpha); + + // Integrate outgoing radiance using filtered importance sampling. + // http://cgg.mff.cuni.cz/~jaroslav/papers/2008-egsr-fis/2008-egsr-fis-final-embedded.pdf + vec3 radiance = vec3(0.0); + int envRadianceSamples = $envRadianceSamples; + for (int i = 0; i < envRadianceSamples; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); + + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, alpha); + vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, H, fd.ior.x) : -reflect(V, H); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + // Sample the environment light from the given direction. + vec3 Lw = tangentToWorld * L; + float pdf = mx_ggx_NDF(H, alpha) * G1V / (4.0 * NdotV); + float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); + vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); + + // Compute the Fresnel term. + vec3 F = mx_compute_fresnel(VdotH, fd); + + // Compute the geometric term. + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + // Compute the combined FG term, which is inverted for refraction. + vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; + + // Add the radiance contribution of this sample. + // From https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf + // incidentLight = sampleColor * NdotL + // microfacetSpecular = D * F * G / (4 * NdotL * NdotV) + // pdf = D * G1V / (4 * NdotV); + // radiance = incidentLight * microfacetSpecular / pdf + radiance += sampleColor * FG; + } + + // Apply the global component of the geometric term and normalize. + radiance /= G1V * float(envRadianceSamples); + + // Return the final radiance. + return radiance * $envLightIntensity; +} + +vec3 mx_environment_irradiance(vec3 N) +{ + vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + return Li * $envLightIntensity; +} +#define M_PI 3.1415926535897932 +#define M_PI_INV (1.0 / M_PI) + +float mx_pow5(float x) +{ + return mx_square(mx_square(x)) * x; +} + +float mx_pow6(float x) +{ + float x2 = mx_square(x); + return mx_square(x2) * x2; +} + +// Standard Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; +} +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; +} + +// Generalized Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0, float F90) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); +} +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); +} + +// Generalized Schlick Fresnel with a variable exponent +float mx_fresnel_schlick(float cosTheta, float F0, float F90, float exponent) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(F0, F90, pow(x, exponent)); +} +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90, float exponent) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(F0, F90, pow(x, exponent)); +} + +// Enforce that the given normal is forward-facing from the specified view direction. +vec3 mx_forward_facing_normal(vec3 N, vec3 V) +{ + return (dot(N, V) < 0.0) ? -N : N; +} + +// https://www.graphics.rwth-aachen.de/publication/2/jgt.pdf +float mx_golden_ratio_sequence(int i) +{ + const float GOLDEN_RATIO = 1.6180339887498948; + return fract((float(i) + 1.0) * GOLDEN_RATIO); +} + +// https://people.irisa.fr/Ricardo.Marques/articles/2013/SF_CGF.pdf +vec2 mx_spherical_fibonacci(int i, int numSamples) +{ + return vec2((float(i) + 0.5) / float(numSamples), mx_golden_ratio_sequence(i)); +} + +// Generate a uniform-weighted sample in the unit hemisphere. +vec3 mx_uniform_sample_hemisphere(vec2 Xi) +{ + float phi = 2.0 * M_PI * Xi.x; + float cosTheta = 1.0 - Xi.y; + float sinTheta = sqrt(1.0 - mx_square(cosTheta)); + return vec3(cos(phi) * sinTheta, + sin(phi) * sinTheta, + cosTheta); +} +#include "mx_microfacet.glsl" + +const int FRESNEL_MODEL_DIELECTRIC = 0; +const int FRESNEL_MODEL_CONDUCTOR = 1; +const int FRESNEL_MODEL_SCHLICK = 2; + +// Parameters for Fresnel calculations +struct FresnelData +{ + // Fresnel model + int model; + bool airy; + + // Physical Fresnel + vec3 ior; + vec3 extinction; + + // Generalized Schlick Fresnel + vec3 F0; + vec3 F82; + vec3 F90; + float exponent; + + // Thin film + float tf_thickness; + float tf_ior; + + // Refraction + bool refraction; +}; + +// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf +// Appendix B.2 Equation 13 +float mx_ggx_NDF(vec3 H, vec2 alpha) +{ + vec2 He = H.xy / alpha; + float denom = dot(He, He) + mx_square(H.z); + return 1.0 / (M_PI * alpha.x * alpha.y * mx_square(denom)); +} + +// https://ggx-research.github.io/publication/2023/06/09/publication-ggx.html +vec3 mx_ggx_importance_sample_VNDF(vec2 Xi, vec3 V, vec2 alpha) +{ + // Transform the view direction to the hemisphere configuration. + V = normalize(vec3(V.xy * alpha, V.z)); + + // Sample a spherical cap in (-V.z, 1]. + float phi = 2.0 * M_PI * Xi.x; + float z = (1.0 - Xi.y) * (1.0 + V.z) - V.z; + float sinTheta = sqrt(clamp(1.0 - z * z, 0.0, 1.0)); + float x = sinTheta * cos(phi); + float y = sinTheta * sin(phi); + vec3 c = vec3(x, y, z); + + // Compute the microfacet normal. + vec3 H = c + V; + + // Transform the microfacet normal back to the ellipsoid configuration. + H = normalize(vec3(H.xy * alpha, max(H.z, 0.0))); + + return H; +} + +// https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf +// Equation 34 +float mx_ggx_smith_G1(float cosTheta, float alpha) +{ + float cosTheta2 = mx_square(cosTheta); + float tanTheta2 = (1.0 - cosTheta2) / cosTheta2; + return 2.0 / (1.0 + sqrt(1.0 + mx_square(alpha) * tanTheta2)); +} + +// Height-correlated Smith masking-shadowing +// http://jcgt.org/published/0003/02/03/paper.pdf +// Equations 72 and 99 +float mx_ggx_smith_G2(float NdotL, float NdotV, float alpha) +{ + float alpha2 = mx_square(alpha); + float lambdaL = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotL)); + float lambdaV = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotV)); + return 2.0 / (lambdaL / NdotL + lambdaV / NdotV); +} + +// Rational quadratic fit to Monte Carlo data for GGX directional albedo. +vec3 mx_ggx_dir_albedo_analytic(float NdotV, float alpha, vec3 F0, vec3 F90) +{ + float x = NdotV; + float y = alpha; + float x2 = mx_square(x); + float y2 = mx_square(y); + vec4 r = vec4(0.1003, 0.9345, 1.0, 1.0) + + vec4(-0.6303, -2.323, -1.765, 0.2281) * x + + vec4(9.748, 2.229, 8.263, 15.94) * y + + vec4(-2.038, -3.748, 11.53, -55.83) * x * y + + vec4(29.34, 1.424, 28.96, 13.08) * x2 + + vec4(-8.245, -0.7684, -7.507, 41.26) * y2 + + vec4(-26.44, 1.436, -36.11, 54.9) * x2 * y + + vec4(19.99, 0.2913, 15.86, 300.2) * x * y2 + + vec4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; + vec2 AB = clamp(r.xy / r.zw, 0.0, 1.0); + return F0 * AB.x + F90 * AB.y; +} + +vec3 mx_ggx_dir_albedo_table_lookup(float NdotV, float alpha, vec3 F0, vec3 F90) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) + { + vec2 AB = texture($albedoTable, vec2(NdotV, alpha)).rg; + return F0 * AB.x + F90 * AB.y; + } +#endif + return vec3(0.0); +} + +// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf +vec3 mx_ggx_dir_albedo_monte_carlo(float NdotV, float alpha, vec3 F0, vec3 F90) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0 - mx_square(NdotV)), 0, NdotV); + + vec2 AB = vec2(0.0); + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); + + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); + vec3 L = -reflect(V, H); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + // Compute the Fresnel term. + float Fc = mx_fresnel_schlick(VdotH, 0.0, 1.0); + + // Compute the per-sample geometric term. + // https://hal.inria.fr/hal-00996995v2/document, Algorithm 2 + float G2 = mx_ggx_smith_G2(NdotL, NdotV, alpha); + + // Add the contribution of this sample. + AB += vec2(G2 * (1.0 - Fc), G2 * Fc); + } + + // Apply the global component of the geometric term and normalize. + AB /= mx_ggx_smith_G1(NdotV, alpha) * float(SAMPLE_COUNT); + + // Return the final directional albedo. + return F0 * AB.x + F90 * AB.y; +} + +vec3 mx_ggx_dir_albedo(float NdotV, float alpha, vec3 F0, vec3 F90) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 0 + return mx_ggx_dir_albedo_analytic(NdotV, alpha, F0, F90); +#elif DIRECTIONAL_ALBEDO_METHOD == 1 + return mx_ggx_dir_albedo_table_lookup(NdotV, alpha, F0, F90); +#else + return mx_ggx_dir_albedo_monte_carlo(NdotV, alpha, F0, F90); +#endif +} + +float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) +{ + return mx_ggx_dir_albedo(NdotV, alpha, vec3(F0), vec3(F90)).x; +} + +// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf +// Equations 14 and 16 +vec3 mx_ggx_energy_compensation(float NdotV, float alpha, vec3 Fss) +{ + float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); + return 1.0 + Fss * (1.0 - Ess) / Ess; +} + +float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) +{ + return mx_ggx_energy_compensation(NdotV, alpha, vec3(Fss)).x; +} + +// Compute the average of an anisotropic alpha pair. +float mx_average_alpha(vec2 alpha) +{ + return sqrt(alpha.x * alpha.y); +} + +// Convert a real-valued index of refraction to normal-incidence reflectivity. +float mx_ior_to_f0(float ior) +{ + return mx_square((ior - 1.0) / (ior + 1.0)); +} + +// Convert normal-incidence reflectivity to real-valued index of refraction. +float mx_f0_to_ior(float F0) +{ + float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (1.0 + sqrtF0) / (1.0 - sqrtF0); +} +vec3 mx_f0_to_ior(vec3 F0) +{ + vec3 sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0); +} + +// https://renderwonk.com/publications/wp-generalization-adobe/gen-adobe.pdf +vec3 mx_fresnel_hoffman_schlick(float cosTheta, FresnelData fd) +{ + const float COS_THETA_MAX = 1.0 / 7.0; + const float COS_THETA_FACTOR = 1.0 / (COS_THETA_MAX * pow(1.0 - COS_THETA_MAX, 6.0)); + + float x = clamp(cosTheta, 0.0, 1.0); + vec3 a = mix(fd.F0, fd.F90, pow(1.0 - COS_THETA_MAX, fd.exponent)) * (vec3(1.0) - fd.F82) * COS_THETA_FACTOR; + return mix(fd.F0, fd.F90, pow(1.0 - x, fd.exponent)) - a * x * mx_pow6(1.0 - x); +} + +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +float mx_fresnel_dielectric(float cosTheta, float ior) +{ + float c = cosTheta; + float g2 = ior*ior + c*c - 1.0; + if (g2 < 0.0) + { + // Total internal reflection + return 1.0; + } + + float g = sqrt(g2); + return 0.5 * mx_square((g - c) / (g + c)) * + (1.0 + mx_square(((g + c) * c - 1.0) / ((g - c) * c + 1.0))); +} + +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +vec2 mx_fresnel_dielectric_polarized(float cosTheta, float ior) +{ + float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); + float sinTheta2 = 1.0 - cosTheta2; + + float t0 = max(ior * ior - sinTheta2, 0.0); + float t1 = t0 + cosTheta2; + float t2 = 2.0 * sqrt(t0) * cosTheta; + float Rs = (t1 - t2) / (t1 + t2); + + float t3 = cosTheta2 * t0 + sinTheta2 * sinTheta2; + float t4 = t2 * sinTheta2; + float Rp = Rs * (t3 - t4) / (t3 + t4); + + return vec2(Rp, Rs); +} + +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +void mx_fresnel_conductor_polarized(float cosTheta, vec3 n, vec3 k, out vec3 Rp, out vec3 Rs) +{ + float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); + float sinTheta2 = 1.0 - cosTheta2; + vec3 n2 = n * n; + vec3 k2 = k * k; + + vec3 t0 = n2 - k2 - vec3(sinTheta2); + vec3 a2plusb2 = sqrt(t0 * t0 + 4.0 * n2 * k2); + vec3 t1 = a2plusb2 + vec3(cosTheta2); + vec3 a = sqrt(max(0.5 * (a2plusb2 + t0), 0.0)); + vec3 t2 = 2.0 * a * cosTheta; + Rs = (t1 - t2) / (t1 + t2); + + vec3 t3 = cosTheta2 * a2plusb2 + vec3(sinTheta2 * sinTheta2); + vec3 t4 = t2 * sinTheta2; + Rp = Rs * (t3 - t4) / (t3 + t4); +} + +vec3 mx_fresnel_conductor(float cosTheta, vec3 n, vec3 k) +{ + vec3 Rp, Rs; + mx_fresnel_conductor_polarized(cosTheta, n, k, Rp, Rs); + return 0.5 * (Rp + Rs); +} + +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +void mx_fresnel_conductor_phase_polarized(float cosTheta, float eta1, vec3 eta2, vec3 kappa2, out vec3 phiP, out vec3 phiS) +{ + vec3 k2 = kappa2 / eta2; + vec3 sinThetaSqr = vec3(1.0) - cosTheta * cosTheta; + vec3 A = eta2*eta2*(vec3(1.0)-k2*k2) - eta1*eta1*sinThetaSqr; + vec3 B = sqrt(A*A + mx_square(2.0*eta2*eta2*k2)); + vec3 U = sqrt((A+B)/2.0); + vec3 V = max(vec3(0.0), sqrt((B-A)/2.0)); + + phiS = atan(2.0*eta1*V*cosTheta, U*U + V*V - mx_square(eta1*cosTheta)); + phiP = atan(2.0*eta1*eta2*eta2*cosTheta * (2.0*k2*U - (vec3(1.0)-k2*k2) * V), + mx_square(eta2*eta2*(vec3(1.0)+k2*k2)*cosTheta) - eta1*eta1*(U*U+V*V)); +} + +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +vec3 mx_eval_sensitivity(float opd, vec3 shift) +{ + // Use Gaussian fits, given by 3 parameters: val, pos and var + float phase = 2.0*M_PI * opd; + vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13); + vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06); + vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09); + vec3 xyz = val * sqrt(2.0*M_PI * var) * cos(pos * phase + shift) * exp(- var * phase*phase); + xyz.x += 9.7470e-14 * sqrt(2.0*M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(- 4.5282e+09 * phase*phase); + return xyz / 1.0685e-7; +} + +// A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +vec3 mx_fresnel_airy(float cosTheta, FresnelData fd) +{ + // XYZ to CIE 1931 RGB color space (using neutral E illuminant) + const mat3 XYZ_TO_RGB = mat3(2.3706743, -0.5138850, 0.0052982, -0.9000405, 1.4253036, -0.0146949, -0.4706338, 0.0885814, 1.0093968); + + // Assume vacuum on the outside + float eta1 = 1.0; + float eta2 = max(fd.tf_ior, eta1); + vec3 eta3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? mx_f0_to_ior(fd.F0) : fd.ior; + vec3 kappa3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? vec3(0.0) : fd.extinction; + float cosThetaT = sqrt(1.0 - (1.0 - mx_square(cosTheta)) * mx_square(eta1 / eta2)); + + // First interface + vec2 R12 = mx_fresnel_dielectric_polarized(cosTheta, eta2 / eta1); + if (cosThetaT <= 0.0) + { + // Total internal reflection + R12 = vec2(1.0); + } + vec2 T121 = vec2(1.0) - R12; + + // Second interface + vec3 R23p, R23s; + if (fd.model == FRESNEL_MODEL_SCHLICK) + { + vec3 f = mx_fresnel_hoffman_schlick(cosThetaT, fd); + R23p = 0.5 * f; + R23s = 0.5 * f; + } + else + { + mx_fresnel_conductor_polarized(cosThetaT, eta3 / eta2, kappa3 / eta2, R23p, R23s); + } + + // Phase shift + float cosB = cos(atan(eta2 / eta1)); + vec2 phi21 = vec2(cosTheta < cosB ? 0.0 : M_PI, M_PI); + vec3 phi23p, phi23s; + if (fd.model == FRESNEL_MODEL_SCHLICK) + { + phi23p = vec3((eta3[0] < eta2) ? M_PI : 0.0, + (eta3[1] < eta2) ? M_PI : 0.0, + (eta3[2] < eta2) ? M_PI : 0.0); + phi23s = phi23p; + } + else + { + mx_fresnel_conductor_phase_polarized(cosThetaT, eta2, eta3, kappa3, phi23p, phi23s); + } + vec3 r123p = max(sqrt(R12.x*R23p), 0.0); + vec3 r123s = max(sqrt(R12.y*R23s), 0.0); + + // Iridescence term + vec3 I = vec3(0.0); + vec3 Cm, Sm; + + // Optical path difference + float distMeters = fd.tf_thickness * 1.0e-9; + float opd = 2.0 * eta2 * cosThetaT * distMeters; + + // Iridescence term using spectral antialiasing for Parallel polarization + + // Reflectance term for m=0 (DC term amplitude) + vec3 Rs = (mx_square(T121.x) * R23p) / (vec3(1.0) - R12.x*R23p); + I += R12.x + Rs; + + // Reflectance term for m>0 (pairs of diracs) + Cm = Rs - T121.x; + for (int m=1; m<=2; m++) + { + Cm *= r123p; + Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23p+vec3(phi21.x))); + I += Cm*Sm; + } + + // Iridescence term using spectral antialiasing for Perpendicular polarization + + // Reflectance term for m=0 (DC term amplitude) + vec3 Rp = (mx_square(T121.y) * R23s) / (vec3(1.0) - R12.y*R23s); + I += R12.y + Rp; + + // Reflectance term for m>0 (pairs of diracs) + Cm = Rp - T121.y; + for (int m=1; m<=2; m++) + { + Cm *= r123s; + Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23s+vec3(phi21.y))); + I += Cm*Sm; + } + + // Average parallel and perpendicular polarization + I *= 0.5; + + // Convert back to RGB reflectance + I = clamp(XYZ_TO_RGB * I, 0.0, 1.0); + + return I; +} + +FresnelData mx_init_fresnel_dielectric(float ior, float tf_thickness, float tf_ior) +{ + FresnelData fd; + fd.model = FRESNEL_MODEL_DIELECTRIC; + fd.airy = tf_thickness > 0.0; + fd.ior = vec3(ior); + fd.extinction = vec3(0.0); + fd.F0 = vec3(0.0); + fd.F82 = vec3(0.0); + fd.F90 = vec3(0.0); + fd.exponent = 0.0; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; +} + +FresnelData mx_init_fresnel_conductor(vec3 ior, vec3 extinction, float tf_thickness, float tf_ior) +{ + FresnelData fd; + fd.model = FRESNEL_MODEL_CONDUCTOR; + fd.airy = tf_thickness > 0.0; + fd.ior = ior; + fd.extinction = extinction; + fd.F0 = vec3(0.0); + fd.F82 = vec3(0.0); + fd.F90 = vec3(0.0); + fd.exponent = 0.0; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; +} + +FresnelData mx_init_fresnel_schlick(vec3 F0, vec3 F82, vec3 F90, float exponent, float tf_thickness, float tf_ior) +{ + FresnelData fd; + fd.model = FRESNEL_MODEL_SCHLICK; + fd.airy = tf_thickness > 0.0; + fd.ior = vec3(0.0); + fd.extinction = vec3(0.0); + fd.F0 = F0; + fd.F82 = F82; + fd.F90 = F90; + fd.exponent = exponent; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; +} + +vec3 mx_compute_fresnel(float cosTheta, FresnelData fd) +{ + if (fd.airy) + { + return mx_fresnel_airy(cosTheta, fd); + } + else if (fd.model == FRESNEL_MODEL_DIELECTRIC) + { + return vec3(mx_fresnel_dielectric(cosTheta, fd.ior.x)); + } + else if (fd.model == FRESNEL_MODEL_CONDUCTOR) + { + return mx_fresnel_conductor(cosTheta, fd.ior, fd.extinction); + } + else + { + return mx_fresnel_hoffman_schlick(cosTheta, fd); + } +} + +// Compute the refraction of a ray through a solid sphere. +vec3 mx_refraction_solid_sphere(vec3 R, vec3 N, float ior) +{ + R = refract(R, N, 1.0 / ior); + vec3 N1 = normalize(R * dot(R, N) - N * 0.5); + return refract(R, N1, ior); +} + +vec2 mx_latlong_projection(vec3 dir) +{ + float latitude = -asin(dir.y) * M_PI_INV + 0.5; + float longitude = atan(dir.x, -dir.z) * M_PI_INV * 0.5 + 0.5; + return vec2(longitude, latitude); +} + +vec3 mx_latlong_map_lookup(vec3 dir, mat4 transform, float lod, sampler2D envSampler) +{ + vec3 envDir = normalize((transform * vec4(dir,0.0)).xyz); + vec2 uv = mx_latlong_projection(envDir); + return textureLod(envSampler, uv, lod).rgb; +} + +// Return the mip level with the appropriate coverage for a filtered importance sample. +// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch20.html +// Section 20.4 Equation 13 +float mx_latlong_compute_lod(vec3 dir, float pdf, float maxMipLevel, int envSamples) +{ + const float MIP_LEVEL_OFFSET = 1.5; + float effectiveMaxMipLevel = maxMipLevel - MIP_LEVEL_OFFSET; + float distortion = sqrt(1.0 - mx_square(dir.y)); + return max(effectiveMaxMipLevel - 0.5 * log2(float(envSamples) * pdf * distortion), 0.0); +} +// https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps +float mx_variance_shadow_occlusion(vec2 moments, float fragmentDepth) +{ + const float MIN_VARIANCE = 0.00001; + + // One-tailed inequality valid if fragmentDepth > moments.x. + float p = (fragmentDepth <= moments.x) ? 1.0 : 0.0; + + // Compute variance. + float variance = moments.y - mx_square(moments.x); + variance = max(variance, MIN_VARIANCE); + + // Compute probabilistic upper bound. + float d = fragmentDepth - moments.x; + float pMax = variance / (variance + mx_square(d)); + return max(p, pMax); +} + +vec2 mx_compute_depth_moments() +{ + float depth = gl_FragCoord.z; + return vec2(depth, mx_square(depth)); +} +#include "mx_microfacet_specular.glsl" + +// Construct an orthonormal basis from a unit vector. +// https://graphics.pixar.com/library/OrthonormalB/paper.pdf +mat3 mx_orthonormal_basis(vec3 N) +{ + float sign = (N.z < 0.0) ? -1.0 : 1.0; + float a = -1.0 / (sign + N.z); + float b = N.x * N.y * a; + vec3 X = vec3(1.0 + sign * N.x * N.x * a, sign * b, -sign * N.x); + vec3 Y = vec3(b, sign + N.y * N.y * a, -N.y); + return mat3(X, Y, N); +} + +// Return the alpha associated with the given mip level in a prefiltered environment. +float mx_latlong_lod_to_alpha(float lod) +{ + float lodBias = lod / float($envRadianceMips - 1); + return (lodBias < 0.5) ? mx_square(lodBias) : 2.0 * (lodBias - 0.375); +} + +// The inverse of mx_latlong_projection. +vec3 mx_latlong_map_projection_inverse(vec2 uv) +{ + float latitude = (uv.y - 0.5) * M_PI; + float longitude = (uv.x - 0.5) * M_PI * 2.0; + + float x = -cos(latitude) * sin(longitude); + float y = -sin(latitude); + float z = cos(latitude) * cos(longitude); + + return vec3(x, y, z); +} + +vec3 mx_generate_prefilter_env() +{ + // The tangent view vector is aligned with the normal. + vec3 V = vec3(0.0, 0.0, 1.0); + float NdotV = 1.0; + + // Compute derived properties. + vec2 uv = gl_FragCoord.xy * pow(2.0, $envPrefilterMip) / vec2(textureSize($envRadiance, 0)); + vec3 worldN = mx_latlong_map_projection_inverse(uv); + mat3 tangentToWorld = mx_orthonormal_basis(worldN); + float alpha = mx_latlong_lod_to_alpha(float($envPrefilterMip)); + float G1V = mx_ggx_smith_G1(NdotV, alpha); + + // Integrate the LD term for the given environment and alpha. + vec3 radiance = vec3(0.0, 0.0, 0.0); + float weight = 0.0; + int envRadianceSamples = 1024; + for (int i = 0; i < envRadianceSamples; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); + + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); + vec3 L = -V + 2.0 * H.z * H; + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + + // Compute the geometric term. + float G = mx_ggx_smith_G2(NdotL, NdotV, alpha); + + // Sample the environment light from the given direction. + vec3 Lw = tangentToWorld * L; + float pdf = mx_ggx_NDF(H, vec2(alpha)) * G1V / (4.0 * NdotV); + float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); + vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); + + // Add the radiance contribution of this sample. + radiance += G * sampleColor; + weight += G; + } + + return radiance / weight; +} +#include "mx_microfacet_sheen.glsl" +#include "mx_microfacet_specular.glsl" + +vec3 mx_generate_dir_albedo_table() +{ + vec2 uv = gl_FragCoord.xy / $albedoTableSize; + vec2 ggxDirAlbedo = mx_ggx_dir_albedo(uv.x, uv.y, vec3(1, 0, 0), vec3(0, 1, 0)).xy; + float sheenDirAlbedo = mx_imageworks_sheen_dir_albedo(uv.x, uv.y); + return vec3(ggxDirAlbedo, sheenDirAlbedo); +} +#include "mx_microfacet_specular.glsl" + +vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) +{ + return tint; +} +#include "mx_microfacet.glsl" + +// Based on the implementation of Oren-Nayar diffuse in Open Shading Language. +// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/testrender/shading.cpp +float mx_oren_nayar_diffuse(float NdotV, float NdotL, float LdotV, float roughness) +{ + float s = LdotV - NdotL * NdotV; + float stinv = (s > 0.0f) ? s / max(NdotL, NdotV) : 0.0; + + float sigma2 = mx_square(roughness); + float A = 1.0 - 0.5 * (sigma2 / (sigma2 + 0.33)); + float B = 0.45 * sigma2 / (sigma2 + 0.09); + + return A + B * stinv; +} + +// Rational quadratic fit to Monte Carlo data for Oren-Nayar directional albedo. +float mx_oren_nayar_diffuse_dir_albedo_analytic(float NdotV, float roughness) +{ + vec2 r = vec2(1.0, 1.0) + + vec2(-0.4297, -0.6076) * roughness + + vec2(-0.7632, -0.4993) * NdotV * roughness + + vec2(1.4385, 2.0315) * mx_square(roughness); + return r.x / r.y; +} + +float mx_oren_nayar_diffuse_dir_albedo_table_lookup(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) + { + return texture($albedoTable, vec2(NdotV, roughness)).b; + } +#endif + return 0.0; +} + +float mx_oren_nayar_diffuse_dir_albedo_monte_carlo(float NdotV, float roughness) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); + + float radiance = 0.0; + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); + + // Compute the incoming light direction. + vec3 L = mx_uniform_sample_hemisphere(Xi); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); + + // Compute diffuse reflectance. + float reflectance = mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); + + // Add the radiance contribution of this sample. + // uniform_pdf = 1 / (2 * PI) + // radiance = (reflectance * NdotL) / (uniform_pdf * PI); + radiance += reflectance * NdotL; + } + + // Apply global components and normalize. + radiance *= 2.0 / float(SAMPLE_COUNT); + + // Return the final directional albedo. + return radiance; +} + +float mx_oren_nayar_diffuse_dir_albedo(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 2 + float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_monte_carlo(NdotV, roughness); +#else + float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_analytic(NdotV, roughness); +#endif + return clamp(dirAlbedo, 0.0, 1.0); +} + +// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf +// Section 5.3 +float mx_burley_diffuse(float NdotV, float NdotL, float LdotH, float roughness) +{ + float F90 = 0.5 + (2.0 * roughness * mx_square(LdotH)); + float refL = mx_fresnel_schlick(NdotL, 1.0, F90); + float refV = mx_fresnel_schlick(NdotV, 1.0, F90); + return refL * refV; +} + +// Compute the directional albedo component of Burley diffuse for the given +// view angle and roughness. Curve fit provided by Stephen Hill. +float mx_burley_diffuse_dir_albedo(float NdotV, float roughness) +{ + float x = NdotV; + float fit0 = 0.97619 - 0.488095 * mx_pow5(1.0 - x); + float fit1 = 1.55754 + (-2.02221 + (2.56283 - 1.06244 * x) * x) * x; + return mix(fit0, fit1, roughness); +} + +// Evaluate the Burley diffusion profile for the given distance and diffusion shape. +// Based on https://graphics.pixar.com/library/ApproxBSSRDF/ +vec3 mx_burley_diffusion_profile(float dist, vec3 shape) +{ + vec3 num1 = exp(-shape * dist); + vec3 num2 = exp(-shape * dist / 3.0); + float denom = max(dist, M_FLOAT_EPS); + return (num1 + num2) / denom; +} + +// Integrate the Burley diffusion profile over a sphere of the given radius. +// Inspired by Eric Penner's presentation in http://advances.realtimerendering.com/s2011/ +vec3 mx_integrate_burley_diffusion(vec3 N, vec3 L, float radius, vec3 mfp) +{ + float theta = acos(dot(N, L)); + + // Estimate the Burley diffusion shape from mean free path. + vec3 shape = vec3(1.0) / max(mfp, 0.1); + + // Integrate the profile over the sphere. + vec3 sumD = vec3(0.0); + vec3 sumR = vec3(0.0); + const int SAMPLE_COUNT = 32; + const float SAMPLE_WIDTH = (2.0 * M_PI) / float(SAMPLE_COUNT); + for (int i = 0; i < SAMPLE_COUNT; i++) + { + float x = -M_PI + (float(i) + 0.5) * SAMPLE_WIDTH; + float dist = radius * abs(2.0 * sin(x * 0.5)); + vec3 R = mx_burley_diffusion_profile(dist, shape); + sumD += R * max(cos(theta + x), 0.0); + sumR += R; + } + + return sumD / sumR; +} + +vec3 mx_subsurface_scattering_approx(vec3 N, vec3 L, vec3 P, vec3 albedo, vec3 mfp) +{ + float curvature = length(fwidth(N)) / length(fwidth(P)); + float radius = 1.0 / max(curvature, 0.01); + return albedo * mx_integrate_burley_diffusion(N, L, radius, mfp) / vec3(M_PI); +} +#include "mx_microfacet_specular.glsl" + +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 roughness, int distribution, FresnelData fd) +{ + return vec3(0.0); +} + +vec3 mx_environment_irradiance(vec3 N) +{ + return vec3(0.0); +} +#include "mx_microfacet.glsl" + +// http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf +// Equation 2 +float mx_imageworks_sheen_NDF(float NdotH, float roughness) +{ + float invRoughness = 1.0 / max(roughness, 0.005); + float cos2 = NdotH * NdotH; + float sin2 = 1.0 - cos2; + return (2.0 + invRoughness) * pow(sin2, invRoughness * 0.5) / (2.0 * M_PI); +} + +float mx_imageworks_sheen_brdf(float NdotL, float NdotV, float NdotH, float roughness) +{ + // Microfacet distribution. + float D = mx_imageworks_sheen_NDF(NdotH, roughness); + + // Fresnel and geometry terms are ignored. + float F = 1.0; + float G = 1.0; + + // We use a smoother denominator, as in: + // https://blog.selfshadow.com/publications/s2013-shading-course/rad/s2013_pbs_rad_notes.pdf + return D * F * G / (4.0 * (NdotL + NdotV - NdotL*NdotV)); +} + +// Rational quadratic fit to Monte Carlo data for Imageworks sheen directional albedo. +float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) +{ + vec2 r = vec2(13.67300, 1.0) + + vec2(-68.78018, 61.57746) * NdotV + + vec2(799.08825, 442.78211) * roughness + + vec2(-905.00061, 2597.49308) * NdotV * roughness + + vec2(60.28956, 121.81241) * mx_square(NdotV) + + vec2(1086.96473, 3045.55075) * mx_square(roughness); + return r.x / r.y; +} + +float mx_imageworks_sheen_dir_albedo_table_lookup(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) + { + return texture($albedoTable, vec2(NdotV, roughness)).b; + } +#endif + return 0.0; +} + +float mx_imageworks_sheen_dir_albedo_monte_carlo(float NdotV, float roughness) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); + + float radiance = 0.0; + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); + + // Compute the incoming light direction and half vector. + vec3 L = mx_uniform_sample_hemisphere(Xi); + vec3 H = normalize(L + V); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float NdotH = clamp(H.z, M_FLOAT_EPS, 1.0); + + // Compute sheen reflectance. + float reflectance = mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); + + // Add the radiance contribution of this sample. + // uniform_pdf = 1 / (2 * PI) + // radiance = reflectance * NdotL / uniform_pdf; + radiance += reflectance * NdotL * 2.0 * M_PI; + } + + // Return the final directional albedo. + return radiance / float(SAMPLE_COUNT); +} + +float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 0 + float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); +#elif DIRECTIONAL_ALBEDO_METHOD == 1 + float dirAlbedo = mx_imageworks_sheen_dir_albedo_table_lookup(NdotV, roughness); +#else + float dirAlbedo = mx_imageworks_sheen_dir_albedo_monte_carlo(NdotV, roughness); +#endif + return clamp(dirAlbedo, 0.0, 1.0); +} +#include "mx_microfacet_specular.glsl" + +// Return the mip level associated with the given alpha in a prefiltered environment. +float mx_latlong_alpha_to_lod(float alpha) +{ + float lodBias = (alpha < 0.25) ? sqrt(alpha) : 0.5 * alpha + 0.375; + return lodBias * float($envRadianceMips - 1); +} + +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) +{ + N = mx_forward_facing_normal(N, V); + vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, N, fd.ior.x) : -reflect(V, N); + + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + float avgAlpha = mx_average_alpha(alpha); + vec3 F = mx_compute_fresnel(NdotV, fd); + float G = mx_ggx_smith_G2(NdotV, NdotV, avgAlpha); + vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; + + vec3 Li = mx_latlong_map_lookup(L, $envMatrix, mx_latlong_alpha_to_lod(avgAlpha), $envRadiance); + return Li * FG * $envLightIntensity; +} + +vec3 mx_environment_irradiance(vec3 N) +{ + vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + return Li * $envLightIntensity; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) +{ + // TODO: Need to remap parameters to match the new closure, + // or change the MaterialX spec to OSL parameterization. + vdf = 0; +} +void mx_displacement_float(float displacement, float scale, output displacementshader result) +{ + result = vector(displacement * scale); +} +void mx_blackbody(float temp, output color color_value) +{ + float xc, yc; + float t, t2, t3, xc2, xc3; + + // if value outside valid range of approximation clamp to accepted temperature range + float temperature = clamp(temp, 1667.0, 25000.0); + + t = 1000.0 / temperature; + t2 = t * t; + t3 = t * t * t; + + // Cubic spline approximation for Kelvin temperature to sRGB conversion + // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) + if (temperature < 4000.0) { // 1667K <= temperature < 4000K + xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; + } + else { // 4000K <= temperature <= 25000K + xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; + } + xc2 = xc * xc; + xc3 = xc * xc * xc; + + if (temperature < 2222.0) { // 1667K <= temperature < 2222K + yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; + } + else if (temperature < 4000.0) { // 2222K <= temperature < 4000K + yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; + } + else { // 4000K <= temperature <= 25000K + yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; + } + + if (yc <= 0.0) { // avoid division by zero + color_value = color(1.0); + return; + } + + vector XYZ = vector(xc / yc, 1.0, (1 - xc - yc) / yc); + + /// XYZ to Rec.709 RGB colorspace conversion + matrix XYZ_to_RGB = matrix( 3.2406, -0.9689, 0.0557, 0.0, + -1.5372, 1.8758, -0.2040, 0.0, + -0.4986, 0.0415, 1.0570, 0.0, + 0.0, 0.0, 0.0, 1.0); + + color_value = transform(XYZ_to_RGB, XYZ); + color_value = max(color_value, vector(0.0)); +} +void mx_displacement_vector3(vector displacement, float scale, output displacementshader result) +{ + result = displacement * scale; +} +#include "lib/mx_microfacet.osl" + +void mx_generalized_schlick_edf(color color0, color color90, float exponent, EDF base, output EDF result) +{ + float NdotV = fabs(dot(N,-I)); + color f = mx_fresnel_schlick(NdotV, color0, color90, exponent); + result = base * f; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +void mx_roughness_anisotropy(float roughness, float anisotropy, output vector2 result) +{ + float roughness_sqr = clamp(roughness*roughness, M_FLOAT_EPS, 1.0); + if (anisotropy > 0.0) + { + float aspect = sqrt(1.0 - clamp(anisotropy, 0.0, 0.98)); + result.x = min(roughness_sqr / aspect, 1.0); + result.y = roughness_sqr * aspect; + } + else + { + result.x = roughness_sqr; + result.y = roughness_sqr; + } +} +void mx_roughness_dual(vector2 roughness, output vector2 result) +{ + result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); + if (roughness.y < 0.0) + { + result.y = result.x; + } + else + { + result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); + } +} +void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +{ + if (scatter_mode == "R") + { + bsdf = weight * dielectric_bsdf(N, U, tint, color(0.0), roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else if (scatter_mode == "T") + { + bsdf = weight * dielectric_bsdf(N, U, color(0.0), tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else + { + bsdf = weight * dielectric_bsdf(N, U, tint, tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) +{ + result.bsdf = bsdf; + result.edf = edf; + result.opacity = clamp(opacity, 0.0, 1.0); +} +void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +{ + if (scatter_mode == "R") + { + bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(0.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else if (scatter_mode == "T") + { + bsdf = weight * generalized_schlick_bsdf(N, U, color(0.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else + { + bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } +} +void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) +{ + // TODO: Subsurface closure is not supported by vanilla OSL. + bsdf = _color * weight * diffuse(N); +} +void mx_artistic_ior(color reflectivity, color edge_color, output vector ior, output vector extinction) +{ + // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 + // http://jcgt.org/published/0003/04/03/paper.pdf + + color r = clamp(reflectivity, 0.0, 0.99); + color r_sqrt = sqrt(r); + color n_min = (1.0 - r) / (1.0 + r); + color n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); + ior = mix(n_max, n_min, edge_color); + + color np1 = ior + 1.0; + color nm1 = ior - 1.0; + color k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); + k2 = max(k2, 0.0); + extinction = sqrt(k2); +} +#include "mx_microfacet.osl" + +// Compute the average of an anisotropic alpha pair. +float mx_average_alpha(vector2 alpha) +{ + return sqrt(alpha.x * alpha.y); +} + +// Convert a real-valued index of refraction to normal-incidence reflectivity. +float mx_ior_to_f0(float ior) +{ + return mx_square((ior - 1.0) / (ior + 1.0)); +} + +// Convert normal-incidence reflectivity to real-valued index of refraction. +float mx_f0_to_ior(float F0) +{ + float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (1.0 + sqrtF0) / (1.0 - sqrtF0); +} + +// Rational quadratic fit to Monte Carlo data for GGX directional albedo. +color mx_ggx_dir_albedo(float NdotV, float alpha, color F0, color F90) +{ + float x = NdotV; + float y = alpha; + float x2 = mx_square(x); + float y2 = mx_square(y); + vector4 r = vector4(0.1003, 0.9345, 1.0, 1.0) + + vector4(-0.6303, -2.323, -1.765, 0.2281) * x + + vector4(9.748, 2.229, 8.263, 15.94) * y + + vector4(-2.038, -3.748, 11.53, -55.83) * x * y + + vector4(29.34, 1.424, 28.96, 13.08) * x2 + + vector4(-8.245, -0.7684, -7.507, 41.26) * y2 + + vector4(-26.44, 1.436, -36.11, 54.9) * x2 * y + + vector4(19.99, 0.2913, 15.86, 300.2) * x * y2 + + vector4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; + vector2 AB = vector2(r.x, r.y) / vector2(r.z, r.w); + AB.x = clamp(AB.x, 0.0, 1.0); + AB.y = clamp(AB.y, 0.0, 1.0); + return F0 * AB.x + F90 * AB.y; +} + +float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) +{ + color result = mx_ggx_dir_albedo(NdotV, alpha, color(F0), color(F90)); + return result[0]; +} + +float mx_ggx_dir_albedo(float NdotV, float alpha, float ior) +{ + color result = mx_ggx_dir_albedo(NdotV, alpha, color(mx_ior_to_f0(ior)), color(1.0)); + return result[0]; +} + +// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf +// Equations 14 and 16 +color mx_ggx_energy_compensation(float NdotV, float alpha, color Fss) +{ + float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); + return 1.0 + Fss * (1.0 - Ess) / Ess; +} + +float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) +{ + color result = mx_ggx_energy_compensation(NdotV, alpha, color(Fss)); + return result[0]; +} +#include "mx_microfacet.osl" + +// Rational curve fit approximation for the directional albedo of Imageworks sheen. +float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) +{ + float a = 5.25248 - 7.66024 * NdotV + 14.26377 * roughness; + float b = 1.0 + 30.66449 * NdotV + 32.53420 * roughness; + return a / b; +} + +float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) +{ + float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); + return clamp(dirAlbedo, 0.0, 1.0); +} +float mx_square(float x) +{ + return x*x; +} + +vector2 mx_square(vector2 x) +{ + return x*x; +} + +vector mx_square(vector x) +{ + return x*x; +} + +vector4 mx_square(vector4 x) +{ + return x*x; +} + +float mx_pow5(float x) +{ + return mx_square(mx_square(x)) * x; +} + +color mx_fresnel_conductor(float cosTheta, vector n, vector k) +{ + float c2 = cosTheta*cosTheta; + vector n2_k2 = n*n + k*k; + vector nc2 = 2.0 * n * cosTheta; + + vector rs_a = n2_k2 + c2; + vector rp_a = n2_k2 * c2 + 1.0; + vector rs = (rs_a - nc2) / (rs_a + nc2); + vector rp = (rp_a - nc2) / (rp_a + nc2); + + return 0.5 * (rs + rp); +} + +// Standard Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; +} +color mx_fresnel_schlick(float cosTheta, color F0) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; +} + +// Generalized Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0, float F90) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); +} +color mx_fresnel_schlick(float cosTheta, color F0, color F90) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); +} + +// Generalized Schlick Fresnel with a variable exponent +color mx_fresnel_schlick(float cosTheta, float f0, float f90, float exponent) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(f0, f90, pow(x, exponent)); +} +color mx_fresnel_schlick(float cosTheta, color f0, color f90, float exponent) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(f0, f90, pow(x, exponent)); +} +void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) +{ + // Not implemented in vanilla OSL + vdf = 0; // volume_henyey_greenstein(color(absorption), color(scattering), color(0.0), anisotropy); +} +void mx_burley_diffuse_bsdf(float weight, color reflectance, float roughness, normal N, output BSDF bsdf) +{ + // TODO: Implement properly. + bsdf.response = reflectance * weight * oren_nayar(N, roughness); + bsdf.throughput = color(0.0); +} +#include "../lib/mx_microfacet_specular.osl" + +void mx_conductor_bsdf(float weight, color ior_n, color ior_k, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, output BSDF bsdf) +{ + bsdf.throughput = color(0.0); + + if (weight < M_FLOAT_EPS) + { + bsdf.response = 0; + return; + } + + // Calculate conductor fresnel + // + // Fresnel should be based on microfacet normal + // but we have no access to that from here, so just use + // view direction and surface normal instead + // + float NdotV = fabs(dot(N,-I)); + color F = mx_fresnel_conductor(NdotV, ior_n, ior_k); + + // Calculate compensation for multiple scattering. + // This should normally be done inside the closure + // but since vanilla OSL doesen't support this we + // add it here in shader code instead. + vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + + // Set ior to 0.0 to disable the internal dielectric fresnel + bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, false); +} +#include "../lib/mx_microfacet_specular.osl" + +void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +{ + if (scatter_mode == "T") + { + bsdf.response = tint * weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); + bsdf.throughput = tint * weight; + return; + } + + float NdotV = clamp(dot(N,-I), M_FLOAT_EPS, 1.0); + float F0 = mx_ior_to_f0(ior); + float F = mx_fresnel_schlick(NdotV, F0); + + // Calculate compensation for multiple scattering. + // This should normally be done inside the closure + // but since vanilla OSL doesen't support this we + // add it here in shader code instead. + vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + float comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + + // Calculate throughput from directional albedo. + float dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, ior) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + if (scatter_mode == "R") + { + bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 0); + } + else + { + bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 2); + } +} +#include "../lib/mx_microfacet_sheen.osl" + +// TODO: Vanilla OSL doesn't have a proper sheen closure, +// so use 'diffuse' scaled by sheen directional albedo for now. +void mx_sheen_bsdf(float weight, color Ks, float roughness, vector N, output BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + bsdf.response = 0; + bsdf.throughput = color(1.0); + return; + } + + // TODO: Normalization should not be needed. My suspicion is that + // BSDF sampling of new outgoing direction in 'testrender' needs + // to be fixed. + vector V = normalize(-I); + + float NdotV = fabs(dot(N,V)); + float alpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float albedo = weight * mx_imageworks_sheen_dir_albedo(NdotV, alpha); + bsdf.response = albedo * Ks * diffuse(N); + bsdf.throughput = 1.0 - albedo; +} +void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) +{ + result.bsdf = bsdf.response; + result.edf = edf; + result.opacity = clamp(opacity, 0.0, 1.0); +} +void mx_translucent_bsdf(float weight, color _color, normal N, output BSDF bsdf) +{ + bsdf.response = _color * weight * translucent(N); + bsdf.throughput = color(0.0); +} +#include "../lib/mx_microfacet_specular.osl" + +void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +{ + float avgF0 = dot(color0, color(1.0 / 3.0)); + float ior = mx_f0_to_ior(avgF0); + + if (scatter_mode == "T") + { + bsdf.response = weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); + bsdf.throughput = weight; + return; + } + + float NdotV = fabs(dot(N,-I)); + color F = mx_fresnel_schlick(NdotV, color0, color90, exponent); + + // Calculate compensation for multiple scattering. + // This should normally be done inside the closure + // but since vanilla OSL doesen't support this we + // add it here in shader code instead. + vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + + // Calculate throughput from directional albedo. + color dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, color0, color90) * comp; + float avgDirAlbedo = dot(dirAlbedo, color(1.0 / 3.0)); + bsdf.throughput = 1.0 - avgDirAlbedo * weight; + + // Calculate the reflection response, setting IOR to zero to disable internal Fresnel. + bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, 0); + + if (scatter_mode == "RT") + { + bsdf.response += bsdf.throughput * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 1); + } +} +void mx_oren_nayar_diffuse_bsdf(float weight, color _color, float roughness, normal N, output BSDF bsdf) +{ + bsdf.response = _color * weight * oren_nayar(N, roughness); + bsdf.throughput = color(0.0); +} +void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) +{ + // TODO: Subsurface closure is not supported by vanilla OSL. + bsdf.response = _color * weight * diffuse(N); + bsdf.throughput = color(0.0); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +void mx_point_light(LightData light, vec3 position, out lightshader result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; +} + + + + + + + + + + + + + +void mx_directional_light(LightData light, vec3 position, out lightshader result) +{ + result.direction = -light.direction; + result.intensity = light.color * light.intensity; +} +void mx_spot_light(LightData light, vec3 position, out lightshader result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; + float low = min(light.inner_angle, light.outer_angle); + float high = light.inner_angle; + float cosDir = dot(result.direction, -light.direction); + float spotAttenuation = smoothstep(low, high, cosDir); + result.intensity *= spotAttenuation; +} +void mx_directional_light(LightData light, float3 position, thread lightshader& result) +{ + result.direction = -light.direction; + result.intensity = light.color * light.intensity; +} +void mx_point_light(LightData light, float3 position, thread lightshader& result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; +} + + + + + + + + + + + + + +void mx_spot_light(LightData light, float3 position, thread lightshader& result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; + float low = min(light.inner_angle, light.outer_angle); + float high = light.inner_angle; + float cosDir = dot(result.direction, -light.direction); + float spotAttenuation = smoothstep(low, high, cosDir); + result.intensity *= spotAttenuation; +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "mx_aastep.glsl" + +void mx_splitlr_vector2(vec2 valuel, vec2 valuer, float center, vec2 texcoord, out vec2 result) +{ + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); +} +float mx_aastep(float threshold, float value) +{ + float afwidth = length(vec2(dFdx(value), dFdy(value))) * 0.70710678118654757; + return smoothstep(threshold-afwidth, threshold+afwidth, value); +} +void mx_dodge_float(float fg, float bg, float mixval, out float result) +{ + if (abs(1.0 - fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(bg / (1.0 - fg)) + ((1.0-mixval)*bg); +} +#include "mx_aastep.glsl" + +void mx_splittb_vector4(vec4 valuet, vec4 valueb, float center, vec2 texcoord, out vec4 result) +{ + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); +} +void mx_luminance_color3(vec3 _in, vec3 lumacoeffs, out vec3 result) +{ + result = vec3(dot(_in, lumacoeffs)); +} +#include "lib/mx_noise.glsl" + +void mx_worleynoise2d_vector2(vec2 texcoord, float jitter, out vec2 result) +{ + result = mx_worley_noise_vec2(texcoord, jitter, 0); +} +#include "lib/mx_noise.glsl" + +void mx_fractal3d_vector3(vec3 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec3 result) +{ + vec3 value = mx_fractal_noise_vec3(position, octaves, lacunarity, diminish); + result = value * amplitude; +} +#include "lib/mx_noise.glsl" + +void mx_noise2d_vector4(vec4 amplitude, float pivot, vec2 texcoord, out vec4 result) +{ + vec3 xyz = mx_perlin_noise_vec3(texcoord); + float w = mx_perlin_noise_float(texcoord + vec2(19, 73)); + result = vec4(xyz, w) * amplitude + pivot; +} +void mx_ramptb_vector3(vec3 valuet, vec3 valueb, vec2 texcoord, out vec3 result) +{ + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); +} +#include "mx_smoothstep_float.glsl" + +void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) +{ + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); +} +void mx_ramplr_vector2(vec2 valuel, vec2 valuer, vec2 texcoord, out vec2 result) +{ + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); +} +#include "lib/mx_noise.glsl" + +void mx_noise2d_float(float amplitude, float pivot, vec2 texcoord, out float result) +{ + float value = mx_perlin_noise_float(texcoord); + result = value * amplitude + pivot; +} +#include "mx_dodge_float.glsl" + +void mx_dodge_color4(vec4 fg , vec4 bg , float mixval, out vec4 result) +{ + mx_dodge_float(fg.x, bg.x, mixval, result.x); + mx_dodge_float(fg.y, bg.y, mixval, result.y); + mx_dodge_float(fg.z, bg.z, mixval, result.z); + mx_dodge_float(fg.w, bg.w, mixval, result.w); +} +#include "mx_aastep.glsl" + +void mx_splitlr_float(float valuel, float valuer, float center, vec2 texcoord, out float result) +{ + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); +} +#include "lib/mx_noise.glsl" + +void mx_cellnoise3d_float(vec3 position, out float result) +{ + result = mx_cell_noise_float(position); +} +#include "mx_smoothstep_float.glsl" + +void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, out vec3 result) +{ + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); + mx_smoothstep_float(val.z, low.z, high.z, result.z); +} +#include "lib/mx_noise.glsl" + +void mx_noise3d_vector2(vec2 amplitude, float pivot, vec3 position, out vec2 result) +{ + vec3 value = mx_perlin_noise_vec3(position); + result = value.xy * amplitude + pivot; +} +void mx_transformmatrix_vector3M4(vec3 val, mat4 transform, out vec3 result) +{ + vec4 res = transform * vec4(val, 1.0); + result = res.xyz; +} +#include "lib/mx_hsv.glsl" + +void mx_rgbtohsv_color3(vec3 _in, out vec3 result) +{ + result = mx_rgbtohsv(_in); +} +void mx_ramplr_vector3(vec3 valuel, vec3 valuer, vec2 texcoord, out vec3 result) +{ + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); +} +void mx_disjointover_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) +{ + float summedAlpha = fg.w + bg.w; + + if (summedAlpha <= 1.0) + { + result.xyz = fg.xyz + bg.xyz; + } + else + { + if (abs(bg.w) < M_FLOAT_EPS) + { + result.xyz = vec3(0.0); + } + else + { + float x = (1.0 - fg.w) / bg.w; + result.xyz = fg.xyz + bg.xyz * x; + } + } + result.w = min(summedAlpha, 1.0); + + result.xyz = result.xyz * mixval + (1.0 - mixval) * bg.xyz; + result.w = result.w * mixval + (1.0 - mixval) * bg.w; +} +#include "lib/mx_noise.glsl" + +void mx_cellnoise2d_float(vec2 texcoord, out float result) +{ + result = mx_cell_noise_float(texcoord); +} +#include "mx_aastep.glsl" + +void mx_splitlr_vector4(vec4 valuel, vec4 valuer, float center, vec2 texcoord, out vec4 result) +{ + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); +} +#include "lib/$fileTransformUv" + +void mx_image_vector2(sampler2D tex_sampler, int layer, vec2 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec2 result) +{ + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rg; +} +#include "mx_dodge_float.glsl" + +void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) +{ + mx_dodge_float(fg.x, bg.x, mixval, result.x); + mx_dodge_float(fg.y, bg.y, mixval, result.y); + mx_dodge_float(fg.z, bg.z, mixval, result.z); +} +void mx_ramptb_vector2(vec2 valuet, vec2 valueb, vec2 texcoord, out vec2 result) +{ + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); +} +#include "lib/mx_hsv.glsl" + +void mx_rgbtohsv_color4(vec4 _in, out vec4 result) +{ + result = vec4(mx_rgbtohsv(_in.rgb), 1.0); +} +#include "lib/mx_noise.glsl" + +void mx_worleynoise3d_float(vec3 position, float jitter, out float result) +{ + result = mx_worley_noise_float(position, jitter, 0); +} +#include "lib/mx_hsv.glsl" + +void mx_hsvtorgb_color3(vec3 _in, out vec3 result) +{ + result = mx_hsvtorgb(_in); +} +#include "lib/mx_noise.glsl" + +void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out float result) +{ + float value = mx_fractal_noise_float(position, octaves, lacunarity, diminish); + result = value * amplitude; +} +#include "lib/mx_noise.glsl" + +void mx_noise3d_vector3(vec3 amplitude, float pivot, vec3 position, out vec3 result) +{ + vec3 value = mx_perlin_noise_vec3(position); + result = value * amplitude + pivot; +} +void mx_ramplr_float(float valuel, float valuer, vec2 texcoord, out float result) +{ + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); +} +void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, out surfaceshader returnshader) +{ + returnshader.color = mix(bg.color, fg.color, w); + returnshader.transparency = mix(bg.transparency, fg.transparency, w); +} +void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) +{ + // Decode the normal map. + value = (value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0; + + // Transform from tangent space if needed. + if (map_space == 0) + { + vec3 B = normalize(cross(N, T)); + value.xy *= normal_scale; + value = T * value.x + B * value.y + N * value.z; + } + + // Normalize the result. + result = normalize(value); +} + +void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result) +{ + mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); +} +#include "lib/mx_noise.glsl" + +void mx_worleynoise2d_vector3(vec2 texcoord, float jitter, out vec3 result) +{ + result = mx_worley_noise_vec3(texcoord, jitter, 0); +} +#include "mx_aastep.glsl" + +void mx_splittb_vector2(vec2 valuet, vec2 valueb, float center, vec2 texcoord, out vec2 result) +{ + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); +} +void mx_creatematrix_vector4_matrix44(vec4 in1, vec4 in2, vec4 in3, vec4 in4, out mat4 result) +{ + result = mat4(in1.x, in1.y, in1.z, in1.w, + in2.x, in2.y, in2.z, in2.w, + in3.x, in3.y, in3.z, in3.w, + in4.x, in4.y, in4.z, in4.w); +} +#include "lib/mx_noise.glsl" + +void mx_worleynoise3d_vector2(vec3 position, float jitter, out vec2 result) +{ + result = mx_worley_noise_vec2(position, jitter, 0); +} +#include "lib/mx_hsv.glsl" + +void mx_hsvtorgb_color4(vec4 _in, out vec4 result) +{ + result = vec4(mx_hsvtorgb(_in.rgb), 1.0); +} +#include "mx_aastep.glsl" + +void mx_splittb_float(float valuet, float valueb, float center, vec2 texcoord, out float result) +{ + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "lib/$fileTransformUv" + +void mx_image_vector4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) +{ + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv); +} +#include "lib/mx_noise.glsl" + +void mx_noise2d_vector3(vec3 amplitude, float pivot, vec2 texcoord, out vec3 result) +{ + vec3 value = mx_perlin_noise_vec3(texcoord); + result = value * amplitude + pivot; +} +#include "lib/mx_noise.glsl" + +void mx_worleynoise2d_float(vec2 texcoord, float jitter, out float result) +{ + result = mx_worley_noise_float(texcoord, jitter, 0); +} +void mx_ramptb_vector4(vec4 valuet, vec4 valueb, vec2 texcoord, out vec4 result) +{ + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); +} +void mx_luminance_color4(vec4 _in, vec3 lumacoeffs, out vec4 result) +{ + result = vec4(vec3(dot(_in.rgb, lumacoeffs)), _in.a); +} +void mx_creatematrix_vector3_matrix44(vec3 in1, vec3 in2, vec3 in3, vec3 in4, out mat4 result) +{ + result = mat4(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + in4.x, in4.y, in4.z, 1.0); +} +#include "lib/mx_noise.glsl" + +void mx_worleynoise3d_vector3(vec3 position, float jitter, out vec3 result) +{ + result = mx_worley_noise_vec3(position, jitter, 0); +} +#include "lib/mx_noise.glsl" + +void mx_noise2d_vector2(vec2 amplitude, float pivot, vec2 texcoord, out vec2 result) +{ + vec3 value = mx_perlin_noise_vec3(texcoord); + result = value.xy * amplitude + pivot; +} +void mx_ramplr_vector4(vec4 valuel, vec4 valuer, vec2 texcoord, out vec4 result) +{ + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); +} +void mx_smoothstep_float(float val, float low, float high, out float result) +{ + if (val <= low) + result = 0.0; + else if (val >= high) + result = 1.0; + else + result = smoothstep(low, high, val); +} +void mx_transformmatrix_vector2M3(vec2 val, mat3 transform, out vec2 result) +{ + vec3 res = transform * vec3(val, 1.0); + result = res.xy; +} +#include "lib/$fileTransformUv" + +void mx_image_color4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) +{ + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv); +} +#include "lib/$fileTransformUv" + +void mx_image_float(sampler2D tex_sampler, int layer, float defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out float result) +{ + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).r; +} +#include "lib/mx_noise.glsl" + +void mx_noise3d_float(float amplitude, float pivot, vec3 position, out float result) +{ + float value = mx_perlin_noise_float(position); + result = value * amplitude + pivot; +} +void mx_creatematrix_vector3_matrix33(vec3 in1, vec3 in2, vec3 in3, out mat3 result) +{ + result = mat3(in1.x, in1.y, in1.z, + in2.x, in2.y, in2.z, + in3.x, in3.y, in3.z); +} +#include "mx_aastep.glsl" + +void mx_splitlr_vector3(vec3 valuel, vec3 valuer, float center, vec2 texcoord, out vec3 result) +{ + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); +} +#include "mx_burn_float.glsl" + +void mx_burn_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) +{ + mx_burn_float(fg.x, bg.x, mixval, result.x); + mx_burn_float(fg.y, bg.y, mixval, result.y); + mx_burn_float(fg.z, bg.z, mixval, result.z); +} +mat4 mx_rotationMatrix(vec3 axis, float angle) +{ + axis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; + + return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, + oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, + oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, + 0.0, 0.0, 0.0, 1.0); +} + +void mx_rotate_vector3(vec3 _in, float amount, vec3 axis, out vec3 result) +{ + float rotationRadians = radians(amount); + mat4 m = mx_rotationMatrix(axis, rotationRadians); + result = (m * vec4(_in, 1.0)).xyz; +} +#include "lib/mx_noise.glsl" + +void mx_noise3d_vector4(vec4 amplitude, float pivot, vec3 position, out vec4 result) +{ + vec3 xyz = mx_perlin_noise_vec3(position); + float w = mx_perlin_noise_float(position + vec3(19, 73, 29)); + result = vec4(xyz, w) * amplitude + pivot; +} +#include "mx_smoothstep_float.glsl" + +void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) +{ + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); + mx_smoothstep_float(val.z, low.z, high.z, result.z); + mx_smoothstep_float(val.w, low.w, high.w, result.w); +} +#include "lib/mx_noise.glsl" + +void mx_fractal3d_vector2(vec2 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec2 result) +{ + vec2 value = mx_fractal_noise_vec2(position, octaves, lacunarity, diminish); + result = value * amplitude; +} +void mx_ramptb_float(float valuet, float valueb, vec2 texcoord, out float result) +{ + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); +} +#include "lib/$fileTransformUv" + +void mx_image_color3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) +{ + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rgb; +} +#include "mx_burn_float.glsl" + +void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) +{ + mx_burn_float(fg.x, bg.x, mixval, result.x); + mx_burn_float(fg.y, bg.y, mixval, result.y); + mx_burn_float(fg.z, bg.z, mixval, result.z); + mx_burn_float(fg.w, bg.w, mixval, result.w); +} +void mx_unpremult_color4(vec4 _in, out vec4 result) +{ + result = vec4(_in.rgb / _in.a, _in.a); +} +#include "lib/mx_noise.glsl" + +void mx_fractal3d_vector4(vec4 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec4 result) +{ + vec4 value = mx_fractal_noise_vec4(position, octaves, lacunarity, diminish); + result = value * amplitude; +} +#include "lib/$fileTransformUv" + +void mx_image_vector3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) +{ + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rgb; +} +void mx_premult_color4(vec4 _in, out vec4 result) +{ + result = vec4(_in.rgb * _in.a, _in.a); +} +#include "mx_aastep.glsl" + +void mx_splittb_vector3(vec3 valuet, vec3 valueb, float center, vec2 texcoord, out vec3 result) +{ + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); +} +void mx_rotate_vector2(vec2 _in, float amount, out vec2 result) +{ + float rotationRadians = radians(amount); + float sa = sin(rotationRadians); + float ca = cos(rotationRadians); + result = vec2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y); +} +void mx_burn_float(float fg, float bg, float mixval, out float result) +{ + if (abs(fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); +} +vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) +{ + uv = uv * uv_scale + uv_offset; + return uv; +} +vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) +{ + uv = uv * uv_scale + uv_offset; + return vec2(uv.x, 1.0 - uv.y); +} +#define M_FLOAT_EPS 1e-8 + +float mx_square(float x) +{ + return x*x; +} + +vec2 mx_square(vec2 x) +{ + return x*x; +} + +vec3 mx_square(vec3 x) +{ + return x*x; +} +// Restrict to 7x7 kernel size for performance reasons +#define MX_MAX_SAMPLE_COUNT 49 +// Size of all weights for all levels (including level 1) +#define MX_WEIGHT_ARRAY_SIZE 84 + +// +// Function to compute the sample size relative to a texture coordinate +// +vec2 mx_compute_sample_size_uv(vec2 uv, float filterSize, float filterOffset) +{ + vec2 derivUVx = dFdx(uv) * 0.5f; + vec2 derivUVy = dFdy(uv) * 0.5f; + float derivX = abs(derivUVx.x) + abs(derivUVy.x); + float derivY = abs(derivUVx.y) + abs(derivUVy.y); + float sampleSizeU = 2.0f * filterSize * derivX + filterOffset; + if (sampleSizeU < 1.0E-05f) + sampleSizeU = 1.0E-05f; + float sampleSizeV = 2.0f * filterSize * derivY + filterOffset; + if (sampleSizeV < 1.0E-05f) + sampleSizeV = 1.0E-05f; + return vec2(sampleSizeU, sampleSizeV); +} + +// +// Compute a normal mapped to 0..1 space based on a set of input +// samples using a Sobel filter. +// +vec3 mx_normal_from_samples_sobel(float S[9], float _scale) +{ + float nx = S[0] - S[2] + (2.0*S[3]) - (2.0*S[5]) + S[6] - S[8]; + float ny = S[0] + (2.0*S[1]) + S[2] - S[6] - (2.0*S[7]) - S[8]; + float nz = max(_scale, M_FLOAT_EPS) * sqrt(max(1.0 - nx * nx - ny * ny, M_FLOAT_EPS)); + vec3 norm = normalize(vec3(nx, ny, nz)); + return (norm + 1.0) * 0.5; +} + +// +// Apply filter for float samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + float result = 0.0; + for (int i = 0; i < sampleCount; i++) + { + result += S[i]*W[i+offset]; + } + return result; +} + +// +// Apply filter for vec2 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vec2 mx_convolution_vec2(vec2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vec2 result = vec2(0.0); + for (int i=0; i>(32-k)); +} + +void mx_bjmix(inout uint a, inout uint b, inout uint c) +{ + a -= c; a ^= mx_rotl32(c, 4); c += b; + b -= a; b ^= mx_rotl32(a, 6); a += c; + c -= b; c ^= mx_rotl32(b, 8); b += a; + a -= c; a ^= mx_rotl32(c,16); c += b; + b -= a; b ^= mx_rotl32(a,19); a += c; + c -= b; c ^= mx_rotl32(b, 4); b += a; +} + +// Mix up and combine the bits of a, b, and c (doesn't change them, but +// returns a hash of those three original values). +uint mx_bjfinal(uint a, uint b, uint c) +{ + c ^= b; c -= mx_rotl32(b,14); + a ^= c; a -= mx_rotl32(c,11); + b ^= a; b -= mx_rotl32(a,25); + c ^= b; c -= mx_rotl32(b,16); + a ^= c; a -= mx_rotl32(c,4); + b ^= a; b -= mx_rotl32(a,14); + c ^= b; c -= mx_rotl32(b,24); + return c; +} + +// Convert a 32 bit integer into a floating point number in [0,1] +float mx_bits_to_01(uint bits) +{ + return float(bits) / float(uint(0xffffffff)); +} + +float mx_fade(float t) +{ + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); +} + +uint mx_hash_int(int x) +{ + uint len = 1u; + uint seed = uint(0xdeadbeef) + (len << 2u) + 13u; + return mx_bjfinal(seed+uint(x), seed, seed); +} + +uint mx_hash_int(int x, int y) +{ + uint len = 2u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + return mx_bjfinal(a, b, c); +} + +uint mx_hash_int(int x, int y, int z) +{ + uint len = 3u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + return mx_bjfinal(a, b, c); +} + +uint mx_hash_int(int x, int y, int z, int xx) +{ + uint len = 4u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + mx_bjmix(a, b, c); + a += uint(xx); + return mx_bjfinal(a, b, c); +} + +uint mx_hash_int(int x, int y, int z, int xx, int yy) +{ + uint len = 5u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + mx_bjmix(a, b, c); + a += uint(xx); + b += uint(yy); + return mx_bjfinal(a, b, c); +} + +uvec3 mx_hash_vec3(int x, int y) +{ + uint h = mx_hash_int(x, y); + // we only need the low-order bits to be random, so split out + // the 32 bit result into 3 parts for each channel + uvec3 result; + result.x = (h ) & 0xFFu; + result.y = (h >> 8 ) & 0xFFu; + result.z = (h >> 16) & 0xFFu; + return result; +} + +uvec3 mx_hash_vec3(int x, int y, int z) +{ + uint h = mx_hash_int(x, y, z); + // we only need the low-order bits to be random, so split out + // the 32 bit result into 3 parts for each channel + uvec3 result; + result.x = (h ) & 0xFFu; + result.y = (h >> 8 ) & 0xFFu; + result.z = (h >> 16) & 0xFFu; + return result; +} + +float mx_perlin_noise_float(vec2 p) +{ + int X, Y; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float u = mx_fade(fx); + float v = mx_fade(fy); + float result = mx_bilerp( + mx_gradient_float(mx_hash_int(X , Y ), fx , fy ), + mx_gradient_float(mx_hash_int(X+1, Y ), fx-1.0, fy ), + mx_gradient_float(mx_hash_int(X , Y+1), fx , fy-1.0), + mx_gradient_float(mx_hash_int(X+1, Y+1), fx-1.0, fy-1.0), + u, v); + return mx_gradient_scale2d(result); +} + +float mx_perlin_noise_float(vec3 p) +{ + int X, Y, Z; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float fz = mx_floorfrac(p.z, Z); + float u = mx_fade(fx); + float v = mx_fade(fy); + float w = mx_fade(fz); + float result = mx_trilerp( + mx_gradient_float(mx_hash_int(X , Y , Z ), fx , fy , fz ), + mx_gradient_float(mx_hash_int(X+1, Y , Z ), fx-1.0, fy , fz ), + mx_gradient_float(mx_hash_int(X , Y+1, Z ), fx , fy-1.0, fz ), + mx_gradient_float(mx_hash_int(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), + mx_gradient_float(mx_hash_int(X , Y , Z+1), fx , fy , fz-1.0), + mx_gradient_float(mx_hash_int(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), + mx_gradient_float(mx_hash_int(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), + mx_gradient_float(mx_hash_int(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), + u, v, w); + return mx_gradient_scale3d(result); +} + +vec3 mx_perlin_noise_vec3(vec2 p) +{ + int X, Y; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float u = mx_fade(fx); + float v = mx_fade(fy); + vec3 result = mx_bilerp( + mx_gradient_vec3(mx_hash_vec3(X , Y ), fx , fy ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y ), fx-1.0, fy ), + mx_gradient_vec3(mx_hash_vec3(X , Y+1), fx , fy-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1), fx-1.0, fy-1.0), + u, v); + return mx_gradient_scale2d(result); +} + +vec3 mx_perlin_noise_vec3(vec3 p) +{ + int X, Y, Z; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float fz = mx_floorfrac(p.z, Z); + float u = mx_fade(fx); + float v = mx_fade(fy); + float w = mx_fade(fz); + vec3 result = mx_trilerp( + mx_gradient_vec3(mx_hash_vec3(X , Y , Z ), fx , fy , fz ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z ), fx-1.0, fy , fz ), + mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z ), fx , fy-1.0, fz ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), + mx_gradient_vec3(mx_hash_vec3(X , Y , Z+1), fx , fy , fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), + u, v, w); + return mx_gradient_scale3d(result); +} + +float mx_cell_noise_float(float p) +{ + int ix = mx_floor(p); + return mx_bits_to_01(mx_hash_int(ix)); +} + +float mx_cell_noise_float(vec2 p) +{ + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + return mx_bits_to_01(mx_hash_int(ix, iy)); +} + +float mx_cell_noise_float(vec3 p) +{ + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + return mx_bits_to_01(mx_hash_int(ix, iy, iz)); +} + +float mx_cell_noise_float(vec4 p) +{ + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + int iw = mx_floor(p.w); + return mx_bits_to_01(mx_hash_int(ix, iy, iz, iw)); +} + +vec3 mx_cell_noise_vec3(float p) +{ + int ix = mx_floor(p); + return vec3( + mx_bits_to_01(mx_hash_int(ix, 0)), + mx_bits_to_01(mx_hash_int(ix, 1)), + mx_bits_to_01(mx_hash_int(ix, 2)) + ); +} + +vec3 mx_cell_noise_vec3(vec2 p) +{ + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, 2)) + ); +} + +vec3 mx_cell_noise_vec3(vec3 p) +{ + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, iz, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, 2)) + ); +} + +vec3 mx_cell_noise_vec3(vec4 p) +{ + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + int iw = mx_floor(p.w); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 2)) + ); +} + +float mx_fractal_noise_float(vec3 p, int octaves, float lacunarity, float diminish) +{ + float result = 0.0; + float amplitude = 1.0; + for (int i = 0; i < octaves; ++i) + { + result += amplitude * mx_perlin_noise_float(p); + amplitude *= diminish; + p *= lacunarity; + } + return result; +} + +vec3 mx_fractal_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish) +{ + vec3 result = vec3(0.0); + float amplitude = 1.0; + for (int i = 0; i < octaves; ++i) + { + result += amplitude * mx_perlin_noise_vec3(p); + amplitude *= diminish; + p *= lacunarity; + } + return result; +} + +vec2 mx_fractal_noise_vec2(vec3 p, int octaves, float lacunarity, float diminish) +{ + return vec2(mx_fractal_noise_float(p, octaves, lacunarity, diminish), + mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish)); +} + +vec4 mx_fractal_noise_vec4(vec3 p, int octaves, float lacunarity, float diminish) +{ + vec3 c = mx_fractal_noise_vec3(p, octaves, lacunarity, diminish); + float f = mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish); + return vec4(c, f); +} + +float mx_worley_distance(vec2 p, int x, int y, int xoff, int yoff, float jitter, int metric) +{ + vec3 tmp = mx_cell_noise_vec3(vec2(x+xoff, y+yoff)); + vec2 off = vec2(tmp.x, tmp.y); + + off -= 0.5f; + off *= jitter; + off += 0.5f; + + vec2 cellpos = vec2(float(x), float(y)) + off; + vec2 diff = cellpos - p; + if (metric == 2) + return abs(diff.x) + abs(diff.y); // Manhattan distance + if (metric == 3) + return max(abs(diff.x), abs(diff.y)); // Chebyshev distance + // Either Euclidian or Distance^2 + return dot(diff, diff); +} + +float mx_worley_distance(vec3 p, int x, int y, int z, int xoff, int yoff, int zoff, float jitter, int metric) +{ + vec3 off = mx_cell_noise_vec3(vec3(x+xoff, y+yoff, z+zoff)); + + off -= 0.5f; + off *= jitter; + off += 0.5f; + + vec3 cellpos = vec3(float(x), float(y), float(z)) + off; + vec3 diff = cellpos - p; + if (metric == 2) + return abs(diff.x) + abs(diff.y) + abs(diff.z); // Manhattan distance + if (metric == 3) + return max(max(abs(diff.x), abs(diff.y)), abs(diff.z)); // Chebyshev distance + // Either Euclidian or Distance^2 + return dot(diff, diff); +} + +float mx_worley_noise_float(vec2 p, float jitter, int metric) +{ + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + float sqdist = 1e6f; // Some big number for jitter > 1 (not all GPUs may be IEEE) + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + sqdist = min(sqdist, dist); + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; +} + +vec2 mx_worley_noise_vec2(vec2 p, float jitter, int metric) +{ + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + vec2 sqdist = vec2(1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + if (dist < sqdist.x) + { + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.y = dist; + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; +} + +vec3 mx_worley_noise_vec3(vec2 p, float jitter, int metric) +{ + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + if (dist < sqdist.x) + { + sqdist.z = sqdist.y; + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.z = sqdist.y; + sqdist.y = dist; + } + else if (dist < sqdist.z) + { + sqdist.z = dist; + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; +} + +float mx_worley_noise_float(vec3 p, float jitter, int metric) +{ + int X, Y, Z; + vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); + float sqdist = 1e6f; + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); + sqdist = min(sqdist, dist); + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; +} + +vec2 mx_worley_noise_vec2(vec3 p, float jitter, int metric) +{ + int X, Y, Z; + vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); + vec2 sqdist = vec2(1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); + if (dist < sqdist.x) + { + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.y = dist; + } + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; +} + +vec3 mx_worley_noise_vec3(vec3 p, float jitter, int metric) +{ + int X, Y, Z; + vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); + vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); + if (dist < sqdist.x) + { + sqdist.z = sqdist.y; + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.z = sqdist.y; + sqdist.y = dist; + } + else if (dist < sqdist.z) + { + sqdist.z = dist; + } + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; +} +/* +Color transform functions. + +These funcions are modified versions of the color operators found in Open Shading Language: +github.com/imageworks/OpenShadingLanguage/blob/master/src/liboslexec/opcolor.cpp + +It contains the subset of color operators needed to implement the MaterialX +standard library. The modifications are for conversions from C++ to GLSL. + +Original copyright notice: +------------------------------------------------------------------------ +Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. +All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of Sony Pictures Imageworks nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------ +*/ + +vec3 mx_hsvtorgb(vec3 hsv) +{ + // Reference for this technique: Foley & van Dam + float h = hsv.x; float s = hsv.y; float v = hsv.z; + if (s < 0.0001f) { + return vec3 (v, v, v); + } else { + h = 6.0f * (h - floor(h)); // expand to [0..6) + int hi = int(trunc(h)); + float f = h - float(hi); + float p = v * (1.0f-s); + float q = v * (1.0f-s*f); + float t = v * (1.0f-s*(1.0f-f)); + if (hi == 0) + return vec3 (v, t, p); + else if (hi == 1) + return vec3 (q, v, p); + else if (hi == 2) + return vec3 (p, v, t); + else if (hi == 3) + return vec3 (p, q, v); + else if (hi == 4) + return vec3 (t, p, v); + return vec3 (v, p, q); + } +} + + +vec3 mx_rgbtohsv(vec3 c) +{ + // See Foley & van Dam + float r = c.x; float g = c.y; float b = c.z; + float mincomp = min (r, min(g, b)); + float maxcomp = max (r, max(g, b)); + float delta = maxcomp - mincomp; // chroma + float h, s, v; + v = maxcomp; + if (maxcomp > 0.0f) + s = delta / maxcomp; + else s = 0.0f; + if (s <= 0.0f) + h = 0.0f; + else { + if (r >= maxcomp) h = (g-b) / delta; + else if (g >= maxcomp) h = 2.0f + (b-r) / delta; + else h = 4.0f + (r-g) / delta; + h *= (1.0f/6.0f); + if (h < 0.0f) + h += 1.0f; + } + return vec3(h, s, v); +} +#include "mx_smoothstep_float.metal" + +void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) +{ + float f; + mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; + mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; +} +void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) +{ + // Decode the normal map. + value = all(value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0; + + // Transform from tangent space if needed. + if (map_space == 0) + { + vec3 B = normalize(cross(N, T)); + value.xy *= normal_scale; + value = T * value.x + B * value.y + N * value.z; + } + + // Normalize the result. + result = normalize(value); +} + +void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result) +{ + mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); +} +void mx_burn_float(float fg, float bg, float mixval, out float result) +{ + if (abs(fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); +} +#include "mx_smoothstep_float.metal" + +void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, thread vec3& result) + { + float f; + mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; + mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; + mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; + }#include "mx_burn_float.metal" + +void mx_burn_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) +{ + float f; + mx_burn_float(fg.x, bg.x, mixval, f); result.x = f; + mx_burn_float(fg.y, bg.y, mixval, f); result.y = f; + mx_burn_float(fg.z, bg.z, mixval, f); result.z = f; +} +#include "mx_smoothstep_float.metal" + +void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) +{ + float f; + mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; + mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; + mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; + mx_smoothstep_float(val.w, low.w, high.w, f); result.w = f; +} +void mx_dodge_float(float fg, float bg, float mixval, out float result) +{ + if (abs(1.0 - fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(bg / (1.0 - fg)) + ((1.0-mixval)*bg); +} +#include "mx_burn_float.metal" + +void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) +{ + float f; + mx_burn_float(fg.x, bg.x, mixval, f); result.x = f; + mx_burn_float(fg.y, bg.y, mixval, f); result.y = f; + mx_burn_float(fg.z, bg.z, mixval, f); result.z = f; + mx_burn_float(fg.w, bg.w, mixval, f); result.w = f; +} +void mx_smoothstep_float(float val, float low, float high, out float result) +{ + if (val <= low) + result = 0.0; + else if (val >= high) + result = 1.0; + else + result = smoothstep(low, high, val); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "mx_dodge_float.metal" + +void mx_dodge_color4(vec4 fg , vec4 bg , float mixval, out vec4 result) +{ + float f; + mx_dodge_float(fg.x, bg.x, mixval, f); result.x = f; + mx_dodge_float(fg.y, bg.y, mixval, f); result.y = f; + mx_dodge_float(fg.z, bg.z, mixval, f); result.z = f; + mx_dodge_float(fg.w, bg.w, mixval, f); result.w = f; +} +#include "mx_dodge_float.metal" + +void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) +{ + float f; + mx_dodge_float(fg.x, bg.x, mixval, f); result.x = f; + mx_dodge_float(fg.y, bg.y, mixval, f); result.y = f; + mx_dodge_float(fg.z, bg.z, mixval, f); result.z = f; +} +struct MetalTexture +{ + texture2d tex; + sampler s; + int get_width() { return tex.get_width(); } + int get_height() { return tex.get_height(); } + int get_num_mip_levels() { return tex.get_num_mip_levels(); } +}; + +int get_width(MetalTexture mtlTex) { return mtlTex.get_width(); } + +float4 texture(MetalTexture mtlTex, float2 uv) +{ + return mtlTex.tex.sample(mtlTex.s, uv); +} + +float4 textureLod(MetalTexture mtlTex, float2 uv, float lod) +{ + return mtlTex.tex.sample(mtlTex.s, uv, level(lod)); +} + +int2 textureSize(MetalTexture mtlTex, int mipLevel) +{ + return int2(mtlTex.get_width(), mtlTex.get_height()); +} + +int texture_mips(MetalTexture mtlTex) +{ + return mtlTex.tex.get_num_mip_levels(); +} +#define M_FLOAT_EPS 1e-8 + +float mx_square(float x) +{ + return x*x; +} + +vec2 mx_square(vec2 x) +{ + return x*x; +} + +vec3 mx_square(vec3 x) +{ + return x*x; +} + +#ifdef __DECL_GL_MATH_FUNCTIONS__ + +float radians(float degree) { return (degree * M_PI_F / 180.0f); } + +float3x3 inverse(float3x3 m) +{ + float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0]; + float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1]; + float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2]; + + float det = determinant(m); + float idet = 1.0f / det; + + float3x3 ret; + + ret[0][0] = idet * (n22 * n33 - n32 * n23); + ret[1][0] = idet * (n32 * n13 - n12 * n33); + ret[2][0] = idet * (n12 * n23 - n22 * n13); + + ret[0][1] = idet * (n31 * n23 - n21 * n33); + ret[1][1] = idet * (n11 * n33 - n31 * n13); + ret[2][1] = idet * (n21 * n13 - n11 * n23); + + ret[0][2] = idet * (n21 * n32 - n31 * n22); + ret[1][2] = idet * (n31 * n12 - n11 * n32); + ret[2][2] = idet * (n11 * n22 - n21 * n12); + + return ret; +} + +float4x4 inverse(float4x4 m) +{ + float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0]; + float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1]; + float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2]; + float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3]; + + float t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44; + float t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44; + float t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44; + float t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; + + float det = determinant(m); + float idet = 1.0f / det; + + float4x4 ret; + + ret[0][0] = t11 * idet; + ret[0][1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * idet; + ret[0][2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * idet; + ret[0][3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * idet; + + ret[1][0] = t12 * idet; + ret[1][1] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * idet; + ret[1][2] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * idet; + ret[1][3] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * idet; + + ret[2][0] = t13 * idet; + ret[2][1] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * idet; + ret[2][2] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * idet; + ret[2][3] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * idet; + + ret[3][0] = t14 * idet; + ret[3][1] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * idet; + ret[3][2] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * idet; + ret[3][3] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * idet; + + return ret; +} + +template +T1 mod(T1 x, T2 y) +{ + return x - y * floor(x/y); +} + +template +T atan(T y_over_x) { return ::atan(y_over_x); } + +template +T atan(T y, T x) { return ::atan2(y, x); } + +#define lessThan(a, b) ((a) < (b)) +#define lessThanEqual(a, b) ((a) <= (b)) +#define greaterThan(a, b) ((a) > (b)) +#define greaterThanEqual(a, b) ((a) >= (b)) +#define equal(a, b) ((a) == (b)) +#define notEqual(a, b) ((a) != (b)) + +#endif +// Restrict to 7x7 kernel size for performance reasons +#define MX_MAX_SAMPLE_COUNT 49 +// Size of all weights for all levels (including level 1) +#define MX_WEIGHT_ARRAY_SIZE 84 + +// +// Function to compute the sample size relative to a texture coordinate +// +vec2 mx_compute_sample_size_uv(vec2 uv, float filterSize, float filterOffset) +{ + vec2 derivUVx = dFdx(uv) * 0.5f; + vec2 derivUVy = dFdy(uv) * 0.5f; + float derivX = abs(derivUVx.x) + abs(derivUVy.x); + float derivY = abs(derivUVx.y) + abs(derivUVy.y); + float sampleSizeU = 2.0f * filterSize * derivX + filterOffset; + if (sampleSizeU < 1.0E-05f) + sampleSizeU = 1.0E-05f; + float sampleSizeV = 2.0f * filterSize * derivY + filterOffset; + if (sampleSizeV < 1.0E-05f) + sampleSizeV = 1.0E-05f; + return vec2(sampleSizeU, sampleSizeV); +} + +// +// Compute a normal mapped to 0..1 space based on a set of input +// samples using a Sobel filter. +// +vec3 mx_normal_from_samples_sobel(constant float S[9], float _scale) +{ + float nx = S[0] - S[2] + (2.0*S[3]) - (2.0*S[5]) + S[6] - S[8]; + float ny = S[0] + (2.0*S[1]) + S[2] - S[6] - (2.0*S[7]) - S[8]; + float nz = max(_scale, M_FLOAT_EPS) * sqrt(max(1.0 - nx * nx - ny * ny, M_FLOAT_EPS)); + vec3 norm = normalize(vec3(nx, ny, nz)); + return (norm + 1.0) * 0.5; +} + +// +// Apply filter for float samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + float result = 0.0; + for (int i = 0; i < sampleCount; i++) + { + result += S[i]*W[i+offset]; + } + return result; +} + +// +// Apply filter for vec2 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vec2 mx_convolution_vec2(vec2 S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vec2 result = vec2(0.0); + for (int i=0; i1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = default_value; + vector2 st = mx_transform_uv(texcoord); + out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); +} +#include "lib/$fileTransformUv" + +void mx_image_float(textureresource file, string layer, float default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output float out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = color(default_value); + vector2 st = mx_transform_uv(texcoord); + color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); + out = rgb[0]; +} +void mx_worleynoise3d_vector2(vector position, float jitter, output vector2 result) +{ + result = mx_worley_noise_vector2(position, jitter, 0); +} +void mx_worleynoise2d_float(vector2 texcoord, float jitter, output float result) +{ + result = mx_worley_noise_float(texcoord, jitter, 0); +} +void mx_frame_float(output float result) +{ + getattribute("frame", result); +} +void mx_hsvtorgb_color3(vector _in, output vector result) +{ + result = transformc("hsv","rgb", _in); +} +void mx_fractal3d_vector2(vector2 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result) +{ + vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_geompropvalue_vector4(string geomprop, vector4 defaultVal, output vector4 out) +{ + float value[4]; + if (getattribute(geomprop, value) == 0) + { + out = defaultVal; + } + else + { + out.x = value[0]; + out.y = value[1]; + out.z = value[2]; + out.w = value[3]; + } +} +#include "mx_dodge_float.osl" + +void mx_dodge_color4(color4 fg , color4 bg , float mix , output color4 result) +{ + mx_dodge_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); + mx_dodge_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); + mx_dodge_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); + mx_dodge_float(fg.a, bg.a, mix, result.a); +} +#include "lib/$fileTransformUv" + +void mx_image_vector2(textureresource file, string layer, vector2 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector2 out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = color(default_value.x, default_value.y, 0.0); + vector2 st = mx_transform_uv(texcoord); + color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); + out.x = rgb[0]; + out.y = rgb[1]; +} +void mx_geompropvalue_vector(string geomprop, vector defaultVal, output vector out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +void mx_unpremult_color4(color4 in, output color4 result) +{ + result = color4(in.rgb / in.a, in.a); +} +void mx_normalmap_vector2(vector value, string map_space, vector2 normal_scale, vector N, vector U, output vector result) +{ + // Tangent space + if (map_space == "tangent") + { + vector v = value * 2.0 - 1.0; + vector T = normalize(U - dot(U, N) * N); + vector B = normalize(cross(N, T)); + result = normalize(T * v[0] * normal_scale.x + B * v[1] * normal_scale.y + N * v[2]); + } + // Object space + else + { + vector n = value * 2.0 - 1.0; + result = normalize(n); + } +} + +void mx_normalmap_float(vector value, string map_space, float normal_scale, vector N, vector U, output vector result) +{ + mx_normalmap_vector2(value, map_space, vector2(normal_scale, normal_scale), N, U, result); +} +void mx_heighttonormal_vector3(float in, float scale, output vector result) +{ + point htP = P + normalize(N) * in * scale; + result = normalize(calculatenormal(htP)); +} +void mx_geomcolor_color4(int index, output color4 result) +{ + float value[4]; + getattribute("color", value); + result.rgb[0] = value[0]; + result.rgb[1] = value[1]; + result.rgb[2] = value[2]; + result.a = value[3]; +} +void mx_noise3d_float(float amplitude, float pivot, vector position, output float result) +{ + float value = noise("snoise", position); + result = value * amplitude + pivot; +} +void mx_hsvtorgb_color4(color4 _in, output color4 result) +{ + result = color4(transformc("hsv","rgb", _in.rgb), 1.0); +} +void mx_noise2d_vector4(vector4 amplitude, float pivot, vector2 texcoord, output vector4 result) +{ + vector4 value = mx_noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_worleynoise2d_vector2(vector2 texcoord, float jitter, output vector2 result) +{ + result = mx_worley_noise_vector2(texcoord, jitter, 0); +} +void mx_ambientocclusion_float(float coneangle, float maxdistance, output float result) +{ + // This node is a stub and does not currently operate to specification + result = 0; +} +#include "mx_dodge_float.osl" + +void mx_dodge_color3(color fg, color bg, float mix, output color result) +{ + mx_dodge_float(fg[0], bg[0], mix, result[0]); + mx_dodge_float(fg[1], bg[1], mix, result[1]); + mx_dodge_float(fg[2], bg[2], mix, result[2]); +} +void mx_fractal3d_vector3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result) +{ + vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_geompropvalue_string(string geomprop, string defaultVal, output string out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +void mx_geompropvalue_boolean(string geomprop, int defaultVal, output int out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +void mx_worleynoise2d_vector3(vector2 texcoord, float jitter, output vector result) +{ + result = mx_worley_noise_vector3(texcoord, jitter, 0); +} +void mx_transformmatrix_vector2M3(vector2 val, matrix m, output vector2 result) +{ + point res = transform(m, point(val.x, val.y, 1.0)); + result.x = res[0]; + result.y = res[1]; +} +void mx_burn_float(float fg, float bg, float mix, output float result) +{ + if (abs(fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mix*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mix)*bg); +} +void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vector position, output float result) +{ + float f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_cellnoise3d_float(vector position, output float result) +{ + result = cellnoise(position); +} +void mx_premult_color4(color4 in, output color4 result) +{ + result = color4(in.rgb * in.a, in.a); +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +void mx_geompropvalue_vector2(string geomprop, vector2 defaultVal, output vector2 out) +{ + float value[2]; + if (getattribute(geomprop, value) == 0) + { + out = defaultVal; + } + else + { + out.x = value[0]; + out.y = value[1]; + } +} +void mx_geompropvalue_color(string geomprop, color defaultVal, output color out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +#include "lib/$fileTransformUv" + +void mx_image_color4(textureresource file, string layer, color4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color4 out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = default_value.rgb; + float missingAlpha = default_value.a; + vector2 st = mx_transform_uv(texcoord); + float alpha; + color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, + "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); + + out = color4(rgb, alpha); +} +void mx_noise2d_float(float amplitude, float pivot, vector2 texcoord, output float result) +{ + float value = noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_time_float(float fps, output float result) +{ + float frame; + getattribute("frame", frame); + result = frame / fps; +} +void mx_noise3d_vector3(vector amplitude, float pivot, vector position, output vector result) +{ + vector value = noise("snoise", position); + result = value * amplitude + pivot; +} +#include "lib/$fileTransformUv" + +void mx_image_vector4(textureresource file, string layer, vector4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector4 out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = color(default_value.x, default_value.y, default_value.z); + float missingAlpha = default_value.w; + vector2 st = mx_transform_uv(texcoord); + float alpha; + color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, + "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode); + + out = vector4(rgb[0], rgb[1], rgb[2], alpha); +} +void mx_noise2d_vector3(vector amplitude, float pivot, vector2 texcoord, output vector result) +{ + vector value = noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_luminance_color3(color in, color lumacoeffs, output color result) +{ + result = dot(in, lumacoeffs); +} +void mx_geompropvalue_integer(string geomprop, int defaultVal, output int out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +matrix rotationMatrix(vector axis, float angle) +{ + vector nAxis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; + + return matrix(oc * nAxis[0] * nAxis[0] + c, oc * nAxis[0] * nAxis[1] - nAxis[2] * s, oc * nAxis[2] * nAxis[0] + nAxis[1] * s, 0.0, + oc * nAxis[0] * nAxis[1] + nAxis[2] * s, oc * nAxis[1] * nAxis[1] + c, oc * nAxis[1] * nAxis[2] - nAxis[0] * s, 0.0, + oc * nAxis[2] * nAxis[0] - nAxis[1] * s, oc * nAxis[1] * nAxis[2] + nAxis[0] * s, oc * nAxis[2] * nAxis[2] + c, 0.0, + 0.0, 0.0, 0.0, 1.0); +} + +void mx_rotate_vector3(vector _in, float amount, vector axis, output vector result) +{ + float rotationRadians = radians(amount); + matrix m = rotationMatrix(axis, rotationRadians); + vector4 trans = transform(m, vector4(_in[0], _in[1], _in[2], 1.0)); + result = vector(trans.x, trans.y, trans.z); +} +void mx_geompropvalue_float(string geomprop, float defaultVal, output float result) +{ + if (getattribute(geomprop, result) == 0) + { + result = defaultVal; + } +} +void mx_geomcolor_float(int index, output float result) +{ + getattribute("color", result); +} +void mx_worleynoise3d_vector3(vector position, float jitter, output vector result) +{ + result = mx_worley_noise_vector3(position, jitter, 0); +} +#include "mx_burn_float.osl" + +void mx_burn_color4(color4 fg, color4 bg, float mix, output color4 result) +{ + mx_burn_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); + mx_burn_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); + mx_burn_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); + mx_burn_float(fg.a, bg.a, mix, result.a); +} +void mx_noise3d_vector4(vector4 amplitude, float pivot, vector position, output vector4 result) +{ + vector4 value = mx_noise("snoise", position); + result = value * amplitude + pivot; +} +void mx_noise2d_vector2(vector2 amplitude, float pivot, vector2 texcoord, output vector2 result) +{ + vector2 value = mx_noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_noise3d_vector2(vector2 amplitude, float pivot, vector position, output vector2 result) +{ + vector2 value = mx_noise("snoise", position); + result = value * amplitude + pivot; +} +void mx_luminance_color4(color4 in, color lumacoeffs, output color4 result) +{ + result = color4(dot(in.rgb, lumacoeffs), in.a); +} +#include "lib/$fileTransformUv" + +void mx_image_color3(textureresource file, string layer, color default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = default_value; + vector2 st = mx_transform_uv(texcoord); + out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); +} +void mx_worleynoise3d_float(vector position, float jitter, output float result) +{ + result = mx_worley_noise_float(position, jitter, 0); +} +void mx_fractal3d_vector4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result) +{ + vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, output surfaceshader result) +{ + result.bsdf = mix(bg.bsdf, fg.bsdf, w); + result.edf = mix(bg.edf, fg.edf, w); + result.opacity = mix(bg.opacity, fg.opacity, w); +} +void mx_rgbtohsv_color3(vector _in, output vector result) +{ + result = transformc("rgb","hsv", _in); +} +void mx_rgbtohsv_color4(color4 _in, output color4 result) +{ + result = color4(transformc("rgb","hsv", _in.rgb), 1.0); +} +void mx_disjointover_color4(color4 fg, color4 bg, float mix, output color4 result) +{ + float summedAlpha = fg.a + bg.a; + + if (summedAlpha <= 1) + { + result.rgb = fg.rgb + bg.rgb; + } + else + { + if (abs(bg.a) < M_FLOAT_EPS) + { + result.rgb = 0.0; + } + else + { + float x = (1 - fg.a) / bg.a; + result.rgb = fg.rgb + bg.rgb * x; + } + } + result.a = min(summedAlpha, 1.0); + + result.rgb = result.rgb * mix + (1.0 - mix) * bg.rgb; + result.a = result.a * mix + (1.0 - mix) * bg.a; +} +void mx_creatematrix_vector3_matrix33(vector in1, vector in2, vector in3, output matrix result) +{ + result = matrix(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + 0.0, 0.0, 0.0, 1.0); +} + +void mx_creatematrix_vector3_matrix44(vector in1, vector in2, vector in3, vector in4, output matrix result) +{ + result = matrix(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + in4.x, in4.y, in4.z, 1.0); +} + +void mx_creatematrix_vector4_matrix44(vector4 in1, vector4 in2, vector4 in3, vector4 in4, output matrix result) +{ + result = matrix(in1.x, in1.y, in1.z, in1.w, + in2.x, in2.y, in2.z, in2.w, + in3.x, in3.y, in3.z, in3.w, + in4.x, in4.y, in4.z, in4.w); +} +void mx_surface_unlit(float emission_weight, color emission_color, float transmission_weight, color transmission_color, float opacity, output surfaceshader result) +{ + float trans = clamp(transmission_weight, 0.0, 1.0); + result.bsdf = trans * transmission_color * transparent(); + result.edf = (1.0 - trans) * emission_weight * emission_color * emission(); + result.opacity = clamp(opacity, 0.0, 1.0); +} +void mx_geompropvalue_color4(string geomprop, color4 defaultVal, output color4 out) +{ + float value[4]; + if (getattribute(geomprop, value) == 0) + { + out.rgb = defaultVal.rgb; + out.a = defaultVal.a; + } + else + { + out.rgb[0] = value[0]; + out.rgb[1] = value[1]; + out.rgb[2] = value[2]; + out.a = value[3]; + } +} +void mx_cellnoise2d_float(vector2 texcoord, output float result) +{ + result = cellnoise(texcoord.x, texcoord.y); +} +// Restrict to 7x7 kernel size for performance reasons +#define MX_MAX_SAMPLE_COUNT 49 +// Size of all weights for all levels (including level 1) +#define MX_WEIGHT_ARRAY_SIZE 84 + +// +// Function to compute the sample size relative to a texture coordinate +// +vector2 mx_compute_sample_size_uv(vector2 uv, float filterSize, float filterOffset) +{ + vector derivUVx = Dx(vector(uv.x, uv.y, 0.0)) * 0.5; + vector derivUVy = Dy(vector(uv.x, uv.y, 0.0)) * 0.5; + float derivX = abs(derivUVx[0]) + abs(derivUVy[0]); + float derivY = abs(derivUVx[1]) + abs(derivUVy[1]); + float sampleSizeU = filterSize * derivX + filterOffset; + if (sampleSizeU < 1.0E-05) + sampleSizeU = 1.0E-05; + float sampleSizeV = filterSize * derivY + filterOffset; + if (sampleSizeV < 1.0E-05) + sampleSizeV = 1.0E-05; + return vector2(sampleSizeU, sampleSizeV); +} + +// Kernel weights for box filter +void mx_get_box_weights(output float W[MX_MAX_SAMPLE_COUNT], int filterSize) +{ + int sampleCount = filterSize*filterSize; + float value = 1.0 / float(sampleCount); + for (int i=0; i= 7) + { + W[0] = 0.000036; W[1] = 0.000363; W[2] = 0.001446; W[3] = 0.002291; W[4] = 0.001446; W[5] = 0.000363; W[6] = 0.000036; + W[7] = 0.000363; W[8] = 0.003676; W[9] = 0.014662; W[10] = 0.023226; W[11] = 0.014662; W[12] = 0.003676; W[13] = 0.000363; + W[14] = 0.001446; W[15] = 0.014662; W[16] = 0.058488; W[17] = 0.092651; W[18] = 0.058488; W[19] = 0.014662; W[20] = 0.001446; + W[21] = 0.002291; W[22] = 0.023226; W[23] = 0.092651; W[24] = 0.146768; W[25] = 0.092651; W[26] = 0.023226; W[27] = 0.002291; + W[28] = 0.001446; W[29] = 0.014662; W[30] = 0.058488; W[31] = 0.092651; W[32] = 0.058488; W[33] = 0.014662; W[34] = 0.001446; + W[35] = 0.000363; W[36] = 0.003676; W[37] = 0.014662; W[38] = 0.023226; W[39] = 0.014662; W[40] = 0.003676; W[41] = 0.000363; + W[42] = 0.000036; W[43] = 0.000363; W[44] = 0.001446; W[45] = 0.002291; W[46] = 0.001446; W[47] = 0.000363; W[48] = 0.000036; + } + else if (filterSize >= 5) + { + W[0] = 0.003765; W[1] = 0.015019; W[2] = 0.023792; W[3] = 0.015019; W[4] = 0.003765; + W[5] = 0.015019; W[6] = 0.059912; W[7] = 0.094907; W[8] = 0.059912; W[9] = 0.015019; + W[10] = 0.023792; W[11] = 0.094907; W[12] = 0.150342; W[13] = 0.094907; W[14] = 0.023792; + W[15] = 0.015019; W[16] = 0.059912; W[17] = 0.094907; W[18] = 0.059912; W[19] = 0.015019; + W[20] = 0.003765; W[21] = 0.015019; W[22] = 0.023792; W[23] = 0.015019; W[24] = 0.003765; + } + else if (filterSize >= 3) + { + W[0] = 0.0625; W[1] = 0.125; W[2] = 0.0625; + W[3] = 0.125; W[4] = 0.25; W[5] = 0.125; + W[6] = 0.0625; W[7] = 0.125; W[8] = 0.0625; + } + else + { + W[0] = 1.0; + } +} + +// +// Apply filter for float samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + float result = 0.0; + for (int i = 0; i < sampleCount; i++) + { + result += S[i]*W[i+offset]; + } + return result; +} + +// +// Apply filter for vector2 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vector2 mx_convolution_vector2(vector2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vector2 result = vector2(0.0, 0.0); + for (int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/JsMaterialXGenShader.js b/javascript/materialxtoy/JsMaterialXGenShader.js new file mode 100644 index 00000000..c86cae3d --- /dev/null +++ b/javascript/materialxtoy/JsMaterialXGenShader.js @@ -0,0 +1,21 @@ + +var MaterialX = (function() { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( +function(MaterialX) { + MaterialX = MaterialX || {}; + +var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){var loadPackage=function(metadata){var PACKAGE_PATH;if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}else{throw"using preloaded data can only be done on a web page or in a web worker"}var PACKAGE_NAME="../../bin/JsMaterialXGenShader.data";var REMOTE_PACKAGE_BASE="JsMaterialXGenShader.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];var PACKAGE_UUID=metadata["package_uuid"];function fetchRemotePackage(packageName,packageSize,callback,errback){var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","libraries",true,true);Module["FS_createPath"]("/libraries","pbrlib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmdl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genglsl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmsl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genosl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","legacy",true,true);Module["FS_createPath"]("/libraries","cmlib",true,true);Module["FS_createPath"]("/libraries","lights",true,true);Module["FS_createPath"]("/libraries/lights","genglsl",true,true);Module["FS_createPath"]("/libraries/lights","genmsl",true,true);Module["FS_createPath"]("/libraries","nprlib",true,true);Module["FS_createPath"]("/libraries/nprlib","genmdl",true,true);Module["FS_createPath"]("/libraries/nprlib","genglsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genmsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genosl",true,true);Module["FS_createPath"]("/libraries","stdlib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmdl",true,true);Module["FS_createPath"]("/libraries/stdlib","genglsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genmsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genosl",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","include",true,true);Module["FS_createPath"]("/libraries","targets",true,true);Module["FS_createPath"]("/libraries","bxdf",true,true);Module["FS_createPath"]("/libraries/bxdf","lama",true,true);Module["FS_createPath"]("/libraries/bxdf","translation",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null}};var files=metadata["files"];for(var i=0;i1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXGenShader.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Wa"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Za"];addOnInit(Module["asm"]["Xa"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={199384:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},199468:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},199553:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"B":___assert_fail,"n":___cxa_allocate_exception,"q":___cxa_begin_catch,"z":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"h":___cxa_find_matching_catch_3,"Ka":___cxa_find_matching_catch_4,"o":___cxa_free_exception,"da":___cxa_rethrow,"K":___cxa_throw,"wa":___cxa_uncaught_exceptions,"e":___resumeException,"ga":___sys_fcntl64,"Da":___sys_getdents64,"Ca":___sys_ioctl,"ia":___sys_open,"za":___sys_stat64,"Qa":__embind_finalize_value_array,"Va":__embind_register_bigint,"Fa":__embind_register_bool,"u":__embind_register_class,"A":__embind_register_class_class_function,"s":__embind_register_class_class_property,"y":__embind_register_class_constructor,"j":__embind_register_class_function,"H":__embind_register_class_property,"S":__embind_register_constant,"Ea":__embind_register_emval,"R":__embind_register_enum,"Q":__embind_register_enum_value,"ja":__embind_register_float,"F":__embind_register_function,"N":__embind_register_integer,"M":__embind_register_memory_view,"r":__embind_register_smart_ptr,"ka":__embind_register_std_string,"$":__embind_register_std_wstring,"oa":__embind_register_value_array,"Z":__embind_register_value_array_element,"Ga":__embind_register_void,"O":__emval_as,"Ra":__emval_call,"Y":__emval_call_void_method,"ha":__emval_decref,"X":__emval_get_method_caller,"Pa":__emval_get_property,"la":__emval_incref,"Ta":__emval_new_array,"Oa":__emval_new_cstring,"La":__emval_new_object,"Na":__emval_run_destructors,"Sa":__emval_set_property,"C":__emval_take_value,"Ma":__emval_typeof,"ua":_abort,"ca":_emscripten_asm_const_int,"ta":_emscripten_memcpy_big,"_":_emscripten_resize_heap,"xa":_environ_get,"ya":_environ_sizes_get,"V":_fd_close,"Aa":_fd_read,"Ua":_fd_seek,"Ba":_fd_write,"a":_getTempRet0,"Ha":invoke_di,"ba":invoke_fi,"Ja":invoke_fifii,"ra":invoke_fii,"na":invoke_fiii,"x":invoke_i,"g":invoke_ii,"Ia":invoke_iid,"L":invoke_iif,"ma":invoke_iiff,"W":invoke_iifff,"d":invoke_iii,"i":invoke_iiii,"t":invoke_iiiii,"ea":invoke_iiiiid,"w":invoke_iiiiii,"E":invoke_iiiiiii,"I":invoke_iiiiiiii,"U":invoke_iiiiiiiiiiii,"l":invoke_v,"m":invoke_vi,"sa":invoke_vid,"J":invoke_vif,"f":invoke_vii,"qa":invoke_viif,"c":invoke_viii,"k":invoke_viiii,"aa":invoke_viiiiffiiii,"p":invoke_viiiii,"v":invoke_viiiiii,"G":invoke_viiiiiii,"fa":invoke_viiiiiiiii,"P":invoke_viiiiiiiiii,"T":invoke_viiiiiiiiiiiiiii,"D":_llvm_eh_typeid_for,"pa":_setTempRet0,"va":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Xa"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["_a"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["$a"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["ab"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["bb"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["cb"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["db"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["eb"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["fb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["gb"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["ib"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["jb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["kb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["lb"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["mb"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iifff(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiff(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiffiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); + + + return MaterialX.ready +} +); +})(); +if (typeof exports === 'object' && typeof module === 'object') + module.exports = MaterialX; +else if (typeof define === 'function' && define['amd']) + define([], function() { return MaterialX; }); +else if (typeof exports === 'object') + exports["MaterialX"] = MaterialX; diff --git a/javascript/materialxtoy/JsMaterialXGenShader.wasm b/javascript/materialxtoy/JsMaterialXGenShader.wasm new file mode 100644 index 00000000..4fe7b990 Binary files /dev/null and b/javascript/materialxtoy/JsMaterialXGenShader.wasm differ diff --git a/javascript/materialxtoy/JsMaterialXNodeEditor.js b/javascript/materialxtoy/JsMaterialXNodeEditor.js new file mode 100644 index 00000000..5483fed1 --- /dev/null +++ b/javascript/materialxtoy/JsMaterialXNodeEditor.js @@ -0,0 +1,3113 @@ + +var mx = null; +var doc = null; +var stdlib = null; +var customlibs = []; +var customDocLibs = []; +var graph = null; +var graphcanvas = null; + +class MxGraphHandler +{ + constructor(id, extension) + { + // Identifier + this.id = id; + // Extension + this.extension = extension; + // Editor + this.editor = null; + + this.DEFAULT_COLOR_SPACE = 'lin_rec709'; + this.DEFAULT_UNIT = 'meter'; + this.activeColorSpace = this.DEFAULT_COLOR_SPACE; + this.activeUnit = this.DEFAULT_UNIT; + } + + setActiveColorSpace(colorSpace) + { + if (colorSpace && colorSpace.length > 0) + this.activeColorSpace = colorSpace; + else + this.activeColorSpace = this.DEFAULT_COLOR_SPACE; + } + + setActiveUnit(unit) + { + if (unit && unit.length > 0) + this.activeUnit = unit; + else + this.activeUnit = this.DEFAULT_UNIT; + } + + getActiveColorSpace() + { + return this.activeColorSpace; + } + + getActiveUnit() + { + return this.activeUnit; + } + + getExtension() + { + return this.extension; + } + + initialize(editor) + { + this.editor = editor; + } + + convertFrom(graphcanvas, graph) + { + return false; + } + + convertTo(graphcanvas, graph) + { + return false; + } + + createValidName(name) + { + return name; + } + + getDefaultValue(value, _type) + { + if (_type === 'string' || _type === 'filename') { + value = "'" + value + "'"; + } + else if (this.isArray(_type)) { + if (value.length == 0) { + if (_type === 'color3') + value = "[0.0, 0.0, 0.0]"; + else if (_type === 'color4') + value = "[0.0, 0.0, 0.0, 0.0]"; + else if (_type === 'vector2') + value = "[0.0, 0.0]"; + else if (_type === 'vector3') + value = "[0.0, 0.0, 0.0]"; + else if (_type === 'vector4') + value = "[0.0, 0.0, 0.0, 0.0]"; + else if (_type === 'matrix33') + value = "[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]"; + else if (_type === 'matrix44') + value = "[1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0]"; + } + else { + value = "[" + value + "]"; + } + } + else if (_type === 'integer') { + if (value.length == 0) { + value = 0; + } + } + else if (_type === 'float') { + if (value.length == 0) { + value = 0.0; + } + } + else if (_type === 'boolean') { + if (value) + value = 'true'; + else + value = 'false'; + } + + if (value.length == 0) { + //console.log('No value for input:', _name, 'type:', _type, 'value:', value);= + value = "''"; + } + return value; + } + + /* + getDefaultValueRaw(value, _type) { + if (_type === 'integer' || _type === 'float') { + if (value.length == 0) { + value = 0; + } + } + else if (_type === 'string' || _type === 'filename') { + //value = value + "'"; + } + else if (isArray(_type)) { + if (value.length == 0) { + if (_type === 'color3') + value = [0.0, 0.0, 0.0]; + else if (_type === 'color4') + value = [0.0, 0.0, 0.0, 0.0]; + else if (_type === 'vector2') + value = [0.0, 0.0]; + else if (_type === 'vector3') + value = [0.0, 0.0, 0.0]; + else if (_type === 'vector4') + value = [0.0, 0.0, 0.0, 0.0]; + else if (_type === 'matrix33') + value = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]; + else if (_type === 'matrix44') + value = [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0]; + } + else { + value = [value]; + } + } + + if (value.length == 0) { + //console.log('No value for input:', _name, 'type:', _type, 'value:', value); + value = ""; + } + return value; + } + */ +}; + +class MxMaterialXHandler extends MxGraphHandler { + constructor(id, extension) + { + super(id, extension); + } + + loadMaterialX() { + return new Promise((resolve, reject) => { + MaterialX().then((mtlx) => { + // Save the MaterialX instance to the global variable + mx = mtlx; + resolve(); + }).catch((error) => { + reject(error); + }); + }); + } + + // Initialize the MaterialX handler for the given editor + initialize(editor) + { + super.initialize(editor); + + if (!mx) { + + this.loadMaterialX().then(() => { + + // Additional logic after MaterialX is loaded + editor.debugOutput("Loaded MaterialX version:" + mx.getVersionString(), 0, true); + doc = mx.createDocument(); + + var generator = new mx.EsslShaderGenerator(); + var genContext = new mx.GenContext(generator); + stdlib = mx.loadStandardLibraries(genContext); + editor.debugOutput('Loaded standard libraries definitions:' + stdlib.getNodeDefs().length, 0, false); + + var definitionsList = []; + var result = this.createLiteGraphDefinitions(stdlib, false, true, definitionsList, 'mtlx', MxShadingGraphEditor.theEditor); + var textarea = editor.ui.mtlxlib; + if (!textarea) + editor.debugOutput('No text area:' + this.mtlxlib); + else + { + //console.log('set value', result); + textarea.setValue(result); + } + + editor.clearNodeTypes(); + try { + eval(result); + } catch (e) { + editor.debugOutput('Error evaluating source: ' + e, 2, false); + } + + var nodeTypes = LiteGraph.registered_node_types; + var i = 0; + for (var typeName in nodeTypes) { + i++; + } + editor.debugOutput("Registered node types:" + definitionsList.length, 0, false); + + editor.displayNodeTypes(); + + editor.updatePropertyPanel(null); + + }).catch((error) => { + editor.debugOutput("Error on initialization:" + error, 2); + }); + } + } + + buildMetaData(colorSpace, unit, unitType, uiname, uimin, uimax, uifolder, _type) + { + // Create a struct with the metadata names as key and value + var metaData = {}; + metaData['colorspace'] = colorSpace; + metaData['unit'] = unit; + metaData['unittype'] = unitType; + metaData['uiname'] = uiname; + if (_type == 'vector2' || _type == 'vector3' || _type == 'vector4' || _type == 'matrix33' || _type == 'matrix44') { + if (uimin) { + uimin = uimin.split(',').map(Number); + } + if (uimax) + { + uimax = uimax.split(',').map(Number); + } + } + metaData['uimin'] = uimin; + metaData['uimax'] = uimax; + metaData['uifolder'] = uifolder; + + // Return struct in an array + return metaData; + } + + createLiteGraphDefinitions(doc, debug, addInputOutputs, definitionsList, libraryPrefix='mtlx', + editor, icon='') + { + //var ctor_code = "function loadMaterialXDefinitions(){\n"; + + var ctor_code = "" + + console.log('Creating LiteGraph definitions from MaterialX document:', doc); + + // Get the node definitions from the MaterialX document + var nodeDefs = doc.getNodeDefs(); + + if (debug) + ctor_code += "console.log('Loading MaterialX Definitions...');\n"; + + var TMAP = {} + TMAP['float'] = 'float'; + TMAP['color3'] = 'color3'; + TMAP['color4'] = 'color4'; + TMAP['vector2'] = 'vector2'; + TMAP['vector3'] = 'vector3'; + TMAP['vector4'] = 'vector4'; + TMAP['matrix33'] = 'matrix33'; + TMAP['matrix44'] = 'matrix44'; + TMAP['integer'] = 'integer'; + TMAP['string'] = 'string'; + TMAP['boolean'] = 'boolean'; + TMAP['filename'] = 'filename'; + TMAP['BSDF'] = 'BSDF'; + TMAP['EDF'] = 'EDF'; + TMAP['VDF'] = 'VDF'; + TMAP['surfaceshader'] = 'surfaceshader'; + TMAP['volumeshader'] = 'volumeshader'; + TMAP['displacementshader'] = 'displacementshader'; + TMAP['lightshader'] = 'lightshader'; + TMAP['material'] = 'material'; + TMAP['vector2array'] = 'vector2array'; + + var CMAP = {} + CMAP['float'] = "#753"; + CMAP['color3'] = "#679"; + CMAP['color4'] = "#899"; + CMAP['vector2'] = "#A32"; + CMAP['vector3'] = "#A76"; + CMAP['vector4'] = "#A98"; + CMAP['matrix33'] = "#333"; + CMAP['matrix44'] = "#444"; + CMAP['integer'] = "#A32"; + CMAP['string'] = "#888"; + CMAP['boolean'] = "#48A"; + CMAP['filename'] = "#58E"; + /* + float: "#753", + vector2: "#A32", + vector3: "#A76", + vector4: "#A98", + color3: "#679", + color4: "#899", + matrix33: "#333", + matrix44: "#444", + string: "#888", + filename: "#58E", + boolean: "#48A", */ + + var inputTypes = ['float', 'color3', 'color4', 'vector2', 'vector3', 'vector4', 'matrix33', 'matrix44', 'integer', 'string', 'boolean', 'filename', 'BSDF', 'EDF', 'VDF', 'surfaceshader', 'volumeshader', 'displacementshader', 'lightshader', 'material', 'vector2array']; + var outputTypes = ['float', 'color3', 'color4', 'vector2', 'vector3', 'vector4', 'matrix33', 'matrix44', 'integer', 'string', 'boolean', 'filename', 'BSDF', 'EDF', 'VDF', 'surfaceshader', 'volumeshader', 'displacementshader', 'lightshader', 'material', 'vector2array']; + + // TODO: Support tokens + var supporTokens = false; + if (supporTokens) + { + inputTypes.push('token'); + TMAP['token'] = 'string'; + } + + const INPUT_ND = 'ND_input_'; + const OUTPUT_ND = 'ND_output_'; + const INPUT_NODE_STRING = 'input'; + const OUTPUT_NODE_STRING = 'output'; + const LIBRARY_ICON = editor.ui.icon_map['_default_']; + + // Register inputs (which have no nodedef) + if (addInputOutputs) + { + for (var _type of inputTypes) { + var id = libraryPrefix + '/input/input_' + _type; + var functionName = mx.createValidName(id); + var titleName = 'input_' + _type; + ctor_code += "\n// MaterialX node type: " + id + "\n//\n"; + ctor_code += "function " + functionName + "() {\n"; + { + ctor_code += " this.nodedef_icon = '" + LIBRARY_ICON + "';\n"; + ctor_code += " this.nodedef_name = '" + INPUT_ND + _type + "';\n"; + ctor_code += " this.nodedef_node = '" + INPUT_NODE_STRING + "';\n"; + ctor_code += " this.nodedef_type = '" + _type + "';\n"; + ctor_code += " this.nodedef_group = '" + INPUT_NODE_STRING + "';\n"; + if (_type == 'token') + _type = 'string'; + ctor_code += " this.addInput('in', '" + TMAP[_type] + "');\n"; + var value = this.getDefaultValue('', _type); + var metaData = this.buildMetaData('', '', '', '', null, null, '', null); + metaData = JSON.stringify(metaData); + ctor_code += " this.addProperty('in', " + value + ", '" + _type + "'," + metaData + ");\n"; + ctor_code += " this.addOutput('out', '" + TMAP[_type] + "');\n"; + + ctor_code += " this.title = '" + titleName + "';\n" + var desc = '"MaterialX:' + id + '"'; + ctor_code += " this.desc = " + desc + ";\n"; + + var onNodeCreated = "function() {\n"; + onNodeCreated += " //console.log('Node created:', this);\n"; + onNodeCreated += " }"; + ctor_code += " this.onNodeCreated = " + onNodeCreated + "\n"; + var onRemoved = "function() {\n"; + onRemoved += " //console.log('Node removed:', this);\n"; + onRemoved += " }"; + ctor_code += " this.onRemoved = " + onRemoved + "\n"; + + ctor_code += " this.color = '#004C94';\n"; + ctor_code += " this.bgcolor = '#000';\n"; + if (_type in CMAP) + { + ctor_code += " this.boxcolor = '" + CMAP[_type] + "';\n"; + } + ctor_code += " this.shape = LiteGraph.ROUND_SHAPE;\n"; + + ctor_code += " this.onExecute = function() {\n"; + ctor_code += " console.log('Executing node: ', this);\n"; + ctor_code += " }\n"; + } + ctor_code += "}\n" + ctor_code += "LiteGraph.registerNodeType('" + id + "', " + functionName + ");\n"; + } + + // Register outputs (which have no nodedef) + for (var _type of outputTypes) { + var id = libraryPrefix + '/output/output_' + _type; + var functionName = mx.createValidName(id); + var titleName = 'output_' + _type; + ctor_code += "\n// MaterialX node type: " + id + "\n//\n"; + ctor_code += "function " + functionName + "() {\n"; + { + ctor_code += " this.title = '" + titleName + "';\n" + var desc = '"MaterialX Node :' + id + '"'; + ctor_code += " this.desc = " + desc + ";\n"; + + ctor_code += " this.nodedef_icon = '" + LIBRARY_ICON + "';\n"; + ctor_code += " this.nodedef_name = '" + OUTPUT_ND + + _type + "';\n"; + ctor_code += " this.nodedef_node = '" + OUTPUT_NODE_STRING + "';\n"; + ctor_code += " this.nodedef_type = '" + _type + "';\n"; + ctor_code += " this.nodedef_group = '" + OUTPUT_NODE_STRING + "';\n"; + ctor_code += " this.addInput('in', '" + TMAP[_type] + "');\n"; + var value = this.getDefaultValue('', _type); + ctor_code += " this.addProperty('in', " + value + ", '" + _type + "');\n"; + ctor_code += " this.addOutput('out', '" + TMAP[_type] + "');\n"; + + var onNodeCreated = "function() {\n"; + onNodeCreated += " //console.log('Node created:', this);\n"; + onNodeCreated += " }"; + ctor_code += " this.onNodeCreated = " + onNodeCreated + "\n"; + var onRemoved = "function() {\n"; + onRemoved += " //console.log('Node removed:', this);\n"; + onRemoved += " }"; + ctor_code += " this.onRemoved = " + onRemoved + "\n"; + + ctor_code += " this.color = '#004C94';\n"; + ctor_code += " this.bgcolor = '#000';\n"; + if (_type in CMAP) + { + ctor_code += " this.boxcolor = '" + CMAP[_type] + "';\n"; + } + ctor_code += " this.shape = LiteGraph.ROUND_SHAPE;\n"; + + ctor_code += " this.onExecute = function() {\n"; + ctor_code += " console.log('Executing node:', this);\n"; + ctor_code += " }\n"; + } + ctor_code += "}\n" + ctor_code += "LiteGraph.registerNodeType('" + id + "', " + functionName + ");\n"; + definitionsList.push(id); + } + } + + // Iterate over all node definitions + for (var nodeDef of nodeDefs) { + + var nodeDefName = nodeDef.getName(); + var id = libraryPrefix + '/' + nodeDef.getNodeGroup() + '/' + nodeDefName; + id = id.replace('ND_', ''); + var functionName = mx.createValidName(id); + var nodeType = nodeDef.getType(); + var titleName = nodeDef.getNodeString() + "_" + nodeType; + var swatchLocation = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/'; + var outputs = nodeDef.getActiveOutputs(); + var outputName = outputs[0].getName(); // TODO: Handle swatch for multiple outputs + var swatchId = swatchLocation + 'material_' + nodeDefName + '_' + outputName + '_genglsl.png'; + swatchId = swatchId.replace('ND_', ''); + if (debug) + console.log('\n--- Registering node type:', id, '----'); + + ctor_code += "\n// MaterialX node type: " + id + "\n//\n"; + ctor_code += "function " + functionName + "() {\n"; + { + var nodeGroup = nodeDef.getNodeGroup(); + var nodeString = nodeDef.getNodeString(); + var theIcon = icon; + if (theIcon.length == 0) + { + for (var key in editor.ui.icon_map) + { + if (nodeString.toLowerCase().startsWith(key.toLowerCase())) + { + theIcon = editor.ui.icon_map[key]; + //console.log('set icon:', theIcon, 'for:', key, nodeString); + break; + } + else if (nodeGroup.toLowerCase().startsWith(key.toLowerCase())) + { + theIcon = editor.ui.icon_map[key]; + //console.log('set icon:', theIcon, 'for:', key, nodeGroup); + break; + } + } + } + + ctor_code += " this.nodedef_icon = '" + theIcon + "';\n"; + ctor_code += " this.nodedef_name = '" + nodeDefName + "';\n"; + ctor_code += " this.nodedef_type = '" + nodeType + "';\n"; + ctor_code += " this.nodedef_node = '" + nodeString + "';\n"; + ctor_code += " this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/" + nodeString + ".html';\n"; + ctor_code += " this.nodedef_swatch = '" + swatchId + "';\n"; + ctor_code += " this.nodedef_group = '" + nodeGroup + "';\n"; + + for (var input of nodeDef.getActiveInputs()) { + var _name = input.getName(); + var _type = input.getType(); + if (_type in TMAP) + _type = TMAP[_type]; + else + console.log('Unmappable type:', _type) + ctor_code += " this.addInput('" + _name + "','" + _type + "');\n"; + + var value = input.getValueString(); + value = this.getDefaultValue(value, _type); + var uiname = input.getAttribute('uiname'); + var uimin = input.getAttribute('uimin'); + if (uimin.length == 0) + { + uimin = null; + } + var uimax = input.getAttribute('uimax'); + if (uimax.length == 0) + { + uimax = null; + } + var uifolder = input.getAttribute('uifolder'); + var metaData = this.buildMetaData('', '', '', uiname, uimin, uimax, uifolder, _type); + metaData = JSON.stringify(metaData); + ctor_code += " this.addProperty('" + _name + "', " + value + ", '" + _type + "'," + metaData + ");\n"; + } + for (var output of nodeDef.getActiveOutputs()) { + var _name = output.getName(); + var _type = output.getType(); + if (_type in TMAP) + _type = TMAP[_type]; + else + console.log('Unmappable type:', _type) + //if(_type && _type.constructor === String) + // _type = '"'+_type+'"'; + ctor_code += " this.addOutput('" + _name + "','" + _type + "');\n"; + } + + ctor_code += " this.title = '" + titleName + "';\n" + var desc = '"MaterialX:' + id + '"'; + ctor_code += " this.desc = " + desc + ";\n"; + + var onNodeCreated = "function() {\n"; + onNodeCreated += " //console.log('Node created:', this);\n"; + onNodeCreated += "}"; + ctor_code += " this.onNodeCreated = " + onNodeCreated + "\n"; + var onRemoved = "function() {\n"; + onRemoved += " //console.log('Node removed:', this);\n"; + onRemoved += " }"; + ctor_code += " this.onRemoved = " + onRemoved + "\n"; + + // Set the background color to slate grey + ctor_code += " this.bgcolor = '#111';\n"; + //console.log('Node group:', nodeGroup, nodeDefName); + if (nodeGroup == 'conditional') + { + //console.log('Cond Node group:', nodeGroup) + ctor_code += " this.color = '#532200';\n"; + ctor_code += " this.title_text_color = '#000';\n"; + ctor_code += " this.shape = LiteGraph.CARD_SHAPE;\n"; + } + + else if (nodeString != 'convert' && + (nodeGroup == 'shader' || nodeType == 'surfaceshader' || nodeType == 'volumshader' || nodeType == 'displacementshader')) + { + ctor_code += " this.color = '#232';\n"; + ctor_code += " this.shape = LiteGraph.ROUND_SHAPE;\n"; + } + else if (nodeGroup == 'material') + { + ctor_code += " this.color = '#151';\n"; + ctor_code += " this.shape = LiteGraph.BOX_SHAPE;\n"; + } + else + { + ctor_code += " this.color = '#222';\n"; + ctor_code += " this.shape = LiteGraph.ROUND_SHAPE;\n"; + } + if (nodeType in CMAP) + { + ctor_code += " this.boxcolor = '" + CMAP[nodeType] + "';\n"; + } + } + ctor_code += "}\n" + + // Register the node type + ctor_code += functionName + ".nodedef_name = '" + nodeDefName + "';\n"; + ctor_code += functionName + ".nodedef_node = '" + nodeString + "';\n"; + ctor_code += functionName + ".nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/" + nodeString + ".html';\n"; + + ctor_code += "LiteGraph.registerNodeType(" + "'" + id + "'," + functionName + ");\n"; + definitionsList.push(id); + if (debug) + ctor_code += "console.log('Registered node type:', '" + id + "');\n"; + } + + //ctor_code += "}\n"; + return ctor_code; + } + + writeGraphToString(graph, writeCustomLibs = true) + { + if (!mx) { + this.editor.debugOutput("MaterialX is not initialized", 2); + return; + } + + var outputDoc = mx.createDocument(); + + if (!stdlib) { + var generator = new mx.EsslShaderGenerator(); + var genContext = new mx.GenContext(generator); + stdlib = mx.loadStandardLibraries(genContext); + } + + // Handle top level + this.writeGraphToDocument(outputDoc, graph); + + if (writeCustomLibs) + { + console.log('Write custom libraries:', customlibs.length); + for (var customlib of customlibs) + { + outputDoc.importLibrary(customlib[1]); + } + console.log('Write document custom definitions:', customDocLibs.length); + for (var customDocLib of customDocLibs) + { + outputDoc.importLibrary(customDocLib[1]); + } + } + + // TODO: Add in another other globals + outputDoc.setColorSpace(this.getActiveColorSpace()); + outputDoc.removeAttribute('fileprefix'); + + var errors; + var valid = outputDoc.validate(errors); + if (!valid) { + this.editor.debugOutput('Failed to validate document', 2); + } + const writeOptions = new mx.XmlWriteOptions(); + writeOptions.writeXIncludeEnable = false; + var result = mx.writeToXmlString(outputDoc, writeOptions); + return result; + } + + saveToString(graph, saveCustomLibs = true) { + if (!mx) { + this.editor.debugOutput("MaterialX is not initialized", 2); + return; + } + + var data = this.writeGraphToString(graph, saveCustomLibs); + var mtlxdoc = this.editor.ui.mtlxdoc; + mtlxdoc.setValue(data); + //console.log('Save MaterialX:', data); + + return data; + } + + saveToFile(graph, saveCustomLibs = true) { + var data = this.saveToString(graph, saveCustomLibs); + if (!data) { + return; + } + + var blob = new Blob([data], { type: "text/plain" }); + var url = URL.createObjectURL(blob); + var a = document.createElement("a"); + a.href = url; + a.download = "output_graph.mtlx"; + a.click(); + } + + writeGraphToDocument(mltxgraph, graph) { + + var debug = false; + + if (debug) + console.log('***** START Scan Graph:', graph.title); + for (var node of graph._nodes) { + if (node.type == 'graph/subgraph') { + var subgraph = node.subgraph; + //var subgraphNode = mltxgraph.addNodeGraph(node.title); + var subgraphNode = mltxgraph.addChildOfCategory('nodegraph', node.title); + if (debug) + console.log('---->>> Scan NodeGraph:', node.title); + this.writeGraphToDocument(subgraphNode, subgraph); + continue; + } + + if (debug) + console.log('---->>> Scan Node:', node.title); + + var nodeDefName = node.nodedef_name; + /* if (!nodeDefName) + { + this.editor.debugOutput('Failed to find nodeDef for:' + node.title, 1); + continue; + } */ + + //var nodeTypes = LiteGraph.registered_node_types; + //var nodeType = nodeTypes[node.type]; + var nodedefName = node.nodedef_name; + var nodedef = null; + var nodeElement = null; + //if (nodeType) { + // nodedefName = nodeType.nodedef_name; + // nodedef = stdlib.getNodeDef(nodedefName); + //} + + //if (nodedef) { + // nodeElement = mltxgraph.addNodeInstance(nodedef, name) + // nodeElement.setName(node.title); + //} + //else + { + if (nodedefName) { + nodeElement = mltxgraph.addChildOfCategory(node.nodedef_node, node.nodedef_type); + nodeElement.setType(node.nodedef_type); + if (debug) + console.log('** Create node:', nodeElement.getNamePath(), nodeElement.getType()); + nodeElement.setName(node.title); + } + } + + if (nodeElement) { + if (debug) + console.log('-> Write Node:', graph.title + '/' + node.title, ' --> ', nodeElement.getNamePath()); + } + else { + console.log('Skip writing :', node.title); + //this.editor.debugOutput('No nodedef for:' + node.title + 'Nodetype: ' + node.type, 0); + continue; + } + + // Add inputs + var properties = node.properties; + + var node_inputs = node.inputs; + var isInputNode = false; + var isOutputNode = false; + if (nodeElement.getCategory() == 'input') { + isInputNode = true; + node_inputs = [node]; + } + else if (nodeElement.getCategory() == 'output') { + isOutputNode = true; + node_inputs = [node]; + } + if (node_inputs) { + + var inputs = node_inputs; + for (var i in inputs) { + var input = inputs[i]; + if (debug) + console.log('---- Write port:', input); + + var inputName = input.name; + var inputType = input.type; + if (nodeElement.getCategory() == 'input' || + nodeElement.getCategory() == 'output') { + inputName = 'in'; + inputType = node.nodedef_type; + } + + //var inputType = input.type; + var inputElement = null; + var inputNode = node.getInputNode(i); + var inputLink = node.getInputLink(i); + var inputLinkOutput = ''; + var numInputOutputs = 0; + if (inputLink) { + numInputOutputs = inputNode.outputs.length; + inputLinkOutput = inputNode.outputs[inputLink.origin_slot]; + } + //console.log('inputLink:', inputLink, '. --- upsteream Output:', inputLinkOutput); + if (inputNode) { + if (nodeElement.getCategory() != 'input' && + nodeElement.getCategory() != 'output') { + inputElement = nodeElement.addInput(inputName, inputType); + } + else { + inputElement = nodeElement; + } + + if (debug) { + console.log('Write connection'); + console.log(' - TO:', inputElement.getName() + "." + inputName); + console.log(' - FROM link:', inputNode.id + "." + inputLinkOutput.name); + } + if (inputNode.type == 'graph/subgraph') { + inputElement.setNodeGraphString(inputNode.title); + // Set output string if there was an output link. + if (numInputOutputs > 1 && inputLinkOutput) { + inputElement.setOutputString(inputLinkOutput.name); + } + } + else { + //var upstream_nodeType = nodeTypes[inputNode.type]; + //if (upstream_nodeType) + { + if (inputNode.nodedef_node == 'input') { + inputElement.setInterfaceName(inputNode.title); + } + else { + inputElement.setNodeName(inputNode.title); + // TODO: Need to check that upstream has > 1 output. + // Put up an issue that this is really annoying to + // disallow an explicit output in validation !!! + if (numInputOutputs > 1 && inputNode.nodedef_node != 'output') { + // Set output string if there was an output link. + if (inputLinkOutput) { + inputElement.setOutputString(inputLinkOutput.name); + } + } + } + } + } + } + else { + var inputValue = node.properties[inputName]; + if (inputValue == null) { + console.log('Cannot find property value for input:', inputName); + } + else { + var origValue = inputValue; + //var inputType = propInfo.type; + if (inputType in ['float', 'integer', 'vector2', 'vector3', 'vector4', + 'matrix33', 'matrix44', 'color3', 'color4']) { + inputValue = '"' + parseFloat(inputValue) + '"'; + } + else if (inputType === 'boolean') { + if (inputValue === 'true') + inputValue = 'true'; + else + inputValue = 'false'; + } + else { + inputValue = inputValue.toString(); + } + //console.log('Write input:', inputElement, node, inputName, origValue, inputValue, inputType); + if (nodeElement.getCategory() != 'input' && + nodeElement.getCategory() != 'output') { + inputElement = nodeElement.addInput(inputName, inputType); + } + else { + inputElement = nodeElement; + } + inputElement.setValueString(inputValue, inputType); + } + } + + if (inputElement) + { + var propInfo = null; + var skip_attributes = []; + if (isInputNode || isOutputNode) { + if (input.properties_info) { + skip_attributes = ['name', 'type', 'value', 'default_value']; + propInfo = input.properties_info[0]; + } + } + else { + if (node.properties_info) { + skip_attributes = ['name', 'type', 'value', 'default_value', 'uimin', 'uimax', 'uiname', 'uifolder']; + propInfo = node.properties_info[i]; + } + } + if (propInfo) + { + //console.log('Scan propinfo:', propInfo, 'for input:', inputElement.getNamePath(), 'prop_info:', propInfo); + + // Write node_properties metadata to input + for (var propAttribute in propInfo) + { + if (skip_attributes.includes(propAttribute)) + continue; + + //console.log('-- scan attrib:', propAttribute); + var propAttributeValue = propInfo[propAttribute]; + if (propAttributeValue && propAttributeValue.length > 0) + { + //console.log('---- save attribute:', propAttribute, propAttributeValue, 'on input:', inputElement.getNamePath()); + inputElement.setAttribute(propAttribute, propAttributeValue); + } + } + } + } + } + + if (debug) + console.log('---- END Write inputs:', node.inputs); + } + + // Add outputs + if (node.outputs) { + /* + var outputs = node.outputs; + for (var i in outputs) + { + var output = outputs[i]; + var outputName = output.name; + var outputType = output.type; + var outputElement = nodeElement.addOutput(outputName, outputType); + } + */ + } + + if (debug) + console.log('---> End write node', node.title); + } + + if (debug) + console.log('***** END Scan Graph:', graph.title); + } + + + convertFrom(graphcanvas, graph) + { + + } + + convertTo(graphcanvas, graph) + { + + } + + isArray(_type) { + var ARRAY_TYPES = ['color3', 'color4', 'vector2', 'vector3', 'vector4', 'matrix33', 'matrix44']; + if (ARRAY_TYPES.includes(_type)) { + return true; + } + return false; + } + + buildConnections(editor, node, lg_node, explicitInputs, graph) { + + var nodeInputs = []; + var isOutput = (node.getCategory() == 'output'); + if (isOutput) { + nodeInputs = [node]; + } + else { + nodeInputs = node.getInputs(); + } + for (var input of nodeInputs) { + + var _name = '' + + if (!isOutput) { + _name = input.getName(); + explicitInputs.push(_name); + } + + var nodeName = input.getNodeName(); + var nodeGraphName = input.getNodeGraphString(); + var inputInterfaceName = input.getInterfaceName(); + var outputName = input.getOutputString(); + + + if (nodeName.length || + nodeGraphName.length || + inputInterfaceName.length || + outputName.length) { + + //console.log('Test connection on input:', input.getNamePath()); + + var target_node = lg_node; + var target_slot = null; + if (!isOutput) + target_slot = target_node.findInputSlot(_name); + else + target_slot = 0; + var source_node = null; + var source_slot = 0; + var source_name = nodeName; + if (nodeGraphName.length) { + source_name = nodeGraphName; + } + if (inputInterfaceName.length) { + source_name = inputInterfaceName; + } + source_node = graph.findNodeByTitle(source_name); + if (source_node) { + if (outputName) { + var outputSlot = source_node.findOutputSlot(outputName); + if (outputSlot >= 0) { + source_slot = outputSlot; + } + else { + editor.debugOutput('Failed to find output slot:' + outputName, 1); + } + var linkInfo = source_node.connect(source_slot, target_node, target_slot); + if (!linkInfo) + { + editor.debugOutput('Failed to connect:' + source_node.title + '.' + outputName, '->', target_node.title + '.' + _name), 1, false; + } + } + //console.log('CONNECT: source[', source_node.title, '.', source_slot, + // '] --> target[:', target_node.title, ".", target_slot); + var linkInfo = source_node.connect(source_slot, target_node, target_slot); + if (!linkInfo) + { + editor.debugOutput('Failed to connect:' + source_node.title + '.' + outputName, '->', target_node.title + '.' + _name, 1); + } + } + else { + this.editor.debugOutput('Failed connecting: ' + source_node + "." + + source_name, '->', lg_node.title + "." + _name, 2); + } + } + else { + var _value = input.getResolvedValueString(); // input.getValueString(); + if (_value.length > 0) { + if (this.isArray(input.getType())) { + _value = "[" + _value + "]" + _value = JSON.parse(_value); + } + + //console.log('-- Value Input:', + //lg_node.title + "." + _name, 'value:', _value); + lg_node.setProperty(_name, _value); + } + } + + var property_info = lg_node.getPropertyInfo(_name); + this.loadInputMetaData(input, property_info); + } + } + + loadInputMetaData(input, property_info) + { + if (input && property_info) { + // Load in basic meta-data + var colorspace = input.getColorSpace(); + if (colorspace.length > 0) + property_info['colorspace'] = colorspace; + + var unit = input.getUnit(); + if (unit.length > 0) + property_info['unit'] = unit; + + var uiname = input.getAttribute('uiname'); + if (uiname.length > 0) + property_info['uiname'] = uiname; + + var uimin = input.getAttribute('uimin'); + if (uimin.length > 0) + property_info['uimin'] = uimin; + + var uimax = input.getAttribute('uimax'); + if (uimax.length > 0) + property_info['uimax'] = uimax; + + var uifolder = input.getAttribute('uifolder'); + if (uifolder.length > 0) + property_info['uifolder'] = uifolder; + + var basicMetaData = ['colorspace', 'unit', 'uiname', 'uimin', 'uimax', 'uifolder', 'name', 'type', 'output', 'nodename', 'nodegraph']; + for (var attrName of input.getAttributeNames()) + { + if (!basicMetaData.includes(attrName)) { + property_info[attrName] = input.getAttribute(attrName); + } + } + + //console.log('load input metadata for:', input.getNamePath(), property_info); + } + } + + buildGraphFromDoc(doc, editor) { + var debug = false; + + if (!mx) { + editor.debugOutput("MaterialX is not initialized", 2); + return; + } + + editor.clearGraph(); + + // Don't try and update the graph while building it + editor.monitorGraph(graph, false); + + for (var nodegraph of doc.getNodeGraphs()) { + if (nodegraph.hasSourceUri()) { + continue; + } + var nodedefAttrib = nodegraph.getAttribute('nodedef'); + if (nodedefAttrib && nodedefAttrib.length > 0) + { + console.log('Skip loading in functional graph:', nodegraph.getName(), 'nodedef:', nodedefAttrib); + continue; + } + if (debug) + console.log('Create nodegraph:', nodegraph.getName()); + var title = nodegraph.getName(); + var subgraphNode = LiteGraph.createNode("graph/subgraph", title); + //var subgraph = new LiteGraph.LGraph(); + //subgraphNode._subgraph_node = subgraph; + subgraphNode.bgcolor = "#112"; + subgraphNode.bgImageUrl = "./Images/nodegraph.png"; + + var mtlxNodes = []; + for (var interfaceInput of nodegraph.getInputs()) { + var _type = interfaceInput.getType(); + var id = 'mtlx/input/input_' + _type; + + var lg_node = LiteGraph.createNode(id); + if (lg_node) { + lg_node.title = interfaceInput.getName(); + this.loadInputMetaData(interfaceInput, lg_node.properties_info[0]); + subgraphNode.subgraph.add(lg_node); + + if (debug) + console.log('-------- Add subgraph input:', lg_node.title, lg_node); + + subgraphNode.addInput(interfaceInput.getName(), _type); + subgraphNode.subgraph.addInput(interfaceInput.getName(), _type); + + var _value = interfaceInput.getValueString(); + if (_value && _value.length > 0) { + if (this.isArray(interfaceInput.getType())) { + _value = "[" + _value + "]" + _value = JSON.parse(_value); + } + lg_node.setProperty('in', _value); + } + + // Make sure size is updated + lg_node.setSize(lg_node.computeSize()); + + //mtlxNodes.push([interfaceInput, lg_node]); + } + } + + for (var interfaceOutput of nodegraph.getOutputs()) { + var _type = interfaceOutput.getType() + var id = 'mtlx/output/output_' + _type; + + var lg_node = LiteGraph.createNode(id); + if (lg_node) { + lg_node.title = interfaceOutput.getName(); + subgraphNode.subgraph.add(lg_node); + if (debug) + console.log('Add subgraph output:', lg_node.title); + + subgraphNode.addOutput(interfaceOutput.getName(), _type); + subgraphNode.subgraph.addOutput(interfaceOutput.getName(), _type); + + // Make sure size is updated + lg_node.setSize(lg_node.computeSize()); + mtlxNodes.push([interfaceOutput, lg_node]); + } + } + + + for (var node of nodegraph.getNodes()) { + var nodeDef = node.getNodeDef(); + if (!nodeDef) { + editor.debugOutput('Skip node w/o nodedef:' + node.getName(), 1) + continue; + } + + // mtlx/pbr/gltf_pbr_surfaceshader + var id = 'mtlx/' + nodeDef.getNodeGroup() + '/' + nodeDef.getName(); + id = id.replace('ND_', ''); + + var lg_node = LiteGraph.createNode(id); + lg_node.title = node.getName(); + subgraphNode.subgraph.add(lg_node); + if (debug) + console.log('Add subgraph node:', lg_node.title); + + // Make sure size is updated + lg_node.setSize(lg_node.computeSize()); + mtlxNodes.push([node, lg_node]); + } + + for (var item of mtlxNodes) { + var node = item[0]; + var lg_node = item[1]; + var explicitInputs = []; + + // Make sure size is updated + lg_node.setSize(lg_node.computeSize()); + + this.buildConnections(editor, node, lg_node, explicitInputs, subgraphNode.subgraph); + } + + if (debug) + console.log('Add subgraph:', subgraphNode.title); + subgraphNode.subgraph.arrange(60); + + graph.add(subgraphNode); + } + + // Index here is index into litegraph nodes + var mtlxNodes = []; + var mtlxNodeDefs = []; + + for (var interfaceInput of doc.getInputs()) { + var _type = interfaceInput.getType(); + var id = 'mtlx/input/input_' + _type; + + var lg_node = LiteGraph.createNode(id); + if (lg_node) { + lg_node.title = interfaceInput.getName(); + if (debug) + console.log('Add top level input:', lg_node.title, 'to graph', graph); + + var _value = interfaceInput.getValueString(); + if (_value && _value.length > 0) { + if (this.isArray(interfaceInput.getType())) { + _value = "[" + _value + "]" + _value = JSON.parse(_value); + } + lg_node.setProperty('in', _value); + } + graph.add(lg_node); + + // Make sure size is updated + lg_node.setSize(lg_node.computeSize()); + //mtlxNodes.push([interfaceInput, lg_node]); + } + } + + for (var interfaceOutput of doc.getOutputs()) { + var _type = interfaceOutput.getType() + var id = 'mtlx/output/output_' + _type; + + var lg_node = LiteGraph.createNode(id); + if (lg_node) { + lg_node.title = interfaceOutput.getName(); + graph.add(lg_node); + if (debug) + { + console.log('Add graph output:', lg_node.title); + } + + // Make sure size is updated + lg_node.setSize(lg_node.computeSize()); + mtlxNodes.push([interfaceOutput, lg_node]); + } + } + + for (var node of doc.getNodes()) { + var nodeDef = node.getNodeDef(); + if (!nodeDef) { + editor.debugOutput('Skip node w/o nodedef:' + node.getName(), 1) + continue; + } + + // mtlx/pbr/gltf_pbr_surfaceshader + var id = 'mtlx/' + nodeDef.getNodeGroup() + '/' + nodeDef.getName(); + id = id.replace('ND_', ''); + if (debug) + console.log('Load node:', node.getName(), ' -> ', id); + + var lg_node = LiteGraph.createNode(id); + if (lg_node) { + //console.log('LiteGraph node:', lg_node); + lg_node.title = node.getName(); + + graph.add(lg_node); + + // Make sure size is updated + lg_node.setSize(lg_node.computeSize()); + mtlxNodes.push([node, lg_node]); + mtlxNodeDefs.push(nodeDef); + } + else { + editor.debugOutput('Failed to create node:' + node.getName(), 2); + } + } + + var itemCount = 0; + for (var item of mtlxNodes) { + var node = item[0]; + var lg_node = item[1]; + + + // Keep track of explicit inputs + var explicitInputs = []; + this.buildConnections(editor, node, lg_node, explicitInputs, graph); + + if (lg_node.nodedef_node == 'input' || lg_node.nodedef_node == 'output') + { + continue; + } + + var removeInputs = []; + var nodeDef = mtlxNodeDefs[itemCount]; + if (nodeDef) + { + for (var nodeDefInput of nodeDef.getActiveInputs()) { + var _name = nodeDefInput.getName(); + if (!explicitInputs.includes(_name)) { + removeInputs.push(_name); + } + } + for (var _name of removeInputs) { + var slot = lg_node.findInputSlot(_name); + //console.log('Remove input:', _name, ' on: ', lg_node); + lg_node.removeInput(slot); + } + + // Make sure size is updated + lg_node.setSize(lg_node.computeSize()); + } + itemCount++; + } + + editor.monitorGraph(graph, true); + graph.arrange(60); + } + + loadDefinitionsFromFile() + { + var that = this; + + // Load mtlx document from disk + var input = document.createElement("input"); + input.type = "file"; + input.accept = ".mtlx"; + input.onchange = function (e) { + var file = e.target.files[0]; + console.log('Loading MaterialX definitions: ' + file.name); + + if (mx) { + // Load the content from the specified file (replace this with actual loading logic) + + const reader = new FileReader(); + reader.readAsText(file, 'UTF-8'); + + reader.onload = function (e) { + // Display the contents of the file in the output div + let fileContents = e.target.result; + //console.log(fileContents); + + (async () => { + try { + const readOptions = new mx.XmlReadOptions(); + readOptions.readXIncludes = false; + var customLib = mx.createDocument(); + + await mx.readFromXmlString(customLib, fileContents, '', readOptions); + + // Create JS from custom library + try { + console.log('Create custom library definitions') + // Icon name is filename with webp as extension instead of mtlx + var iconName = file.name.replace('.mtlx', '.webp'); + // Check if iconName file exists + var iconExists = await that.editor.uriExists(iconName); + if (!iconExists) { + iconName = ''; + } + var definitionsList = []; + var result = that.createLiteGraphDefinitions(customLib, false, false, definitionsList , 'mtlx', that.editor, iconName); + if (result) + { + eval(result); + var definitionsListString = definitionsList.join(', '); + that.editor.debugOutput("Registered custom node types: [" + definitionsListString + "]", 0, false); + that.editor.displayNodeTypes(); + } + } catch (e) { + console.log('Error evaluating source:', e); + } + + + // Keep track of libraries loaded by filename. + customlibs.push([file.name, customLib]); + + } catch (error) { + that.editor.debugOutput('Error reading definitions:' + error, 2, false); + } + })(); + + }; + + } else { + that.editor.debugOutput("MaterialX is not initialized", 2); + } + + //customlibs + }; + input.click(); + } + + sanitizePort(input, node, graphElement) + { + var channelsRemoved = 0; + + var channels = input.getAttribute('channels'); + if (channels && channels.length > 0) { + + var sourceElem = null; + var connectionString = ''; + var nodeName = input.getNodeName(); + if (nodeName.length) { + connectionString = 'nodename'; + sourceElem = graphElement.getDescendant(nodeName); + } + var nodeGraphName = input.getNodeGraphString() + if (nodeGraphName.length) { + connectionString = 'nodegraph'; + sourceElem = graphElement.getDescendant(nodeGraphName); + } + var inputInterfaceName = input.getInterfaceName(); + if (inputInterfaceName.length) { + connectionString = 'interfacename'; + sourceElem = graphElement.getDescendant(inputInterfaceName); + } + var outputType = sourceElem.getType(); + var outputName = input.getOutputString(); + var sourceOutput = null; + if (outputName.length > 0) { + var testOutput = sourceElem.getOutput(outputName); + outputType = testOutput.getType(); + //if (sourceElem.getOutputs().length > 1) { + // sourceOutput = testOutput.getName(); + //} + } + console.log('Source element:', sourceElem.getNamePath(), 'output type:', outputType, 'output name:', outputName); + + // Insert an extract node. e.g. + /* + + + + + */ + var extractName = graphElement.createValidChildName('C_extract'); + var extractNode = graphElement.addNode('extract', extractName, 'float'); + extractName = extractNode.getName(); + var extractInput = extractNode.addInput('in', outputType); + if (sourceOutput) { + extractInput.setAttribute('output', sourceOutput); + } + var extractIndex = extractNode.addInput('index', 'integer') + var remappedChannels = '0'; + if (channels == 'g' || channels == 'y') + remappedChannels = '1'; + else if (channels == 'b' || channels == 'z') + remappedChannels = '2'; + else if (channels == 'a' || channels == 'w') + remappedChannels = '3'; + extractIndex.setValueString(remappedChannels, 'integer'); + extractInput.setAttribute(connectionString, sourceElem.getName()); + if (outputName.length > 0) { + extractInput.setAttribute('output', outputName); + } + var extractOutput = extractNode.addOutput('out', input.getType()); + console.log('++ Insert extract node:', mx.prettyPrint(extractNode), 'in graph', graphElement.getName()); + + input.setAttribute(connectionString, extractName); + input.removeAttribute('channels'); + console.log('-- Remove channels:', channels, ' on:', mx.prettyPrint(input)); + + channelsRemoved++; + } + } + + sanitizeDocument(graphElement) + { + var channelsRemoved = 0; + + // Scane for any nodes with inputs which have a "channels" specified + var nodes = graphElement.getNodes(); + for (var node of nodes) { + for (var input of node.getInputs()) { + channelsRemoved += this.sanitizePort(input, node, graphElement) + } + } + for (var output of graphElement.getOutputs()) { + channelsRemoved += this.sanitizePort(output, output, graphElement); + } + + if (graphElement.getParent() == null) { + var childGraphs = graphElement.getNodeGraphs(); + for (var index in childGraphs) { + //console.log('Scan child graph:', childGraphs[index].getNamePath()); + channelsRemoved += this.sanitizeDocument(childGraphs[index]); + } + return channelsRemoved; + } + } + + loadFromString(fileContents, fileName) + { + (async () => { + try { + const readOptions = new mx.XmlReadOptions(); + readOptions.readXIncludes = false; + + doc.clearContent(); + + doc.importLibrary(stdlib); + for (var item of customlibs) { + console.log('Import custom library:', item[0]); + doc.importLibrary(item[1]); + } + var loadDoc = mx.createDocument(); + await mx.readFromXmlString(loadDoc, fileContents, '', readOptions); + + // Check if nodedef is not in existingDefs + // + var customLib = mx.createDocument(); + customLib.copyContentFrom(loadDoc); + var keepChildren = []; + var existingDefs = [] + var saveCustomLib = false; + doc.getNodeDefs().forEach(def => { existingDefs.push(def.getName()); }); + for (var nodedef of loadDoc.getNodeDefs()) { + var nodedefName = nodedef.getName(); + if (!existingDefs.includes(nodedefName)) { + keepChildren.push(nodedef.getName()); + saveCustomLib = true; + } + } + for (var ng of loadDoc.getNodeGraphs()) { + if (ng.getAttribute('nodedef') && ng.getAttribute('nodedef').length > 0) { + saveCustomLib = true; + keepChildren.push(ng.getName()); + } + } + + if (saveCustomLib) { + + for (var child of customLib.getChildren()) { + if (!keepChildren.includes(child.getName())) { + console.log('Remove child:', child.getName()); + customLib.removeChild(child.getName()); + } + } + + var additionDefs = []; + var result = this.createLiteGraphDefinitions(customLib, true, false, additionDefs, 'mtlx', MxShadingGraphEditor.theEditor); + try { + eval(result); + console.log('Loaded local definitions: ', additionDefs); + } catch (e) { + console.log('Error evaluating source:', e); + } + } + + doc.copyContentFrom(loadDoc); + this.buildGraphFromDoc(doc, MxShadingGraphEditor.theEditor); + + // Must do this after build as build will clear customDocLibs array + if (saveCustomLib) { + customDocLibs.push([fileName, customLib]); + } + + var documentColorSace = doc.getColorSpace(); + this.setActiveColorSpace(documentColorSace); + documentColorSace = this.getActiveColorSpace(); + //console.log('Document colorspace:', documentColorSace); + var csArea = MxShadingGraphEditor.theEditor.ui.mtlxdoc_colorspace; + if (csArea) + csArea.innerHTML = documentColorSace; + MxShadingGraphEditor.theEditor.updatePropertyPanel(null); + + // Cleanup document + //loadDoc.removeAttribute('fileprefix'); + //fileContents = mx.writeToXmlString(loadDoc); + + MxShadingGraphEditor.theEditor.debugOutput('Loaded document: "' + fileName + '"', 0, false); + + // Update mtlx text area + let textArea = MxShadingGraphEditor.theEditor.ui.mtlxdoc; + if (!textArea) { + MxShadingGraphEditor.theEditor.debugOutput('Failed to find text area for mtlxdoc', 2, false); + } + else { + textArea.setValue(fileContents); + } + } catch (error) { + MxShadingGraphEditor.theEditor.debugOutput('Error reading document:' + error, 2, false); + } + })(); + } + + loadFromFile(file, fileName, editor) { + var debug = false; + + if (mx) + { + if (!this.loadMaterialXLibraries()) + return; + + // Load the content from the specified file (replace this with actual loading logic) + + const reader = new FileReader(); + reader.readAsText(file, 'UTF-8'); + reader.accept = '.mtlx'; + + var that = this; + reader.onload = function (e) { + // Display the contents of the file in the output div + let fileContents = e.target.result; + //console.log(e.target); + + that.loadFromString(fileContents, fileName); + }; + + } else { + editor.debugOutput("MaterialX is not initialized", 2, false); + } + } + + loadMaterialXLibraries() { + if (stdlib) + return stdlib; + + if (!mx) { + MxShadingGraphEditor.theEditor.debugOutput("MaterialX is not initialized", 2); + return null; + } + + var generator = new mx.EsslShaderGenerator(); + var genContext = new mx.GenContext(generator); + { + stdlib = mx.loadStandardLibraries(genContext); + console.log('Loaded standard libraries:', stdlib.getNodeDefs().length); + } + + return stdlib; + } + + // Create a valid MaterialX name + createValidName(name, msg=null) + { + if (name.length == 0) { + if (msg) + { + msg = 'Setting empty name as "blank"'; + } + name = "blank"; + } + + // Get list of all names in graph. + var graph = graphcanvas.graph; + var nodes = graph._nodes; + var nodenames = []; + for (var node of nodes) { + nodenames.push(node.title); + } + //console.log('Current graph nodes:', nodenames); + + name = mx.createValidName(name); + + if (!nodenames.includes(name)) { + return name; + } + + // Get starting number and root name + var rootName = name; + var i = 1; + var number = name.match(/\d+$/); + if (number) { + i = (parseInt(number) + 1) + rootName = name.slice(0, -number[0].length); + } + + var valid_name = rootName + i.toString(); + while (nodenames.includes(valid_name)) { + i++; + valid_name = rootName + i.toString(); + } + return valid_name; + } +}; + +class MxShadingGraphEditor { + // + // This class is a wrapper around the LiteGraph library to provide a MaterialX node editor. + // It is designed to work with the MaterialX JavaScript API. + // + // List of methods: + // - constructor + // - setUI + // - setDirty + // - debugOutput + // - arrangeGraph + // - resetView + // - clearGraph + // - saveSerialization + // - loadSerialization + // - saveMaterialXGraph + // - saveMaterialXGraphText + // - loadMaterialXDefinitions + // - loadMaterialXGraph + // - loadMaterialXGraphFromString + // - rgbToHex + // - createButtonWithImageAndText + // - openImageDialog + // - updatePropertyPanel + // + constructor() { + if (!MxShadingGraphEditor.theEditor) + { + MxShadingGraphEditor.theEditor = this; + this.handler = new MxMaterialXHandler('MaterialX Handler', 'mtlx'); + console.log('Create new editor', MxShadingGraphEditor.theEditor, ' and handler: ', this.handler); + } + return MxShadingGraphEditor.theEditor; + } + + setUI(ui) { + this.ui = ui; + } + + setDirty() + { + if (graphcanvas) + { + graphcanvas.setDirty(true, true); + //graphcanvas.resize(); + } + } + + debugOutput(text, severity, clear = null) { + var console_area = MxShadingGraphEditor.theEditor.ui.console_area; + if (!console_area) { + console.error('No console area found!'); + return; + } + if (severity === 2) { + text = '> Error: ' + text + } + else if (severity === 1) { + text = '> Warning: ' + text + } + else { + if (text.length) + text = '> ' + text; + } + + //if (clear) { + // console_area.value = text + '\n'; + //} + //else + { + console_area.value = console_area.value + text + '\n'; + } + // Scroll to latest entry. + console_area.scrollTop = console_area.scrollHeight; + } + + arrangeGraph() { + // This does not track the current subgraph. + if (graphcanvas) { + graphcanvas.graph.arrange(60); + } + } + + resetView() { + if (graphcanvas) { + graphcanvas.ds.reset(); + graphcanvas.setDirty(true, true); + } + } + + clearGraph() { + this.handler.activeColorSpace = this.handler.DEFAULT_COLOR_SPACE; + this.handler.activeUnits = this.handler.DEFAULT_UNITS; + MxShadingGraphEditor.theEditor.updatePropertyPanel(null); + MxShadingGraphEditor.theEditor.debugOutput('', 0, false); + this.updatePropertyPanel(null); + if (graphcanvas) { + // Set back to top graph + graphcanvas.setGraph(graph); + graphcanvas.graph.clear(); + graphcanvas.ds.reset(); + graphcanvas.setDirty(true, true); + } + //console.log('Clear graph', customDocLibs); + customDocLibs = []; + } + + saveSerialization() { + var data = JSON.stringify(graph.serialize(), null, 2); + var blob = new Blob([data], { type: "text/plain" }); + var url = URL.createObjectURL(blob); + var a = document.createElement("a"); + a.href = url; + a.download = "my_lite_graph.json"; + a.click(); + } + + loadSerialization() { + MxShadingGraphEditor.theEditor.clearGraph(); + + var input = document.createElement("input"); + input.type = "file"; + input.accept = ".json"; + input.onchange = function (e) { + var file = e.target.files[0]; + var reader = new FileReader(); + reader.onload = function (event) { + var data = JSON.parse(event.target.result); + graph.configure(data); + }; + reader.readAsText(file); + }; + input.click(); + } + + saveMaterialXGraph(saveCustomLibs) + { + this.handler.saveToFile(graph, saveCustomLibs); + } + + saveMaterialXGraphText(saveCustomLibs) + { + this.handler.saveToString(graph, saveCustomLibs); + } + + loadMaterialXDefinitions() + { + this.handler.loadDefinitionsFromFile(); + } + + loadMaterialXGraph() { + + // Load mtlx document from disk + var input = document.createElement("input"); + input.type = "file"; + input.accept = "." + this.handler.getExtension(); + console.log('Accept:', input.accept); + input.onchange = function (e) { + var file = e.target.files[0]; + console.log('Loading file: ' + file.name); + + MxShadingGraphEditor.theEditor.handler.loadFromFile(file, file.name, MxShadingGraphEditor.theEditor); + }; + input.click(); + } + + loadMaterialXGraphFromString(content, fileName) + { + if (content.length > 0) + this.handler.loadFromString(content, fileName); + else + MxShadingGraphEditor.theEditor.debugOutput('No content to load', 2, false); + } + + rgbToHex(rgb) { + if (!rgb) { + console.log('rgbToHex empty !', rgb); + return "#000000"; + } + return '#' + rgb.map(x => { + var hex = Math.round(x * 255).toString(16); + return hex.length === 1 ? '0' + hex : hex; + }).join(''); + } + + createButtonWithImageAndText(imageSrc, text, id) { + // Create image element + var img = document.createElement("img"); + img.id = id + "_img"; + img.src = imageSrc; + img.classList.add("img-fluid"); // Bootstrap class for responsive images + + // Create text element + var span = document.createElement("span"); + span.id = id + "_text"; + span.textContent = " " + text; + + // Create button element + var button = document.createElement("button"); + button.id = id; + button.classList.add("btn", "btn-sm", "btn-outline-secondary", "form-control", "form-control-sm"); // Bootstrap button classes + button.appendChild(img); // Append image to button + button.appendChild(span); // Append text to button + + return button; + } + + + openImageDialog(theNode, updateProp, wantURI) { + //console.log('updateImageDialog', theNode, updateProp, wantURI); + + // Dynamically create a file input element + var fileInput = document.createElement('input'); + fileInput.type = 'file'; + fileInput.accept = 'image/*'; // Accept any image file + fileInput.style.display = 'none'; + document.body.appendChild(fileInput); + + fileInput.click(); + + // TODO : Cache the fileURI on the node so can display without loading... + fileInput.addEventListener('change', function () { + var fileURI = fileInput.value.split('\\').pop(); // Get the filename without the full path + var file = fileInput.files[0]; + //if (wantURI) + fileURI = URL.createObjectURL(file); + + var updateElementId = '__pp:' + updateProp; + var textInput = document.getElementById(updateElementId); + //console.log('New filename:', fileURI, 'updateElementId:', updateElementId, 'updateProp:', updateProp); + textInput.value = fileURI; + theNode.properties[updateProp] = fileURI; + + var propertypanel_preview = document.getElementById('propertypanel_preview'); + propertypanel_preview.src = URL.createObjectURL(file); + propertypanel_preview.style.display = "block"; + + var previewImage = false; + if (previewImage) { + if (propertypanel_preview) { + var reader = new FileReader(); + reader.onload = function (event) { + propertypanel_preview.src = event.target.result; + }; + + // Read the file as a data URL (base64 encoded string) + reader.readAsDataURL(file); + + propertypanel_preview.style.display = "block"; + } + } + + document.body.removeChild(fileInput); + }); + } + + uriExists(uri) { + // Add try / catch block to handle network errors + return fetch(uri) + .then(response => { + if (response.ok) { + return true; + } else { + return false; + } + }) + .catch(error => { + console.log('Error checking URI:', error); + return false; + }); + } + + + updatePropertyPanel(node) { + //console.log('Update Panel For:', node); + var propertypanelcontent = MxShadingGraphEditor.theEditor.ui.propertypanel_content; + if (!propertypanelcontent) { + console.error('No property panel content widget found!'); + return; + } + // Delete all children + while (propertypanelcontent.firstChild) { + propertypanelcontent.removeChild(propertypanelcontent.firstChild); + } + + // Update icon + var panelIcon = MxShadingGraphEditor.theEditor.ui.propertypanel_icon; + if (node && node.nodedef_icon) { + //if (panelIcon.src != node.nodedef_icon) + panelIcon.src = node.nodedef_icon; + } + else { + if (!node) + //if (panelIcon.src != this.ui.icon_map['_default_graph_']) + panelIcon.src = this.ui.icon_map['_default_graph_']; + else + //if (panelIcon.src != this.ui.icon_map['_default_']) + panelIcon.src = this.ui.icon_map['_default_']; + } + + propertypanelcontent.innerHTML = ""; + if (!node) { + var docInfo = [ ['Colorspace', this.handler.activeColorSpace], + ['Units', this.handler.activeUnit ]]; + + for (var item of docInfo) { + + var elem = document.createElement("div"); + elem.className = "row px-1 py-0"; + var label = document.createElement("div"); + label.className = "col py-0 col-form-label-sm text-left"; + label.innerHTML = "" + item[0] + ""; + elem.appendChild(label); + + var inputCol = document.createElement("div"); + inputCol.className = "col text-left"; + var nameInput = document.createElement("input"); + nameInput.type = "text"; + nameInput.value = item[1]; + nameInput.className = "form-control form-control-sm"; + nameInput.disabled = true; + elem.appendChild(inputCol); + inputCol.appendChild(nameInput); + + propertypanelcontent.appendChild(elem); + } + return; + } + + var _category = node.nodedef_node; + var _type = node.nodedef_type; + + var isNodeGraph = node.type == 'graph/subgraph'; + if (isNodeGraph) { + _category = 'nodegraph'; + if (node.outputs) { + if (node.outputs.length > 1) { + _type = 'multi'; + } + else if (node.outputs.length > 0) { + _type = node.outputs[0].type; + } + } + else { + _type = ''; + } + } + else { + if (_category == 'surfacematerial') { + _type = ''; + } + } + + var elem = document.createElement("div"); + elem.className = "row px-1 py-0"; + var label = document.createElement("div"); + label.className = "col-4 py-0 col-form-label-sm text-left"; + label.innerHTML = "" + _category; + if (_type.length > 0) { + label.innerHTML += '
                            ' + _type; + } + label.innerHTML += "
                            "; + + var inputCol = document.createElement("div"); + inputCol.className = "col text-left"; + var nameInput = document.createElement("input"); + nameInput.type = "text"; + nameInput.value = node.title; + nameInput.className = "form-control form-control-sm"; + nameInput.onchange = function (e) { + var oldTitle = node.title; + node.title = MxShadingGraphEditor.theEditor.handler.createValidName(e.target.value); + e.target.value = node.title; + //console.log('node.graph._is_subgraph:', node) + if (node.graph._is_subgraph) { + if (node.nodedef_node == 'input') { + //console.log('Rename subgraph input:'); + node.graph.renameInput(oldTitle, node.title); + } + else if (node.nodedef_node == 'output') { + //console.log('Rename subgraph output:'); + node.graph.renameOutput(oldTitle, node.title); + } + } + + // Note: there is a custom size fo subgraphs. + node.setSize(node.computeSize()); + node.setDirtyCanvas(true, true); + } + inputCol.appendChild(nameInput); + + // TODO: Preview image + if (node.nodedef_node != 'input' && node.nodedef_node != 'output' + && node.type != 'graph/subgraph') { + var imagePreview = document.createElement("img"); + imagePreview.src = "./Images/no_image.png"; + var previewSet = false; + console.log('Check for preview:', node.nodedef_swatch, 'category:', _category) + imagePreview.style.display = "none"; + imagePreview.src = "./Images/no_image.png"; + if (node.nodedef_swatch && + (_type == 'BSDF' || _type == 'EDF' || _type == 'surfaceshader')) + { + this.uriExists(node.nodedef_swatch) + .then(exists => { + if (exists) { + previewSet = true; + imagePreview.style.display = "block"; + imagePreview.src = node.nodedef_swatch; + } + }); + } + imagePreview.id = "propertypanel_preview"; + imagePreview.className = "img-fluid form-control form-control-sm"; + inputCol.appendChild(imagePreview); + } + + elem.appendChild(label); + elem.appendChild(inputCol); + propertypanelcontent.appendChild(elem); + + // TODO: Add toggle for showing/hiding all inputs + var addShow = false; + if (addShow) { + var elem = document.createElement("div"); + elem.className = "row px-1 py-0"; + + var label = document.createElement("div"); + label.className = "col-12 col-form-label-sm"; + label.innerHTML = "All Inputs: "; + elem.appendChild(label); + var input = document.createElement("input"); + input.type = "checkbox"; + label.appendChild(input); + + var showAll = false; + if (node.showAllInputs) { + showAll = node.showAllInputs; + } + input.checked = showAll; + input.onclick = function (e) { + var show = e.target.checked; + node.showAllInputs = show; + + // Need to keep all old + new inputs in order. Easiest + // is to keep a list of all inputs, remove old and add new. + for (var index in node.properties_info) { + var propInfo = node.properties_info[index]; + var found = false; + for (var i = 0; i < node.inputs.length; ++i) { + if (node.inputs[i].name == propInfo.name) { + found = true; + break; + } + } + if (!found) { + console.log('Add missing input:', propInfo.name, propInfo.default_value, propInfo.type); + //node.addInput(propInfo.name, propInfo.type); + //node.addProperty(propInfo.name, propInfo.value, propInfo.type); + } + } + } + + if (current_details) + current_details.appendChild(elem); + else + propertypanelcontent.appendChild(elem); + } + + var hr = document.createElement("hr"); + hr.classList.add("my-1"); + propertypanelcontent.appendChild(hr); + + var current_details = null; + var first_details = true; + var nodeInputs = node.inputs + for (var i in nodeInputs) { + var nodeInput = nodeInputs[i]; + var inputName = nodeInput.name; + var uiName = inputName; + var uimin = null; + var uimax = null; + var colorspace = ''; + var units = ''; + + var property_info = node.properties_info[i]; + //console.log('Property info:', property_info, ' for input:', inputName); + if (property_info) + { + if (property_info.colorspace) + { + colorspace = property_info.colorspace; + } + if (property_info.unit) + { + units = property_info.unit; + } + if (property_info.uiname) + { + uiName = property_info.uiname; + } + if (property_info.uimin) + { + uimin = property_info.uimin; + } + if (property_info.uimax) + { + uimax = property_info.uimax; + } + if (property_info.uifolder && property_info.uifolder.length > 0) + { + // Create a details element + if (current_details == null || current_details.id != property_info.uifolder) + { + //console.log('Create new details:', property_info.uifolder); + current_details = document.createElement("details"); + current_details.id = property_info.uifolder; + current_details.open = first_details; + current_details.classList.add('w-100', 'p-1', 'border', 'border-secondary', 'rounded', 'my-1'); + first_details = false; + var summary = document.createElement('summary') + summary.innerHTML = property_info.uifolder; + //summary.classList.add('btn', 'btn-sm', 'btn-outline-secondary', 'btn-block'); + current_details.appendChild(summary); + + propertypanelcontent.appendChild(current_details); + } + } + else { + current_details = null; + } + //console.log('>>>>>>>>>>>> uiName:', uiName, 'uimin:', uimin, 'uimax:', uimax); + } + else { + current_details = null; + } + + var elem = null; + + // Check if there is a link + if (nodeInput.link) { + var upstreamLink = null; + + var nodegraph = node.graph; + var link = nodegraph.links[nodeInput.link]; + //console.log('link:', link); + var linkId = link.origin_id; + var linkNode = nodegraph.getNodeById(linkId); + if (linkNode) { + + + //console.log('linkNode:', linkNode); + var linkSlot = link.origin_slot; + //console.log('linkSlot:', linkSlot); + var linkOutput = linkNode.outputs[linkSlot]; + //console.log('linkOutput:', linkOutput); + upstreamLink = linkNode.title + '.' + linkOutput.name; + //console.log('upstreamLink:', upstreamLink); + + var id = "__pp:" + inputName; + var input = this.createButtonWithImageAndText("./Images/arrow_up_white.svg", upstreamLink, id); + + //var input = document.createElement("div"); + //input.id = "__pp:" + inputName; + //input.type = "text"; + //input.value = upstreamLink; + //input.disabled = true; + //input.className = "btn form-control form-control-sm"; + //input.style = "background-color: #252"; + input.onclick = function (e) { + + var inputName = e.target.id; + inputName = inputName.replace('__pp:', ''); + inputName = inputName.replace('_text', ''); + inputName = inputName.replace('_img', ''); + console.log('Clicked traversal button:', inputName); + + console.log('Jump to node:', linkNode.title); + graphcanvas.selectNodes([linkNode]); + //node.setDirtyCanvas(true, true); + MxShadingGraphEditor.theEditor.updatePropertyPanel(linkNode); + node.setDirtyCanvas(true, true); + } + + // Add new row + elem = document.createElement("div"); + elem.className = "row px-1 py-0"; + + input.id = "__pp:" + inputName; + + var label = document.createElement("div"); + label.className = "col-4 p-0 col-form-label-sm text-end"; + label.innerHTML = uiName; + label.for = input.id; + elem.appendChild(label); + + // form-control + if (useFormControl) { + input.classList.add("form-control"); + } + input.classList.add("form-control-sm"); + // Disable if don't want interaction. + if (!graphcanvas.allow_interaction) + input.disabled = true; + + var propvalue = document.createElement("div"); + propvalue.className = "col p-1"; + propvalue.appendChild(input); + + elem.appendChild(propvalue); + } + } + + else { + + var targetNode = node; + var propertyKey = inputName; + + var property = targetNode.properties[inputName]; + if (property == null) { + if (isNodeGraph) + { + var subgraph = targetNode.subgraph; + if (subgraph) + { + //console.log('Find node by title', inputName, ' in subgraph', subgraph._nodes); + var subNode = subgraph.findNodeByTitle(inputName); + if (subNode) + { + targetNode = subNode; + propertyKey = 'in'; + property = targetNode.properties['in']; + //console.log('Update nodegraph child node properties:', targetNode.title, '. ', inputName, ' = ', JSON.stringify(property)); + } + } + } + if (property == null) + { + console.log('Update: Cannot find property value for input:', inputName); + continue; + } + } + else { + //console.log('handle propery value: ', property, 'for input', input); + } + + // Add new row + elem = document.createElement("div"); + elem.className = "row px-1 py-0"; + + var input = null; + var input_btn = null; + var colorspace_unit_btn = null; + var useFormControl = true; + + // TODO: Clean this up to be a drop-down and only apply to numbers / colors + if (colorspace.length > 0) { + /* + // Create drop-down menu + /* + colorspace_unit_btn = document.createElement("div"); + colorspace_unit_btn.classList.add("dropdown"); + var dropdownButton = document.createElement("button"); + dropdownButton.classList.add("btn", "btn-sm", "btn-outline-secondary", "dropdown-toggle"); + dropdownButton.type = "button"; + dropdownButton.id = "dropdownMenuButton"; + dropdownButton.setAttribute("data-bs-toggle", "dropdown"); + dropdownButton.setAttribute("aria-expanded", "false"); + dropdownButton.innerHTML = "+"; + var dropdownMenu = document.createElement("ul"); + dropdownMenu.classList.add("dropdown-menu"); + dropdownMenu.setAttribute("aria-labelledby", "dropdownMenuButton"); + var dropdownItem = document.createElement("li"); + dropdownItem.classList.add("dropdown-item"); + dropdownItem.innerHTML = colorspace; + dropdownMenu.appendChild(dropdownItem); + colorspace_unit_btn.appendChild(dropdownMenu); + */ + colorspace_unit_btn = document.createElement("button"); + colorspace_unit_btn.classList.add("btn", "py-0", "btn-sm", "btn-outline-secondary"); + colorspace_unit_btn.innerHTML = colorspace; + + console.log('Show MetaData Colorspace:', colorspace, ' for input:', inputName, ' on node:', node.title) + } + else if (units.length > 0) { + colorspace_unit_btn = document.createElement("button"); + colorspace_unit_btn.classList.add("btn", "py-0", "btn-sm", "btn-outline-secondary"); + colorspace_unit_btn.innerHTML = units; + console.log('Show MetaData Units:', units, ' for input:', inputName, ' on node:', node.title) + } + + var proptype = nodeInput.type; + if (proptype == 'float' || proptype == 'integer') { + var isFloat = proptype == 'float'; + input = document.createElement("input"); + input.type = 'number'; + input.value = property; + if (uimin) + { + input.min = uimin; + } + if (uimax) + { + input.max = uimax; + } + if (input.min && input.max && isFloat) + { + input.step = uimax - uimin / 100.0; + } + input.setAttribute('propertyKey', propertyKey); + var theNode = targetNode; + input.onchange = function (e) { + var pi = e.target.getAttribute('propertyKey'); + var val = parseFloat(e.target.value); + if (uimin && val < uimin) { + val = uimin; + e.target.value = val; + } + if (uimax && val > uimax) { + val = uimax; + e.target.value = val; + } + theNode.properties[pi] = val; + console.log('Update scalar property:', pi, parseFloat(e.target.value), theNode.title, theNode.properties) + } + } + else if (proptype == 'string' || proptype == 'filename') { + input = document.createElement("input"); + input.type = "text"; + if (proptype == 'filename') { + var propertypanel_preview = document.getElementById('propertypanel_preview'); + var curImage = property; + if (curImage) { + this.uriExists(curImage) + .then(exists => { + if (exists) { + propertypanel_preview.src = curImage; + propertypanel_preview.style.display = "block"; + } else { + //propertypanel_preview.style.display = "none"; + propertypanel_preview.src = "./Images/no_image.png"; + propertypanel_preview.style.display = "block"; + MxShadingGraphEditor.theEditor.debugOutput('Image does not exist: ' + curImage, 1); + } + }); + } + + input_btn = document.createElement("button"); + input_btn.classList.add("btn", "btn-sm", "btn-outline-secondary"); + input_btn.innerHTML = "+"; + input_btn.setAttribute('propertyKey', propertyKey); + var fileId = "__pp:" + inputName; + var theNode = node; + input_btn.onclick = function (e) { + var pi = e.target.getAttribute('propertyKey'); + console.log('pi:', pi); + MxShadingGraphEditor.theEditor.openImageDialog(theNode, pi, false); + } + } + input.value = property; + input.setAttribute('propertyKey', propertyKey); + var theNode = targetNode; + input.onchange = function (e) { + var pi = e.target.getAttribute('propertyKey'); + theNode.properties[pi] = e.target.value; + //console.log('Update string property:', pi, theNode.properties[pi]) + } + } + else if (proptype == 'boolean') { + //console.log('Add Boolean property:', property); + input = document.createElement("input"); + input.type = "checkbox"; + input.classList = "form-check-input"; + //input.style.width = "10%"; + //input.style.height = "50%"; + useFormControl = false; + input.checked = property; + input.setAttribute('propertyKey', propertyKey); + var theNode = targetNode; + input.onchange = function (e) { + var pi = e.target.getAttribute('propertyKey'); + theNode.properties[pi] = e.target.checked; + //console.log('Update boolean property:', theNode.properties[pi]); + } + } + + else if (proptype == 'vector2' || proptype == 'vector3' || proptype == 'vector4') { + // Find index of proptype in ['vector2', 'vector3', 'vector4' ] + var vector_size = ['vector2', 'vector3', 'vector4'].indexOf(proptype) + 2; + var input = document.createElement("div"); + useFormControl = false; + + input.className = "row py-1 ps-2"; + { + //console.log('Vector property:[', 0, '] = ', property[0], proptype) + var subinput = document.createElement("input"); + subinput.type = 'number'; + subinput.classList.add("form-control"); + subinput.classList.add("form-control-sm"); + subinput.value = property[0]; + if (uimin) { + subinput.min = uimin[0]; + } + if (uimax) { + subinput.max = uimax[0]; + } + if (uimin && uimax) { + subinput.step = (uimax[0] - uimin[0]) / 100.0; + } + subinput.setAttribute('propertyKey', propertyKey); + var theNode = targetNode; + subinput.onchange = function (e) { + var pi = e.target.getAttribute('propertyKey'); + var value = parseFloat(e.target.value); + if (uimin && value < uimin[0]) { + value = uimin[0]; + } + if (uimax && value > uimax[0]) { + value = uimax[0]; + } + e.target.value = value; + theNode.properties[pi][0] = value; + } + input.appendChild(subinput); + } + { + //console.log('Vector property:[', 1, '] = ', property[0], proptype) + var subinput = document.createElement("input"); + subinput.type = 'number'; + subinput.value = property[1]; + if (uimin) { + subinput.min = uimin[1]; + } + if (uimax) { + subinput.max = uimax[1]; + } + if (uimin && uimax) { + subinput.step = (uimax[1] - uimin[1]) / 100.0; + } + subinput.setAttribute('propertyKey', propertyKey); + subinput.classList.add("form-control"); + subinput.classList.add("form-control-sm"); + var theNode = targetNode; + subinput.onchange = function (e) { + var pi = e.target.getAttribute('propertyKey'); + var value = parseFloat(e.target.value); + if (uimin && value < uimin[1]) { + value = uimin[1]; + } + if (uimax && value > uimax[1]) { + value = uimax[1]; + } + e.target.value = value; + theNode.properties[pi][1] = value; + //console.log('Update Vector property:"', pi, '"', 1, parseFloat(e.target.value), theNode.properties[pi]) + } + input.appendChild(subinput); + } + if (vector_size > 2) { + //console.log('Vector property:[', 2, '] = ', property[0], proptype) + var subinput = document.createElement("input"); + subinput.type = 'number'; + if (uimin) { + subinput.min = uimin[2]; + } + if (uimax) { + subinput.max = uimax[2]; + } + if (uimin && uimax) { + subinput.step = (uimax[2] - uimin[2]) / 100.0; + } + subinput.value = property[2]; + subinput.setAttribute('propertyKey', propertyKey); + subinput.classList.add("form-control"); + subinput.classList.add("form-control-sm"); + var theNode = targetNode; + subinput.onchange = function (e) { + var pi = e.target.getAttribute('propertyKey'); + //console.log('Update Vector property:"', pi, '"', 2, parseFloat(e.target.value), theNode.properties[pi]) + var value = parseFloat(e.target.value); + if (uimin && value < uimin[2]) { + value = uimin[2]; + } + if (uimax && value > uimax[2]) { + value = uimax[2]; + } + e.target.value = value; + theNode.properties[pi][2] = value; + } + input.appendChild(subinput); + } + if (vector_size > 3) { + //console.log('Vector property:[', 3, '] = ', property[0], proptype) + var subinput = document.createElement("input"); + subinput.type = 'number'; + if (uimin) { + subinput.min = uimin[3]; + } + if (uimax) { + subinput.max = uimax[3]; + } + if (uimin && uimax) { + subinput.step = (uimax[3] - uimin[3]) / 100.0; + } + subinput.value = property[3]; + subinput.setAttribute('propertyKey', propertyKey); + subinput.classList.add("form-control"); + subinput.classList.add("form-control-sm"); + var theNode = targetNode; + subinput.onchange = function (e) { + var pi = e.target.getAttribute('propertyKey'); + //console.log('Update Vector property:"', pi, '"', 3, parseFloat(e.target.value), theNode.properties[pi]) + var value = parseFloat(e.target.value); + if (uimin && value < uimin[3]) { + value = uimin[3]; + } + if (uimax && value > uimax[3]) { + value = uimax[3]; + } + e.target.value = value; + theNode.properties[pi][3] = value; + } + input.appendChild(subinput); + } + } + else if (proptype == 'color3' || proptype == 'color4') { + input = document.createElement("input"); + input.type = "color"; + //console.log('set color property:', rgbToHex(property)); + input.value = this.rgbToHex(property); + input.setAttribute('propertyKey', propertyKey); + input.onchange = function (e) { + // Convert hex to rgb in 0..1 range + var hex = e.target.value; + var rgb = [0, 0, 0]; + rgb[0] = parseInt(hex.substring(1, 3), 16) / 255.0; + rgb[1] = parseInt(hex.substring(3, 5), 16) / 255.0; + rgb[2] = parseInt(hex.substring(5, 7), 16) / 255.0; + if (uimin) + { + if (rgb[0] < uimin) rgb[0] = uimin; + if (rgb[1] < uimin) rgb[1] = uimin; + if (rgb[2] < uimin) rgb[2] = uimin; + } + if (uimax) + { + if (rgb[0] > uimax) rgb[0] = uimax; + if (rgb[1] > uimax) rgb[1] = uimax; + if (rgb[2] > uimax) rgb[2] = uimax; + } + var pi = e.target.getAttribute('propertyKey'); + targetNode.properties[pi] = rgb; + //console.log('set color property:', targetNode, targetNode.properties[propertyKey], propertyKey, rgb); + } + } + else { + input = document.createElement("input"); + input.type = "text"; + input.value = property; + var propertyKey = inputName; + input.onchange = function (e) { + targetNode.properties[propertyKey] = e.target.value; + } + } + /* + TODO: Handle enumerations + else if (proptype == 'enum') { + var input = document.createElement("select"); + for (var j in nodes.inputs[i].values) { + var option = document.createElement("option"); + option.value = j; + option.innerHTML = nodes.inputs[i].values[j]; + input.appendChild(option); + } + input.value = property; + input.onchange = function (e) { + targetNode.properties[i] = e.target.value; + } + } */ + + if (input) { + input.id = "__pp:" + inputName; + //console.log('> Add input:', input.id); + + var label = document.createElement("div"); + label.className = "col-4 p-0 col-form-label-sm text-end font-small"; + label.innerHTML = uiName; + label.for = input.id; + elem.appendChild(label); + + // form-control + if (useFormControl) { + input.classList.add("form-control"); + } + input.classList.add("form-control-sm"); + // Disable if don't want interaction. + if (!graphcanvas.allow_interaction) + input.disabled = true; + + var propvalue = document.createElement("div"); + propvalue.className = "col py-0"; + propvalue.appendChild(input); + + if (input_btn) { + var propbutton = document.createElement("div"); + propbutton.className = "col-1 py-0"; + //console.log('Add input button:', input_btn); + propbutton.appendChild(input_btn); + elem.appendChild(propbutton); + } + if (colorspace_unit_btn) { + //console.log('Add cs / unit button:', input_btn); + var propbutton = document.createElement("div"); + propbutton.className = "col col-form-label-sm font-small"; + var details = document.createElement("details"); + var summary = document.createElement('summary') + if (colorspace.length > 0) + summary.innerHTML = "Colorspace"; + else if (units.length > 0) + summary.innerHTML = "Units"; + details.appendChild(summary); + details.appendChild(colorspace_unit_btn); + propbutton.appendChild(details); + propvalue.appendChild(propbutton); + } + elem.appendChild(propvalue); + } + } + //elem.innerHTML = "" + i + " : " + property; + if (elem) { + if (current_details) + current_details.appendChild(elem); + else + propertypanelcontent.appendChild(elem); + } + } + } + + monitorGraph(theGraph, monitor) { + if (!theGraph) + return; + + theGraph.onConnectionChange = null; + theGraph.onNodeAdded = null; + theGraph.onNodeRemoved = null; + + if (monitor) { + + var that = this; + theGraph.onConnectionChange = function (node) + { + var selected = graphcanvas.selected_nodes; + for (var s in selected) { + console.log('update selected node:', selected[s].title); + that.updatePropertyPanel(selected[s]); + break; + } + } + + //console.log('Monitor graph add:', theGraph); + theGraph.onNodeAdded = function (node) { + if (node.type == 'graph/subgraph') { + // Use MaterialX naming for subgraphs + node.title = 'nodegraph'; + } + + node.title = MxShadingGraphEditor.theEditor.handler.createValidName(node.title) + node.setSize(node.computeSize()); + //console.log('-> Node Added:', node, '. Type:', node.type, '. Graph:', node.graph._is_subgraph); + + var is_subgraph = node.graph._is_subgraph;; + if (is_subgraph) { + if (node.nodedef_node == 'input') { + //console.log('Adding input node to subgraph.'); + node.graph.addInput(node.title, node.nodedef_type); + } + else if (node.nodedef_node == 'output') { + //console.log('Adding output node to subgraph.'); + node.graph.addOutput(node.title, node.nodedef_type); + } + } + + if (node.type == 'graph/subgraph') { + MxShadingGraphEditor.theEditor.monitorGraph(node.subgraph, monitor); + } + } + + //console.log('Monitor graph remove:', theGraph); + theGraph.onNodeRemoved = function (node) { + //console.log('-> Node Removed:', node, '. Type:', node.type, '. Graph:', graphcanvas.graph); + /* This is too late the graph reference has already been removed */ + var is_subgraph = graphcanvas.graph._is_subgraph; + if (is_subgraph) { + if (node.nodedef_node == 'input') { + console.log('Removing input node from subgraph.'); + graphcanvas.graph.removeInput(node.title); + } + else if (node.nodedef_node == 'output') { + console.log('Removing output node from subgraph.'); + graphcanvas.graph.removeOutput(node.title); + } + } + } + } + + + for (var i in theGraph._nodes) { + var node = theGraph._nodes[i]; + if (node.type == 'graph/subgraph') { + //console.log('Monitor subgraph:', node); + this.monitorGraph(node.subgraph, monitor); + } + } + } + + initializeLiteGraph(canvas) + { + // Initialize Litegraph + graph = new LiteGraph.LGraph(); + graphcanvas = new LiteGraph.LGraphCanvas(canvas, graph); + graphcanvas.onShowNodePanel = function (node) { + ; // Making this a no-op as will not use the default panel + } + graphcanvas.onNodeSelected = function (node) { + console.log('Selected node:', node.title, node); + MxShadingGraphEditor.theEditor.updatePropertyPanel(node); + } + graphcanvas.onNodeDeselected = function (node) { + //console.log('Node Deselected:', node); + MxShadingGraphEditor.theEditor.updatePropertyPanel(null); + } + + graphcanvas.default_connection_color_byTypeOff = { + float: "#753", + vector2: "#A32", + vector3: "#A76", + vector4: "#A98", + color3: "#679", + color4: "#899", + matrix33: "#333", + matrix44: "#444", + string: "#888", + filename: "#58E", + boolean: "#48A", + }; + /* + graphcanvas.default_connection_color_byType = { + float: "#666", + vector2: "#777", + vector3: "#888", + color3: "#89A", + vector4: "#99B", + color4: "#9AC", + matrix33: "#9BD", + matrix44: "#9CE", + string: "#9DF", + filename: "#9EF", + boolean: "#AF0", + };*/ + + //console.log('Setup graph canvas:', graphcanvas); + + graphcanvas.resize(); + + this.monitorGraph(graph, true); + graph.arrange(60); + + // Run the graph + //graph.runStep(); + + // Enable interaction + //graphcanvas.hide_unconnected = false; + graphcanvas.allow_interaction = true; + graphcanvas.allow_dragnodes = true; + graphcanvas.allow_searchbox = true; + graphcanvas.render_connections_arrows = true; + graphcanvas.clear_background_color = "#222223"; + graphcanvas.max_zoom = 0.25; + graphcanvas.connections_width = 2; + graphcanvas.render_canvas_border = false; + graphcanvas.align_to_grid = true; + //graphcanvas.background_image = null; + + // Turn off HUD + graphcanvas.show_info = false; + + // Ad event handler to call centerOnNode with f key press within the canvas area + canvas.addEventListener("keydown", function (e) { + if (e.key === "f") { + MxShadingGraphEditor.theEditor.centerNode(); + } + }); + + // Ad event handler to call array with l key press within the canvas area + canvas.addEventListener("keydown", function (e) { + if (e.key === "l") { + MxShadingGraphEditor.theEditor.arrangeGraph(); + } + }); + + } + + centerNode() { + var selected = graphcanvas.selected_nodes; + for (var s in selected) { + console.log('Focus on', selected[s]); + graphcanvas.centerOnNode(selected[s]); + break; + } + } + + clearNodeTypes() { + LiteGraph.searchbox_extras = []; + var nodeTypes = LiteGraph.registered_node_types; + for (var typeName in nodeTypes) { + if (typeName !== "graph/subgraph") { + console.log('Removing node type:', LiteGraph.getNodeType(typeName)); + LiteGraph.unregisterNodeType(typeName); + } + } + } + + collapseNode(node, collapse) { + if (node.constructor.collapsable === false) { + return false; + } + if (node.flags.collapsed != collapse) { + node.flags.collapsed = collapse; + return true; + } + return false; + } + + collapseExpandNodes(collapse) { + var curGraph = graphcanvas.graph; + + var selected_nodes = graphcanvas.selected_nodes; + console.log('Selected nodes:', selected_nodes); + var modified = false; + if (selected_nodes) { + for (var i in selected_nodes) { + var node = selected_nodes[i]; + console.log('Collapse/Expand:', node.title, collapse); + if (this.collapseNode(node, collapse)) + modified = true; + } + } + if (!modified) + { + var nodes = curGraph._nodes; + for (var i in nodes) { + var node = nodes[i]; + if (this.collapseNode(node, collapse)) + modified = true; + } + } + + if (modified) + { + graph._version++; + graph.setDirtyCanvas(true, true); + } + } + + extractNodeGraph() { + var selected = graphcanvas.selected_nodes; + if (selected.length == 0) { + console.log('No nodes selected.'); + return; + } + + var subgraphsSelected = [] + for (var i in selected) { + var node = selected[i]; + if (node.type == 'graph/subgraph') { + subgraphsSelected.push(node); + } + } + if (subgraphsSelected.length == 0) { + console.log('No subgraphs selected.'); + return; + } + + // Select subgraph nodes + var subGraph = subgraphsSelected[0]; + var subGraphNodes = subGraph.subgraph._nodes; + for (var i in subGraphNodes) { + var node = subGraphNodes[i]; + console.log('Select subgraph node:', node.title); + } + + graphcanvas.openSubgraph(subGraph.subgraph); + graphcanvas.selectNodes(subGraphNodes); + // Copy the selected nodes to the clipboard + graphcanvas.copyToClipboard(); + + // Paste the copied nodes into the graph + graphcanvas.closeSubgraph(); + graphcanvas.pasteFromClipboard(); + } + + createNodeGraph() { + // Disallow testing for now. + if (graphcanvas.graph._is_subgraph) + { + this.debugOutput('Cannot create nest subgraphs.', 1); + return; + } + + // Check for selected nodes + var selected = graphcanvas.selected_nodes; + if (selected.length == 0) { + console.log('No nodes selected.'); + return; + } + + // Copy the selected nodes to the clipboard + graphcanvas.copyToClipboard(); + + // Create a new graph/subgraph node + var node = LiteGraph.createNode('graph/subgraph'); + graph.add(node); + node.title = MxShadingGraphEditor.theEditor.handler.createValidName('group'); + // Open subgraph + graphcanvas.openSubgraph(node.subgraph); + // Paste the copied nodes into the subgraph + graphcanvas.pasteFromClipboard(); + + node.subgraph.arrange(60); + graphcanvas.ds.reset(); + graphcanvas.setDirty(true, true); + } + + displayNodeTypes() { + // Get the list of available node types + var nodeTypes = LiteGraph.registered_node_types; + + // Get the list container + var nodeList = this.ui.nodeTypesList; + // Clear all children of nodeList + while (nodeList.firstChild) { + nodeList.removeChild(nodeList.firstChild); + } + + // Iterate over the node types and add them to the list + for (var typeName in nodeTypes) { + + var rowItem = document.createElement("tr"); + + var cellItem = document.createElement("td"); + cellItem.textContent = typeName; + rowItem.appendChild(cellItem); + + cellItem = document.createElement("td"); + var nodeDefString = ''; + var nodeDefName = nodeTypes[typeName].nodedef_name; + var nodeDefNode = nodeTypes[typeName].nodedef_node + var nodeDefHref = nodeTypes[typeName].nodedef_href; + if (nodeDefName) { + if (nodeDefNode) + { + var link = document.createElement("a"); + link.target = "_blank"; + link.href = nodeDefHref; + link.textContent = nodeDefNode + " ( " + nodeDefName + " )"; + cellItem.appendChild(link); + } + else + { + cellItem.textContent = nodeDefName; + } + } + else { + cellItem.textContent = nodeDefString; + } + rowItem.appendChild(cellItem); + + nodeList.appendChild(rowItem); + } + } + + + initialize(createMode, canvas, ui) { + + this.setUI(ui); + this.initializeLiteGraph(canvas); + this.handler.initialize(MxShadingGraphEditor.theEditor); + } +} + +/* +document.addEventListener('DOMContentLoaded', () { + console.log('Setup property panel event handlers...') + var panel1 = document.getElementById('propertypanelcontent'); + //var panel2 = document.getElementById('panel2'); + var isDraggingPanel1 = false; + //var isDraggingPanel2 = false; + var offsetX1, offsetY1, offsetX2, offsetY2; + + panel1.addEventListener('mousedown', (e) { + console.log('mousedown:', e.target.id); + isDraggingPanel1 = true; + var rect = panel1.getBoundingClientRect(); + offsetX1 = e.clientX - rect.left; + offsetY1 = e.clientY - rect.top; + e.stopPropagation(); + }); + + + document.addEventListener('mousemove', (e) { + if (isDraggingPanel1) { + handleDragging(panel1, offsetX1, offsetY1, e); + } + }); + + document.addEventListener('mouseup', () { + isDraggingPanel1 = false; + //isDraggingPanel2 = false; + }); + + handleDragging(panel, offsetX, offsetY, e) { + var canvas = document.getElementById('graphcanvas'); + var canvasRect = canvas.getBoundingClientRect(); + var canvasLeft = canvasRect.left + window.pageXOffset; + var canvasTop = canvasRect.top + window.pageYOffset; + var canvasRight = canvasLeft + canvas.width; + var canvasBottom = canvasTop + canvas.height; + + var x = e.clientX - offsetX; + var y = e.clientY - offsetY; + + x = Math.min(Math.max(canvasLeft, x), canvasRight - panel.offsetWidth); + y = Math.min(Math.max(canvasTop, y), canvasBottom - panel.offsetHeight); + + panel.style.left = x - canvasLeft + 'px'; + panel.style.top = y - canvasTop + 'px'; + } +}); */ diff --git a/javascript/materialxtoy/Materials/MayaLambert_embedded_def.mtlx b/javascript/materialxtoy/Materials/MayaLambert_embedded_def.mtlx new file mode 100644 index 00000000..58ee7cad --- /dev/null +++ b/javascript/materialxtoy/Materials/MayaLambert_embedded_def.mtlx @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Materials/channels.mtlx b/javascript/materialxtoy/Materials/channels.mtlx new file mode 100644 index 00000000..d5cd6c7c --- /dev/null +++ b/javascript/materialxtoy/Materials/channels.mtlx @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Materials/compound_graph_example.mtlx b/javascript/materialxtoy/Materials/compound_graph_example.mtlx new file mode 100644 index 00000000..58b5c4fe --- /dev/null +++ b/javascript/materialxtoy/Materials/compound_graph_example.mtlx @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Materials/extract_graph_example.mtlx b/javascript/materialxtoy/Materials/extract_graph_example.mtlx new file mode 100644 index 00000000..d3ed18f9 --- /dev/null +++ b/javascript/materialxtoy/Materials/extract_graph_example.mtlx @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Materials/gltf_pattern.mtlx b/javascript/materialxtoy/Materials/gltf_pattern.mtlx new file mode 100644 index 00000000..ce1b2ee4 --- /dev/null +++ b/javascript/materialxtoy/Materials/gltf_pattern.mtlx @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Materials/mapped_surfaceshader.mtlx b/javascript/materialxtoy/Materials/mapped_surfaceshader.mtlx new file mode 100644 index 00000000..b11c4586 --- /dev/null +++ b/javascript/materialxtoy/Materials/mapped_surfaceshader.mtlx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Materials/pseudo_hatching.mtlx b/javascript/materialxtoy/Materials/pseudo_hatching.mtlx new file mode 100644 index 00000000..12e41f60 --- /dev/null +++ b/javascript/materialxtoy/Materials/pseudo_hatching.mtlx @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/Materials/sample_olives.mtlx b/javascript/materialxtoy/Materials/sample_olives.mtlx new file mode 100644 index 00000000..8199ed3e --- /dev/null +++ b/javascript/materialxtoy/Materials/sample_olives.mtlx @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/materialxtoy/index.html b/javascript/materialxtoy/index.html new file mode 100644 index 00000000..d3ec3d2b --- /dev/null +++ b/javascript/materialxtoy/index.html @@ -0,0 +1,561 @@ + + + + + + + + + MaterialXToy Editor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            + +

                            MaterialXToy Editor

                            +
                            + + +
                            +
                            + +
                            + +
                            + +
                            +
                            + +
                            +
                            + + +
                            +
                            + + +
                            +
                            + +
                            +
                            + +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            +
                            + + Properties Icon Properties + +
                            +
                            +
                            +
                            +
                            + + +
                            +
                            +
                            + + +
                            +
                            + +
                            +
                            + + + + + + + +
                            +
                            +
                            + +
                            + +
                            + +
                            + Definition Information +
                            +
                            + + + +
                            +
                            +
                            +
                            + Available Node Types +
                            + + + + + + + + + +
                            Graph IdNode Definition
                            +
                            +
                            +
                            +
                            +
                            +
                            + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/javascript/materialxtoy/litegraph/base.js b/javascript/materialxtoy/litegraph/base.js new file mode 100644 index 00000000..e2365308 --- /dev/null +++ b/javascript/materialxtoy/litegraph/base.js @@ -0,0 +1,1780 @@ +//basic nodes +(function(global) { + + var LiteGraph = global.LiteGraph; + + //Constant + function Time() { + this.addOutput("in ms", "number"); + this.addOutput("in sec", "number"); + } + + Time.title = "Time"; + Time.desc = "Time"; + + Time.prototype.onExecute = function() { + this.setOutputData(0, this.graph.globaltime * 1000); + this.setOutputData(1, this.graph.globaltime); + }; + + //LiteGraph.registerNodeType("basic/time", Time); + + //Subgraph: a node that contains a graph + function Subgraph() { + var that = this; + this.size = [140, 80]; + this.properties = { enabled: true }; + this.enabled = true; + + //create inner graph + this.subgraph = new LiteGraph.LGraph(); + this.subgraph._subgraph_node = this; + this.subgraph._is_subgraph = true; + + this.subgraph.onTrigger = this.onSubgraphTrigger.bind(this); + + //nodes input node added inside + this.subgraph.onInputAdded = this.onSubgraphNewInput.bind(this); + this.subgraph.onInputRenamed = this.onSubgraphRenamedInput.bind(this); + this.subgraph.onInputTypeChanged = this.onSubgraphTypeChangeInput.bind(this); + this.subgraph.onInputRemoved = this.onSubgraphRemovedInput.bind(this); + + this.subgraph.onOutputAdded = this.onSubgraphNewOutput.bind(this); + this.subgraph.onOutputRenamed = this.onSubgraphRenamedOutput.bind(this); + this.subgraph.onOutputTypeChanged = this.onSubgraphTypeChangeOutput.bind(this); + this.subgraph.onOutputRemoved = this.onSubgraphRemovedOutput.bind(this); + } + + Subgraph.title = "Subgraph"; + Subgraph.desc = "Graph inside a node"; + Subgraph.title_color = "#334"; + + Subgraph.prototype.onGetInputs = function() { + return [["enabled", "boolean"]]; + }; + + /* + Subgraph.prototype.onDrawTitle = function(ctx) { + if (this.flags.collapsed) { + return; + } + + ctx.fillStyle = "#555"; + var w = LiteGraph.NODE_TITLE_HEIGHT; + var x = this.size[0] - w; + ctx.fillRect(x, -w, w, w); + ctx.fillStyle = "#333"; + ctx.beginPath(); + ctx.moveTo(x + w * 0.2, -w * 0.6); + ctx.lineTo(x + w * 0.8, -w * 0.6); + ctx.lineTo(x + w * 0.5, -w * 0.3); + ctx.fill(); + }; + */ + + Subgraph.prototype.onDblClick = function(e, pos, graphcanvas) { + var that = this; + setTimeout(function() { + graphcanvas.openSubgraph(that.subgraph); + }, 10); + }; + + /* + Subgraph.prototype.onMouseDown = function(e, pos, graphcanvas) { + if ( + !this.flags.collapsed && + pos[0] > this.size[0] - LiteGraph.NODE_TITLE_HEIGHT && + pos[1] < 0 + ) { + var that = this; + setTimeout(function() { + graphcanvas.openSubgraph(that.subgraph); + }, 10); + } + }; + */ + + Subgraph.prototype.onAction = function(action, param) { + this.subgraph.onAction(action, param); + }; + + Subgraph.prototype.onExecute = function() { + this.enabled = this.getInputOrProperty("enabled"); + if (!this.enabled) { + return; + } + + //send inputs to subgraph global inputs + if (this.inputs) { + for (var i = 0; i < this.inputs.length; i++) { + var input = this.inputs[i]; + var value = this.getInputData(i); + this.subgraph.setInputData(input.name, value); + } + } + + //execute + this.subgraph.runStep(); + + //send subgraph global outputs to outputs + if (this.outputs) { + for (var i = 0; i < this.outputs.length; i++) { + var output = this.outputs[i]; + var value = this.subgraph.getOutputData(output.name); + this.setOutputData(i, value); + } + } + }; + + Subgraph.prototype.sendEventToAllNodes = function(eventname, param, mode) { + if (this.enabled) { + this.subgraph.sendEventToAllNodes(eventname, param, mode); + } + }; + + Subgraph.prototype.onDrawBackground2 = function (ctx, graphcanvas, canvas, pos) { + if (this.flags.collapsed) + return; + var y = this.size[1] - LiteGraph.NODE_TITLE_HEIGHT + 0.5; + // button + var over = LiteGraph.isInsideRectangle(pos[0], pos[1], this.pos[0], this.pos[1] + y, this.size[0], LiteGraph.NODE_TITLE_HEIGHT); + let overleft = LiteGraph.isInsideRectangle(pos[0], pos[1], this.pos[0], this.pos[1] + y, this.size[0] / 2, LiteGraph.NODE_TITLE_HEIGHT) + ctx.fillStyle = over ? "#555" : "#222"; + ctx.beginPath(); + if (this._shape == LiteGraph.BOX_SHAPE) { + if (overleft) { + ctx.rect(0, y, this.size[0] / 2 + 1, LiteGraph.NODE_TITLE_HEIGHT); + } else { + ctx.rect(this.size[0] / 2, y, this.size[0] / 2 + 1, LiteGraph.NODE_TITLE_HEIGHT); + } + } + else { + if (overleft) { + ctx.roundRect(0, y, this.size[0] / 2 + 1, LiteGraph.NODE_TITLE_HEIGHT, [0,0, 8,8]); + } else { + ctx.roundRect(this.size[0] / 2, y, this.size[0] / 2 + 1, LiteGraph.NODE_TITLE_HEIGHT, [0,0, 8,8]); + } + } + if (over) { + ctx.fill(); + } else { + ctx.fillRect(0, y, this.size[0] + 1, LiteGraph.NODE_TITLE_HEIGHT); + } + // button + ctx.textAlign = "center"; + ctx.font = "24px Arial"; + ctx.fillStyle = over ? "#DDD" : "#999"; + ctx.fillText("+", this.size[0] * 0.25, y + 24); + ctx.fillText("+", this.size[0] * 0.75, y + 24); + } + + // Subgraph.prototype.onMouseDown = function(e, localpos, graphcanvas) + // { + // var y = this.size[1] - LiteGraph.NODE_TITLE_HEIGHT + 0.5; + // if(localpos[1] > y) + // { + // graphcanvas.showSubgraphPropertiesDialog(this); + // } + // } + Subgraph.prototype.onMouseDown = function (e, localpos, graphcanvas) { + var y = this.size[1] - LiteGraph.NODE_TITLE_HEIGHT + 0.5; + if (localpos[1] > y) { + if (localpos[0] < this.size[0] / 2) { + graphcanvas.showSubgraphPropertiesDialog(this); + } else { + graphcanvas.showSubgraphPropertiesDialogRight(this); + } + } + } + + + Subgraph.prototype.computeSize = function() + { + var font_size = LiteGraph.NODE_TEXT_SIZE; + function compute_text_size(text) { + if (!text) { + return 200; + } + return font_size * text.length; + } + var width = compute_text_size(this.title); + if (width < 200) + width = 200; + var num_inputs = this.inputs ? this.inputs.length : 0; + var num_outputs = this.outputs ? this.outputs.length : 0; + return [ width, Math.max(num_inputs,num_outputs) * LiteGraph.NODE_SLOT_HEIGHT + LiteGraph.NODE_TITLE_HEIGHT ]; + } + + //**** INPUTS *********************************** + Subgraph.prototype.onSubgraphTrigger = function(event, param) { + var slot = this.findOutputSlot(event); + if (slot != -1) { + this.triggerSlot(slot); + } + }; + + Subgraph.prototype.onSubgraphNewInput = function(name, type) { + var slot = this.findInputSlot(name); + if (slot == -1) { + //add input to the node + this.addInput(name, type); + } + }; + + Subgraph.prototype.onSubgraphRenamedInput = function(oldname, name) { + var slot = this.findInputSlot(oldname); + if (slot == -1) { + return; + } + var info = this.getInputInfo(slot); + info.name = name; + }; + + Subgraph.prototype.onSubgraphTypeChangeInput = function(name, type) { + var slot = this.findInputSlot(name); + if (slot == -1) { + return; + } + var info = this.getInputInfo(slot); + info.type = type; + }; + + Subgraph.prototype.onSubgraphRemovedInput = function(name) { + var slot = this.findInputSlot(name); + if (slot == -1) { + return; + } + this.removeInput(slot); + }; + + //**** OUTPUTS *********************************** + Subgraph.prototype.onSubgraphNewOutput = function(name, type) { + var slot = this.findOutputSlot(name); + if (slot == -1) { + this.addOutput(name, type); + } + }; + + Subgraph.prototype.onSubgraphRenamedOutput = function(oldname, name) { + var slot = this.findOutputSlot(oldname); + if (slot == -1) { + return; + } + var info = this.getOutputInfo(slot); + info.name = name; + }; + + Subgraph.prototype.onSubgraphTypeChangeOutput = function(name, type) { + var slot = this.findOutputSlot(name); + if (slot == -1) { + return; + } + var info = this.getOutputInfo(slot); + info.type = type; + }; + + Subgraph.prototype.onSubgraphRemovedOutput = function(name) { + var slot = this.findOutputSlot(name); + if (slot == -1) { + return; + } + this.removeOutput(slot); + }; + // ***************************************************** + + Subgraph.prototype.getExtraMenuOptions = function(graphcanvas) { + var that = this; + return [ + { + content: "Open", + callback: function() { + graphcanvas.openSubgraph(that.subgraph); + } + } + ]; + }; + + Subgraph.prototype.onResize = function(size) { + size[1] += 20; + }; + + Subgraph.prototype.serialize = function() { + var data = LiteGraph.LGraphNode.prototype.serialize.call(this); + data.subgraph = this.subgraph.serialize(); + return data; + }; + //no need to define node.configure, the default method detects node.subgraph and passes the object to node.subgraph.configure() + + Subgraph.prototype.reassignSubgraphUUIDs = function(graph) { + const idMap = { nodeIDs: {}, linkIDs: {} } + + for (const node of graph.nodes) { + const oldID = node.id + const newID = LiteGraph.uuidv4() + node.id = newID + + if (idMap.nodeIDs[oldID] || idMap.nodeIDs[newID]) { + throw new Error(`New/old node UUID wasn't unique in changed map! ${oldID} ${newID}`) + } + + idMap.nodeIDs[oldID] = newID + idMap.nodeIDs[newID] = oldID + } + + for (const link of graph.links) { + const oldID = link[0] + const newID = LiteGraph.uuidv4(); + link[0] = newID + + if (idMap.linkIDs[oldID] || idMap.linkIDs[newID]) { + throw new Error(`New/old link UUID wasn't unique in changed map! ${oldID} ${newID}`) + } + + idMap.linkIDs[oldID] = newID + idMap.linkIDs[newID] = oldID + + const nodeFrom = link[1] + const nodeTo = link[3] + + if (!idMap.nodeIDs[nodeFrom]) { + throw new Error(`Old node UUID not found in mapping! ${nodeFrom}`) + } + + link[1] = idMap.nodeIDs[nodeFrom] + + if (!idMap.nodeIDs[nodeTo]) { + throw new Error(`Old node UUID not found in mapping! ${nodeTo}`) + } + + link[3] = idMap.nodeIDs[nodeTo] + } + + // Reconnect links + for (const node of graph.nodes) { + if (node.inputs) { + for (const input of node.inputs) { + if (input.link) { + input.link = idMap.linkIDs[input.link] + } + } + } + if (node.outputs) { + for (const output of node.outputs) { + if (output.links) { + output.links = output.links.map(l => idMap.linkIDs[l]); + } + } + } + } + + // Recurse! + for (const node of graph.nodes) { + if (node.type === "graph/subgraph") { + const merge = reassignGraphUUIDs(node.subgraph); + idMap.nodeIDs.assign(merge.nodeIDs) + idMap.linkIDs.assign(merge.linkIDs) + } + } + }; + + Subgraph.prototype.clone = function() { + var node = LiteGraph.createNode(this.type); + var data = this.serialize(); + + if (LiteGraph.use_uuids) { + // LGraph.serialize() seems to reuse objects in the original graph. But we + // need to change node IDs here, so clone it first. + const subgraph = LiteGraph.cloneObject(data.subgraph) + + this.reassignSubgraphUUIDs(subgraph); + + data.subgraph = subgraph; + } + + delete data["id"]; + delete data["inputs"]; + delete data["outputs"]; + node.configure(data); + return node; + }; + + Subgraph.prototype.buildFromNodes = function(nodes) + { + //clear all? + //TODO + + //nodes that connect data between parent graph and subgraph + var subgraph_inputs = []; + var subgraph_outputs = []; + + //mark inner nodes + var ids = {}; + var min_x = 0; + var max_x = 0; + for(var i = 0; i < nodes.length; ++i) + { + var node = nodes[i]; + ids[ node.id ] = node; + min_x = Math.min( node.pos[0], min_x ); + max_x = Math.max( node.pos[0], min_x ); + } + + var last_input_y = 0; + var last_output_y = 0; + + for(var i = 0; i < nodes.length; ++i) + { + var node = nodes[i]; + //check inputs + if( node.inputs ) + for(var j = 0; j < node.inputs.length; ++j) + { + var input = node.inputs[j]; + if( !input || !input.link ) + continue; + var link = node.graph.links[ input.link ]; + if(!link) + continue; + if( ids[ link.origin_id ] ) + continue; + //this.addInput(input.name,link.type); + this.subgraph.addInput(input.name,link.type); + /* + var input_node = LiteGraph.createNode("graph/input"); + this.subgraph.add( input_node ); + input_node.pos = [min_x - 200, last_input_y ]; + last_input_y += 100; + */ + } + + //check outputs + if( node.outputs ) + for(var j = 0; j < node.outputs.length; ++j) + { + var output = node.outputs[j]; + if( !output || !output.links || !output.links.length ) + continue; + var is_external = false; + for(var k = 0; k < output.links.length; ++k) + { + var link = node.graph.links[ output.links[k] ]; + if(!link) + continue; + if( ids[ link.target_id ] ) + continue; + is_external = true; + break; + } + if(!is_external) + continue; + //this.addOutput(output.name,output.type); + /* + var output_node = LiteGraph.createNode("graph/output"); + this.subgraph.add( output_node ); + output_node.pos = [max_x + 50, last_output_y ]; + last_output_y += 100; + */ + } + } + + //detect inputs and outputs + //split every connection in two data_connection nodes + //keep track of internal connections + //connect external connections + + //clone nodes inside subgraph and try to reconnect them + + //connect edge subgraph nodes to extarnal connections nodes + } + + LiteGraph.Subgraph = Subgraph; + LiteGraph.registerNodeType("graph/subgraph", Subgraph); + + //Input for a subgraph + function GraphInput() { + this.addOutput("", "number"); + + this.name_in_graph = ""; + this.properties = { + name: "", + type: "number", + value: 0 + }; + + var that = this; + + this.name_widget = this.addWidget( + "text", + "Name", + this.properties.name, + function(v) { + if (!v) { + return; + } + that.setProperty("name",v); + } + ); + this.type_widget = this.addWidget( + "text", + "Type", + this.properties.type, + function(v) { + that.setProperty("type",v); + } + ); + + this.value_widget = this.addWidget( + "number", + "Value", + this.properties.value, + function(v) { + that.setProperty("value",v); + } + ); + + this.widgets_up = true; + this.size = [180, 90]; + } + + GraphInput.title = "Input"; + GraphInput.desc = "Input of the graph"; + + GraphInput.prototype.onConfigure = function() + + { + this.updateType(); + } + + //ensures the type in the node output and the type in the associated graph input are the same + GraphInput.prototype.updateType = function() + { + var type = this.properties.type; + this.type_widget.value = type; + + //update output + if(this.outputs[0].type != type) + { + if (!LiteGraph.isValidConnection(this.outputs[0].type,type)) + this.disconnectOutput(0); + this.outputs[0].type = type; + } + + //update widget + if(type == "number") + { + this.value_widget.type = "number"; + this.value_widget.value = 0; + } + else if(type == "boolean") + { + this.value_widget.type = "toggle"; + this.value_widget.value = true; + } + else if(type == "string") + { + this.value_widget.type = "text"; + this.value_widget.value = ""; + } + else + { + this.value_widget.type = null; + this.value_widget.value = null; + } + this.properties.value = this.value_widget.value; + + //update graph + if (this.graph && this.name_in_graph) { + this.graph.changeInputType(this.name_in_graph, type); + } + } + + //this is executed AFTER the property has changed + GraphInput.prototype.onPropertyChanged = function(name,v) + { + if( name == "name" ) + { + if (v == "" || v == this.name_in_graph || v == "enabled") { + return false; + } + if(this.graph) + { + if (this.name_in_graph) { + //already added + this.graph.renameInput( this.name_in_graph, v ); + } else { + this.graph.addInput( v, this.properties.type ); + } + } //what if not?! + this.name_widget.value = v; + this.name_in_graph = v; + } + else if( name == "type" ) + { + this.updateType(); + } + else if( name == "value" ) + { + } + } + + GraphInput.prototype.getTitle = function() { + if (this.flags.collapsed) { + return this.properties.name; + } + return this.title; + }; + + GraphInput.prototype.onAction = function(action, param) { + if (this.properties.type == LiteGraph.EVENT) { + this.triggerSlot(0, param); + } + }; + + GraphInput.prototype.onExecute = function() { + var name = this.properties.name; + //read from global input + var data = this.graph.inputs[name]; + if (!data) { + this.setOutputData(0, this.properties.value ); + return; + } + + this.setOutputData(0, data.value !== undefined ? data.value : this.properties.value ); + }; + + GraphInput.prototype.onRemoved = function() { + if (this.name_in_graph) { + this.graph.removeInput(this.name_in_graph); + } + }; + + LiteGraph.GraphInput = GraphInput; + //LiteGraph.registerNodeType("graph/input", GraphInput); + + //Output for a subgraph + function GraphOutput() { + this.addInput("", ""); + + this.name_in_graph = ""; + this.properties = { name: "", type: "" }; + var that = this; + + // Object.defineProperty(this.properties, "name", { + // get: function() { + // return that.name_in_graph; + // }, + // set: function(v) { + // if (v == "" || v == that.name_in_graph) { + // return; + // } + // if (that.name_in_graph) { + // //already added + // that.graph.renameOutput(that.name_in_graph, v); + // } else { + // that.graph.addOutput(v, that.properties.type); + // } + // that.name_widget.value = v; + // that.name_in_graph = v; + // }, + // enumerable: true + // }); + + // Object.defineProperty(this.properties, "type", { + // get: function() { + // return that.inputs[0].type; + // }, + // set: function(v) { + // if (v == "action" || v == "event") { + // v = LiteGraph.ACTION; + // } + // if (!LiteGraph.isValidConnection(that.inputs[0].type,v)) + // that.disconnectInput(0); + // that.inputs[0].type = v; + // if (that.name_in_graph) { + // //already added + // that.graph.changeOutputType( + // that.name_in_graph, + // that.inputs[0].type + // ); + // } + // that.type_widget.value = v || ""; + // }, + // enumerable: true + // }); + + this.name_widget = this.addWidget("text","Name",this.properties.name,"name"); + this.type_widget = this.addWidget("text","Type",this.properties.type,"type"); + this.widgets_up = true; + this.size = [180, 60]; + } + + GraphOutput.title = "Output"; + GraphOutput.desc = "Output of the graph"; + + GraphOutput.prototype.onPropertyChanged = function (name, v) { + if (name == "name") { + if (v == "" || v == this.name_in_graph || v == "enabled") { + return false; + } + if (this.graph) { + if (this.name_in_graph) { + //already added + this.graph.renameOutput(this.name_in_graph, v); + } else { + this.graph.addOutput(v, this.properties.type); + } + } //what if not?! + this.name_widget.value = v; + this.name_in_graph = v; + } + else if (name == "type") { + this.updateType(); + } + else if (name == "value") { + } + } + + GraphOutput.prototype.updateType = function () { + var type = this.properties.type; + if (this.type_widget) + this.type_widget.value = type; + + //update output + if (this.inputs[0].type != type) { + + if ( type == "action" || type == "event") + type = LiteGraph.EVENT; + if (!LiteGraph.isValidConnection(this.inputs[0].type, type)) + this.disconnectInput(0); + this.inputs[0].type = type; + } + + //update graph + if (this.graph && this.name_in_graph) { + this.graph.changeOutputType(this.name_in_graph, type); + } + } + + + + GraphOutput.prototype.onExecute = function() { + this._value = this.getInputData(0); + this.graph.setOutputData(this.properties.name, this._value); + }; + + GraphOutput.prototype.onAction = function(action, param) { + if (this.properties.type == LiteGraph.ACTION) { + this.graph.trigger( this.properties.name, param ); + } + }; + + GraphOutput.prototype.onRemoved = function() { + if (this.name_in_graph) { + this.graph.removeOutput(this.name_in_graph); + } + }; + + GraphOutput.prototype.getTitle = function() { + if (this.flags.collapsed) { + return this.properties.name; + } + return this.title; + }; + + LiteGraph.GraphOutput = GraphOutput; + //LiteGraph.registerNodeType("graph/output", GraphOutput); + + //Constant + function ConstantNumber() { + this.addOutput("value", "number"); + this.addProperty("value", 1.0); + this.widget = this.addWidget("number","value",1,"value"); + this.widgets_up = true; + this.size = [180, 30]; + } + + ConstantNumber.title = "Const Number"; + ConstantNumber.desc = "Constant number"; + + ConstantNumber.prototype.onExecute = function() { + this.setOutputData(0, parseFloat(this.properties["value"])); + }; + + ConstantNumber.prototype.getTitle = function() { + if (this.flags.collapsed) { + return this.properties.value; + } + return this.title; + }; + + ConstantNumber.prototype.setValue = function(v) + { + this.setProperty("value",v); + } + + ConstantNumber.prototype.onDrawBackground = function(ctx) { + //show the current value + this.outputs[0].label = this.properties["value"].toFixed(3); + }; + + //LiteGraph.registerNodeType("basic/const", ConstantNumber); + + function ConstantBoolean() { + this.addOutput("bool", "boolean"); + this.addProperty("value", true); + this.widget = this.addWidget("toggle","value",true,"value"); + this.serialize_widgets = true; + this.widgets_up = true; + this.size = [140, 30]; + } + + ConstantBoolean.title = "Const Boolean"; + ConstantBoolean.desc = "Constant boolean"; + ConstantBoolean.prototype.getTitle = ConstantNumber.prototype.getTitle; + + ConstantBoolean.prototype.onExecute = function() { + this.setOutputData(0, this.properties["value"]); + }; + + ConstantBoolean.prototype.setValue = ConstantNumber.prototype.setValue; + + ConstantBoolean.prototype.onGetInputs = function() { + return [["toggle", LiteGraph.ACTION]]; + }; + + ConstantBoolean.prototype.onAction = function(action) + { + this.setValue( !this.properties.value ); + } + + //LiteGraph.registerNodeType("basic/boolean", ConstantBoolean); + + function ConstantString() { + this.addOutput("string", "string"); + this.addProperty("value", ""); + this.widget = this.addWidget("text","value","","value"); //link to property value + this.widgets_up = true; + this.size = [180, 30]; + } + + ConstantString.title = "Const String"; + ConstantString.desc = "Constant string"; + + ConstantString.prototype.getTitle = ConstantNumber.prototype.getTitle; + + ConstantString.prototype.onExecute = function() { + this.setOutputData(0, this.properties["value"]); + }; + + ConstantString.prototype.setValue = ConstantNumber.prototype.setValue; + + ConstantString.prototype.onDropFile = function(file) + { + var that = this; + var reader = new FileReader(); + reader.onload = function(e) + { + that.setProperty("value",e.target.result); + } + reader.readAsText(file); + } + + //LiteGraph.registerNodeType("basic/string", ConstantString); + + function ConstantObject() { + this.addOutput("obj", "object"); + this.size = [120, 30]; + this._object = {}; + } + + ConstantObject.title = "Const Object"; + ConstantObject.desc = "Constant Object"; + + ConstantObject.prototype.onExecute = function() { + this.setOutputData(0, this._object); + }; + + //LiteGraph.registerNodeType("basic/object", ConstantObject ); + + function ConstantFile() { + this.addInput("url", "string"); + this.addOutput("file", "string"); + this.addProperty("url", ""); + this.addProperty("type", "text"); + this.widget = this.addWidget("text","url","","url"); + this._data = null; + } + + ConstantFile.title = "Const File"; + ConstantFile.desc = "Fetches a file from an url"; + ConstantFile["@type"] = { type: "enum", values: ["text","arraybuffer","blob","json"] }; + + ConstantFile.prototype.onPropertyChanged = function(name, value) { + if (name == "url") + { + if( value == null || value == "") + this._data = null; + else + { + this.fetchFile(value); + } + } + } + + ConstantFile.prototype.onExecute = function() { + var url = this.getInputData(0) || this.properties.url; + if(url && (url != this._url || this._type != this.properties.type)) + this.fetchFile(url); + this.setOutputData(0, this._data ); + }; + + ConstantFile.prototype.setValue = ConstantNumber.prototype.setValue; + + ConstantFile.prototype.fetchFile = function(url) { + var that = this; + if(!url || url.constructor !== String) + { + that._data = null; + that.boxcolor = null; + return; + } + + this._url = url; + this._type = this.properties.type; + if (url.substr(0, 4) == "http" && LiteGraph.proxy) { + url = LiteGraph.proxy + url.substr(url.indexOf(":") + 3); + } + fetch(url) + .then(function(response) { + if(!response.ok) + throw new Error("File not found"); + + if(that.properties.type == "arraybuffer") + return response.arrayBuffer(); + else if(that.properties.type == "text") + return response.text(); + else if(that.properties.type == "json") + return response.json(); + else if(that.properties.type == "blob") + return response.blob(); + }) + .then(function(data) { + that._data = data; + that.boxcolor = "#AEA"; + }) + .catch(function(error) { + that._data = null; + that.boxcolor = "red"; + console.error("error fetching file:",url); + }); + }; + + ConstantFile.prototype.onDropFile = function(file) + { + var that = this; + this._url = file.name; + this._type = this.properties.type; + this.properties.url = file.name; + var reader = new FileReader(); + reader.onload = function(e) + { + that.boxcolor = "#AEA"; + var v = e.target.result; + if( that.properties.type == "json" ) + v = JSON.parse(v); + that._data = v; + } + if(that.properties.type == "arraybuffer") + reader.readAsArrayBuffer(file); + else if(that.properties.type == "text" || that.properties.type == "json") + reader.readAsText(file); + else if(that.properties.type == "blob") + return reader.readAsBinaryString(file); + } + + //LiteGraph.registerNodeType("basic/file", ConstantFile); + + +//to store json objects +function JSONParse() { + this.addInput("parse", LiteGraph.ACTION); + this.addInput("json", "string"); + this.addOutput("done", LiteGraph.EVENT); + this.addOutput("object", "object"); + this.widget = this.addWidget("button","parse","",this.parse.bind(this)); + this._str = null; + this._obj = null; +} + +JSONParse.title = "JSON Parse"; +JSONParse.desc = "Parses JSON String into object"; + +JSONParse.prototype.parse = function() +{ + if(!this._str) + return; + + try { + this._str = this.getInputData(1); + this._obj = JSON.parse(this._str); + this.boxcolor = "#AEA"; + this.triggerSlot(0); + } catch (err) { + this.boxcolor = "red"; + } +} + +JSONParse.prototype.onExecute = function() { + this._str = this.getInputData(1); + this.setOutputData(1, this._obj); +}; + +JSONParse.prototype.onAction = function(name) { + if(name == "parse") + this.parse(); +} + +//LiteGraph.registerNodeType("basic/jsonparse", JSONParse); + + //to store json objects + function ConstantData() { + this.addOutput("data", "object"); + this.addProperty("value", ""); + this.widget = this.addWidget("text","json","","value"); + this.widgets_up = true; + this.size = [140, 30]; + this._value = null; + } + + ConstantData.title = "Const Data"; + ConstantData.desc = "Constant Data"; + + ConstantData.prototype.onPropertyChanged = function(name, value) { + this.widget.value = value; + if (value == null || value == "") { + return; + } + + try { + this._value = JSON.parse(value); + this.boxcolor = "#AEA"; + } catch (err) { + this.boxcolor = "red"; + } + }; + + ConstantData.prototype.onExecute = function() { + this.setOutputData(0, this._value); + }; + + ConstantData.prototype.setValue = ConstantNumber.prototype.setValue; + + //LiteGraph.registerNodeType("basic/data", ConstantData); + + //to store json objects + function ConstantArray() { + this._value = []; + this.addInput("json", ""); + this.addOutput("arrayOut", "array"); + this.addOutput("length", "number"); + this.addProperty("value", "[]"); + this.widget = this.addWidget("text","array",this.properties.value,"value"); + this.widgets_up = true; + this.size = [140, 50]; + } + + ConstantArray.title = "Const Array"; + ConstantArray.desc = "Constant Array"; + + ConstantArray.prototype.onPropertyChanged = function(name, value) { + this.widget.value = value; + if (value == null || value == "") { + return; + } + + try { + if(value[0] != "[") + this._value = JSON.parse("[" + value + "]"); + else + this._value = JSON.parse(value); + this.boxcolor = "#AEA"; + } catch (err) { + this.boxcolor = "red"; + } + }; + + ConstantArray.prototype.onExecute = function() { + var v = this.getInputData(0); + if(v && v.length) //clone + { + if(!this._value) + this._value = new Array(); + this._value.length = v.length; + for(var i = 0; i < v.length; ++i) + this._value[i] = v[i]; + } + this.setOutputData(0, this._value); + this.setOutputData(1, this._value ? ( this._value.length || 0) : 0 ); + }; + + ConstantArray.prototype.setValue = ConstantNumber.prototype.setValue; + + //LiteGraph.registerNodeType("basic/array", ConstantArray); + + function SetArray() + { + this.addInput("arr", "array"); + this.addInput("value", ""); + this.addOutput("arr", "array"); + this.properties = { index: 0 }; + this.widget = this.addWidget("number","i",this.properties.index,"index",{precision: 0, step: 10, min: 0}); + } + + SetArray.title = "Set Array"; + SetArray.desc = "Sets index of array"; + + SetArray.prototype.onExecute = function() { + var arr = this.getInputData(0); + if(!arr) + return; + var v = this.getInputData(1); + if(v === undefined ) + return; + if(this.properties.index) + arr[ Math.floor(this.properties.index) ] = v; + this.setOutputData(0,arr); + }; + + //LiteGraph.registerNodeType("basic/set_array", SetArray ); + + function ArrayElement() { + this.addInput("array", "array,table,string"); + this.addInput("index", "number"); + this.addOutput("value", ""); + this.addProperty("index",0); + } + + ArrayElement.title = "Array[i]"; + ArrayElement.desc = "Returns an element from an array"; + + ArrayElement.prototype.onExecute = function() { + var array = this.getInputData(0); + var index = this.getInputData(1); + if(index == null) + index = this.properties.index; + if(array == null || index == null ) + return; + this.setOutputData(0, array[Math.floor(Number(index))] ); + }; + + //LiteGraph.registerNodeType("basic/array[]", ArrayElement); + + function TableElement() { + this.addInput("table", "table"); + this.addInput("row", "number"); + this.addInput("col", "number"); + this.addOutput("value", ""); + this.addProperty("row",0); + this.addProperty("column",0); + } + + TableElement.title = "Table[row][col]"; + TableElement.desc = "Returns an element from a table"; + + TableElement.prototype.onExecute = function() { + var table = this.getInputData(0); + var row = this.getInputData(1); + var col = this.getInputData(2); + if(row == null) + row = this.properties.row; + if(col == null) + col = this.properties.column; + if(table == null || row == null || col == null) + return; + var row = table[Math.floor(Number(row))]; + if(row) + this.setOutputData(0, row[Math.floor(Number(col))] ); + else + this.setOutputData(0, null ); + }; + + //LiteGraph.registerNodeType("basic/table[][]", TableElement); + + function ObjectProperty() { + this.addInput("obj", "object"); + this.addOutput("property", 0); + this.addProperty("value", 0); + this.widget = this.addWidget("text","prop.","",this.setValue.bind(this) ); + this.widgets_up = true; + this.size = [140, 30]; + this._value = null; + } + + ObjectProperty.title = "Object property"; + ObjectProperty.desc = "Outputs the property of an object"; + + ObjectProperty.prototype.setValue = function(v) { + this.properties.value = v; + this.widget.value = v; + }; + + ObjectProperty.prototype.getTitle = function() { + if (this.flags.collapsed) { + return "in." + this.properties.value; + } + return this.title; + }; + + ObjectProperty.prototype.onPropertyChanged = function(name, value) { + this.widget.value = value; + }; + + ObjectProperty.prototype.onExecute = function() { + var data = this.getInputData(0); + if (data != null) { + this.setOutputData(0, data[this.properties.value]); + } + }; + + //LiteGraph.registerNodeType("basic/object_property", ObjectProperty); + + function ObjectKeys() { + this.addInput("obj", ""); + this.addOutput("keys", "array"); + this.size = [140, 30]; + } + + ObjectKeys.title = "Object keys"; + ObjectKeys.desc = "Outputs an array with the keys of an object"; + + ObjectKeys.prototype.onExecute = function() { + var data = this.getInputData(0); + if (data != null) { + this.setOutputData(0, Object.keys(data) ); + } + }; + + //LiteGraph.registerNodeType("basic/object_keys", ObjectKeys); + + + function SetObject() + { + this.addInput("obj", ""); + this.addInput("value", ""); + this.addOutput("obj", ""); + this.properties = { property: "" }; + this.name_widget = this.addWidget("text","prop.",this.properties.property,"property"); + } + + SetObject.title = "Set Object"; + SetObject.desc = "Adds propertiesrty to object"; + + SetObject.prototype.onExecute = function() { + var obj = this.getInputData(0); + if(!obj) + return; + var v = this.getInputData(1); + if(v === undefined ) + return; + if(this.properties.property) + obj[ this.properties.property ] = v; + this.setOutputData(0,obj); + }; + + //LiteGraph.registerNodeType("basic/set_object", SetObject ); + + + function MergeObjects() { + this.addInput("A", "object"); + this.addInput("B", "object"); + this.addOutput("out", "object"); + this._result = {}; + var that = this; + this.addWidget("button","clear","",function(){ + that._result = {}; + }); + this.size = this.computeSize(); + } + + MergeObjects.title = "Merge Objects"; + MergeObjects.desc = "Creates an object copying properties from others"; + + MergeObjects.prototype.onExecute = function() { + var A = this.getInputData(0); + var B = this.getInputData(1); + var C = this._result; + if(A) + for(var i in A) + C[i] = A[i]; + if(B) + for(var i in B) + C[i] = B[i]; + this.setOutputData(0,C); + }; + + //LiteGraph.registerNodeType("basic/merge_objects", MergeObjects ); + + //Store as variable + function Variable() { + this.size = [60, 30]; + this.addInput("in"); + this.addOutput("out"); + this.properties = { varname: "myname", container: Variable.LITEGRAPH }; + this.value = null; + } + + Variable.title = "Variable"; + Variable.desc = "store/read variable value"; + + Variable.LITEGRAPH = 0; //between all graphs + Variable.GRAPH = 1; //only inside this graph + Variable.GLOBALSCOPE = 2; //attached to Window + + Variable["@container"] = { type: "enum", values: {"litegraph":Variable.LITEGRAPH, "graph":Variable.GRAPH,"global": Variable.GLOBALSCOPE} }; + + Variable.prototype.onExecute = function() { + var container = this.getContainer(); + + if(this.isInputConnected(0)) + { + this.value = this.getInputData(0); + container[ this.properties.varname ] = this.value; + this.setOutputData(0, this.value ); + return; + } + + this.setOutputData( 0, container[ this.properties.varname ] ); + }; + + Variable.prototype.getContainer = function() + { + switch(this.properties.container) + { + case Variable.GRAPH: + if(this.graph) + return this.graph.vars; + return {}; + break; + case Variable.GLOBALSCOPE: + return global; + break; + case Variable.LITEGRAPH: + default: + return LiteGraph.Globals; + break; + } + } + + Variable.prototype.getTitle = function() { + return this.properties.varname; + }; + + //LiteGraph.registerNodeType("basic/variable", Variable); + + function length(v) { + if(v && v.length != null) + return Number(v.length); + return 0; + } + + /*LiteGraph.wrapFunctionAsNode( + "basic/length", + length, + [""], + "number" + );*/ + + function length(v) { + if(v && v.length != null) + return Number(v.length); + return 0; + } + + /* LiteGraph.wrapFunctionAsNode( + "basic/not", + function(a){ return !a; }, + [""], + "boolean" + ); */ + + function DownloadData() { + this.size = [60, 30]; + this.addInput("data", 0 ); + this.addInput("download", LiteGraph.ACTION ); + this.properties = { filename: "data.json" }; + this.value = null; + var that = this; + this.addWidget("button","Download","", function(v){ + if(!that.value) + return; + that.downloadAsFile(); + }); + } + + DownloadData.title = "Download"; + DownloadData.desc = "Download some data"; + + DownloadData.prototype.downloadAsFile = function() + { + if(this.value == null) + return; + + var str = null; + if(this.value.constructor === String) + str = this.value; + else + str = JSON.stringify(this.value); + + var file = new Blob([str]); + var url = URL.createObjectURL( file ); + var element = document.createElement("a"); + element.setAttribute('href', url); + element.setAttribute('download', this.properties.filename ); + element.style.display = 'none'; + document.body.appendChild(element); + element.click(); + document.body.removeChild(element); + setTimeout( function(){ URL.revokeObjectURL( url ); }, 1000*60 ); //wait one minute to revoke url + } + + DownloadData.prototype.onAction = function(action, param) { + var that = this; + setTimeout( function(){ that.downloadAsFile(); }, 100); //deferred to avoid blocking the renderer with the popup + } + + DownloadData.prototype.onExecute = function() { + if (this.inputs[0]) { + this.value = this.getInputData(0); + } + }; + + DownloadData.prototype.getTitle = function() { + if (this.flags.collapsed) { + return this.properties.filename; + } + return this.title; + }; + + //LiteGraph.registerNodeType("basic/download", DownloadData); + + + + //Watch a value in the editor + function Watch() { + this.size = [60, 30]; + this.addInput("value", 0, { label: "" }); + this.value = 0; + } + + Watch.title = "Watch"; + Watch.desc = "Show value of input"; + + Watch.prototype.onExecute = function() { + if (this.inputs[0]) { + this.value = this.getInputData(0); + } + }; + + Watch.prototype.getTitle = function() { + if (this.flags.collapsed) { + return this.inputs[0].label; + } + return this.title; + }; + + Watch.toString = function(o) { + if (o == null) { + return "null"; + } else if (o.constructor === Number) { + return o.toFixed(3); + } else if (o.constructor === Array) { + var str = "["; + for (var i = 0; i < o.length; ++i) { + str += Watch.toString(o[i]) + (i + 1 != o.length ? "," : ""); + } + str += "]"; + return str; + } else { + return String(o); + } + }; + + Watch.prototype.onDrawBackground = function(ctx) { + //show the current value + this.inputs[0].label = Watch.toString(this.value); + }; + + //LiteGraph.registerNodeType("basic/watch", Watch); + + //in case one type doesnt match other type but you want to connect them anyway + function Cast() { + this.addInput("in", 0); + this.addOutput("out", 0); + this.size = [40, 30]; + } + + Cast.title = "Cast"; + Cast.desc = "Allows to connect different types"; + + Cast.prototype.onExecute = function() { + this.setOutputData(0, this.getInputData(0)); + }; + + //LiteGraph.registerNodeType("basic/cast", Cast); + + //Show value inside the debug console + function Console() { + this.mode = LiteGraph.ON_EVENT; + this.size = [80, 30]; + this.addProperty("msg", ""); + this.addInput("log", LiteGraph.EVENT); + this.addInput("msg", 0); + } + + Console.title = "Console"; + Console.desc = "Show value inside the console"; + + Console.prototype.onAction = function(action, param) { + // param is the action + var msg = this.getInputData(1); //getInputDataByName("msg"); + //if (msg == null || typeof msg == "undefined") return; + if (!msg) msg = this.properties.msg; + if (!msg) msg = "Event: "+param; // msg is undefined if the slot is lost? + if (action == "log") { + console.log(msg); + } else if (action == "warn") { + console.warn(msg); + } else if (action == "error") { + console.error(msg); + } + }; + + Console.prototype.onExecute = function() { + var msg = this.getInputData(1); //getInputDataByName("msg"); + if (!msg) msg = this.properties.msg; + if (msg != null && typeof msg != "undefined") { + this.properties.msg = msg; + console.log(msg); + } + }; + + Console.prototype.onGetInputs = function() { + return [ + ["log", LiteGraph.ACTION], + ["warn", LiteGraph.ACTION], + ["error", LiteGraph.ACTION] + ]; + }; + + //LiteGraph.registerNodeType("basic/console", Console); + + //Show value inside the debug console + function Alert() { + this.mode = LiteGraph.ON_EVENT; + this.addProperty("msg", ""); + this.addInput("", LiteGraph.EVENT); + var that = this; + this.widget = this.addWidget("text", "Text", "", "msg"); + this.widgets_up = true; + this.size = [200, 30]; + } + + Alert.title = "Alert"; + Alert.desc = "Show an alert window"; + Alert.color = "#510"; + + Alert.prototype.onConfigure = function(o) { + this.widget.value = o.properties.msg; + }; + + Alert.prototype.onAction = function(action, param) { + var msg = this.properties.msg; + setTimeout(function() { + alert(msg); + }, 10); + }; + + //LiteGraph.registerNodeType("basic/alert", Alert); + + //Execites simple code + function NodeScript() { + this.size = [60, 30]; + this.addProperty("onExecute", "return A;"); + this.addInput("A", 0); + this.addInput("B", 0); + this.addOutput("out", 0); + + this._func = null; + this.data = {}; + } + + NodeScript.prototype.onConfigure = function(o) { + if (o.properties.onExecute && LiteGraph.allow_scripts) + this.compileCode(o.properties.onExecute); + else + console.warn("Script not compiled, LiteGraph.allow_scripts is false"); + }; + + NodeScript.title = "Script"; + NodeScript.desc = "executes a code (max 256 characters)"; + + NodeScript.widgets_info = { + onExecute: { type: "code" } + }; + + NodeScript.prototype.onPropertyChanged = function(name, value) { + if (name == "onExecute" && LiteGraph.allow_scripts) + this.compileCode(value); + else + console.warn("Script not compiled, LiteGraph.allow_scripts is false"); + }; + + NodeScript.prototype.compileCode = function(code) { + this._func = null; + if (code.length > 256) { + console.warn("Script too long, max 256 chars"); + } else { + var code_low = code.toLowerCase(); + var forbidden_words = [ + "script", + "body", + "document", + "eval", + "nodescript", + "function" + ]; //bad security solution + for (var i = 0; i < forbidden_words.length; ++i) { + if (code_low.indexOf(forbidden_words[i]) != -1) { + console.warn("invalid script"); + return; + } + } + try { + this._func = new Function("A", "B", "C", "DATA", "node", code); + } catch (err) { + console.error("Error parsing script"); + console.error(err); + } + } + }; + + NodeScript.prototype.onExecute = function() { + if (!this._func) { + return; + } + + try { + var A = this.getInputData(0); + var B = this.getInputData(1); + var C = this.getInputData(2); + this.setOutputData(0, this._func(A, B, C, this.data, this)); + } catch (err) { + console.error("Error in script"); + console.error(err); + } + }; + + NodeScript.prototype.onGetOutputs = function() { + return [["C", ""]]; + }; + + //LiteGraph.registerNodeType("basic/script", NodeScript); + + + function GenericCompare() { + this.addInput("A", 0); + this.addInput("B", 0); + this.addOutput("true", "boolean"); + this.addOutput("false", "boolean"); + this.addProperty("A", 1); + this.addProperty("B", 1); + this.addProperty("OP", "==", "enum", { values: GenericCompare.values }); + this.addWidget("combo","Op.",this.properties.OP,{ property: "OP", values: GenericCompare.values } ); + + this.size = [80, 60]; + } + + GenericCompare.values = ["==", "!="]; //[">", "<", "==", "!=", "<=", ">=", "||", "&&" ]; + GenericCompare["@OP"] = { + type: "enum", + title: "operation", + values: GenericCompare.values + }; + + GenericCompare.title = "Compare *"; + GenericCompare.desc = "evaluates condition between A and B"; + + GenericCompare.prototype.getTitle = function() { + return "*A " + this.properties.OP + " *B"; + }; + + GenericCompare.prototype.onExecute = function() { + var A = this.getInputData(0); + if (A === undefined) { + A = this.properties.A; + } else { + this.properties.A = A; + } + + var B = this.getInputData(1); + if (B === undefined) { + B = this.properties.B; + } else { + this.properties.B = B; + } + + var result = false; + if (typeof A == typeof B){ + switch (this.properties.OP) { + case "==": + case "!=": + // traverse both objects.. consider that this is not a true deep check! consider underscore or other library for thath :: _isEqual() + result = true; + switch(typeof A){ + case "object": + var aProps = Object.getOwnPropertyNames(A); + var bProps = Object.getOwnPropertyNames(B); + if (aProps.length != bProps.length){ + result = false; + break; + } + for (var i = 0; i < aProps.length; i++) { + var propName = aProps[i]; + if (A[propName] !== B[propName]) { + result = false; + break; + } + } + break; + default: + result = A == B; + } + if (this.properties.OP == "!=") result = !result; + break; + /*case ">": + result = A > B; + break; + case "<": + result = A < B; + break; + case "<=": + result = A <= B; + break; + case ">=": + result = A >= B; + break; + case "||": + result = A || B; + break; + case "&&": + result = A && B; + break;*/ + } + } + this.setOutputData(0, result); + this.setOutputData(1, !result); + }; + + //LiteGraph.registerNodeType("basic/CompareValues", GenericCompare); + +})(this); diff --git a/javascript/materialxtoy/litegraph/demos.js b/javascript/materialxtoy/litegraph/demos.js new file mode 100644 index 00000000..9bd0f804 --- /dev/null +++ b/javascript/materialxtoy/litegraph/demos.js @@ -0,0 +1,307 @@ + +function demo() +{ + multiConnection(); +} + +function multiConnection() +{ + var node_button = LiteGraph.createNode("widget/button"); + node_button.pos = [100,400]; + graph.add(node_button); + + var node_console = LiteGraph.createNode("basic/console"); + node_console.pos = [400,400]; + graph.add(node_console); + node_button.connect(0, node_console ); + + var node_const_A = LiteGraph.createNode("basic/const"); + node_const_A.pos = [200,200]; + graph.add(node_const_A); + node_const_A.setValue(4.5); + + var node_const_B = LiteGraph.createNode("basic/const"); + node_const_B.pos = [200,300]; + graph.add(node_const_B); + node_const_B.setValue(10); + + var node_math = LiteGraph.createNode("math/operation"); + node_math.pos = [400,200]; + graph.add(node_math); + + var node_watch = LiteGraph.createNode("basic/watch"); + node_watch.pos = [700,200]; + graph.add(node_watch); + + var node_watch2 = LiteGraph.createNode("basic/watch"); + node_watch2.pos = [700,300]; + graph.add(node_watch2); + + node_const_A.connect(0,node_math,0 ); + node_const_B.connect(0,node_math,1 ); + node_math.connect(0,node_watch,0 ); + node_math.connect(0,node_watch2,0 ); +} + +function CopyPasteWithConnectionToUnselectedOutputTest() +{ + // number + var nodeConstA = LiteGraph.createNode("basic/const"); + nodeConstA.pos = [200,200]; + graph.add(nodeConstA); + nodeConstA.setValue(4.5); + + // number + var nodeConstB = LiteGraph.createNode("basic/const"); + nodeConstB.pos = [200,300]; + graph.add(nodeConstB); + nodeConstB.setValue(10); + + // math + var nodeMath = LiteGraph.createNode("math/operation"); + nodeMath.pos = [400,200]; + graph.add(nodeMath); + + // connection + nodeConstA.connect(0,nodeMath,0 ); + nodeConstB.connect(0,nodeMath,1 ); + + // copy with unselected nodes connected + graphcanvas.selectNodes([nodeMath]); + graphcanvas.copyToClipboard(); + graphcanvas.pasteFromClipboard(true); + + var count = 1; + var lastNode = null; + for (const [key, element] of Object.entries(graphcanvas.selected_nodes)) { + element.pos = [nodeMath.pos[0], nodeMath.pos[1] + 100 * count]; + lastNode = element + count++; + } + + // copy with unselected nodes unconnected + graphcanvas.pasteFromClipboard(false); + var count = 1; + for (const [key, element] of Object.entries(graphcanvas.selected_nodes)) { + element.pos = [nodeMath.pos[0], lastNode.pos[1] + 100 * count]; + count++; + } +} + +function sortTest() +{ + var rand = LiteGraph.createNode("math/rand",null, {pos: [10,100] }); + graph.add(rand); + + var nodes = []; + for(var i = 4; i >= 1; i--) + { + var n = LiteGraph.createNode("basic/watch",null, {pos: [i * 120,100] }); + graph.add(n); + nodes[i-1] = n; + } + + rand.connect(0, nodes[0], 0); + + for(var i = 0; i < nodes.length - 1; i++) + nodes[i].connect(0,nodes[i+1], 0); +} + +function benchmark() +{ + var num_nodes = 200; + var nodes = []; + for(var i = 0; i < num_nodes; i++) + { + var n = LiteGraph.createNode("basic/watch",null, {pos: [(2000 * Math.random())|0, (2000 * Math.random())|0] }); + graph.add(n); + nodes.push(n); + } + + for(var i = 0; i < nodes.length; i++) + nodes[ (Math.random() * nodes.length)|0 ].connect(0, nodes[ (Math.random() * nodes.length)|0 ], 0 ); +} + + + +//Show value inside the debug console +function TestWidgetsNode() +{ + this.addOutput("","number"); + this.properties = {}; + var that = this; + this.slider = this.addWidget("slider","Slider", 0.5, function(v){}, { min: 0, max: 1} ); + this.number = this.addWidget("number","Number", 0.5, function(v){}, { min: 0, max: 100} ); + this.combo = this.addWidget("combo","Combo", "red", function(v){}, { values:["red","green","blue"]} ); + this.text = this.addWidget("text","Text", "edit me", function(v){}, {} ); + this.text2 = this.addWidget("text","Text", "multiline", function(v){}, { multiline:true } ); + this.toggle = this.addWidget("toggle","Toggle", true, function(v){}, { on: "enabled", off:"disabled"} ); + this.button = this.addWidget("button","Button", null, function(v){}, {} ); + this.toggle2 = this.addWidget("toggle","Disabled", true, function(v){}, { on: "enabled", off:"disabled"} ); + this.toggle2.disabled = true; + this.size = this.computeSize(); + this.serialize_widgets = true; +} + +TestWidgetsNode.title = "Widgets"; + +LiteGraph.registerNodeType("features/widgets", TestWidgetsNode ); + +//Show value inside the debug console +function TestSpecialNode() +{ + this.addInput("","number"); + this.addOutput("","number"); + this.properties = {}; + var that = this; + this.size = this.computeSize(); + this.enabled = false; + this.visible = false; +} + +TestSpecialNode.title = "Custom Shapes"; +TestSpecialNode.title_mode = LiteGraph.TRANSPARENT_TITLE; +TestSpecialNode.slot_start_y = 20; + +TestSpecialNode.prototype.onDrawBackground = function(ctx) +{ + if(this.flags.collapsed) + return; + + ctx.fillStyle = "#555"; + ctx.fillRect(0,0,this.size[0],20); + + if(this.enabled) + { + ctx.fillStyle = "#AFB"; + ctx.beginPath(); + ctx.moveTo(this.size[0]-20,0); + ctx.lineTo(this.size[0]-25,20); + ctx.lineTo(this.size[0],20); + ctx.lineTo(this.size[0],0); + ctx.fill(); + } + + if(this.visible) + { + ctx.fillStyle = "#ABF"; + ctx.beginPath(); + ctx.moveTo(this.size[0]-40,0); + ctx.lineTo(this.size[0]-45,20); + ctx.lineTo(this.size[0]-25,20); + ctx.lineTo(this.size[0]-20,0); + ctx.fill(); + } + + ctx.strokeStyle = "#333"; + ctx.beginPath(); + ctx.moveTo(0,20); + ctx.lineTo(this.size[0]+1,20); + ctx.moveTo(this.size[0]-20,0); + ctx.lineTo(this.size[0]-25,20); + ctx.moveTo(this.size[0]-40,0); + ctx.lineTo(this.size[0]-45,20); + ctx.stroke(); + + if( this.mouseOver ) + { + ctx.fillStyle = "#AAA"; + ctx.fillText( "Example of helper", 0, this.size[1] + 14 ); + } +} + +TestSpecialNode.prototype.onMouseDown = function(e, pos) +{ + if(pos[1] > 20) + return; + + if( pos[0] > this.size[0] - 20) + this.enabled = !this.enabled; + else if( pos[0] > this.size[0] - 40) + this.visible = !this.visible; +} + +TestSpecialNode.prototype.onBounding = function(rect) +{ + if(!this.flags.collapsed && this.mouseOver ) + rect[3] = this.size[1] + 20; +} + +LiteGraph.registerNodeType("features/shape", TestSpecialNode ); + + + +//Show value inside the debug console +function TestSlotsNode() +{ + this.addInput("C","number"); + this.addOutput("A","number"); + this.addOutput("B","number"); + this.horizontal = true; + this.size = [100,40]; +} + +TestSlotsNode.title = "Flat Slots"; + + +LiteGraph.registerNodeType("features/slots", TestSlotsNode ); + + +//Show value inside the debug console +function TestPropertyEditorsNode() +{ + this.properties = { + name: "foo", + age: 10, + alive: true, + children: ["John","Emily","Charles"], + skills: { + speed: 10, + dexterity: 100 + } + } + + var that = this; + this.addWidget("button","Log",null,function(){ + console.log(that.properties); + }); +} + +TestPropertyEditorsNode.title = "Properties"; + + +LiteGraph.registerNodeType("features/properties_editor", TestPropertyEditorsNode ); + + + +//Show value inside the debug console +function LargeInputNode() +{ + this.addInput("in 1","number"); + this.addInput("in 2","number"); + this.addInput("in 3","number"); + this.addInput("in 4","number"); + this.addInput("in 5","number"); + this.addInput("in 6","number"); + this.addInput("in 7","number"); + this.addInput("in 8","number"); + this.addInput("in 9","number"); + this.addInput("in 10","number"); + this.addInput("in 11","number"); + this.addInput("in 12","number"); + this.addInput("in 13","number"); + this.addInput("in 14","number"); + this.addInput("in 15","number"); + this.addInput("in 16","number"); + this.addInput("in 17","number"); + this.addInput("in 18","number"); + this.addInput("in 19","number"); + this.addInput("in 20","number"); + this.size = [200,410]; +} + +LargeInputNode.title = "Large Input Node"; + + +LiteGraph.registerNodeType("features/largeinput_editor", LargeInputNode); + diff --git a/javascript/materialxtoy/litegraph/input.js b/javascript/materialxtoy/litegraph/input.js new file mode 100644 index 00000000..9926b69d --- /dev/null +++ b/javascript/materialxtoy/litegraph/input.js @@ -0,0 +1,354 @@ +(function(global) { + var LiteGraph = global.LiteGraph; + + function GamepadInput() { + this.addOutput("left_x_axis", "number"); + this.addOutput("left_y_axis", "number"); + this.addOutput("button_pressed", LiteGraph.EVENT); + this.properties = { gamepad_index: 0, threshold: 0.1 }; + + this._left_axis = new Float32Array(2); + this._right_axis = new Float32Array(2); + this._triggers = new Float32Array(2); + this._previous_buttons = new Uint8Array(17); + this._current_buttons = new Uint8Array(17); + } + + GamepadInput.title = "Gamepad"; + GamepadInput.desc = "gets the input of the gamepad"; + + GamepadInput.CENTER = 0; + GamepadInput.LEFT = 1; + GamepadInput.RIGHT = 2; + GamepadInput.UP = 4; + GamepadInput.DOWN = 8; + + GamepadInput.zero = new Float32Array(2); + GamepadInput.buttons = [ + "a", + "b", + "x", + "y", + "lb", + "rb", + "lt", + "rt", + "back", + "start", + "ls", + "rs", + "home" + ]; + + GamepadInput.prototype.onExecute = function() { + //get gamepad + var gamepad = this.getGamepad(); + var threshold = this.properties.threshold || 0.0; + + if (gamepad) { + this._left_axis[0] = + Math.abs(gamepad.xbox.axes["lx"]) > threshold + ? gamepad.xbox.axes["lx"] + : 0; + this._left_axis[1] = + Math.abs(gamepad.xbox.axes["ly"]) > threshold + ? gamepad.xbox.axes["ly"] + : 0; + this._right_axis[0] = + Math.abs(gamepad.xbox.axes["rx"]) > threshold + ? gamepad.xbox.axes["rx"] + : 0; + this._right_axis[1] = + Math.abs(gamepad.xbox.axes["ry"]) > threshold + ? gamepad.xbox.axes["ry"] + : 0; + this._triggers[0] = + Math.abs(gamepad.xbox.axes["ltrigger"]) > threshold + ? gamepad.xbox.axes["ltrigger"] + : 0; + this._triggers[1] = + Math.abs(gamepad.xbox.axes["rtrigger"]) > threshold + ? gamepad.xbox.axes["rtrigger"] + : 0; + } + + if (this.outputs) { + for (var i = 0; i < this.outputs.length; i++) { + var output = this.outputs[i]; + if (!output.links || !output.links.length) { + continue; + } + var v = null; + + if (gamepad) { + switch (output.name) { + case "left_axis": + v = this._left_axis; + break; + case "right_axis": + v = this._right_axis; + break; + case "left_x_axis": + v = this._left_axis[0]; + break; + case "left_y_axis": + v = this._left_axis[1]; + break; + case "right_x_axis": + v = this._right_axis[0]; + break; + case "right_y_axis": + v = this._right_axis[1]; + break; + case "trigger_left": + v = this._triggers[0]; + break; + case "trigger_right": + v = this._triggers[1]; + break; + case "a_button": + v = gamepad.xbox.buttons["a"] ? 1 : 0; + break; + case "b_button": + v = gamepad.xbox.buttons["b"] ? 1 : 0; + break; + case "x_button": + v = gamepad.xbox.buttons["x"] ? 1 : 0; + break; + case "y_button": + v = gamepad.xbox.buttons["y"] ? 1 : 0; + break; + case "lb_button": + v = gamepad.xbox.buttons["lb"] ? 1 : 0; + break; + case "rb_button": + v = gamepad.xbox.buttons["rb"] ? 1 : 0; + break; + case "ls_button": + v = gamepad.xbox.buttons["ls"] ? 1 : 0; + break; + case "rs_button": + v = gamepad.xbox.buttons["rs"] ? 1 : 0; + break; + case "hat_left": + v = gamepad.xbox.hatmap & GamepadInput.LEFT; + break; + case "hat_right": + v = gamepad.xbox.hatmap & GamepadInput.RIGHT; + break; + case "hat_up": + v = gamepad.xbox.hatmap & GamepadInput.UP; + break; + case "hat_down": + v = gamepad.xbox.hatmap & GamepadInput.DOWN; + break; + case "hat": + v = gamepad.xbox.hatmap; + break; + case "start_button": + v = gamepad.xbox.buttons["start"] ? 1 : 0; + break; + case "back_button": + v = gamepad.xbox.buttons["back"] ? 1 : 0; + break; + case "button_pressed": + for ( + var j = 0; + j < this._current_buttons.length; + ++j + ) { + if ( + this._current_buttons[j] && + !this._previous_buttons[j] + ) { + this.triggerSlot( + i, + GamepadInput.buttons[j] + ); + } + } + break; + default: + break; + } + } else { + //if no gamepad is connected, output 0 + switch (output.name) { + case "button_pressed": + break; + case "left_axis": + case "right_axis": + v = GamepadInput.zero; + break; + default: + v = 0; + } + } + this.setOutputData(i, v); + } + } + }; + + GamepadInput.mapping = {a:0,b:1,x:2,y:3,lb:4,rb:5,lt:6,rt:7,back:8,start:9,ls:10,rs:11 }; + GamepadInput.mapping_array = ["a","b","x","y","lb","rb","lt","rt","back","start","ls","rs"]; + + GamepadInput.prototype.getGamepad = function() { + var getGamepads = + navigator.getGamepads || + navigator.webkitGetGamepads || + navigator.mozGetGamepads; + if (!getGamepads) { + return null; + } + var gamepads = getGamepads.call(navigator); + var gamepad = null; + + this._previous_buttons.set(this._current_buttons); + + //pick the first connected + for (var i = this.properties.gamepad_index; i < 4; i++) { + if (!gamepads[i]) { + continue; + } + gamepad = gamepads[i]; + + //xbox controller mapping + var xbox = this.xbox_mapping; + if (!xbox) { + xbox = this.xbox_mapping = { + axes: [], + buttons: {}, + hat: "", + hatmap: GamepadInput.CENTER + }; + } + + xbox.axes["lx"] = gamepad.axes[0]; + xbox.axes["ly"] = gamepad.axes[1]; + xbox.axes["rx"] = gamepad.axes[2]; + xbox.axes["ry"] = gamepad.axes[3]; + xbox.axes["ltrigger"] = gamepad.buttons[6].value; + xbox.axes["rtrigger"] = gamepad.buttons[7].value; + xbox.hat = ""; + xbox.hatmap = GamepadInput.CENTER; + + for (var j = 0; j < gamepad.buttons.length; j++) { + this._current_buttons[j] = gamepad.buttons[j].pressed; + + if(j < 12) + { + xbox.buttons[ GamepadInput.mapping_array[j] ] = gamepad.buttons[j].pressed; + if(gamepad.buttons[j].was_pressed) + this.trigger( GamepadInput.mapping_array[j] + "_button_event" ); + } + else //mapping of XBOX + switch ( j ) //I use a switch to ensure that a player with another gamepad could play + { + case 12: + if (gamepad.buttons[j].pressed) { + xbox.hat += "up"; + xbox.hatmap |= GamepadInput.UP; + } + break; + case 13: + if (gamepad.buttons[j].pressed) { + xbox.hat += "down"; + xbox.hatmap |= GamepadInput.DOWN; + } + break; + case 14: + if (gamepad.buttons[j].pressed) { + xbox.hat += "left"; + xbox.hatmap |= GamepadInput.LEFT; + } + break; + case 15: + if (gamepad.buttons[j].pressed) { + xbox.hat += "right"; + xbox.hatmap |= GamepadInput.RIGHT; + } + break; + case 16: + xbox.buttons["home"] = gamepad.buttons[j].pressed; + break; + default: + } + } + gamepad.xbox = xbox; + return gamepad; + } + }; + + GamepadInput.prototype.onDrawBackground = function(ctx) { + if (this.flags.collapsed) { + return; + } + + //render gamepad state? + var la = this._left_axis; + var ra = this._right_axis; + ctx.strokeStyle = "#88A"; + ctx.strokeRect( + (la[0] + 1) * 0.5 * this.size[0] - 4, + (la[1] + 1) * 0.5 * this.size[1] - 4, + 8, + 8 + ); + ctx.strokeStyle = "#8A8"; + ctx.strokeRect( + (ra[0] + 1) * 0.5 * this.size[0] - 4, + (ra[1] + 1) * 0.5 * this.size[1] - 4, + 8, + 8 + ); + var h = this.size[1] / this._current_buttons.length; + ctx.fillStyle = "#AEB"; + for (var i = 0; i < this._current_buttons.length; ++i) { + if (this._current_buttons[i]) { + ctx.fillRect(0, h * i, 6, h); + } + } + }; + + GamepadInput.prototype.onGetOutputs = function() { + return [ + ["left_axis", "vec2"], + ["right_axis", "vec2"], + ["left_x_axis", "number"], + ["left_y_axis", "number"], + ["right_x_axis", "number"], + ["right_y_axis", "number"], + ["trigger_left", "number"], + ["trigger_right", "number"], + ["a_button", "number"], + ["b_button", "number"], + ["x_button", "number"], + ["y_button", "number"], + ["lb_button", "number"], + ["rb_button", "number"], + ["ls_button", "number"], + ["rs_button", "number"], + ["start_button", "number"], + ["back_button", "number"], + ["a_button_event", LiteGraph.EVENT ], + ["b_button_event", LiteGraph.EVENT ], + ["x_button_event", LiteGraph.EVENT ], + ["y_button_event", LiteGraph.EVENT ], + ["lb_button_event", LiteGraph.EVENT ], + ["rb_button_event", LiteGraph.EVENT ], + ["ls_button_event", LiteGraph.EVENT ], + ["rs_button_event", LiteGraph.EVENT ], + ["start_button_event", LiteGraph.EVENT ], + ["back_button_event", LiteGraph.EVENT ], + ["hat_left", "number"], + ["hat_right", "number"], + ["hat_up", "number"], + ["hat_down", "number"], + ["hat", "number"], + ["button_pressed", LiteGraph.EVENT] + ]; + }; + + LiteGraph.registerNodeType("input/gamepad", GamepadInput); + +})(this); diff --git a/javascript/materialxtoy/litegraph/interface.js b/javascript/materialxtoy/litegraph/interface.js new file mode 100644 index 00000000..a73c098c --- /dev/null +++ b/javascript/materialxtoy/litegraph/interface.js @@ -0,0 +1,798 @@ +//widgets +(function(global) { + var LiteGraph = global.LiteGraph; + + /* Button ****************/ + + function WidgetButton() { + this.addOutput("", LiteGraph.EVENT); + this.addOutput("", "boolean"); + this.addProperty("text", "click me"); + this.addProperty("font_size", 30); + this.addProperty("message", ""); + this.size = [164, 84]; + this.clicked = false; + } + + WidgetButton.title = "Button"; + WidgetButton.desc = "Triggers an event"; + + WidgetButton.font = "Arial"; + WidgetButton.prototype.onDrawForeground = function(ctx) { + if (this.flags.collapsed) { + return; + } + var margin = 10; + ctx.fillStyle = "black"; + ctx.fillRect( + margin + 1, + margin + 1, + this.size[0] - margin * 2, + this.size[1] - margin * 2 + ); + ctx.fillStyle = "#AAF"; + ctx.fillRect( + margin - 1, + margin - 1, + this.size[0] - margin * 2, + this.size[1] - margin * 2 + ); + ctx.fillStyle = this.clicked + ? "white" + : this.mouseOver + ? "#668" + : "#334"; + ctx.fillRect( + margin, + margin, + this.size[0] - margin * 2, + this.size[1] - margin * 2 + ); + + if (this.properties.text || this.properties.text === 0) { + var font_size = this.properties.font_size || 30; + ctx.textAlign = "center"; + ctx.fillStyle = this.clicked ? "black" : "white"; + ctx.font = font_size + "px " + WidgetButton.font; + ctx.fillText( + this.properties.text, + this.size[0] * 0.5, + this.size[1] * 0.5 + font_size * 0.3 + ); + ctx.textAlign = "left"; + } + }; + + WidgetButton.prototype.onMouseDown = function(e, local_pos) { + if ( + local_pos[0] > 1 && + local_pos[1] > 1 && + local_pos[0] < this.size[0] - 2 && + local_pos[1] < this.size[1] - 2 + ) { + this.clicked = true; + this.setOutputData(1, this.clicked); + this.triggerSlot(0, this.properties.message); + return true; + } + }; + + WidgetButton.prototype.onExecute = function() { + this.setOutputData(1, this.clicked); + }; + + WidgetButton.prototype.onMouseUp = function(e) { + this.clicked = false; + }; + + LiteGraph.registerNodeType("widget/button", WidgetButton); + + function WidgetToggle() { + this.addInput("", "boolean"); + this.addInput("e", LiteGraph.ACTION); + this.addOutput("v", "boolean"); + this.addOutput("e", LiteGraph.EVENT); + this.properties = { font: "", value: false }; + this.size = [160, 44]; + } + + WidgetToggle.title = "Toggle"; + WidgetToggle.desc = "Toggles between true or false"; + + WidgetToggle.prototype.onDrawForeground = function(ctx) { + if (this.flags.collapsed) { + return; + } + + var size = this.size[1] * 0.5; + var margin = 0.25; + var h = this.size[1] * 0.8; + ctx.font = this.properties.font || (size * 0.8).toFixed(0) + "px Arial"; + var w = ctx.measureText(this.title).width; + var x = (this.size[0] - (w + size)) * 0.5; + + ctx.fillStyle = "#AAA"; + ctx.fillRect(x, h - size, size, size); + + ctx.fillStyle = this.properties.value ? "#AEF" : "#000"; + ctx.fillRect( + x + size * margin, + h - size + size * margin, + size * (1 - margin * 2), + size * (1 - margin * 2) + ); + + ctx.textAlign = "left"; + ctx.fillStyle = "#AAA"; + ctx.fillText(this.title, size * 1.2 + x, h * 0.85); + ctx.textAlign = "left"; + }; + + WidgetToggle.prototype.onAction = function(action) { + this.properties.value = !this.properties.value; + this.trigger("e", this.properties.value); + }; + + WidgetToggle.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v != null) { + this.properties.value = v; + } + this.setOutputData(0, this.properties.value); + }; + + WidgetToggle.prototype.onMouseDown = function(e, local_pos) { + if ( + local_pos[0] > 1 && + local_pos[1] > 1 && + local_pos[0] < this.size[0] - 2 && + local_pos[1] < this.size[1] - 2 + ) { + this.properties.value = !this.properties.value; + this.graph._version++; + this.trigger("e", this.properties.value); + return true; + } + }; + + LiteGraph.registerNodeType("widget/toggle", WidgetToggle); + + /* Number ****************/ + + function WidgetNumber() { + this.addOutput("", "number"); + this.size = [80, 60]; + this.properties = { min: -1000, max: 1000, value: 1, step: 1 }; + this.old_y = -1; + this._remainder = 0; + this._precision = 0; + this.mouse_captured = false; + } + + WidgetNumber.title = "Number"; + WidgetNumber.desc = "Widget to select number value"; + + WidgetNumber.pixels_threshold = 10; + WidgetNumber.markers_color = "#666"; + + WidgetNumber.prototype.onDrawForeground = function(ctx) { + var x = this.size[0] * 0.5; + var h = this.size[1]; + if (h > 30) { + ctx.fillStyle = WidgetNumber.markers_color; + ctx.beginPath(); + ctx.moveTo(x, h * 0.1); + ctx.lineTo(x + h * 0.1, h * 0.2); + ctx.lineTo(x + h * -0.1, h * 0.2); + ctx.fill(); + ctx.beginPath(); + ctx.moveTo(x, h * 0.9); + ctx.lineTo(x + h * 0.1, h * 0.8); + ctx.lineTo(x + h * -0.1, h * 0.8); + ctx.fill(); + ctx.font = (h * 0.7).toFixed(1) + "px Arial"; + } else { + ctx.font = (h * 0.8).toFixed(1) + "px Arial"; + } + + ctx.textAlign = "center"; + ctx.font = (h * 0.7).toFixed(1) + "px Arial"; + ctx.fillStyle = "#EEE"; + ctx.fillText( + this.properties.value.toFixed(this._precision), + x, + h * 0.75 + ); + }; + + WidgetNumber.prototype.onExecute = function() { + this.setOutputData(0, this.properties.value); + }; + + WidgetNumber.prototype.onPropertyChanged = function(name, value) { + var t = (this.properties.step + "").split("."); + this._precision = t.length > 1 ? t[1].length : 0; + }; + + WidgetNumber.prototype.onMouseDown = function(e, pos) { + if (pos[1] < 0) { + return; + } + + this.old_y = e.canvasY; + this.captureInput(true); + this.mouse_captured = true; + + return true; + }; + + WidgetNumber.prototype.onMouseMove = function(e) { + if (!this.mouse_captured) { + return; + } + + var delta = this.old_y - e.canvasY; + if (e.shiftKey) { + delta *= 10; + } + if (e.metaKey || e.altKey) { + delta *= 0.1; + } + this.old_y = e.canvasY; + + var steps = this._remainder + delta / WidgetNumber.pixels_threshold; + this._remainder = steps % 1; + steps = steps | 0; + + var v = clamp( + this.properties.value + steps * this.properties.step, + this.properties.min, + this.properties.max + ); + this.properties.value = v; + this.graph._version++; + this.setDirtyCanvas(true); + }; + + WidgetNumber.prototype.onMouseUp = function(e, pos) { + if (e.click_time < 200) { + var steps = pos[1] > this.size[1] * 0.5 ? -1 : 1; + this.properties.value = clamp( + this.properties.value + steps * this.properties.step, + this.properties.min, + this.properties.max + ); + this.graph._version++; + this.setDirtyCanvas(true); + } + + if (this.mouse_captured) { + this.mouse_captured = false; + this.captureInput(false); + } + }; + + LiteGraph.registerNodeType("widget/number", WidgetNumber); + + + /* Combo ****************/ + + function WidgetCombo() { + this.addOutput("", "string"); + this.addOutput("change", LiteGraph.EVENT); + this.size = [80, 60]; + this.properties = { value: "A", values:"A;B;C" }; + this.old_y = -1; + this.mouse_captured = false; + this._values = this.properties.values.split(";"); + var that = this; + this.widgets_up = true; + this.widget = this.addWidget("combo","", this.properties.value, function(v){ + that.properties.value = v; + that.triggerSlot(1, v); + }, { property: "value", values: this._values } ); + } + + WidgetCombo.title = "Combo"; + WidgetCombo.desc = "Widget to select from a list"; + + WidgetCombo.prototype.onExecute = function() { + this.setOutputData( 0, this.properties.value ); + }; + + WidgetCombo.prototype.onPropertyChanged = function(name, value) { + if(name == "values") + { + this._values = value.split(";"); + this.widget.options.values = this._values; + } + else if(name == "value") + { + this.widget.value = value; + } + }; + + LiteGraph.registerNodeType("widget/combo", WidgetCombo); + + + /* Knob ****************/ + + function WidgetKnob() { + this.addOutput("", "number"); + this.size = [64, 84]; + this.properties = { + min: 0, + max: 1, + value: 0.5, + color: "#7AF", + precision: 2 + }; + this.value = -1; + } + + WidgetKnob.title = "Knob"; + WidgetKnob.desc = "Circular controller"; + WidgetKnob.size = [80, 100]; + + WidgetKnob.prototype.onDrawForeground = function(ctx) { + if (this.flags.collapsed) { + return; + } + + if (this.value == -1) { + this.value = + (this.properties.value - this.properties.min) / + (this.properties.max - this.properties.min); + } + + var center_x = this.size[0] * 0.5; + var center_y = this.size[1] * 0.5; + var radius = Math.min(this.size[0], this.size[1]) * 0.5 - 5; + var w = Math.floor(radius * 0.05); + + ctx.globalAlpha = 1; + ctx.save(); + ctx.translate(center_x, center_y); + ctx.rotate(Math.PI * 0.75); + + //bg + ctx.fillStyle = "rgba(0,0,0,0.5)"; + ctx.beginPath(); + ctx.moveTo(0, 0); + ctx.arc(0, 0, radius, 0, Math.PI * 1.5); + ctx.fill(); + + //value + ctx.strokeStyle = "black"; + ctx.fillStyle = this.properties.color; + ctx.lineWidth = 2; + ctx.beginPath(); + ctx.moveTo(0, 0); + ctx.arc( + 0, + 0, + radius - 4, + 0, + Math.PI * 1.5 * Math.max(0.01, this.value) + ); + ctx.closePath(); + ctx.fill(); + //ctx.stroke(); + ctx.lineWidth = 1; + ctx.globalAlpha = 1; + ctx.restore(); + + //inner + ctx.fillStyle = "black"; + ctx.beginPath(); + ctx.arc(center_x, center_y, radius * 0.75, 0, Math.PI * 2, true); + ctx.fill(); + + //miniball + ctx.fillStyle = this.mouseOver ? "white" : this.properties.color; + ctx.beginPath(); + var angle = this.value * Math.PI * 1.5 + Math.PI * 0.75; + ctx.arc( + center_x + Math.cos(angle) * radius * 0.65, + center_y + Math.sin(angle) * radius * 0.65, + radius * 0.05, + 0, + Math.PI * 2, + true + ); + ctx.fill(); + + //text + ctx.fillStyle = this.mouseOver ? "white" : "#AAA"; + ctx.font = Math.floor(radius * 0.5) + "px Arial"; + ctx.textAlign = "center"; + ctx.fillText( + this.properties.value.toFixed(this.properties.precision), + center_x, + center_y + radius * 0.15 + ); + }; + + WidgetKnob.prototype.onExecute = function() { + this.setOutputData(0, this.properties.value); + this.boxcolor = LiteGraph.colorToString([ + this.value, + this.value, + this.value + ]); + }; + + WidgetKnob.prototype.onMouseDown = function(e) { + this.center = [this.size[0] * 0.5, this.size[1] * 0.5 + 20]; + this.radius = this.size[0] * 0.5; + if ( + e.canvasY - this.pos[1] < 20 || + LiteGraph.distance( + [e.canvasX, e.canvasY], + [this.pos[0] + this.center[0], this.pos[1] + this.center[1]] + ) > this.radius + ) { + return false; + } + this.oldmouse = [e.canvasX - this.pos[0], e.canvasY - this.pos[1]]; + this.captureInput(true); + return true; + }; + + WidgetKnob.prototype.onMouseMove = function(e) { + if (!this.oldmouse) { + return; + } + + var m = [e.canvasX - this.pos[0], e.canvasY - this.pos[1]]; + + var v = this.value; + v -= (m[1] - this.oldmouse[1]) * 0.01; + if (v > 1.0) { + v = 1.0; + } else if (v < 0.0) { + v = 0.0; + } + this.value = v; + this.properties.value = + this.properties.min + + (this.properties.max - this.properties.min) * this.value; + this.oldmouse = m; + this.setDirtyCanvas(true); + }; + + WidgetKnob.prototype.onMouseUp = function(e) { + if (this.oldmouse) { + this.oldmouse = null; + this.captureInput(false); + } + }; + + WidgetKnob.prototype.onPropertyChanged = function(name, value) { + if (name == "min" || name == "max" || name == "value") { + this.properties[name] = parseFloat(value); + return true; //block + } + }; + + LiteGraph.registerNodeType("widget/knob", WidgetKnob); + + //Show value inside the debug console + function WidgetSliderGUI() { + this.addOutput("", "number"); + this.properties = { + value: 0.5, + min: 0, + max: 1, + text: "V" + }; + var that = this; + this.size = [140, 40]; + this.slider = this.addWidget( + "slider", + "V", + this.properties.value, + function(v) { + that.properties.value = v; + }, + this.properties + ); + this.widgets_up = true; + } + + WidgetSliderGUI.title = "Inner Slider"; + + WidgetSliderGUI.prototype.onPropertyChanged = function(name, value) { + if (name == "value") { + this.slider.value = value; + } + }; + + WidgetSliderGUI.prototype.onExecute = function() { + this.setOutputData(0, this.properties.value); + }; + + LiteGraph.registerNodeType("widget/internal_slider", WidgetSliderGUI); + + //Widget H SLIDER + function WidgetHSlider() { + this.size = [160, 26]; + this.addOutput("", "number"); + this.properties = { color: "#7AF", min: 0, max: 1, value: 0.5 }; + this.value = -1; + } + + WidgetHSlider.title = "H.Slider"; + WidgetHSlider.desc = "Linear slider controller"; + + WidgetHSlider.prototype.onDrawForeground = function(ctx) { + if (this.value == -1) { + this.value = + (this.properties.value - this.properties.min) / + (this.properties.max - this.properties.min); + } + + //border + ctx.globalAlpha = 1; + ctx.lineWidth = 1; + ctx.fillStyle = "#000"; + ctx.fillRect(2, 2, this.size[0] - 4, this.size[1] - 4); + + ctx.fillStyle = this.properties.color; + ctx.beginPath(); + ctx.rect(4, 4, (this.size[0] - 8) * this.value, this.size[1] - 8); + ctx.fill(); + }; + + WidgetHSlider.prototype.onExecute = function() { + this.properties.value = + this.properties.min + + (this.properties.max - this.properties.min) * this.value; + this.setOutputData(0, this.properties.value); + this.boxcolor = LiteGraph.colorToString([ + this.value, + this.value, + this.value + ]); + }; + + WidgetHSlider.prototype.onMouseDown = function(e) { + if (e.canvasY - this.pos[1] < 0) { + return false; + } + + this.oldmouse = [e.canvasX - this.pos[0], e.canvasY - this.pos[1]]; + this.captureInput(true); + return true; + }; + + WidgetHSlider.prototype.onMouseMove = function(e) { + if (!this.oldmouse) { + return; + } + + var m = [e.canvasX - this.pos[0], e.canvasY - this.pos[1]]; + + var v = this.value; + var delta = m[0] - this.oldmouse[0]; + v += delta / this.size[0]; + if (v > 1.0) { + v = 1.0; + } else if (v < 0.0) { + v = 0.0; + } + + this.value = v; + + this.oldmouse = m; + this.setDirtyCanvas(true); + }; + + WidgetHSlider.prototype.onMouseUp = function(e) { + this.oldmouse = null; + this.captureInput(false); + }; + + WidgetHSlider.prototype.onMouseLeave = function(e) { + //this.oldmouse = null; + }; + + LiteGraph.registerNodeType("widget/hslider", WidgetHSlider); + + function WidgetProgress() { + this.size = [160, 26]; + this.addInput("", "number"); + this.properties = { min: 0, max: 1, value: 0, color: "#AAF" }; + } + + WidgetProgress.title = "Progress"; + WidgetProgress.desc = "Shows data in linear progress"; + + WidgetProgress.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v != undefined) { + this.properties["value"] = v; + } + }; + + WidgetProgress.prototype.onDrawForeground = function(ctx) { + //border + ctx.lineWidth = 1; + ctx.fillStyle = this.properties.color; + var v = + (this.properties.value - this.properties.min) / + (this.properties.max - this.properties.min); + v = Math.min(1, v); + v = Math.max(0, v); + ctx.fillRect(2, 2, (this.size[0] - 4) * v, this.size[1] - 4); + }; + + LiteGraph.registerNodeType("widget/progress", WidgetProgress); + + function WidgetText() { + this.addInputs("", 0); + this.properties = { + value: "...", + font: "Arial", + fontsize: 18, + color: "#AAA", + align: "left", + glowSize: 0, + decimals: 1 + }; + } + + WidgetText.title = "Text"; + WidgetText.desc = "Shows the input value"; + WidgetText.widgets = [ + { name: "resize", text: "Resize box", type: "button" }, + { name: "led_text", text: "LED", type: "minibutton" }, + { name: "normal_text", text: "Normal", type: "minibutton" } + ]; + + WidgetText.prototype.onDrawForeground = function(ctx) { + //ctx.fillStyle="#000"; + //ctx.fillRect(0,0,100,60); + ctx.fillStyle = this.properties["color"]; + var v = this.properties["value"]; + + if (this.properties["glowSize"]) { + ctx.shadowColor = this.properties.color; + ctx.shadowOffsetX = 0; + ctx.shadowOffsetY = 0; + ctx.shadowBlur = this.properties["glowSize"]; + } else { + ctx.shadowColor = "transparent"; + } + + var fontsize = this.properties["fontsize"]; + + ctx.textAlign = this.properties["align"]; + ctx.font = fontsize.toString() + "px " + this.properties["font"]; + this.str = + typeof v == "number" ? v.toFixed(this.properties["decimals"]) : v; + + if (typeof this.str == "string") { + var lines = this.str.replace(/[\r\n]/g, "\\n").split("\\n"); + for (var i=0; i < lines.length; i++) { + ctx.fillText( + lines[i], + this.properties["align"] == "left" ? 15 : this.size[0] - 15, + fontsize * -0.15 + fontsize * (parseInt(i) + 1) + ); + } + } + + ctx.shadowColor = "transparent"; + this.last_ctx = ctx; + ctx.textAlign = "left"; + }; + + WidgetText.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v != null) { + this.properties["value"] = v; + } + //this.setDirtyCanvas(true); + }; + + WidgetText.prototype.resize = function() { + if (!this.last_ctx) { + return; + } + + var lines = this.str.split("\\n"); + this.last_ctx.font = + this.properties["fontsize"] + "px " + this.properties["font"]; + var max = 0; + for (var i=0; i < lines.length; i++) { + var w = this.last_ctx.measureText(lines[i]).width; + if (max < w) { + max = w; + } + } + this.size[0] = max + 20; + this.size[1] = 4 + lines.length * this.properties["fontsize"]; + + this.setDirtyCanvas(true); + }; + + WidgetText.prototype.onPropertyChanged = function(name, value) { + this.properties[name] = value; + this.str = typeof value == "number" ? value.toFixed(3) : value; + //this.resize(); + return true; + }; + + LiteGraph.registerNodeType("widget/text", WidgetText); + + function WidgetPanel() { + this.size = [200, 100]; + this.properties = { + borderColor: "#ffffff", + bgcolorTop: "#f0f0f0", + bgcolorBottom: "#e0e0e0", + shadowSize: 2, + borderRadius: 3 + }; + } + + WidgetPanel.title = "Panel"; + WidgetPanel.desc = "Non interactive panel"; + WidgetPanel.widgets = [{ name: "update", text: "Update", type: "button" }]; + + WidgetPanel.prototype.createGradient = function(ctx) { + if ( + this.properties["bgcolorTop"] == "" || + this.properties["bgcolorBottom"] == "" + ) { + this.lineargradient = 0; + return; + } + + this.lineargradient = ctx.createLinearGradient(0, 0, 0, this.size[1]); + this.lineargradient.addColorStop(0, this.properties["bgcolorTop"]); + this.lineargradient.addColorStop(1, this.properties["bgcolorBottom"]); + }; + + WidgetPanel.prototype.onDrawForeground = function(ctx) { + if (this.flags.collapsed) { + return; + } + + if (this.lineargradient == null) { + this.createGradient(ctx); + } + + if (!this.lineargradient) { + return; + } + + ctx.lineWidth = 1; + ctx.strokeStyle = this.properties["borderColor"]; + //ctx.fillStyle = "#ebebeb"; + ctx.fillStyle = this.lineargradient; + + if (this.properties["shadowSize"]) { + ctx.shadowColor = "#000"; + ctx.shadowOffsetX = 0; + ctx.shadowOffsetY = 0; + ctx.shadowBlur = this.properties["shadowSize"]; + } else { + ctx.shadowColor = "transparent"; + } + + ctx.roundRect( + 0, + 0, + this.size[0] - 1, + this.size[1] - 1, + this.properties["shadowSize"] + ); + ctx.fill(); + ctx.shadowColor = "transparent"; + ctx.stroke(); + }; + + LiteGraph.registerNodeType("widget/panel", WidgetPanel); +})(this); diff --git a/javascript/materialxtoy/litegraph/litegraph-editor.css b/javascript/materialxtoy/litegraph/litegraph-editor.css new file mode 100644 index 00000000..130ac0b9 --- /dev/null +++ b/javascript/materialxtoy/litegraph/litegraph-editor.css @@ -0,0 +1,214 @@ +.litegraph-editor { + width: 100%; + height: 100%; + margin: 0; + padding: 0; + + background-color: #333; + color: #eee; + font: 14px Tahoma; + + position: relative; +} + +.litegraph-editor h1 { + font-family: "Metro Light", Tahoma; + color: #ddd; + font-size: 28px; + padding-left: 10px; + /*text-shadow: 0 1px 1px #333, 0 -1px 1px #777;*/ + margin: 0; + font-weight: normal; +} + +.litegraph-editor h1 span { + font-family: "Arial"; + font-size: 14px; + font-weight: normal; + color: #aaa; +} + +.litegraph-editor h2 { + font-family: "Metro Light"; + padding: 5px; + margin-left: 10px; +} + +.litegraph-editor * { + box-sizing: border-box; + -moz-box-sizing: border-box; +} + +.litegraph-editor .content { + position: relative; + width: 100%; + height: calc(100% - 80px); + background-color: #1a1a1a; +} + +.litegraph-editor .header, +.litegraph-editor .footer { + position: relative; + height: 40px; + background-color: #333; + /*border-radius: 10px 10px 0 0;*/ +} + +.litegraph-editor .tools, +.litegraph-editor .tools-left, +.litegraph-editor .tools-right { + position: absolute; + top: 2px; + right: 0px; + vertical-align: top; + + margin: 2px 5px 0 0px; +} + +.litegraph-editor .tools-left { + right: auto; + left: 4px; +} + +.litegraph-editor .footer { + height: 40px; + position: relative; + /*border-radius: 0 0 10px 10px;*/ +} + +.litegraph-editor .miniwindow { + background-color: #333; + border: 1px solid #111; +} + +.litegraph-editor .miniwindow .corner-button { + position: absolute; + top: 2px; + right: 2px; + font-family: "Tahoma"; + font-size: 14px; + color: #aaa; + cursor: pointer; +} + +/* BUTTONS **********************/ + +.litegraph-editor .btn { + /*font-family: "Metro Light";*/ + color: #ccc; + font-size: 20px; + min-width: 30px; + /*border-radius: 0.3em;*/ + border: 0 solid #666; + background-color: #3f3f3f; + /*box-shadow: 0 0 3px black;*/ + padding: 4px 10px; + cursor: pointer; + transition: all 1s; + -moz-transition: all 1s; + -webkit-transition: all 0.4s; +} + +.litegraph-editor button:hover { + background-color: #999; + color: #fff; + transition: all 1s; + -moz-transition: all 1s; + -webkit-transition: all 0.4s; +} + +.litegraph-editor button:active { + background-color: white; +} + +.litegraph-editor button.fixed { + position: absolute; + top: 5px; + right: 5px; + font-size: 1.2em; +} + +.litegraph-editor button img { + margin: -4px; + vertical-align: top; + opacity: 0.8; + transition: all 1s; +} + +.litegraph-editor button:hover img { + opacity: 1; +} + +.litegraph-editor .header button { + height: 32px; + vertical-align: top; +} + +.litegraph-editor .footer button { + /*font-size: 16px;*/ +} + +.litegraph-editor .toolbar-widget { + display: inline-block; +} + +.litegraph-editor .editor-area { + width: 100%; + height: 100%; +} + +/* METER *********************/ + +.litegraph-editor .loadmeter { + font-family: "Tahoma"; + color: #aaa; + font-size: 12px; + border-radius: 2px; + width: 130px; + vertical-align: top; +} + +.litegraph-editor .strong { + vertical-align: top; + padding: 3px; + width: 30px; + display: inline-block; + line-height: 8px; +} + +.litegraph-editor .cpuload .bgload, +.litegraph-editor .gpuload .bgload { + display: inline-block; + width: 90px; + height: 15px; + background-image: url("../editor/imgs/load-progress-empty.png"); +} + +.litegraph-editor .cpuload .fgload, +.litegraph-editor .gpuload .fgload { + display: inline-block; + width: 4px; + height: 15px; + max-width: 90px; + background-image: url("../editor/imgs/load-progress-full.png"); +} + +.litegraph-editor textarea.code, .litegraph-editor div.code { + height: 100%; + width: 100%; + background-color: black; + padding: 4px; + font: 16px monospace; + overflow: auto; + resize: none; + outline: none; + color: #DDD; +} + +.litegraph-editor .codeflask { + background-color: #2a2a2a; +} + +.litegraph-editor .codeflask textarea { + opacity: 0; +} \ No newline at end of file diff --git a/javascript/materialxtoy/litegraph/litegraph-editor.js b/javascript/materialxtoy/litegraph/litegraph-editor.js new file mode 100644 index 00000000..b9a40fec --- /dev/null +++ b/javascript/materialxtoy/litegraph/litegraph-editor.js @@ -0,0 +1,283 @@ +//Creates an interface to access extra features from a graph (like play, stop, live, etc) +function Editor(container_id, options) { + options = options || {}; + + //fill container + var html = "
                            "; + html += "
                            "; + html += ""; + + var root = document.createElement("div"); + this.root = root; + root.className = "litegraph litegraph-editor"; + root.innerHTML = html; + + this.tools = root.querySelector(".tools"); + this.content = root.querySelector(".content"); + this.footer = root.querySelector(".footer"); + + var canvas = this.canvas = root.querySelector(".graphcanvas"); + + //create graph + var graph = (this.graph = new LGraph()); + var graphcanvas = this.graphcanvas = new LGraphCanvas(canvas, graph); + graphcanvas.background_image = "imgs/grid.png"; + graph.onAfterExecute = function() { + graphcanvas.draw(true); + }; + + graphcanvas.onDropItem = this.onDropItem.bind(this); + + //add stuff + //this.addToolsButton("loadsession_button","Load","imgs/icon-load.png", this.onLoadButton.bind(this), ".tools-left" ); + //this.addToolsButton("savesession_button","Save","imgs/icon-save.png", this.onSaveButton.bind(this), ".tools-left" ); + this.addLoadCounter(); + this.addToolsButton( + "playnode_button", + "Play", + "imgs/icon-play.png", + this.onPlayButton.bind(this), + ".tools-right" + ); + this.addToolsButton( + "playstepnode_button", + "Step", + "imgs/icon-playstep.png", + this.onPlayStepButton.bind(this), + ".tools-right" + ); + + if (!options.skip_livemode) { + this.addToolsButton( + "livemode_button", + "Live", + "imgs/icon-record.png", + this.onLiveButton.bind(this), + ".tools-right" + ); + } + if (!options.skip_maximize) { + this.addToolsButton( + "maximize_button", + "", + "imgs/icon-maximize.png", + this.onFullscreenButton.bind(this), + ".tools-right" + ); + } + if (options.miniwindow) { + this.addMiniWindow(300, 200); + } + + //append to DOM + var parent = document.getElementById(container_id); + if (parent) { + parent.appendChild(root); + } + + graphcanvas.resize(); + //graphcanvas.draw(true,true); +} + +Editor.prototype.addLoadCounter = function() { + var meter = document.createElement("div"); + meter.className = "headerpanel loadmeter toolbar-widget"; + + var html = + "
                            CPU
                            "; + html += + "
                            GFX
                            "; + + meter.innerHTML = html; + this.root.querySelector(".header .tools-left").appendChild(meter); + var self = this; + + setInterval(function() { + meter.querySelector(".cpuload .fgload").style.width = + 2 * self.graph.execution_time * 90 + "px"; + if (self.graph.status == LGraph.STATUS_RUNNING) { + meter.querySelector(".gpuload .fgload").style.width = + self.graphcanvas.render_time * 10 * 90 + "px"; + } else { + meter.querySelector(".gpuload .fgload").style.width = 4 + "px"; + } + }, 200); +}; + +Editor.prototype.addToolsButton = function( id, name, icon_url, callback, container ) { + if (!container) { + container = ".tools"; + } + + var button = this.createButton(name, icon_url, callback); + button.id = id; + this.root.querySelector(container).appendChild(button); +}; + +Editor.prototype.createButton = function(name, icon_url, callback) { + var button = document.createElement("button"); + if (icon_url) { + button.innerHTML = " "; + } + button.classList.add("btn"); + button.innerHTML += name; + if(callback) + button.addEventListener("click", callback ); + return button; +}; + +Editor.prototype.onLoadButton = function() { + var panel = this.graphcanvas.createPanel("Load session",{closable:true}); + //TO DO + + this.root.appendChild(panel); +}; + +Editor.prototype.onSaveButton = function() {}; + +Editor.prototype.onPlayButton = function() { + var graph = this.graph; + var button = this.root.querySelector("#playnode_button"); + + if (graph.status == LGraph.STATUS_STOPPED) { + button.innerHTML = " Stop"; + graph.start(); + } else { + button.innerHTML = " Play"; + graph.stop(); + } +}; + +Editor.prototype.onPlayStepButton = function() { + var graph = this.graph; + graph.runStep(1); + this.graphcanvas.draw(true, true); +}; + +Editor.prototype.onLiveButton = function() { + var is_live_mode = !this.graphcanvas.live_mode; + this.graphcanvas.switchLiveMode(true); + this.graphcanvas.draw(); + var url = this.graphcanvas.live_mode + ? "imgs/gauss_bg_medium.jpg" + : "imgs/gauss_bg.jpg"; + var button = this.root.querySelector("#livemode_button"); + button.innerHTML = !is_live_mode + ? " Live" + : " Edit"; +}; + +Editor.prototype.onDropItem = function(e) +{ + var that = this; + for(var i = 0; i < e.dataTransfer.files.length; ++i) + { + var file = e.dataTransfer.files[i]; + var ext = LGraphCanvas.getFileExtension(file.name); + var reader = new FileReader(); + if(ext == "json") + { + reader.onload = function(event) { + var data = JSON.parse( event.target.result ); + that.graph.configure(data); + }; + reader.readAsText(file); + } + } +} + +Editor.prototype.goFullscreen = function() { + if (this.root.requestFullscreen) { + this.root.requestFullscreen(Element.ALLOW_KEYBOARD_INPUT); + } else if (this.root.mozRequestFullscreen) { + this.root.requestFullscreen(Element.ALLOW_KEYBOARD_INPUT); + } else if (this.root.webkitRequestFullscreen) { + this.root.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); + } else { + throw "Fullscreen not supported"; + } + + var self = this; + setTimeout(function() { + self.graphcanvas.resize(); + }, 100); +}; + +Editor.prototype.onFullscreenButton = function() { + this.goFullscreen(); +}; + +Editor.prototype.addMiniWindow = function(w, h) { + var miniwindow = document.createElement("div"); + miniwindow.className = "litegraph miniwindow"; + miniwindow.innerHTML = + ""; + var canvas = miniwindow.querySelector("canvas"); + var that = this; + + var graphcanvas = new LGraphCanvas( canvas, this.graph ); + graphcanvas.show_info = false; + graphcanvas.background_image = "imgs/grid.png"; + graphcanvas.scale = 0.25; + graphcanvas.allow_dragnodes = false; + graphcanvas.allow_interaction = false; + graphcanvas.render_shadows = false; + graphcanvas.max_zoom = 0.25; + this.miniwindow_graphcanvas = graphcanvas; + graphcanvas.onClear = function() { + graphcanvas.scale = 0.25; + graphcanvas.allow_dragnodes = false; + graphcanvas.allow_interaction = false; + }; + graphcanvas.onRenderBackground = function(canvas, ctx) { + ctx.strokeStyle = "#567"; + var tl = that.graphcanvas.convertOffsetToCanvas([0, 0]); + var br = that.graphcanvas.convertOffsetToCanvas([ + that.graphcanvas.canvas.width, + that.graphcanvas.canvas.height + ]); + tl = this.convertCanvasToOffset(tl); + br = this.convertCanvasToOffset(br); + ctx.lineWidth = 1; + ctx.strokeRect( + Math.floor(tl[0]) + 0.5, + Math.floor(tl[1]) + 0.5, + Math.floor(br[0] - tl[0]), + Math.floor(br[1] - tl[1]) + ); + }; + + miniwindow.style.position = "absolute"; + miniwindow.style.top = "4px"; + miniwindow.style.right = "4px"; + + var close_button = document.createElement("div"); + close_button.className = "corner-button"; + close_button.innerHTML = "❌"; + close_button.addEventListener("click", function(e) { + graphcanvas.setGraph(null); + miniwindow.parentNode.removeChild(miniwindow); + }); + miniwindow.appendChild(close_button); + + this.root.querySelector(".content").appendChild(miniwindow); +}; + +Editor.prototype.addMultiview = function() +{ + var canvas = this.canvas; + this.graphcanvas.ctx.fillStyle = "black"; + this.graphcanvas.ctx.fillRect(0,0,canvas.width,canvas.height); + this.graphcanvas.viewport = [0,0,canvas.width*0.5-2,canvas.height]; + + var graphcanvas = new LGraphCanvas( canvas, this.graph ); + graphcanvas.background_image = "imgs/grid.png"; + this.graphcanvas2 = graphcanvas; + this.graphcanvas2.viewport = [canvas.width*0.5,0,canvas.width*0.5,canvas.height]; +} + +LiteGraph.Editor = Editor; diff --git a/javascript/materialxtoy/litegraph/litegraph.css b/javascript/materialxtoy/litegraph/litegraph.css new file mode 100644 index 00000000..ffe2158c --- /dev/null +++ b/javascript/materialxtoy/litegraph/litegraph.css @@ -0,0 +1,681 @@ +/* this CSS contains only the basic CSS needed to run the app and use it */ + +.lgraphcanvas { + /*cursor: crosshair;*/ + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + outline: none; + font-family: Tahoma, sans-serif; +} + +.lgraphcanvas * { + box-sizing: border-box; +} + +.litegraph.litecontextmenu { + font-family: Tahoma, sans-serif; + position: fixed; + top: 100px; + left: 100px; + min-width: 100px; + color: #aaf; + padding: 0; + box-shadow: 0 0 10px black !important; + background-color: #2e2e2e !important; + z-index: 10; +} + +.litegraph.litecontextmenu.dark { + background-color: #000 !important; +} + +.litegraph.litecontextmenu .litemenu-title img { + margin-top: 2px; + margin-left: 2px; + margin-right: 4px; +} + +.litegraph.litecontextmenu .litemenu-entry { + margin: 2px; + padding: 2px; +} + +.litegraph.litecontextmenu .litemenu-entry.submenu { + background-color: #2e2e2e !important; +} + +.litegraph.litecontextmenu.dark .litemenu-entry.submenu { + background-color: #000 !important; +} + +.litegraph .litemenubar ul { + font-family: Tahoma, sans-serif; + margin: 0; + padding: 0; +} + +.litegraph .litemenubar li { + font-size: 14px; + color: #999; + display: inline-block; + min-width: 50px; + padding-left: 10px; + padding-right: 10px; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + cursor: pointer; +} + +.litegraph .litemenubar li:hover { + background-color: #777; + color: #eee; +} + +.litegraph .litegraph .litemenubar-panel { + position: absolute; + top: 5px; + left: 5px; + min-width: 100px; + background-color: #444; + box-shadow: 0 0 3px black; + padding: 4px; + border-bottom: 2px solid #aaf; + z-index: 10; +} + +.litegraph .litemenu-entry, +.litemenu-title { + font-size: 12px; + color: #aaa; + padding: 0 0 0 4px; + margin: 2px; + padding-left: 2px; + -moz-user-select: none; + -webkit-user-select: none; + user-select: none; + cursor: pointer; +} + +.litegraph .litemenu-entry .icon { + display: inline-block; + width: 12px; + height: 12px; + margin: 2px; + vertical-align: top; +} + +.litegraph .litemenu-entry.checked .icon { + background-color: #aaf; +} + +.litegraph .litemenu-entry .more { + float: right; + padding-right: 5px; +} + +.litegraph .litemenu-entry.disabled { + opacity: 0.5; + cursor: default; +} + +.litegraph .litemenu-entry.separator { + display: block; + border-top: 1px solid #333; + border-bottom: 1px solid #666; + width: 100%; + height: 0px; + margin: 3px 0 2px 0; + background-color: transparent; + padding: 0 !important; + cursor: default !important; +} + +.litegraph .litemenu-entry.has_submenu { + border-right: 2px solid cyan; +} + +.litegraph .litemenu-title { + color: #dde; + background-color: #111; + margin: 0; + padding: 2px; + cursor: default; +} + +.litegraph .litemenu-entry:hover:not(.disabled):not(.separator) { + background-color: #444 !important; + color: #eee; + transition: all 0.2s; +} + +.litegraph .litemenu-entry .property_name { + display: inline-block; + text-align: left; + min-width: 80px; + min-height: 1.2em; +} + +.litegraph .litemenu-entry .property_value { + display: inline-block; + background-color: rgba(0, 0, 0, 0.5); + text-align: right; + min-width: 80px; + min-height: 1.2em; + vertical-align: middle; + padding-right: 10px; +} + +.litegraph.litesearchbox { + font-size: 12px; + font-family: Tahoma, sans-serif; + position: absolute; + background-color: rgba(0, 0, 0, 0.5); + padding-top: 4px; +} + +.litegraph.litesearchbox input, +.litegraph.litesearchbox select { + margin-top: 3px; + min-width: 60px; + min-height: 1.5em; + background-color: black; + border: 0; + color: white; + padding-left: 10px; + margin-right: 5px; +} + +.litegraph.litesearchbox .name { + display: inline-block; + min-width: 60px; + min-height: 1.5em; + padding-left: 10px; +} + +.litegraph.litesearchbox .helper { + overflow: auto; + max-height: 200px; + margin-top: 2px; +} + +.litegraph.lite-search-item { + font-family: Tahoma, sans-serif; + background-color: rgba(0, 0, 0, 0.5); + color: white; + padding-top: 2px; +} + +.litegraph.lite-search-item.not_in_filter{ + /*background-color: rgba(50, 50, 50, 0.5);*/ + /*color: #999;*/ + color: #B99; + font-style: italic; +} + +.litegraph.lite-search-item.generic_type{ + /*background-color: rgba(50, 50, 50, 0.5);*/ + /*color: #DD9;*/ + color: #999; + font-style: italic; +} + +.litegraph.lite-search-item:hover, +.litegraph.lite-search-item.selected { + cursor: pointer; + background-color: white; + color: black; +} + +/* DIALOGs ******/ + +.litegraph .dialog { + position: absolute; + top: 50%; + left: 50%; + margin-top: -150px; + margin-left: -200px; + + background-color: #2A2A2A; + + min-width: 400px; + min-height: 200px; + box-shadow: 0 0 4px #111; + border-radius: 6px; +} + +.litegraph .dialog.settings { + left: 10px; + top: 10px; + height: calc( 100% - 20px ); + margin: auto; + max-width: 50%; +} + +.litegraph .dialog.centered { + top: 50px; + left: 50%; + position: absolute; + transform: translateX(-50%); + min-width: 600px; + min-height: 300px; + height: calc( 100% - 100px ); + margin: auto; +} + +.litegraph .dialog .close { + float: right; + margin: 4px; + margin-right: 10px; + cursor: pointer; + font-size: 1.4em; +} + +.litegraph .dialog .close:hover { + color: white; +} + +.litegraph .dialog .dialog-header { + color: #AAA; + border-bottom: 1px solid #161616; +} + +.litegraph .dialog .dialog-header { height: 40px; } +.litegraph .dialog .dialog-footer { height: 50px; padding: 10px; border-top: 1px solid #1a1a1a;} + +.litegraph .dialog .dialog-header .dialog-title { + font: 20px "Arial"; + margin: 4px; + padding: 4px 10px; + display: inline-block; +} + +.litegraph .dialog .dialog-content, .litegraph .dialog .dialog-alt-content { + height: calc(100% - 90px); + width: 100%; + min-height: 100px; + display: inline-block; + color: #AAA; + /*background-color: black;*/ + overflow: auto; +} + +.litegraph .dialog .dialog-content h3 { + margin: 10px; +} + +.litegraph .dialog .dialog-content .connections { + flex-direction: row; +} + +.litegraph .dialog .dialog-content .connections .connections_side { + width: calc(50% - 5px); + min-height: 100px; + background-color: black; + display: flex; +} + +.litegraph .dialog .node_type { + font-size: 1.2em; + display: block; + margin: 10px; +} + +.litegraph .dialog .node_desc { + opacity: 0.5; + display: block; + margin: 10px; +} + +.litegraph .dialog .separator { + display: block; + width: calc( 100% - 4px ); + height: 1px; + border-top: 1px solid #000; + border-bottom: 1px solid #333; + margin: 10px 2px; + padding: 0; +} + +.litegraph .dialog .property { + margin-bottom: 2px; + padding: 4px; +} + +.litegraph .dialog .property:hover { + background: #545454; +} + +.litegraph .dialog .property_name { + color: #737373; + display: inline-block; + text-align: left; + vertical-align: top; + width: 160px; + padding-left: 4px; + overflow: hidden; + margin-right: 6px; +} + +.litegraph .dialog .property:hover .property_name { + color: white; +} + +.litegraph .dialog .property_value { + display: inline-block; + text-align: right; + color: #AAA; + background-color: #1A1A1A; + /*width: calc( 100% - 122px );*/ + max-width: calc( 100% - 162px ); + min-width: 200px; + max-height: 300px; + min-height: 20px; + padding: 4px; + padding-right: 12px; + overflow: hidden; + cursor: pointer; + border-radius: 3px; +} + +.litegraph .dialog .property_value:hover { + color: white; +} + +.litegraph .dialog .property.boolean .property_value { + padding-right: 30px; + color: #A88; + /*width: auto; + float: right;*/ +} + +.litegraph .dialog .property.boolean.bool-on .property_name{ + color: #8A8; +} +.litegraph .dialog .property.boolean.bool-on .property_value{ + color: #8A8; +} + +.litegraph .dialog .btn { + border: 0; + border-radius: 4px; + padding: 4px 20px; + margin-left: 0px; + background-color: #060606; + color: #8e8e8e; +} + +.litegraph .dialog .btn:hover { + background-color: #111; + color: #FFF; +} + +.litegraph .dialog .btn.delete:hover { + background-color: #F33; + color: black; +} + +.litegraph .subgraph_property { + padding: 4px; +} + +.litegraph .subgraph_property:hover { + background-color: #333; +} + +.litegraph .subgraph_property.extra { + margin-top: 8px; +} + +.litegraph .subgraph_property span.name { + font-size: 1.3em; + padding-left: 4px; +} + +.litegraph .subgraph_property span.type { + opacity: 0.5; + margin-right: 20px; + padding-left: 4px; +} + +.litegraph .subgraph_property span.label { + display: inline-block; + width: 60px; + padding: 0px 10px; +} + +.litegraph .subgraph_property input { + width: 140px; + color: #999; + background-color: #1A1A1A; + border-radius: 4px; + border: 0; + margin-right: 10px; + padding: 4px; + padding-left: 10px; +} + +.litegraph .subgraph_property button { + background-color: #1c1c1c; + color: #aaa; + border: 0; + border-radius: 2px; + padding: 4px 10px; + cursor: pointer; +} + +.litegraph .subgraph_property.extra { + color: #ccc; +} + +.litegraph .subgraph_property.extra input { + background-color: #111; +} + +.litegraph .bullet_icon { + margin-left: 10px; + border-radius: 10px; + width: 12px; + height: 12px; + background-color: #666; + display: inline-block; + margin-top: 2px; + margin-right: 4px; + transition: background-color 0.1s ease 0s; + -moz-transition: background-color 0.1s ease 0s; +} + +.litegraph .bullet_icon:hover { + background-color: #698; + cursor: pointer; +} + +/* OLD */ + +.graphcontextmenu { + padding: 4px; + min-width: 100px; +} + +.graphcontextmenu-title { + color: #dde; + background-color: #222; + margin: 0; + padding: 2px; + cursor: default; +} + +.graphmenu-entry { + box-sizing: border-box; + margin: 2px; + padding-left: 20px; + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + transition: all linear 0.3s; +} + +.graphmenu-entry.event, +.litemenu-entry.event { + border-left: 8px solid orange; + padding-left: 12px; +} + +.graphmenu-entry.disabled { + opacity: 0.3; +} + +.graphmenu-entry.submenu { + border-right: 2px solid #eee; +} + +.graphmenu-entry:hover { + background-color: #555; +} + +.graphmenu-entry.separator { + background-color: #111; + border-bottom: 1px solid #666; + height: 1px; + width: calc(100% - 20px); + -moz-width: calc(100% - 20px); + -webkit-width: calc(100% - 20px); +} + +.graphmenu-entry .property_name { + display: inline-block; + text-align: left; + min-width: 80px; + min-height: 1.2em; +} + +.graphmenu-entry .property_value, +.litemenu-entry .property_value { + display: inline-block; + background-color: rgba(0, 0, 0, 0.5); + text-align: right; + min-width: 80px; + min-height: 1.2em; + vertical-align: middle; + padding-right: 10px; +} + +.graphdialog { + position: absolute; + top: 10px; + left: 10px; + min-height: 2em; + background-color: #333; + font-size: 1.2em; + box-shadow: 0 0 10px black !important; + z-index: 10; +} + +.graphdialog.rounded { + border-radius: 12px; + padding-right: 2px; +} + +.graphdialog .name { + display: inline-block; + min-width: 60px; + min-height: 1.5em; + padding-left: 10px; +} + +.graphdialog input, +.graphdialog textarea, +.graphdialog select { + margin: 3px; + min-width: 60px; + min-height: 1.5em; + background-color: black; + border: 0; + color: white; + padding-left: 10px; + outline: none; +} + +.graphdialog textarea { + min-height: 150px; +} + +.graphdialog button { + margin-top: 3px; + vertical-align: top; + background-color: #999; + border: 0; +} + +.graphdialog button.rounded, +.graphdialog input.rounded { + border-radius: 0 12px 12px 0; +} + +.graphdialog .helper { + overflow: auto; + max-height: 200px; +} + +.graphdialog .help-item { + padding-left: 10px; +} + +.graphdialog .help-item:hover, +.graphdialog .help-item.selected { + cursor: pointer; + background-color: white; + color: black; +} + +.litegraph .dialog { + min-height: 0; +} +.litegraph .dialog .dialog-content { +display: block; +} +.litegraph .dialog .dialog-content .subgraph_property { +padding: 5px; +} +.litegraph .dialog .dialog-footer { +margin: 0; +} +.litegraph .dialog .dialog-footer .subgraph_property { +margin-top: 0; +display: flex; +align-items: center; +padding: 5px; +} +.litegraph .dialog .dialog-footer .subgraph_property .name { +flex: 1; +} +.litegraph .graphdialog { +display: flex; +align-items: center; +border-radius: 20px; +padding: 4px 10px; +position: fixed; +} +.litegraph .graphdialog .name { +padding: 0; +min-height: 0; +font-size: 16px; +vertical-align: middle; +} +.litegraph .graphdialog .value { +font-size: 16px; +min-height: 0; +margin: 0 10px; +padding: 2px 5px; +} +.litegraph .graphdialog input[type="checkbox"] { +width: 16px; +height: 16px; +} +.litegraph .graphdialog button { +padding: 4px 18px; +border-radius: 20px; +cursor: pointer; +} + diff --git a/javascript/materialxtoy/litegraph/litegraph.js b/javascript/materialxtoy/litegraph/litegraph.js new file mode 100644 index 00000000..7f7e519b --- /dev/null +++ b/javascript/materialxtoy/litegraph/litegraph.js @@ -0,0 +1,14454 @@ + +(function(global) { + // ************************************************************* + // LiteGraph CLASS ******* + // ************************************************************* + + /** + * The Global Scope. It contains all the registered node classes. + * + * @class LiteGraph + * @constructor + */ + + var LiteGraph = (global.LiteGraph = { + VERSION: 0.4, + + CANVAS_GRID_SIZE: 10, + + NODE_TITLE_HEIGHT: 30, + NODE_TITLE_TEXT_Y: 20, + NODE_SLOT_HEIGHT: 20, + NODE_WIDGET_HEIGHT: 20, + NODE_WIDTH: 140, + NODE_MIN_WIDTH: 50, + NODE_COLLAPSED_RADIUS: 10, + NODE_COLLAPSED_WIDTH: 80, + NODE_TITLE_COLOR: "#999", + NODE_SELECTED_TITLE_COLOR: "#FFF", + NODE_TEXT_SIZE: 14, + NODE_TEXT_COLOR: "#AAA", + NODE_SUBTEXT_SIZE: 12, + NODE_DEFAULT_COLOR: "#333", + NODE_DEFAULT_BGCOLOR: "#353535", + NODE_DEFAULT_BOXCOLOR: "#666", + NODE_DEFAULT_SHAPE: "box", + NODE_BOX_OUTLINE_COLOR: "#FFF", + DEFAULT_SHADOW_COLOR: "rgba(0,0,0,0.5)", + DEFAULT_GROUP_FONT: 24, + + WIDGET_BGCOLOR: "#222", + WIDGET_OUTLINE_COLOR: "#666", + WIDGET_TEXT_COLOR: "#DDD", + WIDGET_SECONDARY_TEXT_COLOR: "#999", + + LINK_COLOR: "#9A9", + EVENT_LINK_COLOR: "#A86", + CONNECTING_LINK_COLOR: "#AFA", + + MAX_NUMBER_OF_NODES: 1000, //avoid infinite loops + DEFAULT_POSITION: [100, 100], //default node position + VALID_SHAPES: ["default", "box", "round", "card"], //,"circle" + + //shapes are used for nodes but also for slots + BOX_SHAPE: 1, + ROUND_SHAPE: 2, + CIRCLE_SHAPE: 3, + CARD_SHAPE: 4, + ARROW_SHAPE: 5, + GRID_SHAPE: 6, // intended for slot arrays + + //enums + INPUT: 1, + OUTPUT: 2, + + EVENT: -1, //for outputs + ACTION: -1, //for inputs + + NODE_MODES: ["Always", "On Event", "Never", "On Trigger"], // helper, will add "On Request" and more in the future + NODE_MODES_COLORS:["#666","#422","#333","#224","#626"], // use with node_box_coloured_by_mode + ALWAYS: 0, + ON_EVENT: 1, + NEVER: 2, + ON_TRIGGER: 3, + + UP: 1, + DOWN: 2, + LEFT: 3, + RIGHT: 4, + CENTER: 5, + + LINK_RENDER_MODES: ["Straight", "Linear", "Spline"], // helper + STRAIGHT_LINK: 0, + LINEAR_LINK: 1, + SPLINE_LINK: 2, + + NORMAL_TITLE: 0, + NO_TITLE: 1, + TRANSPARENT_TITLE: 2, + AUTOHIDE_TITLE: 3, + VERTICAL_LAYOUT: "vertical", // arrange nodes vertically + + proxy: null, //used to redirect calls + node_images_path: "", + + debug: false, + catch_exceptions: true, + throw_errors: true, + allow_scripts: false, //if set to true some nodes like Formula would be allowed to evaluate code that comes from unsafe sources (like node configuration), which could lead to exploits + use_deferred_actions: true, //executes actions during the graph execution flow + registered_node_types: {}, //nodetypes by string + node_types_by_file_extension: {}, //used for dropping files in the canvas + Nodes: {}, //node types by classname + Globals: {}, //used to store vars between graphs + + searchbox_extras: {}, //used to add extra features to the search box + auto_sort_node_types: false, // [true!] If set to true, will automatically sort node types / categories in the context menus + + node_box_coloured_when_on: false, // [true!] this make the nodes box (top left circle) coloured when triggered (execute/action), visual feedback + node_box_coloured_by_mode: false, // [true!] nodebox based on node mode, visual feedback + + dialog_close_on_mouse_leave: true, // [false on mobile] better true if not touch device, TODO add an helper/listener to close if false + dialog_close_on_mouse_leave_delay: 500, + + shift_click_do_break_link_from: false, // [false!] prefer false if results too easy to break links - implement with ALT or TODO custom keys + click_do_break_link_to: false, // [false!]prefer false, way too easy to break links + + search_hide_on_mouse_leave: true, // [false on mobile] better true if not touch device, TODO add an helper/listener to close if false + search_filter_enabled: false, // [true!] enable filtering slots type in the search widget, !requires auto_load_slot_types or manual set registered_slot_[in/out]_types and slot_types_[in/out] + search_show_all_on_open: true, // [true!] opens the results list when opening the search widget + + auto_load_slot_types: false, // [if want false, use true, run, get vars values to be statically set, than disable] nodes types and nodeclass association with node types need to be calculated, if dont want this, calculate once and set registered_slot_[in/out]_types and slot_types_[in/out] + + // set these values if not using auto_load_slot_types + registered_slot_in_types: {}, // slot types for nodeclass + registered_slot_out_types: {}, // slot types for nodeclass + slot_types_in: [], // slot types IN + slot_types_out: [], // slot types OUT + slot_types_default_in: [], // specify for each IN slot type a(/many) default node(s), use single string, array, or object (with node, title, parameters, ..) like for search + slot_types_default_out: [], // specify for each OUT slot type a(/many) default node(s), use single string, array, or object (with node, title, parameters, ..) like for search + + alt_drag_do_clone_nodes: false, // [true!] very handy, ALT click to clone and drag the new node + + do_add_triggers_slots: false, // [true!] will create and connect event slots when using action/events connections, !WILL CHANGE node mode when using onTrigger (enable mode colors), onExecuted does not need this + + allow_multi_output_for_events: true, // [false!] being events, it is strongly reccomended to use them sequentially, one by one + + middle_click_slot_add_default_node: false, //[true!] allows to create and connect a ndoe clicking with the third button (wheel) + + release_link_on_empty_shows_menu: false, //[true!] dragging a link to empty space will open a menu, add from list, search or defaults + + pointerevents_method: "mouse", // "mouse"|"pointer" use mouse for retrocompatibility issues? (none found @ now) + // TODO implement pointercancel, gotpointercapture, lostpointercapture, (pointerover, pointerout if necessary) + + ctrl_shift_v_paste_connect_unselected_outputs: false, //[true!] allows ctrl + shift + v to paste nodes with the outputs of the unselected nodes connected with the inputs of the newly pasted nodes + + // if true, all newly created nodes/links will use string UUIDs for their id fields instead of integers. + // use this if you must have node IDs that are unique across all graphs and subgraphs. + use_uuids: false, + + /** + * Register a node class so it can be listed when the user wants to create a new one + * @method registerNodeType + * @param {String} type name of the node and path + * @param {Class} base_class class containing the structure of a node + */ + + registerNodeType: function(type, base_class) { + if (!base_class.prototype) { + throw "Cannot register a simple object, it must be a class with a prototype"; + } + base_class.type = type; + + if (LiteGraph.debug) { + console.log("Node registered: " + type); + } + + const classname = base_class.name; + + const pos = type.lastIndexOf("/"); + base_class.category = type.substring(0, pos); + + if (!base_class.title) { + base_class.title = classname; + } + + //extend class + for (var i in LGraphNode.prototype) { + if (!base_class.prototype[i]) { + base_class.prototype[i] = LGraphNode.prototype[i]; + } + } + + const prev = this.registered_node_types[type]; + if(prev) { + console.log("replacing node type: " + type); + } + if( !Object.prototype.hasOwnProperty.call( base_class.prototype, "shape") ) { + Object.defineProperty(base_class.prototype, "shape", { + set: function(v) { + switch (v) { + case "default": + delete this._shape; + break; + case "box": + this._shape = LiteGraph.BOX_SHAPE; + break; + case "round": + this._shape = LiteGraph.ROUND_SHAPE; + break; + case "circle": + this._shape = LiteGraph.CIRCLE_SHAPE; + break; + case "card": + this._shape = LiteGraph.CARD_SHAPE; + break; + default: + this._shape = v; + } + }, + get: function() { + return this._shape; + }, + enumerable: true, + configurable: true + }); + + + //used to know which nodes to create when dragging files to the canvas + if (base_class.supported_extensions) { + for (let i in base_class.supported_extensions) { + const ext = base_class.supported_extensions[i]; + if(ext && ext.constructor === String) { + this.node_types_by_file_extension[ ext.toLowerCase() ] = base_class; + } + } + } + } + + this.registered_node_types[type] = base_class; + if (base_class.constructor.name) { + this.Nodes[classname] = base_class; + } + if (LiteGraph.onNodeTypeRegistered) { + LiteGraph.onNodeTypeRegistered(type, base_class); + } + if (prev && LiteGraph.onNodeTypeReplaced) { + LiteGraph.onNodeTypeReplaced(type, base_class, prev); + } + + //warnings + if (base_class.prototype.onPropertyChange) { + console.warn( + "LiteGraph node class " + + type + + " has onPropertyChange method, it must be called onPropertyChanged with d at the end" + ); + } + + // TODO one would want to know input and ouput :: this would allow through registerNodeAndSlotType to get all the slots types + if (this.auto_load_slot_types) { + new base_class(base_class.title || "tmpnode"); + } + }, + + /** + * removes a node type from the system + * @method unregisterNodeType + * @param {String|Object} type name of the node or the node constructor itself + */ + unregisterNodeType: function(type) { + const base_class = + type.constructor === String + ? this.registered_node_types[type] + : type; + if (!base_class) { + throw "node type not found: " + type; + } + delete this.registered_node_types[base_class.type]; + if (base_class.constructor.name) { + delete this.Nodes[base_class.constructor.name]; + } + }, + + /** + * Save a slot type and his node + * @method registerSlotType + * @param {String|Object} type name of the node or the node constructor itself + * @param {String} slot_type name of the slot type (variable type), eg. string, number, array, boolean, .. + */ + registerNodeAndSlotType: function(type, slot_type, out){ + out = out || false; + const base_class = + type.constructor === String && + this.registered_node_types[type] !== "anonymous" + ? this.registered_node_types[type] + : type; + + const class_type = base_class.constructor.type; + + let allTypes = []; + if (typeof slot_type === "string") { + allTypes = slot_type.split(","); + } else if (slot_type == this.EVENT || slot_type == this.ACTION) { + allTypes = ["_event_"]; + } else { + allTypes = ["*"]; + } + + for (let i = 0; i < allTypes.length; ++i) { + let slotType = allTypes[i]; + if (slotType === "") { + slotType = "*"; + } + const registerTo = out + ? "registered_slot_out_types" + : "registered_slot_in_types"; + if (this[registerTo][slotType] === undefined) { + this[registerTo][slotType] = { nodes: [] }; + } + if (!this[registerTo][slotType].nodes.includes(class_type)) { + this[registerTo][slotType].nodes.push(class_type); + } + + // check if is a new type + if (!out) { + if (!this.slot_types_in.includes(slotType.toLowerCase())) { + this.slot_types_in.push(slotType.toLowerCase()); + this.slot_types_in.sort(); + } + } else { + if (!this.slot_types_out.includes(slotType.toLowerCase())) { + this.slot_types_out.push(slotType.toLowerCase()); + this.slot_types_out.sort(); + } + } + } + }, + + /** + * Create a new nodetype by passing an object with some properties + * like onCreate, inputs:Array, outputs:Array, properties, onExecute + * @method buildNodeClassFromObject + * @param {String} name node name with namespace (p.e.: 'math/sum') + * @param {Object} object methods expected onCreate, inputs, outputs, properties, onExecute + */ + buildNodeClassFromObject: function( + name, + object + ) { + var ctor_code = ""; + if(object.inputs) + for(var i=0; i < object.inputs.length; ++i) + { + var _name = object.inputs[i][0]; + var _type = object.inputs[i][1]; + if(_type && _type.constructor === String) + _type = '"'+_type+'"'; + ctor_code += "this.addInput('"+_name+"',"+_type+");\n"; + } + if(object.outputs) + for(var i=0; i < object.outputs.length; ++i) + { + var _name = object.outputs[i][0]; + var _type = object.outputs[i][1]; + if(_type && _type.constructor === String) + _type = '"'+_type+'"'; + ctor_code += "this.addOutput('"+_name+"',"+_type+");\n"; + } + if(object.properties) + for(var i in object.properties) + { + var prop = object.properties[i]; + if(prop && prop.constructor === String) + prop = '"'+prop+'"'; + ctor_code += "this.addProperty('"+i+"',"+prop+");\n"; + } + ctor_code += "if(this.onCreate)this.onCreate()"; + var classobj = Function(ctor_code); + for(var i in object) + if(i!="inputs" && i!="outputs" && i!="properties") + classobj.prototype[i] = object[i]; + classobj.title = object.title || name.split("/").pop(); + classobj.desc = object.desc || "Generated from object"; + this.registerNodeType(name, classobj); + return classobj; + }, + + /** + * Create a new nodetype by passing a function, it wraps it with a proper class and generates inputs according to the parameters of the function. + * Useful to wrap simple methods that do not require properties, and that only process some input to generate an output. + * @method wrapFunctionAsNode + * @param {String} name node name with namespace (p.e.: 'math/sum') + * @param {Function} func + * @param {Array} param_types [optional] an array containing the type of every parameter, otherwise parameters will accept any type + * @param {String} return_type [optional] string with the return type, otherwise it will be generic + * @param {Object} properties [optional] properties to be configurable + */ + wrapFunctionAsNode: function( + name, + func, + param_types, + return_type, + properties + ) { + var params = Array(func.length); + var code = ""; + if(param_types !== null) //null means no inputs + { + var names = LiteGraph.getParameterNames(func); + for (var i = 0; i < names.length; ++i) { + var type = 0; + if(param_types) + { + //type = param_types[i] != null ? "'" + param_types[i] + "'" : "0"; + if( param_types[i] != null && param_types[i].constructor === String ) + type = "'" + param_types[i] + "'" ; + else if( param_types[i] != null ) + type = param_types[i]; + } + code += + "this.addInput('" + + names[i] + + "'," + + type + + ");\n"; + } + } + if(return_type !== null) //null means no output + code += + "this.addOutput('out'," + + (return_type != null ? (return_type.constructor === String ? "'" + return_type + "'" : return_type) : 0) + + ");\n"; + if (properties) { + code += + "this.properties = " + JSON.stringify(properties) + ";\n"; + } + var classobj = Function(code); + classobj.title = name.split("/").pop(); + classobj.desc = "Generated from " + func.name; + classobj.prototype.onExecute = function onExecute() { + for (var i = 0; i < params.length; ++i) { + params[i] = this.getInputData(i); + } + var r = func.apply(this, params); + this.setOutputData(0, r); + }; + this.registerNodeType(name, classobj); + return classobj; + }, + + /** + * Removes all previously registered node's types + */ + clearRegisteredTypes: function() { + this.registered_node_types = {}; + this.node_types_by_file_extension = {}; + this.Nodes = {}; + this.searchbox_extras = {}; + }, + + /** + * Adds this method to all nodetypes, existing and to be created + * (You can add it to LGraphNode.prototype but then existing node types wont have it) + * @method addNodeMethod + * @param {Function} func + */ + addNodeMethod: function(name, func) { + LGraphNode.prototype[name] = func; + for (var i in this.registered_node_types) { + var type = this.registered_node_types[i]; + if (type.prototype[name]) { + type.prototype["_" + name] = type.prototype[name]; + } //keep old in case of replacing + type.prototype[name] = func; + } + }, + + /** + * Create a node of a given type with a name. The node is not attached to any graph yet. + * @method createNode + * @param {String} type full name of the node class. p.e. "math/sin" + * @param {String} name a name to distinguish from other nodes + * @param {Object} options to set options + */ + + createNode: function(type, title, options) { + var base_class = this.registered_node_types[type]; + if (!base_class) { + if (LiteGraph.debug) { + console.log( + 'GraphNode type "' + type + '" not registered.' + ); + } + return null; + } + + var prototype = base_class.prototype || base_class; + + title = title || base_class.title || type; + + var node = null; + + if (LiteGraph.catch_exceptions) { + try { + node = new base_class(title); + } catch (err) { + console.error(err); + return null; + } + } else { + node = new base_class(title); + } + + node.type = type; + + if (!node.title && title) { + node.title = title; + } + if (!node.properties) { + node.properties = {}; + } + if (!node.properties_info) { + node.properties_info = []; + } + if (!node.flags) { + node.flags = {}; + } + if (!node.size) { + node.size = node.computeSize(); + //call onresize? + } + if (!node.pos) { + node.pos = LiteGraph.DEFAULT_POSITION.concat(); + } + if (!node.mode) { + node.mode = LiteGraph.ALWAYS; + } + + //extra options + if (options) { + for (var i in options) { + node[i] = options[i]; + } + } + + // callback + if ( node.onNodeCreated ) { + node.onNodeCreated(); + } + + return node; + }, + + /** + * Returns a registered node type with a given name + * @method getNodeType + * @param {String} type full name of the node class. p.e. "math/sin" + * @return {Class} the node class + */ + getNodeType: function(type) { + return this.registered_node_types[type]; + }, + + /** + * Returns a list of node types matching one category + * @method getNodeType + * @param {String} category category name + * @return {Array} array with all the node classes + */ + + getNodeTypesInCategory: function(category, filter) { + var r = []; + for (var i in this.registered_node_types) { + var type = this.registered_node_types[i]; + if (type.filter != filter) { + continue; + } + + if (category == "") { + if (type.category == null) { + r.push(type); + } + } else if (type.category == category) { + r.push(type); + } + } + + if (this.auto_sort_node_types) { + r.sort(function(a,b){return a.title.localeCompare(b.title)}); + } + + return r; + }, + + /** + * Returns a list with all the node type categories + * @method getNodeTypesCategories + * @param {String} filter only nodes with ctor.filter equal can be shown + * @return {Array} array with all the names of the categories + */ + getNodeTypesCategories: function( filter ) { + var categories = { "": 1 }; + for (var i in this.registered_node_types) { + var type = this.registered_node_types[i]; + if ( type.category && !type.skip_list ) + { + if(type.filter != filter) + continue; + categories[type.category] = 1; + } + } + var result = []; + for (var i in categories) { + result.push(i); + } + return this.auto_sort_node_types ? result.sort() : result; + }, + + //debug purposes: reloads all the js scripts that matches a wildcard + reloadNodes: function(folder_wildcard) { + var tmp = document.getElementsByTagName("script"); + //weird, this array changes by its own, so we use a copy + var script_files = []; + for (var i=0; i < tmp.length; i++) { + script_files.push(tmp[i]); + } + + var docHeadObj = document.getElementsByTagName("head")[0]; + folder_wildcard = document.location.href + folder_wildcard; + + for (var i=0; i < script_files.length; i++) { + var src = script_files[i].src; + if ( + !src || + src.substr(0, folder_wildcard.length) != folder_wildcard + ) { + continue; + } + + try { + if (LiteGraph.debug) { + console.log("Reloading: " + src); + } + var dynamicScript = document.createElement("script"); + dynamicScript.type = "text/javascript"; + dynamicScript.src = src; + docHeadObj.appendChild(dynamicScript); + docHeadObj.removeChild(script_files[i]); + } catch (err) { + if (LiteGraph.throw_errors) { + throw err; + } + if (LiteGraph.debug) { + console.log("Error while reloading " + src); + } + } + } + + if (LiteGraph.debug) { + console.log("Nodes reloaded"); + } + }, + + //separated just to improve if it doesn't work + cloneObject: function(obj, target) { + if (obj == null) { + return null; + } + var r = JSON.parse(JSON.stringify(obj)); + if (!target) { + return r; + } + + for (var i in r) { + target[i] = r[i]; + } + return target; + }, + + /* + * https://gist.github.com/jed/982883?permalink_comment_id=852670#gistcomment-852670 + */ + uuidv4: function() { + return ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,a=>(a^Math.random()*16>>a/4).toString(16)); + }, + + /** + * Returns if the types of two slots are compatible (taking into account wildcards, etc) + * @method isValidConnection + * @param {String} type_a + * @param {String} type_b + * @return {Boolean} true if they can be connected + */ + isValidConnection: function(type_a, type_b) { + if (type_a=="" || type_a==="*") type_a = 0; + if (type_b=="" || type_b==="*") type_b = 0; + if ( + !type_a //generic output + || !type_b // generic input + || type_a == type_b //same type (is valid for triggers) + || (type_a == LiteGraph.EVENT && type_b == LiteGraph.ACTION) + ) { + return true; + } + + // Enforce string type to handle toLowerCase call (-1 number not ok) + type_a = String(type_a); + type_b = String(type_b); + type_a = type_a.toLowerCase(); + type_b = type_b.toLowerCase(); + + // For nodes supporting multiple connection types + if (type_a.indexOf(",") == -1 && type_b.indexOf(",") == -1) { + return type_a == type_b; + } + + // Check all permutations to see if one is valid + var supported_types_a = type_a.split(","); + var supported_types_b = type_b.split(","); + for (var i = 0; i < supported_types_a.length; ++i) { + for (var j = 0; j < supported_types_b.length; ++j) { + if(this.isValidConnection(supported_types_a[i],supported_types_b[j])){ + //if (supported_types_a[i] == supported_types_b[j]) { + return true; + } + } + } + + return false; + }, + + /** + * Register a string in the search box so when the user types it it will recommend this node + * @method registerSearchboxExtra + * @param {String} node_type the node recommended + * @param {String} description text to show next to it + * @param {Object} data it could contain info of how the node should be configured + * @return {Boolean} true if they can be connected + */ + registerSearchboxExtra: function(node_type, description, data) { + this.searchbox_extras[description.toLowerCase()] = { + type: node_type, + desc: description, + data: data + }; + }, + + /** + * Wrapper to load files (from url using fetch or from file using FileReader) + * @method fetchFile + * @param {String|File|Blob} url the url of the file (or the file itself) + * @param {String} type an string to know how to fetch it: "text","arraybuffer","json","blob" + * @param {Function} on_complete callback(data) + * @param {Function} on_error in case of an error + * @return {FileReader|Promise} returns the object used to + */ + fetchFile: function( url, type, on_complete, on_error ) { + var that = this; + if(!url) + return null; + + type = type || "text"; + if( url.constructor === String ) + { + if (url.substr(0, 4) == "http" && LiteGraph.proxy) { + url = LiteGraph.proxy + url.substr(url.indexOf(":") + 3); + } + return fetch(url) + .then(function(response) { + if(!response.ok) + throw new Error("File not found"); //it will be catch below + if(type == "arraybuffer") + return response.arrayBuffer(); + else if(type == "text" || type == "string") + return response.text(); + else if(type == "json") + return response.json(); + else if(type == "blob") + return response.blob(); + }) + .then(function(data) { + if(on_complete) + on_complete(data); + }) + .catch(function(error) { + console.error("error fetching file:",url); + if(on_error) + on_error(error); + }); + } + else if( url.constructor === File || url.constructor === Blob) + { + var reader = new FileReader(); + reader.onload = function(e) + { + var v = e.target.result; + if( type == "json" ) + v = JSON.parse(v); + if(on_complete) + on_complete(v); + } + if(type == "arraybuffer") + return reader.readAsArrayBuffer(url); + else if(type == "text" || type == "json") + return reader.readAsText(url); + else if(type == "blob") + return reader.readAsBinaryString(url); + } + return null; + } + }); + + //timer that works everywhere + if (typeof performance != "undefined") { + LiteGraph.getTime = performance.now.bind(performance); + } else if (typeof Date != "undefined" && Date.now) { + LiteGraph.getTime = Date.now.bind(Date); + } else if (typeof process != "undefined") { + LiteGraph.getTime = function() { + var t = process.hrtime(); + return t[0] * 0.001 + t[1] * 1e-6; + }; + } else { + LiteGraph.getTime = function getTime() { + return new Date().getTime(); + }; + } + + //********************************************************************************* + // LGraph CLASS + //********************************************************************************* + + /** + * LGraph is the class that contain a full graph. We instantiate one and add nodes to it, and then we can run the execution loop. + * supported callbacks: + + onNodeAdded: when a new node is added to the graph + + onNodeRemoved: when a node inside this graph is removed + + onNodeConnectionChange: some connection has changed in the graph (connected or disconnected) + * + * @class LGraph + * @constructor + * @param {Object} o data from previous serialization [optional] + */ + + function LGraph(o) { + if (LiteGraph.debug) { + console.log("Graph created"); + } + this.list_of_graphcanvas = null; + this.clear(); + + if (o) { + this.configure(o); + } + } + + global.LGraph = LiteGraph.LGraph = LGraph; + + //default supported types + LGraph.supported_types = ["number", "string", "boolean"]; + + //used to know which types of connections support this graph (some graphs do not allow certain types) + LGraph.prototype.getSupportedTypes = function() { + return this.supported_types || LGraph.supported_types; + }; + + LGraph.STATUS_STOPPED = 1; + LGraph.STATUS_RUNNING = 2; + + /** + * Removes all nodes from this graph + * @method clear + */ + + LGraph.prototype.clear = function() { + this.stop(); + this.status = LGraph.STATUS_STOPPED; + + this.last_node_id = 0; + this.last_link_id = 0; + + this._version = -1; //used to detect changes + + //safe clear + if (this._nodes) { + for (var i = 0; i < this._nodes.length; ++i) { + var node = this._nodes[i]; + if (node.onRemoved) { + node.onRemoved(); + } + } + } + + //nodes + this._nodes = []; + this._nodes_by_id = {}; + this._nodes_in_order = []; //nodes sorted in execution order + this._nodes_executable = null; //nodes that contain onExecute sorted in execution order + + //other scene stuff + this._groups = []; + + //links + this.links = {}; //container with all the links + + //iterations + this.iteration = 0; + + //custom data + this.config = {}; + this.vars = {}; + this.extra = {}; //to store custom data + + //timing + this.globaltime = 0; + this.runningtime = 0; + this.fixedtime = 0; + this.fixedtime_lapse = 0.01; + this.elapsed_time = 0.01; + this.last_update_time = 0; + this.starttime = 0; + + this.catch_errors = true; + + this.nodes_executing = []; + this.nodes_actioning = []; + this.nodes_executedAction = []; + + //subgraph_data + this.inputs = {}; + this.outputs = {}; + + //notify canvas to redraw + this.change(); + + this.sendActionToCanvas("clear"); + }; + + /** + * Attach Canvas to this graph + * @method attachCanvas + * @param {GraphCanvas} graph_canvas + */ + + LGraph.prototype.attachCanvas = function(graphcanvas) { + if (graphcanvas.constructor != LGraphCanvas) { + throw "attachCanvas expects a LGraphCanvas instance"; + } + if (graphcanvas.graph && graphcanvas.graph != this) { + graphcanvas.graph.detachCanvas(graphcanvas); + } + + graphcanvas.graph = this; + + if (!this.list_of_graphcanvas) { + this.list_of_graphcanvas = []; + } + this.list_of_graphcanvas.push(graphcanvas); + }; + + /** + * Detach Canvas from this graph + * @method detachCanvas + * @param {GraphCanvas} graph_canvas + */ + LGraph.prototype.detachCanvas = function(graphcanvas) { + if (!this.list_of_graphcanvas) { + return; + } + + var pos = this.list_of_graphcanvas.indexOf(graphcanvas); + if (pos == -1) { + return; + } + graphcanvas.graph = null; + this.list_of_graphcanvas.splice(pos, 1); + }; + + /** + * Starts running this graph every interval milliseconds. + * @method start + * @param {number} interval amount of milliseconds between executions, if 0 then it renders to the monitor refresh rate + */ + + LGraph.prototype.start = function(interval) { + if (this.status == LGraph.STATUS_RUNNING) { + return; + } + this.status = LGraph.STATUS_RUNNING; + + if (this.onPlayEvent) { + this.onPlayEvent(); + } + + this.sendEventToAllNodes("onStart"); + + //launch + this.starttime = LiteGraph.getTime(); + this.last_update_time = this.starttime; + interval = interval || 0; + var that = this; + + //execute once per frame + if ( interval == 0 && typeof window != "undefined" && window.requestAnimationFrame ) { + function on_frame() { + if (that.execution_timer_id != -1) { + return; + } + window.requestAnimationFrame(on_frame); + if(that.onBeforeStep) + that.onBeforeStep(); + that.runStep(1, !that.catch_errors); + if(that.onAfterStep) + that.onAfterStep(); + } + this.execution_timer_id = -1; + on_frame(); + } else { //execute every 'interval' ms + this.execution_timer_id = setInterval(function() { + //execute + if(that.onBeforeStep) + that.onBeforeStep(); + that.runStep(1, !that.catch_errors); + if(that.onAfterStep) + that.onAfterStep(); + }, interval); + } + }; + + /** + * Stops the execution loop of the graph + * @method stop execution + */ + + LGraph.prototype.stop = function() { + if (this.status == LGraph.STATUS_STOPPED) { + return; + } + + this.status = LGraph.STATUS_STOPPED; + + if (this.onStopEvent) { + this.onStopEvent(); + } + + if (this.execution_timer_id != null) { + if (this.execution_timer_id != -1) { + clearInterval(this.execution_timer_id); + } + this.execution_timer_id = null; + } + + this.sendEventToAllNodes("onStop"); + }; + + /** + * Run N steps (cycles) of the graph + * @method runStep + * @param {number} num number of steps to run, default is 1 + * @param {Boolean} do_not_catch_errors [optional] if you want to try/catch errors + * @param {number} limit max number of nodes to execute (used to execute from start to a node) + */ + + LGraph.prototype.runStep = function(num, do_not_catch_errors, limit ) { + num = num || 1; + + var start = LiteGraph.getTime(); + this.globaltime = 0.001 * (start - this.starttime); + + //not optimal: executes possible pending actions in node, problem is it is not optimized + //it is done here as if it was done in the later loop it wont be called in the node missed the onExecute + + //from now on it will iterate only on executable nodes which is faster + var nodes = this._nodes_executable + ? this._nodes_executable + : this._nodes; + if (!nodes) { + return; + } + + limit = limit || nodes.length; + + if (do_not_catch_errors) { + //iterations + for (var i = 0; i < num; i++) { + for (var j = 0; j < limit; ++j) { + var node = nodes[j]; + if(LiteGraph.use_deferred_actions && node._waiting_actions && node._waiting_actions.length) + node.executePendingActions(); + if (node.mode == LiteGraph.ALWAYS && node.onExecute) { + //wrap node.onExecute(); + node.doExecute(); + } + } + + this.fixedtime += this.fixedtime_lapse; + if (this.onExecuteStep) { + this.onExecuteStep(); + } + } + + if (this.onAfterExecute) { + this.onAfterExecute(); + } + } else { //catch errors + try { + //iterations + for (var i = 0; i < num; i++) { + for (var j = 0; j < limit; ++j) { + var node = nodes[j]; + if(LiteGraph.use_deferred_actions && node._waiting_actions && node._waiting_actions.length) + node.executePendingActions(); + if (node.mode == LiteGraph.ALWAYS && node.onExecute) { + node.onExecute(); + } + } + + this.fixedtime += this.fixedtime_lapse; + if (this.onExecuteStep) { + this.onExecuteStep(); + } + } + + if (this.onAfterExecute) { + this.onAfterExecute(); + } + this.errors_in_execution = false; + } catch (err) { + this.errors_in_execution = true; + if (LiteGraph.throw_errors) { + throw err; + } + if (LiteGraph.debug) { + console.log("Error during execution: " + err); + } + this.stop(); + } + } + + var now = LiteGraph.getTime(); + var elapsed = now - start; + if (elapsed == 0) { + elapsed = 1; + } + this.execution_time = 0.001 * elapsed; + this.globaltime += 0.001 * elapsed; + this.iteration += 1; + this.elapsed_time = (now - this.last_update_time) * 0.001; + this.last_update_time = now; + this.nodes_executing = []; + this.nodes_actioning = []; + this.nodes_executedAction = []; + }; + + /** + * Updates the graph execution order according to relevance of the nodes (nodes with only outputs have more relevance than + * nodes with only inputs. + * @method updateExecutionOrder + */ + LGraph.prototype.updateExecutionOrder = function() { + this._nodes_in_order = this.computeExecutionOrder(false); + this._nodes_executable = []; + for (var i = 0; i < this._nodes_in_order.length; ++i) { + if (this._nodes_in_order[i].onExecute) { + this._nodes_executable.push(this._nodes_in_order[i]); + } + } + }; + + //This is more internal, it computes the executable nodes in order and returns it + LGraph.prototype.computeExecutionOrder = function( + only_onExecute, + set_level + ) { + var L = []; + var S = []; + var M = {}; + var visited_links = {}; //to avoid repeating links + var remaining_links = {}; //to a + + //search for the nodes without inputs (starting nodes) + for (var i = 0, l = this._nodes.length; i < l; ++i) { + var node = this._nodes[i]; + if (only_onExecute && !node.onExecute) { + continue; + } + + M[node.id] = node; //add to pending nodes + + var num = 0; //num of input connections + if (node.inputs) { + for (var j = 0, l2 = node.inputs.length; j < l2; j++) { + if (node.inputs[j] && node.inputs[j].link != null) { + num += 1; + } + } + } + + if (num == 0) { + //is a starting node + S.push(node); + if (set_level) { + node._level = 1; + } + } //num of input links + else { + if (set_level) { + node._level = 0; + } + remaining_links[node.id] = num; + } + } + + while (true) { + if (S.length == 0) { + break; + } + + //get an starting node + var node = S.shift(); + L.push(node); //add to ordered list + delete M[node.id]; //remove from the pending nodes + + if (!node.outputs) { + continue; + } + + //for every output + for (var i = 0; i < node.outputs.length; i++) { + var output = node.outputs[i]; + //not connected + if ( + output == null || + output.links == null || + output.links.length == 0 + ) { + continue; + } + + //for every connection + for (var j = 0; j < output.links.length; j++) { + var link_id = output.links[j]; + var link = this.links[link_id]; + if (!link) { + continue; + } + + //already visited link (ignore it) + if (visited_links[link.id]) { + continue; + } + + var target_node = this.getNodeById(link.target_id); + if (target_node == null) { + visited_links[link.id] = true; + continue; + } + + if ( + set_level && + (!target_node._level || + target_node._level <= node._level) + ) { + target_node._level = node._level + 1; + } + + visited_links[link.id] = true; //mark as visited + remaining_links[target_node.id] -= 1; //reduce the number of links remaining + if (remaining_links[target_node.id] == 0) { + S.push(target_node); + } //if no more links, then add to starters array + } + } + } + + //the remaining ones (loops) + for (var i in M) { + L.push(M[i]); + } + + if (L.length != this._nodes.length && LiteGraph.debug) { + console.warn("something went wrong, nodes missing"); + } + + var l = L.length; + + //save order number in the node + for (var i = 0; i < l; ++i) { + L[i].order = i; + } + + //sort now by priority + L = L.sort(function(A, B) { + var Ap = A.constructor.priority || A.priority || 0; + var Bp = B.constructor.priority || B.priority || 0; + if (Ap == Bp) { + //if same priority, sort by order + return A.order - B.order; + } + return Ap - Bp; //sort by priority + }); + + //save order number in the node, again... + for (var i = 0; i < l; ++i) { + L[i].order = i; + } + + return L; + }; + + /** + * Returns all the nodes that could affect this one (ancestors) by crawling all the inputs recursively. + * It doesn't include the node itself + * @method getAncestors + * @return {Array} an array with all the LGraphNodes that affect this node, in order of execution + */ + LGraph.prototype.getAncestors = function(node) { + var ancestors = []; + var pending = [node]; + var visited = {}; + + while (pending.length) { + var current = pending.shift(); + if (!current.inputs) { + continue; + } + if (!visited[current.id] && current != node) { + visited[current.id] = true; + ancestors.push(current); + } + + for (var i = 0; i < current.inputs.length; ++i) { + var input = current.getInputNode(i); + if (input && ancestors.indexOf(input) == -1) { + pending.push(input); + } + } + } + + ancestors.sort(function(a, b) { + return a.order - b.order; + }); + return ancestors; + }; + + /** + * Positions every node in a more readable manner + * @method arrange + */ + LGraph.prototype.arrange = function (margin, layout) { + margin = margin || 100; + + const nodes = this.computeExecutionOrder(false, true); + const columns = []; + for (let i = 0; i < nodes.length; ++i) { + const node = nodes[i]; + const col = node._level || 1; + if (!columns[col]) { + columns[col] = []; + } + columns[col].push(node); + } + + let x = margin; + + for (let i = 0; i < columns.length; ++i) { + const column = columns[i]; + if (!column) { + continue; + } + let max_size = 100; + let y = margin + LiteGraph.NODE_TITLE_HEIGHT; + for (let j = 0; j < column.length; ++j) { + const node = column[j]; + node.pos[0] = (layout == LiteGraph.VERTICAL_LAYOUT) ? y : x; + node.pos[1] = (layout == LiteGraph.VERTICAL_LAYOUT) ? x : y; + const max_size_index = (layout == LiteGraph.VERTICAL_LAYOUT) ? 1 : 0; + if (node.size[max_size_index] > max_size) { + max_size = node.size[max_size_index]; + } + const node_size_index = (layout == LiteGraph.VERTICAL_LAYOUT) ? 0 : 1; + y += node.size[node_size_index] + margin + LiteGraph.NODE_TITLE_HEIGHT; + } + x += max_size + margin; + } + + this.setDirtyCanvas(true, true); + }; + + /** + * Returns the amount of time the graph has been running in milliseconds + * @method getTime + * @return {number} number of milliseconds the graph has been running + */ + LGraph.prototype.getTime = function() { + return this.globaltime; + }; + + /** + * Returns the amount of time accumulated using the fixedtime_lapse var. This is used in context where the time increments should be constant + * @method getFixedTime + * @return {number} number of milliseconds the graph has been running + */ + + LGraph.prototype.getFixedTime = function() { + return this.fixedtime; + }; + + /** + * Returns the amount of time it took to compute the latest iteration. Take into account that this number could be not correct + * if the nodes are using graphical actions + * @method getElapsedTime + * @return {number} number of milliseconds it took the last cycle + */ + + LGraph.prototype.getElapsedTime = function() { + return this.elapsed_time; + }; + + /** + * Sends an event to all the nodes, useful to trigger stuff + * @method sendEventToAllNodes + * @param {String} eventname the name of the event (function to be called) + * @param {Array} params parameters in array format + */ + LGraph.prototype.sendEventToAllNodes = function(eventname, params, mode) { + mode = mode || LiteGraph.ALWAYS; + + var nodes = this._nodes_in_order ? this._nodes_in_order : this._nodes; + if (!nodes) { + return; + } + + for (var j = 0, l = nodes.length; j < l; ++j) { + var node = nodes[j]; + + if ( + node.constructor === LiteGraph.Subgraph && + eventname != "onExecute" + ) { + if (node.mode == mode) { + node.sendEventToAllNodes(eventname, params, mode); + } + continue; + } + + if (!node[eventname] || node.mode != mode) { + continue; + } + if (params === undefined) { + node[eventname](); + } else if (params && params.constructor === Array) { + node[eventname].apply(node, params); + } else { + node[eventname](params); + } + } + }; + + LGraph.prototype.sendActionToCanvas = function(action, params) { + if (!this.list_of_graphcanvas) { + return; + } + + for (var i = 0; i < this.list_of_graphcanvas.length; ++i) { + var c = this.list_of_graphcanvas[i]; + if (c[action]) { + c[action].apply(c, params); + } + } + }; + + /** + * Adds a new node instance to this graph + * @method add + * @param {LGraphNode} node the instance of the node + */ + + LGraph.prototype.add = function(node, skip_compute_order) { + if (!node) { + return; + } + + //groups + if (node.constructor === LGraphGroup) { + this._groups.push(node); + this.setDirtyCanvas(true); + this.change(); + node.graph = this; + this._version++; + return; + } + + //nodes + if (node.id != -1 && this._nodes_by_id[node.id] != null) { + console.warn( + "LiteGraph: there is already a node with this ID, changing it" + ); + if (LiteGraph.use_uuids) { + node.id = LiteGraph.uuidv4(); + } + else { + node.id = ++this.last_node_id; + } + } + + if (this._nodes.length >= LiteGraph.MAX_NUMBER_OF_NODES) { + throw "LiteGraph: max number of nodes in a graph reached"; + } + + //give him an id + if (LiteGraph.use_uuids) { + if (node.id == null || node.id == -1) + node.id = LiteGraph.uuidv4(); + } + else { + if (node.id == null || node.id == -1) { + node.id = ++this.last_node_id; + } else if (this.last_node_id < node.id) { + this.last_node_id = node.id; + } + } + + node.graph = this; + this._version++; + + this._nodes.push(node); + this._nodes_by_id[node.id] = node; + + if (node.onAdded) { + node.onAdded(this); + } + + if (this.config.align_to_grid) { + node.alignToGrid(); + } + + if (!skip_compute_order) { + this.updateExecutionOrder(); + } + + if (this.onNodeAdded) { + this.onNodeAdded(node); + } + + this.setDirtyCanvas(true); + this.change(); + + return node; //to chain actions + }; + + /** + * Removes a node from the graph + * @method remove + * @param {LGraphNode} node the instance of the node + */ + + LGraph.prototype.remove = function(node) { + if (node.constructor === LiteGraph.LGraphGroup) { + var index = this._groups.indexOf(node); + if (index != -1) { + this._groups.splice(index, 1); + } + node.graph = null; + this._version++; + this.setDirtyCanvas(true, true); + this.change(); + return; + } + + if (this._nodes_by_id[node.id] == null) { + return; + } //not found + + if (node.ignore_remove) { + return; + } //cannot be removed + + this.beforeChange(); //sure? - almost sure is wrong + + //disconnect inputs + if (node.inputs) { + for (var i = 0; i < node.inputs.length; i++) { + var slot = node.inputs[i]; + if (slot.link != null) { + node.disconnectInput(i); + } + } + } + + //disconnect outputs + if (node.outputs) { + for (var i = 0; i < node.outputs.length; i++) { + var slot = node.outputs[i]; + if (slot.links != null && slot.links.length) { + node.disconnectOutput(i); + } + } + } + + //node.id = -1; //why? + + //callback + if (node.onRemoved) { + node.onRemoved(); + } + + node.graph = null; + this._version++; + + //remove from canvas render + if (this.list_of_graphcanvas) { + for (var i = 0; i < this.list_of_graphcanvas.length; ++i) { + var canvas = this.list_of_graphcanvas[i]; + if (canvas.selected_nodes[node.id]) { + delete canvas.selected_nodes[node.id]; + } + if (canvas.node_dragged == node) { + canvas.node_dragged = null; + } + } + } + + //remove from containers + var pos = this._nodes.indexOf(node); + if (pos != -1) { + this._nodes.splice(pos, 1); + } + delete this._nodes_by_id[node.id]; + + if (this.onNodeRemoved) { + this.onNodeRemoved(node); + } + + //close panels + this.sendActionToCanvas("checkPanels"); + + this.setDirtyCanvas(true, true); + this.afterChange(); //sure? - almost sure is wrong + this.change(); + + this.updateExecutionOrder(); + }; + + /** + * Returns a node by its id. + * @method getNodeById + * @param {Number} id + */ + + LGraph.prototype.getNodeById = function(id) { + if (id == null) { + return null; + } + return this._nodes_by_id[id]; + }; + + /** + * Returns a list of nodes that matches a class + * @method findNodesByClass + * @param {Class} classObject the class itself (not an string) + * @return {Array} a list with all the nodes of this type + */ + LGraph.prototype.findNodesByClass = function(classObject, result) { + result = result || []; + result.length = 0; + for (var i = 0, l = this._nodes.length; i < l; ++i) { + if (this._nodes[i].constructor === classObject) { + result.push(this._nodes[i]); + } + } + return result; + }; + + /** + * Returns a list of nodes that matches a type + * @method findNodesByType + * @param {String} type the name of the node type + * @return {Array} a list with all the nodes of this type + */ + LGraph.prototype.findNodesByType = function(type, result) { + var type = type.toLowerCase(); + result = result || []; + result.length = 0; + for (var i = 0, l = this._nodes.length; i < l; ++i) { + if (this._nodes[i].type.toLowerCase() == type) { + result.push(this._nodes[i]); + } + } + return result; + }; + + /** + * Returns the first node that matches a name in its title + * @method findNodeByTitle + * @param {String} name the name of the node to search + * @return {Node} the node or null + */ + LGraph.prototype.findNodeByTitle = function(title) { + for (var i = 0, l = this._nodes.length; i < l; ++i) { + if (this._nodes[i].title == title) { + return this._nodes[i]; + } + } + return null; + }; + + /** + * Returns a list of nodes that matches a name + * @method findNodesByTitle + * @param {String} name the name of the node to search + * @return {Array} a list with all the nodes with this name + */ + LGraph.prototype.findNodesByTitle = function(title) { + var result = []; + for (var i = 0, l = this._nodes.length; i < l; ++i) { + if (this._nodes[i].title == title) { + result.push(this._nodes[i]); + } + } + return result; + }; + + /** + * Returns the top-most node in this position of the canvas + * @method getNodeOnPos + * @param {number} x the x coordinate in canvas space + * @param {number} y the y coordinate in canvas space + * @param {Array} nodes_list a list with all the nodes to search from, by default is all the nodes in the graph + * @return {LGraphNode} the node at this position or null + */ + LGraph.prototype.getNodeOnPos = function(x, y, nodes_list, margin) { + nodes_list = nodes_list || this._nodes; + var nRet = null; + for (var i = nodes_list.length - 1; i >= 0; i--) { + var n = nodes_list[i]; + if (n.isPointInside(x, y, margin)) { + // check for lesser interest nodes (TODO check for overlapping, use the top) + /*if (typeof n == "LGraphGroup"){ + nRet = n; + }else{*/ + return n; + /*}*/ + } + } + return nRet; + }; + + /** + * Returns the top-most group in that position + * @method getGroupOnPos + * @param {number} x the x coordinate in canvas space + * @param {number} y the y coordinate in canvas space + * @return {LGraphGroup} the group or null + */ + LGraph.prototype.getGroupOnPos = function(x, y) { + for (var i = this._groups.length - 1; i >= 0; i--) { + var g = this._groups[i]; + if (g.isPointInside(x, y, 2, true)) { + return g; + } + } + return null; + }; + + /** + * Checks that the node type matches the node type registered, used when replacing a nodetype by a newer version during execution + * this replaces the ones using the old version with the new version + * @method checkNodeTypes + */ + LGraph.prototype.checkNodeTypes = function() { + var changes = false; + for (var i = 0; i < this._nodes.length; i++) { + var node = this._nodes[i]; + var ctor = LiteGraph.registered_node_types[node.type]; + if (node.constructor == ctor) { + continue; + } + console.log("node being replaced by newer version: " + node.type); + var newnode = LiteGraph.createNode(node.type); + changes = true; + this._nodes[i] = newnode; + newnode.configure(node.serialize()); + newnode.graph = this; + this._nodes_by_id[newnode.id] = newnode; + if (node.inputs) { + newnode.inputs = node.inputs.concat(); + } + if (node.outputs) { + newnode.outputs = node.outputs.concat(); + } + } + this.updateExecutionOrder(); + }; + + // ********** GLOBALS ***************** + + LGraph.prototype.onAction = function(action, param, options) { + this._input_nodes = this.findNodesByClass( + LiteGraph.GraphInput, + this._input_nodes + ); + for (var i = 0; i < this._input_nodes.length; ++i) { + var node = this._input_nodes[i]; + if (node.properties.name != action) { + continue; + } + //wrap node.onAction(action, param); + node.actionDo(action, param, options); + break; + } + }; + + LGraph.prototype.trigger = function(action, param) { + if (this.onTrigger) { + this.onTrigger(action, param); + } + }; + + /** + * Tell this graph it has a global graph input of this type + * @method addGlobalInput + * @param {String} name + * @param {String} type + * @param {*} value [optional] + */ + LGraph.prototype.addInput = function(name, type, value) { + var input = this.inputs[name]; + if (input) { + //already exist + return; + } + + this.beforeChange(); + this.inputs[name] = { name: name, type: type, value: value }; + this._version++; + this.afterChange(); + + if (this.onInputAdded) { + this.onInputAdded(name, type); + } + + if (this.onInputsOutputsChange) { + this.onInputsOutputsChange(); + } + }; + + /** + * Assign a data to the global graph input + * @method setGlobalInputData + * @param {String} name + * @param {*} data + */ + LGraph.prototype.setInputData = function(name, data) { + var input = this.inputs[name]; + if (!input) { + return; + } + input.value = data; + }; + + /** + * Returns the current value of a global graph input + * @method getInputData + * @param {String} name + * @return {*} the data + */ + LGraph.prototype.getInputData = function(name) { + var input = this.inputs[name]; + if (!input) { + return null; + } + return input.value; + }; + + /** + * Changes the name of a global graph input + * @method renameInput + * @param {String} old_name + * @param {String} new_name + */ + LGraph.prototype.renameInput = function(old_name, name) { + if (name == old_name) { + return; + } + + if (!this.inputs[old_name]) { + return false; + } + + if (this.inputs[name]) { + console.error("there is already one input with that name"); + return false; + } + + this.inputs[name] = this.inputs[old_name]; + delete this.inputs[old_name]; + this._version++; + + if (this.onInputRenamed) { + this.onInputRenamed(old_name, name); + } + + if (this.onInputsOutputsChange) { + this.onInputsOutputsChange(); + } + }; + + /** + * Changes the type of a global graph input + * @method changeInputType + * @param {String} name + * @param {String} type + */ + LGraph.prototype.changeInputType = function(name, type) { + if (!this.inputs[name]) { + return false; + } + + if ( + this.inputs[name].type && + String(this.inputs[name].type).toLowerCase() == + String(type).toLowerCase() + ) { + return; + } + + this.inputs[name].type = type; + this._version++; + if (this.onInputTypeChanged) { + this.onInputTypeChanged(name, type); + } + }; + + /** + * Removes a global graph input + * @method removeInput + * @param {String} name + * @param {String} type + */ + LGraph.prototype.removeInput = function(name) { + if (!this.inputs[name]) { + return false; + } + + delete this.inputs[name]; + this._version++; + + if (this.onInputRemoved) { + this.onInputRemoved(name); + } + + if (this.onInputsOutputsChange) { + this.onInputsOutputsChange(); + } + return true; + }; + + /** + * Creates a global graph output + * @method addOutput + * @param {String} name + * @param {String} type + * @param {*} value + */ + LGraph.prototype.addOutput = function(name, type, value) { + this.outputs[name] = { name: name, type: type, value: value }; + this._version++; + + if (this.onOutputAdded) { + this.onOutputAdded(name, type); + } + + if (this.onInputsOutputsChange) { + this.onInputsOutputsChange(); + } + }; + + /** + * Assign a data to the global output + * @method setOutputData + * @param {String} name + * @param {String} value + */ + LGraph.prototype.setOutputData = function(name, value) { + var output = this.outputs[name]; + if (!output) { + return; + } + output.value = value; + }; + + /** + * Returns the current value of a global graph output + * @method getOutputData + * @param {String} name + * @return {*} the data + */ + LGraph.prototype.getOutputData = function(name) { + var output = this.outputs[name]; + if (!output) { + return null; + } + return output.value; + }; + + /** + * Renames a global graph output + * @method renameOutput + * @param {String} old_name + * @param {String} new_name + */ + LGraph.prototype.renameOutput = function(old_name, name) { + if (!this.outputs[old_name]) { + return false; + } + + if (this.outputs[name]) { + console.error("there is already one output with that name"); + return false; + } + + this.outputs[name] = this.outputs[old_name]; + delete this.outputs[old_name]; + this._version++; + + if (this.onOutputRenamed) { + this.onOutputRenamed(old_name, name); + } + + if (this.onInputsOutputsChange) { + this.onInputsOutputsChange(); + } + }; + + /** + * Changes the type of a global graph output + * @method changeOutputType + * @param {String} name + * @param {String} type + */ + LGraph.prototype.changeOutputType = function(name, type) { + if (!this.outputs[name]) { + return false; + } + + if ( + this.outputs[name].type && + String(this.outputs[name].type).toLowerCase() == + String(type).toLowerCase() + ) { + return; + } + + this.outputs[name].type = type; + this._version++; + if (this.onOutputTypeChanged) { + this.onOutputTypeChanged(name, type); + } + }; + + /** + * Removes a global graph output + * @method removeOutput + * @param {String} name + */ + LGraph.prototype.removeOutput = function(name) { + if (!this.outputs[name]) { + return false; + } + delete this.outputs[name]; + this._version++; + + if (this.onOutputRemoved) { + this.onOutputRemoved(name); + } + + if (this.onInputsOutputsChange) { + this.onInputsOutputsChange(); + } + return true; + }; + + LGraph.prototype.triggerInput = function(name, value) { + var nodes = this.findNodesByTitle(name); + for (var i = 0; i < nodes.length; ++i) { + nodes[i].onTrigger(value); + } + }; + + LGraph.prototype.setCallback = function(name, func) { + var nodes = this.findNodesByTitle(name); + for (var i = 0; i < nodes.length; ++i) { + nodes[i].setTrigger(func); + } + }; + + //used for undo, called before any change is made to the graph + LGraph.prototype.beforeChange = function(info) { + if (this.onBeforeChange) { + this.onBeforeChange(this,info); + } + this.sendActionToCanvas("onBeforeChange", this); + }; + + //used to resend actions, called after any change is made to the graph + LGraph.prototype.afterChange = function(info) { + if (this.onAfterChange) { + this.onAfterChange(this,info); + } + this.sendActionToCanvas("onAfterChange", this); + }; + + LGraph.prototype.connectionChange = function(node, link_info) { + this.updateExecutionOrder(); + if (this.onConnectionChange) { + this.onConnectionChange(node); + } + this._version++; + this.sendActionToCanvas("onConnectionChange"); + }; + + /** + * returns if the graph is in live mode + * @method isLive + */ + + LGraph.prototype.isLive = function() { + if (!this.list_of_graphcanvas) { + return false; + } + + for (var i = 0; i < this.list_of_graphcanvas.length; ++i) { + var c = this.list_of_graphcanvas[i]; + if (c.live_mode) { + return true; + } + } + return false; + }; + + /** + * clears the triggered slot animation in all links (stop visual animation) + * @method clearTriggeredSlots + */ + LGraph.prototype.clearTriggeredSlots = function() { + for (var i in this.links) { + var link_info = this.links[i]; + if (!link_info) { + continue; + } + if (link_info._last_time) { + link_info._last_time = 0; + } + } + }; + + /* Called when something visually changed (not the graph!) */ + LGraph.prototype.change = function() { + if (LiteGraph.debug) { + console.log("Graph changed"); + } + this.sendActionToCanvas("setDirty", [true, true]); + if (this.on_change) { + this.on_change(this); + } + }; + + LGraph.prototype.setDirtyCanvas = function(fg, bg) { + this.sendActionToCanvas("setDirty", [fg, bg]); + }; + + /** + * Destroys a link + * @method removeLink + * @param {Number} link_id + */ + LGraph.prototype.removeLink = function(link_id) { + var link = this.links[link_id]; + if (!link) { + return; + } + var node = this.getNodeById(link.target_id); + if (node) { + node.disconnectInput(link.target_slot); + } + }; + + //save and recover app state *************************************** + /** + * Creates a Object containing all the info about this graph, it can be serialized + * @method serialize + * @return {Object} value of the node + */ + LGraph.prototype.serialize = function() { + var nodes_info = []; + for (var i = 0, l = this._nodes.length; i < l; ++i) { + nodes_info.push(this._nodes[i].serialize()); + } + + //pack link info into a non-verbose format + var links = []; + for (var i in this.links) { + //links is an OBJECT + var link = this.links[i]; + if (!link.serialize) { + //weird bug I havent solved yet + console.warn( + "weird LLink bug, link info is not a LLink but a regular object" + ); + var link2 = new LLink(); + for (var j in link) { + link2[j] = link[j]; + } + this.links[i] = link2; + link = link2; + } + + links.push(link.serialize()); + } + + var groups_info = []; + for (var i = 0; i < this._groups.length; ++i) { + groups_info.push(this._groups[i].serialize()); + } + + var data = { + last_node_id: this.last_node_id, + last_link_id: this.last_link_id, + nodes: nodes_info, + links: links, + groups: groups_info, + config: this.config, + extra: this.extra, + version: LiteGraph.VERSION + }; + + if(this.onSerialize) + this.onSerialize(data); + + return data; + }; + + /** + * Configure a graph from a JSON string + * @method configure + * @param {String} str configure a graph from a JSON string + * @param {Boolean} returns if there was any error parsing + */ + LGraph.prototype.configure = function(data, keep_old) { + if (!data) { + return; + } + + if (!keep_old) { + this.clear(); + } + + var nodes = data.nodes; + + //decode links info (they are very verbose) + if (data.links && data.links.constructor === Array) { + var links = []; + for (var i = 0; i < data.links.length; ++i) { + var link_data = data.links[i]; + if(!link_data) //weird bug + { + console.warn("serialized graph link data contains errors, skipping."); + continue; + } + var link = new LLink(); + link.configure(link_data); + links[link.id] = link; + } + data.links = links; + } + + //copy all stored fields + for (var i in data) { + if(i == "nodes" || i == "groups" ) //links must be accepted + continue; + this[i] = data[i]; + } + + var error = false; + + //create nodes + this._nodes = []; + if (nodes) { + for (var i = 0, l = nodes.length; i < l; ++i) { + var n_info = nodes[i]; //stored info + var node = LiteGraph.createNode(n_info.type, n_info.title); + if (!node) { + if (LiteGraph.debug) { + console.log( + "Node not found or has errors: " + n_info.type + ); + } + + //in case of error we create a replacement node to avoid losing info + node = new LGraphNode(); + node.last_serialization = n_info; + node.has_errors = true; + error = true; + //continue; + } + + node.id = n_info.id; //id it or it will create a new id + this.add(node, true); //add before configure, otherwise configure cannot create links + } + + //configure nodes afterwards so they can reach each other + for (var i = 0, l = nodes.length; i < l; ++i) { + var n_info = nodes[i]; + var node = this.getNodeById(n_info.id); + if (node) { + node.configure(n_info); + } + } + } + + //groups + this._groups.length = 0; + if (data.groups) { + for (var i = 0; i < data.groups.length; ++i) { + var group = new LiteGraph.LGraphGroup(); + group.configure(data.groups[i]); + this.add(group); + } + } + + this.updateExecutionOrder(); + + this.extra = data.extra || {}; + + if(this.onConfigure) + this.onConfigure(data); + + this._version++; + this.setDirtyCanvas(true, true); + return error; + }; + + LGraph.prototype.load = function(url, callback) { + var that = this; + + //from file + if(url.constructor === File || url.constructor === Blob) + { + var reader = new FileReader(); + reader.addEventListener('load', function(event) { + var data = JSON.parse(event.target.result); + that.configure(data); + if(callback) + callback(); + }); + + reader.readAsText(url); + return; + } + + //is a string, then an URL + var req = new XMLHttpRequest(); + req.open("GET", url, true); + req.send(null); + req.onload = function(oEvent) { + if (req.status !== 200) { + console.error("Error loading graph:", req.status, req.response); + return; + } + var data = JSON.parse( req.response ); + that.configure(data); + if(callback) + callback(); + }; + req.onerror = function(err) { + console.error("Error loading graph:", err); + }; + }; + + LGraph.prototype.onNodeTrace = function(node, msg, color) { + //TODO + }; + + //this is the class in charge of storing link information + function LLink(id, type, origin_id, origin_slot, target_id, target_slot) { + this.id = id; + this.type = type; + this.origin_id = origin_id; + this.origin_slot = origin_slot; + this.target_id = target_id; + this.target_slot = target_slot; + + this._data = null; + this._pos = new Float32Array(2); //center + } + + LLink.prototype.configure = function(o) { + if (o.constructor === Array) { + this.id = o[0]; + this.origin_id = o[1]; + this.origin_slot = o[2]; + this.target_id = o[3]; + this.target_slot = o[4]; + this.type = o[5]; + } else { + this.id = o.id; + this.type = o.type; + this.origin_id = o.origin_id; + this.origin_slot = o.origin_slot; + this.target_id = o.target_id; + this.target_slot = o.target_slot; + } + }; + + LLink.prototype.serialize = function() { + return [ + this.id, + this.origin_id, + this.origin_slot, + this.target_id, + this.target_slot, + this.type + ]; + }; + + LiteGraph.LLink = LLink; + + // ************************************************************* + // Node CLASS ******* + // ************************************************************* + + /* + title: string + pos: [x,y] + size: [x,y] + + input|output: every connection + + { name:string, type:string, pos: [x,y]=Optional, direction: "input"|"output", links: Array }); + + general properties: + + clip_area: if you render outside the node, it will be clipped + + unsafe_execution: not allowed for safe execution + + skip_repeated_outputs: when adding new outputs, it wont show if there is one already connected + + resizable: if set to false it wont be resizable with the mouse + + horizontal: slots are distributed horizontally + + widgets_start_y: widgets start at y distance from the top of the node + + flags object: + + collapsed: if it is collapsed + + supported callbacks: + + onAdded: when added to graph (warning: this is called BEFORE the node is configured when loading) + + onRemoved: when removed from graph + + onStart: when the graph starts playing + + onStop: when the graph stops playing + + onDrawForeground: render the inside widgets inside the node + + onDrawBackground: render the background area inside the node (only in edit mode) + + onMouseDown + + onMouseMove + + onMouseUp + + onMouseEnter + + onMouseLeave + + onExecute: execute the node + + onPropertyChanged: when a property is changed in the panel (return true to skip default behaviour) + + onGetInputs: returns an array of possible inputs + + onGetOutputs: returns an array of possible outputs + + onBounding: in case this node has a bigger bounding than the node itself (the callback receives the bounding as [x,y,w,h]) + + onDblClick: double clicked in the node + + onInputDblClick: input slot double clicked (can be used to automatically create a node connected) + + onOutputDblClick: output slot double clicked (can be used to automatically create a node connected) + + onConfigure: called after the node has been configured + + onSerialize: to add extra info when serializing (the callback receives the object that should be filled with the data) + + onSelected + + onDeselected + + onDropItem : DOM item dropped over the node + + onDropFile : file dropped over the node + + onConnectInput : if returns false the incoming connection will be canceled + + onConnectionsChange : a connection changed (new one or removed) (LiteGraph.INPUT or LiteGraph.OUTPUT, slot, true if connected, link_info, input_info ) + + onAction: action slot triggered + + getExtraMenuOptions: to add option to context menu +*/ + + /** + * Base Class for all the node type classes + * @class LGraphNode + * @param {String} name a name for the node + */ + + function LGraphNode(title) { + this._ctor(title); + } + + global.LGraphNode = LiteGraph.LGraphNode = LGraphNode; + + LGraphNode.prototype._ctor = function(title) { + this.title = title || "Unnamed"; + this.size = [LiteGraph.NODE_WIDTH, 60]; + this.graph = null; + + this._pos = new Float32Array(10, 10); + + Object.defineProperty(this, "pos", { + set: function(v) { + if (!v || v.length < 2) { + return; + } + this._pos[0] = v[0]; + this._pos[1] = v[1]; + }, + get: function() { + return this._pos; + }, + enumerable: true + }); + + if (LiteGraph.use_uuids) { + this.id = LiteGraph.uuidv4(); + } + else { + this.id = -1; //not know till not added + } + this.type = null; + + //inputs available: array of inputs + this.inputs = []; + this.outputs = []; + this.connections = []; + + //local data + this.properties = {}; //for the values + this.properties_info = []; //for the info + + this.flags = {}; + }; + + /** + * configure a node from an object containing the serialized info + * @method configure + */ + LGraphNode.prototype.configure = function(info) { + if (this.graph) { + this.graph._version++; + } + for (var j in info) { + if (j == "properties") { + //i don't want to clone properties, I want to reuse the old container + for (var k in info.properties) { + this.properties[k] = info.properties[k]; + if (this.onPropertyChanged) { + this.onPropertyChanged( k, info.properties[k] ); + } + } + continue; + } + + if (info[j] == null) { + continue; + } else if (typeof info[j] == "object") { + //object + if (this[j] && this[j].configure) { + this[j].configure(info[j]); + } else { + this[j] = LiteGraph.cloneObject(info[j], this[j]); + } + } //value + else { + this[j] = info[j]; + } + } + + if (!info.title) { + this.title = this.constructor.title; + } + + if (this.inputs) { + for (var i = 0; i < this.inputs.length; ++i) { + var input = this.inputs[i]; + var link_info = this.graph ? this.graph.links[input.link] : null; + if (this.onConnectionsChange) + this.onConnectionsChange( LiteGraph.INPUT, i, true, link_info, input ); //link_info has been created now, so its updated + + if( this.onInputAdded ) + this.onInputAdded(input); + + } + } + + if (this.outputs) { + for (var i = 0; i < this.outputs.length; ++i) { + var output = this.outputs[i]; + if (!output.links) { + continue; + } + for (var j = 0; j < output.links.length; ++j) { + var link_info = this.graph ? this.graph.links[output.links[j]] : null; + if (this.onConnectionsChange) + this.onConnectionsChange( LiteGraph.OUTPUT, i, true, link_info, output ); //link_info has been created now, so its updated + } + + if( this.onOutputAdded ) + this.onOutputAdded(output); + } + } + + if( this.widgets ) + { + for (var i = 0; i < this.widgets.length; ++i) + { + var w = this.widgets[i]; + if(!w) + continue; + if(w.options && w.options.property && (this.properties[ w.options.property ] != undefined)) + w.value = JSON.parse( JSON.stringify( this.properties[ w.options.property ] ) ); + } + if (info.widgets_values) { + for (var i = 0; i < info.widgets_values.length; ++i) { + if (this.widgets[i]) { + this.widgets[i].value = info.widgets_values[i]; + } + } + } + } + + if (this.onConfigure) { + this.onConfigure(info); + } + }; + + /** + * serialize the content + * @method serialize + */ + + LGraphNode.prototype.serialize = function() { + //create serialization object + var o = { + id: this.id, + type: this.type, + pos: this.pos, + size: this.size, + flags: LiteGraph.cloneObject(this.flags), + order: this.order, + mode: this.mode + }; + + //special case for when there were errors + if (this.constructor === LGraphNode && this.last_serialization) { + return this.last_serialization; + } + + if (this.inputs) { + o.inputs = this.inputs; + } + + if (this.outputs) { + //clear outputs last data (because data in connections is never serialized but stored inside the outputs info) + for (var i = 0; i < this.outputs.length; i++) { + delete this.outputs[i]._data; + } + o.outputs = this.outputs; + } + + if (this.title && this.title != this.constructor.title) { + o.title = this.title; + } + + if (this.properties) { + o.properties = LiteGraph.cloneObject(this.properties); + } + + if (this.widgets && this.serialize_widgets) { + o.widgets_values = []; + for (var i = 0; i < this.widgets.length; ++i) { + if(this.widgets[i]) + o.widgets_values[i] = this.widgets[i].value; + else + o.widgets_values[i] = null; + } + } + + if (!o.type) { + o.type = this.constructor.type; + } + + if (this.color) { + o.color = this.color; + } + if (this.bgcolor) { + o.bgcolor = this.bgcolor; + } + if (this.boxcolor) { + o.boxcolor = this.boxcolor; + } + if (this.shape) { + o.shape = this.shape; + } + + if (this.onSerialize) { + if (this.onSerialize(o)) { + console.warn( + "node onSerialize shouldnt return anything, data should be stored in the object pass in the first parameter" + ); + } + } + + return o; + }; + + /* Creates a clone of this node */ + LGraphNode.prototype.clone = function() { + var node = LiteGraph.createNode(this.type); + if (!node) { + return null; + } + + //we clone it because serialize returns shared containers + var data = LiteGraph.cloneObject(this.serialize()); + + //remove links + if (data.inputs) { + for (var i = 0; i < data.inputs.length; ++i) { + data.inputs[i].link = null; + } + } + + if (data.outputs) { + for (var i = 0; i < data.outputs.length; ++i) { + if (data.outputs[i].links) { + data.outputs[i].links.length = 0; + } + } + } + + delete data["id"]; + + if (LiteGraph.use_uuids) { + data["id"] = LiteGraph.uuidv4() + } + + //remove links + node.configure(data); + + return node; + }; + + /** + * serialize and stringify + * @method toString + */ + + LGraphNode.prototype.toString = function() { + return JSON.stringify(this.serialize()); + }; + //LGraphNode.prototype.deserialize = function(info) {} //this cannot be done from within, must be done in LiteGraph + + /** + * get the title string + * @method getTitle + */ + + LGraphNode.prototype.getTitle = function() { + return this.title || this.constructor.title; + }; + + /** + * sets the value of a property + * @method setProperty + * @param {String} name + * @param {*} value + */ + LGraphNode.prototype.setProperty = function(name, value) { + if (!this.properties) { + this.properties = {}; + } + if( value === this.properties[name] ) + return; + var prev_value = this.properties[name]; + this.properties[name] = value; + if (this.onPropertyChanged) { + if( this.onPropertyChanged(name, value, prev_value) === false ) //abort change + this.properties[name] = prev_value; + } + if(this.widgets) //widgets could be linked to properties + for(var i = 0; i < this.widgets.length; ++i) + { + var w = this.widgets[i]; + if(!w) + continue; + if(w.options.property == name) + { + w.value = value; + break; + } + } + }; + + // Execution ************************* + /** + * sets the output data + * @method setOutputData + * @param {number} slot + * @param {*} data + */ + LGraphNode.prototype.setOutputData = function(slot, data) { + if (!this.outputs) { + return; + } + + //this maybe slow and a niche case + //if(slot && slot.constructor === String) + // slot = this.findOutputSlot(slot); + + if (slot == -1 || slot >= this.outputs.length) { + return; + } + + var output_info = this.outputs[slot]; + if (!output_info) { + return; + } + + //store data in the output itself in case we want to debug + output_info._data = data; + + //if there are connections, pass the data to the connections + if (this.outputs[slot].links) { + for (var i = 0; i < this.outputs[slot].links.length; i++) { + var link_id = this.outputs[slot].links[i]; + var link = this.graph.links[link_id]; + if(link) + link.data = data; + } + } + }; + + /** + * sets the output data type, useful when you want to be able to overwrite the data type + * @method setOutputDataType + * @param {number} slot + * @param {String} datatype + */ + LGraphNode.prototype.setOutputDataType = function(slot, type) { + if (!this.outputs) { + return; + } + if (slot == -1 || slot >= this.outputs.length) { + return; + } + var output_info = this.outputs[slot]; + if (!output_info) { + return; + } + //store data in the output itself in case we want to debug + output_info.type = type; + + //if there are connections, pass the data to the connections + if (this.outputs[slot].links) { + for (var i = 0; i < this.outputs[slot].links.length; i++) { + var link_id = this.outputs[slot].links[i]; + this.graph.links[link_id].type = type; + } + } + }; + + /** + * Retrieves the input data (data traveling through the connection) from one slot + * @method getInputData + * @param {number} slot + * @param {boolean} force_update if set to true it will force the connected node of this slot to output data into this link + * @return {*} data or if it is not connected returns undefined + */ + LGraphNode.prototype.getInputData = function(slot, force_update) { + if (!this.inputs) { + return; + } //undefined; + + if (slot >= this.inputs.length || this.inputs[slot].link == null) { + return; + } + + var link_id = this.inputs[slot].link; + var link = this.graph.links[link_id]; + if (!link) { + //bug: weird case but it happens sometimes + return null; + } + + if (!force_update) { + return link.data; + } + + //special case: used to extract data from the incoming connection before the graph has been executed + var node = this.graph.getNodeById(link.origin_id); + if (!node) { + return link.data; + } + + if (node.updateOutputData) { + node.updateOutputData(link.origin_slot); + } else if (node.onExecute) { + node.onExecute(); + } + + return link.data; + }; + + /** + * Retrieves the input data type (in case this supports multiple input types) + * @method getInputDataType + * @param {number} slot + * @return {String} datatype in string format + */ + LGraphNode.prototype.getInputDataType = function(slot) { + if (!this.inputs) { + return null; + } //undefined; + + if (slot >= this.inputs.length || this.inputs[slot].link == null) { + return null; + } + var link_id = this.inputs[slot].link; + var link = this.graph.links[link_id]; + if (!link) { + //bug: weird case but it happens sometimes + return null; + } + var node = this.graph.getNodeById(link.origin_id); + if (!node) { + return link.type; + } + var output_info = node.outputs[link.origin_slot]; + if (output_info) { + return output_info.type; + } + return null; + }; + + /** + * Retrieves the input data from one slot using its name instead of slot number + * @method getInputDataByName + * @param {String} slot_name + * @param {boolean} force_update if set to true it will force the connected node of this slot to output data into this link + * @return {*} data or if it is not connected returns null + */ + LGraphNode.prototype.getInputDataByName = function( + slot_name, + force_update + ) { + var slot = this.findInputSlot(slot_name); + if (slot == -1) { + return null; + } + return this.getInputData(slot, force_update); + }; + + /** + * tells you if there is a connection in one input slot + * @method isInputConnected + * @param {number} slot + * @return {boolean} + */ + LGraphNode.prototype.isInputConnected = function(slot) { + if (!this.inputs) { + return false; + } + return slot < this.inputs.length && this.inputs[slot].link != null; + }; + + /** + * tells you info about an input connection (which node, type, etc) + * @method getInputInfo + * @param {number} slot + * @return {Object} object or null { link: id, name: string, type: string or 0 } + */ + LGraphNode.prototype.getInputInfo = function(slot) { + if (!this.inputs) { + return null; + } + if (slot < this.inputs.length) { + return this.inputs[slot]; + } + return null; + }; + + /** + * Returns the link info in the connection of an input slot + * @method getInputLink + * @param {number} slot + * @return {LLink} object or null + */ + LGraphNode.prototype.getInputLink = function(slot) { + if (!this.inputs) { + return null; + } + if (slot < this.inputs.length) { + var slot_info = this.inputs[slot]; + return this.graph.links[ slot_info.link ]; + } + return null; + }; + + /** + * returns the node connected in the input slot + * @method getInputNode + * @param {number} slot + * @return {LGraphNode} node or null + */ + LGraphNode.prototype.getInputNode = function(slot) { + if (!this.inputs) { + return null; + } + if (slot >= this.inputs.length) { + return null; + } + var input = this.inputs[slot]; + if (!input || input.link === null) { + return null; + } + var link_info = this.graph.links[input.link]; + if (!link_info) { + return null; + } + return this.graph.getNodeById(link_info.origin_id); + }; + + /** + * returns the value of an input with this name, otherwise checks if there is a property with that name + * @method getInputOrProperty + * @param {string} name + * @return {*} value + */ + LGraphNode.prototype.getInputOrProperty = function(name) { + if (!this.inputs || !this.inputs.length) { + return this.properties ? this.properties[name] : null; + } + + for (var i = 0, l = this.inputs.length; i < l; ++i) { + var input_info = this.inputs[i]; + if (name == input_info.name && input_info.link != null) { + var link = this.graph.links[input_info.link]; + if (link) { + return link.data; + } + } + } + return this.properties[name]; + }; + + /** + * tells you the last output data that went in that slot + * @method getOutputData + * @param {number} slot + * @return {Object} object or null + */ + LGraphNode.prototype.getOutputData = function(slot) { + if (!this.outputs) { + return null; + } + if (slot >= this.outputs.length) { + return null; + } + + var info = this.outputs[slot]; + return info._data; + }; + + /** + * tells you info about an output connection (which node, type, etc) + * @method getOutputInfo + * @param {number} slot + * @return {Object} object or null { name: string, type: string, links: [ ids of links in number ] } + */ + LGraphNode.prototype.getOutputInfo = function(slot) { + if (!this.outputs) { + return null; + } + if (slot < this.outputs.length) { + return this.outputs[slot]; + } + return null; + }; + + /** + * tells you if there is a connection in one output slot + * @method isOutputConnected + * @param {number} slot + * @return {boolean} + */ + LGraphNode.prototype.isOutputConnected = function(slot) { + if (!this.outputs) { + return false; + } + return ( + slot < this.outputs.length && + this.outputs[slot].links && + this.outputs[slot].links.length + ); + }; + + /** + * tells you if there is any connection in the output slots + * @method isAnyOutputConnected + * @return {boolean} + */ + LGraphNode.prototype.isAnyOutputConnected = function() { + if (!this.outputs) { + return false; + } + for (var i = 0; i < this.outputs.length; ++i) { + if (this.outputs[i].links && this.outputs[i].links.length) { + return true; + } + } + return false; + }; + + /** + * retrieves all the nodes connected to this output slot + * @method getOutputNodes + * @param {number} slot + * @return {array} + */ + LGraphNode.prototype.getOutputNodes = function(slot) { + if (!this.outputs || this.outputs.length == 0) { + return null; + } + + if (slot >= this.outputs.length) { + return null; + } + + var output = this.outputs[slot]; + if (!output.links || output.links.length == 0) { + return null; + } + + var r = []; + for (var i = 0; i < output.links.length; i++) { + var link_id = output.links[i]; + var link = this.graph.links[link_id]; + if (link) { + var target_node = this.graph.getNodeById(link.target_id); + if (target_node) { + r.push(target_node); + } + } + } + return r; + }; + + LGraphNode.prototype.addOnTriggerInput = function(){ + var trigS = this.findInputSlot("onTrigger"); + if (trigS == -1){ //!trigS || + var input = this.addInput("onTrigger", LiteGraph.EVENT, {optional: true, nameLocked: true}); + return this.findInputSlot("onTrigger"); + } + return trigS; + } + + LGraphNode.prototype.addOnExecutedOutput = function(){ + var trigS = this.findOutputSlot("onExecuted"); + if (trigS == -1){ //!trigS || + var output = this.addOutput("onExecuted", LiteGraph.ACTION, {optional: true, nameLocked: true}); + return this.findOutputSlot("onExecuted"); + } + return trigS; + } + + LGraphNode.prototype.onAfterExecuteNode = function(param, options){ + var trigS = this.findOutputSlot("onExecuted"); + if (trigS != -1){ + + //console.debug(this.id+":"+this.order+" triggering slot onAfterExecute"); + //console.debug(param); + //console.debug(options); + this.triggerSlot(trigS, param, null, options); + + } + } + + LGraphNode.prototype.changeMode = function(modeTo){ + switch(modeTo){ + case LiteGraph.ON_EVENT: + // this.addOnExecutedOutput(); + break; + + case LiteGraph.ON_TRIGGER: + this.addOnTriggerInput(); + this.addOnExecutedOutput(); + break; + + case LiteGraph.NEVER: + break; + + case LiteGraph.ALWAYS: + break; + + case LiteGraph.ON_REQUEST: + break; + + default: + return false; + break; + } + this.mode = modeTo; + return true; + }; + + /** + * Triggers the execution of actions that were deferred when the action was triggered + * @method executePendingActions + */ + LGraphNode.prototype.executePendingActions = function() { + if(!this._waiting_actions || !this._waiting_actions.length) + return; + for(var i = 0; i < this._waiting_actions.length;++i) + { + var p = this._waiting_actions[i]; + this.onAction(p[0],p[1],p[2],p[3],p[4]); + } + this._waiting_actions.length = 0; + } + + + /** + * Triggers the node code execution, place a boolean/counter to mark the node as being executed + * @method doExecute + * @param {*} param + * @param {*} options + */ + LGraphNode.prototype.doExecute = function(param, options) { + options = options || {}; + if (this.onExecute){ + + // enable this to give the event an ID + if (!options.action_call) options.action_call = this.id+"_exec_"+Math.floor(Math.random()*9999); + + this.graph.nodes_executing[this.id] = true; //.push(this.id); + + this.onExecute(param, options); + + this.graph.nodes_executing[this.id] = false; //.pop(); + + // save execution/action ref + this.exec_version = this.graph.iteration; + if(options && options.action_call){ + this.action_call = options.action_call; // if (param) + this.graph.nodes_executedAction[this.id] = options.action_call; + } + } + else { + } + this.execute_triggered = 2; // the nFrames it will be used (-- each step), means "how old" is the event + if(this.onAfterExecuteNode) this.onAfterExecuteNode(param, options); // callback + }; + + /** + * Triggers an action, wrapped by logics to control execution flow + * @method actionDo + * @param {String} action name + * @param {*} param + */ + LGraphNode.prototype.actionDo = function(action, param, options, action_slot ) { + options = options || {}; + if (this.onAction){ + + // enable this to give the event an ID + if (!options.action_call) options.action_call = this.id+"_"+(action?action:"action")+"_"+Math.floor(Math.random()*9999); + + this.graph.nodes_actioning[this.id] = (action?action:"actioning"); //.push(this.id); + + this.onAction(action, param, options, action_slot); + + this.graph.nodes_actioning[this.id] = false; //.pop(); + + // save execution/action ref + if(options && options.action_call){ + this.action_call = options.action_call; // if (param) + this.graph.nodes_executedAction[this.id] = options.action_call; + } + } + this.action_triggered = 2; // the nFrames it will be used (-- each step), means "how old" is the event + if(this.onAfterExecuteNode) this.onAfterExecuteNode(param, options); + }; + + /** + * Triggers an event in this node, this will trigger any output with the same name + * @method trigger + * @param {String} event name ( "on_play", ... ) if action is equivalent to false then the event is send to all + * @param {*} param + */ + LGraphNode.prototype.trigger = function(action, param, options) { + if (!this.outputs || !this.outputs.length) { + return; + } + + if (this.graph) + this.graph._last_trigger_time = LiteGraph.getTime(); + + for (var i = 0; i < this.outputs.length; ++i) { + var output = this.outputs[i]; + if ( !output || output.type !== LiteGraph.EVENT || (action && output.name != action) ) + continue; + this.triggerSlot(i, param, null, options); + } + }; + + /** + * Triggers a slot event in this node: cycle output slots and launch execute/action on connected nodes + * @method triggerSlot + * @param {Number} slot the index of the output slot + * @param {*} param + * @param {Number} link_id [optional] in case you want to trigger and specific output link in a slot + */ + LGraphNode.prototype.triggerSlot = function(slot, param, link_id, options) { + options = options || {}; + if (!this.outputs) { + return; + } + + if(slot == null) + { + console.error("slot must be a number"); + return; + } + + if(slot.constructor !== Number) + console.warn("slot must be a number, use node.trigger('name') if you want to use a string"); + + var output = this.outputs[slot]; + if (!output) { + return; + } + + var links = output.links; + if (!links || !links.length) { + return; + } + + if (this.graph) { + this.graph._last_trigger_time = LiteGraph.getTime(); + } + + //for every link attached here + for (var k = 0; k < links.length; ++k) { + var id = links[k]; + if (link_id != null && link_id != id) { + //to skip links + continue; + } + var link_info = this.graph.links[links[k]]; + if (!link_info) { + //not connected + continue; + } + link_info._last_time = LiteGraph.getTime(); + var node = this.graph.getNodeById(link_info.target_id); + if (!node) { + //node not found? + continue; + } + + //used to mark events in graph + var target_connection = node.inputs[link_info.target_slot]; + + if (node.mode === LiteGraph.ON_TRIGGER) + { + // generate unique trigger ID if not present + if (!options.action_call) options.action_call = this.id+"_trigg_"+Math.floor(Math.random()*9999); + if (node.onExecute) { + // -- wrapping node.onExecute(param); -- + node.doExecute(param, options); + } + } + else if (node.onAction) { + // generate unique action ID if not present + if (!options.action_call) options.action_call = this.id+"_act_"+Math.floor(Math.random()*9999); + //pass the action name + var target_connection = node.inputs[link_info.target_slot]; + + //instead of executing them now, it will be executed in the next graph loop, to ensure data flow + if(LiteGraph.use_deferred_actions && node.onExecute) + { + if(!node._waiting_actions) + node._waiting_actions = []; + node._waiting_actions.push([target_connection.name, param, options, link_info.target_slot]); + } + else + { + // wrap node.onAction(target_connection.name, param); + node.actionDo( target_connection.name, param, options, link_info.target_slot ); + } + } + } + }; + + /** + * clears the trigger slot animation + * @method clearTriggeredSlot + * @param {Number} slot the index of the output slot + * @param {Number} link_id [optional] in case you want to trigger and specific output link in a slot + */ + LGraphNode.prototype.clearTriggeredSlot = function(slot, link_id) { + if (!this.outputs) { + return; + } + + var output = this.outputs[slot]; + if (!output) { + return; + } + + var links = output.links; + if (!links || !links.length) { + return; + } + + //for every link attached here + for (var k = 0; k < links.length; ++k) { + var id = links[k]; + if (link_id != null && link_id != id) { + //to skip links + continue; + } + var link_info = this.graph.links[links[k]]; + if (!link_info) { + //not connected + continue; + } + link_info._last_time = 0; + } + }; + + /** + * changes node size and triggers callback + * @method setSize + * @param {vec2} size + */ + LGraphNode.prototype.setSize = function(size) + { + this.size = size; + if(this.onResize) + this.onResize(this.size); + } + + /** + * add a new property to this node + * @method addProperty + * @param {string} name + * @param {*} default_value + * @param {string} type string defining the output type ("vec3","number",...) + * @param {Object} extra_info this can be used to have special properties of the property (like values, etc) + */ + LGraphNode.prototype.addProperty = function( + name, + default_value, + type, + extra_info + ) { + var o = { name: name, type: type, default_value: default_value }; + if (extra_info) { + for (var i in extra_info) { + o[i] = extra_info[i]; + } + } + if (!this.properties_info) { + this.properties_info = []; + } + this.properties_info.push(o); + if (!this.properties) { + this.properties = {}; + } + this.properties[name] = default_value; + return o; + }; + + //connections + + /** + * add a new output slot to use in this node + * @method addOutput + * @param {string} name + * @param {string} type string defining the output type ("vec3","number",...) + * @param {Object} extra_info this can be used to have special properties of an output (label, special color, position, etc) + */ + LGraphNode.prototype.addOutput = function(name, type, extra_info) { + var output = { name: name, type: type, links: null }; + if (extra_info) { + for (var i in extra_info) { + output[i] = extra_info[i]; + } + } + + if (!this.outputs) { + this.outputs = []; + } + this.outputs.push(output); + if (this.onOutputAdded) { + this.onOutputAdded(output); + } + + if (LiteGraph.auto_load_slot_types) LiteGraph.registerNodeAndSlotType(this,type,true); + + this.setSize( this.computeSize() ); + this.setDirtyCanvas(true, true); + return output; + }; + + /** + * add a new output slot to use in this node + * @method addOutputs + * @param {Array} array of triplets like [[name,type,extra_info],[...]] + */ + LGraphNode.prototype.addOutputs = function(array) { + for (var i = 0; i < array.length; ++i) { + var info = array[i]; + var o = { name: info[0], type: info[1], link: null }; + if (array[2]) { + for (var j in info[2]) { + o[j] = info[2][j]; + } + } + + if (!this.outputs) { + this.outputs = []; + } + this.outputs.push(o); + if (this.onOutputAdded) { + this.onOutputAdded(o); + } + + if (LiteGraph.auto_load_slot_types) LiteGraph.registerNodeAndSlotType(this,info[1],true); + + } + + this.setSize( this.computeSize() ); + this.setDirtyCanvas(true, true); + }; + + /** + * remove an existing output slot + * @method removeOutput + * @param {number} slot + */ + LGraphNode.prototype.removeOutput = function(slot) { + this.disconnectOutput(slot); + this.outputs.splice(slot, 1); + for (var i = slot; i < this.outputs.length; ++i) { + if (!this.outputs[i] || !this.outputs[i].links) { + continue; + } + var links = this.outputs[i].links; + for (var j = 0; j < links.length; ++j) { + var link = this.graph.links[links[j]]; + if (!link) { + continue; + } + link.origin_slot -= 1; + } + } + + this.setSize( this.computeSize() ); + if (this.onOutputRemoved) { + this.onOutputRemoved(slot); + } + this.setDirtyCanvas(true, true); + }; + + /** + * add a new input slot to use in this node + * @method addInput + * @param {string} name + * @param {string} type string defining the input type ("vec3","number",...), it its a generic one use 0 + * @param {Object} extra_info this can be used to have special properties of an input (label, color, position, etc) + */ + LGraphNode.prototype.addInput = function(name, type, extra_info) { + type = type || 0; + var input = { name: name, type: type, link: null }; + if (extra_info) { + for (var i in extra_info) { + input[i] = extra_info[i]; + } + } + + if (!this.inputs) { + this.inputs = []; + } + + this.inputs.push(input); + this.setSize( this.computeSize() ); + + if (this.onInputAdded) { + this.onInputAdded(input); + } + + LiteGraph.registerNodeAndSlotType(this,type); + + this.setDirtyCanvas(true, true); + return input; + }; + + /** + * add several new input slots in this node + * @method addInputs + * @param {Array} array of triplets like [[name,type,extra_info],[...]] + */ + LGraphNode.prototype.addInputs = function(array) { + for (var i = 0; i < array.length; ++i) { + var info = array[i]; + var o = { name: info[0], type: info[1], link: null }; + if (array[2]) { + for (var j in info[2]) { + o[j] = info[2][j]; + } + } + + if (!this.inputs) { + this.inputs = []; + } + this.inputs.push(o); + if (this.onInputAdded) { + this.onInputAdded(o); + } + + LiteGraph.registerNodeAndSlotType(this,info[1]); + } + + this.setSize( this.computeSize() ); + this.setDirtyCanvas(true, true); + }; + + /** + * remove an existing input slot + * @method removeInput + * @param {number} slot + */ + LGraphNode.prototype.removeInput = function(slot) { + this.disconnectInput(slot); + var slot_info = this.inputs.splice(slot, 1); + for (var i = slot; i < this.inputs.length; ++i) { + if (!this.inputs[i]) { + continue; + } + var link = this.graph.links[this.inputs[i].link]; + if (!link) { + continue; + } + link.target_slot -= 1; + } + this.setSize( this.computeSize() ); + if (this.onInputRemoved) { + this.onInputRemoved(slot, slot_info[0] ); + } + this.setDirtyCanvas(true, true); + }; + + /** + * add an special connection to this node (used for special kinds of graphs) + * @method addConnection + * @param {string} name + * @param {string} type string defining the input type ("vec3","number",...) + * @param {[x,y]} pos position of the connection inside the node + * @param {string} direction if is input or output + */ + LGraphNode.prototype.addConnection = function(name, type, pos, direction) { + var o = { + name: name, + type: type, + pos: pos, + direction: direction, + links: null + }; + this.connections.push(o); + return o; + }; + + /** + * computes the minimum size of a node according to its inputs and output slots + * @method computeSize + * @param {vec2} minHeight + * @return {vec2} the total size + */ + LGraphNode.prototype.computeSize = function(out) { + if (this.constructor.size) { + return this.constructor.size.concat(); + } + + var rows = Math.max( + this.inputs ? this.inputs.length : 1, + this.outputs ? this.outputs.length : 1 + ); + var size = out || new Float32Array([0, 0]); + rows = Math.max(rows, 1); + var font_size = LiteGraph.NODE_TEXT_SIZE; //although it should be graphcanvas.inner_text_font size + + var title_width = compute_text_size(this.title); + var input_width = 0; + var output_width = 0; + + if (this.inputs) { + for (var i = 0, l = this.inputs.length; i < l; ++i) { + var input = this.inputs[i]; + var text = input.label || input.name || ""; + var text_width = compute_text_size(text); + if (input_width < text_width) { + input_width = text_width; + } + } + } + + if (this.outputs) { + for (var i = 0, l = this.outputs.length; i < l; ++i) { + var output = this.outputs[i]; + var text = output.label || output.name || ""; + var text_width = compute_text_size(text); + if (output_width < text_width) { + output_width = text_width; + } + } + } + + size[0] = Math.max(input_width + output_width + 10, title_width); + size[0] = Math.max(size[0], LiteGraph.NODE_WIDTH); + if (this.widgets && this.widgets.length) { + size[0] = Math.max(size[0], LiteGraph.NODE_WIDTH * 1.5); + } + + size[1] = (this.constructor.slot_start_y || 0) + rows * LiteGraph.NODE_SLOT_HEIGHT; + + var widgets_height = 0; + if (this.widgets && this.widgets.length) { + for (var i = 0, l = this.widgets.length; i < l; ++i) { + if (this.widgets[i].computeSize) + widgets_height += this.widgets[i].computeSize(size[0])[1] + 4; + else + widgets_height += LiteGraph.NODE_WIDGET_HEIGHT + 4; + } + widgets_height += 8; + } + + //compute height using widgets height + if( this.widgets_up ) + size[1] = Math.max( size[1], widgets_height ); + else if( this.widgets_start_y != null ) + size[1] = Math.max( size[1], widgets_height + this.widgets_start_y ); + else + size[1] += widgets_height; + + function compute_text_size(text) { + if (!text) { + return 0; + } + return font_size * text.length * 0.6; + } + + if ( + this.constructor.min_height && + size[1] < this.constructor.min_height + ) { + size[1] = this.constructor.min_height; + } + + size[1] += 6; //margin + + return size; + }; + + /** + * returns all the info available about a property of this node. + * + * @method getPropertyInfo + * @param {String} property name of the property + * @return {Object} the object with all the available info + */ + LGraphNode.prototype.getPropertyInfo = function( property ) + { + var info = null; + + //there are several ways to define info about a property + //legacy mode + if (this.properties_info) { + for (var i = 0; i < this.properties_info.length; ++i) { + if (this.properties_info[i].name == property) { + info = this.properties_info[i]; + break; + } + } + } + //litescene mode using the constructor + if(this.constructor["@" + property]) + info = this.constructor["@" + property]; + + if(this.constructor.widgets_info && this.constructor.widgets_info[property]) + info = this.constructor.widgets_info[property]; + + //litescene mode using the constructor + if (!info && this.onGetPropertyInfo) { + info = this.onGetPropertyInfo(property); + } + + if (!info) + info = {}; + if(!info.type) + info.type = typeof this.properties[property]; + if(info.widget == "combo") + info.type = "enum"; + + return info; + } + + /** + * Defines a widget inside the node, it will be rendered on top of the node, you can control lots of properties + * + * @method addWidget + * @param {String} type the widget type (could be "number","string","combo" + * @param {String} name the text to show on the widget + * @param {String} value the default value + * @param {Function|String} callback function to call when it changes (optionally, it can be the name of the property to modify) + * @param {Object} options the object that contains special properties of this widget + * @return {Object} the created widget object + */ + LGraphNode.prototype.addWidget = function( type, name, value, callback, options ) + { + if (!this.widgets) { + this.widgets = []; + } + + if(!options && callback && callback.constructor === Object) + { + options = callback; + callback = null; + } + + if(options && options.constructor === String) //options can be the property name + options = { property: options }; + + if(callback && callback.constructor === String) //callback can be the property name + { + if(!options) + options = {}; + options.property = callback; + callback = null; + } + + if(callback && callback.constructor !== Function) + { + console.warn("addWidget: callback must be a function"); + callback = null; + } + + var w = { + type: type.toLowerCase(), + name: name, + value: value, + callback: callback, + options: options || {} + }; + + if (w.options.y !== undefined) { + w.y = w.options.y; + } + + if (!callback && !w.options.callback && !w.options.property) { + console.warn("LiteGraph addWidget(...) without a callback or property assigned"); + } + if (type == "combo" && !w.options.values) { + throw "LiteGraph addWidget('combo',...) requires to pass values in options: { values:['red','blue'] }"; + } + this.widgets.push(w); + this.setSize( this.computeSize() ); + return w; + }; + + LGraphNode.prototype.addCustomWidget = function(custom_widget) { + if (!this.widgets) { + this.widgets = []; + } + this.widgets.push(custom_widget); + return custom_widget; + }; + + /** + * returns the bounding of the object, used for rendering purposes + * @method getBounding + * @param out {Float32Array[4]?} [optional] a place to store the output, to free garbage + * @param compute_outer {boolean?} [optional] set to true to include the shadow and connection points in the bounding calculation + * @return {Float32Array[4]} the bounding box in format of [topleft_cornerx, topleft_cornery, width, height] + */ + LGraphNode.prototype.getBounding = function(out, compute_outer) { + out = out || new Float32Array(4); + const nodePos = this.pos; + const isCollapsed = this.flags.collapsed; + const nodeSize = this.size; + + let left_offset = 0; + // 1 offset due to how nodes are rendered + let right_offset = 1 ; + let top_offset = 0; + let bottom_offset = 0; + + if (compute_outer) { + // 4 offset for collapsed node connection points + left_offset = 4; + // 6 offset for right shadow and collapsed node connection points + right_offset = 6 + left_offset; + // 4 offset for collapsed nodes top connection points + top_offset = 4; + // 5 offset for bottom shadow and collapsed node connection points + bottom_offset = 5 + top_offset; + } + + out[0] = nodePos[0] - left_offset; + out[1] = nodePos[1] - LiteGraph.NODE_TITLE_HEIGHT - top_offset; + out[2] = isCollapsed ? + (this._collapsed_width || LiteGraph.NODE_COLLAPSED_WIDTH) + right_offset : + nodeSize[0] + right_offset; + out[3] = isCollapsed ? + LiteGraph.NODE_TITLE_HEIGHT + bottom_offset : + nodeSize[1] + LiteGraph.NODE_TITLE_HEIGHT + bottom_offset; + + if (this.onBounding) { + this.onBounding(out); + } + return out; + }; + + /** + * checks if a point is inside the shape of a node + * @method isPointInside + * @param {number} x + * @param {number} y + * @return {boolean} + */ + LGraphNode.prototype.isPointInside = function(x, y, margin, skip_title) { + margin = margin || 0; + + var margin_top = this.graph && this.graph.isLive() ? 0 : LiteGraph.NODE_TITLE_HEIGHT; + if (skip_title) { + margin_top = 0; + } + if (this.flags && this.flags.collapsed) { + //if ( distance([x,y], [this.pos[0] + this.size[0]*0.5, this.pos[1] + this.size[1]*0.5]) < LiteGraph.NODE_COLLAPSED_RADIUS) + if ( + isInsideRectangle( + x, + y, + this.pos[0] - margin, + this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT - margin, + (this._collapsed_width || LiteGraph.NODE_COLLAPSED_WIDTH) + + 2 * margin, + LiteGraph.NODE_TITLE_HEIGHT + 2 * margin + ) + ) { + return true; + } + } else if ( + this.pos[0] - 4 - margin < x && + this.pos[0] + this.size[0] + 4 + margin > x && + this.pos[1] - margin_top - margin < y && + this.pos[1] + this.size[1] + margin > y + ) { + return true; + } + return false; + }; + + /** + * checks if a point is inside a node slot, and returns info about which slot + * @method getSlotInPosition + * @param {number} x + * @param {number} y + * @return {Object} if found the object contains { input|output: slot object, slot: number, link_pos: [x,y] } + */ + LGraphNode.prototype.getSlotInPosition = function(x, y) { + //search for inputs + var link_pos = new Float32Array(2); + if (this.inputs) { + for (var i = 0, l = this.inputs.length; i < l; ++i) { + var input = this.inputs[i]; + this.getConnectionPos(true, i, link_pos); + if ( + isInsideRectangle( + x, + y, + link_pos[0] - 10, + link_pos[1] - 5, + 20, + 10 + ) + ) { + return { input: input, slot: i, link_pos: link_pos }; + } + } + } + + if (this.outputs) { + for (var i = 0, l = this.outputs.length; i < l; ++i) { + var output = this.outputs[i]; + this.getConnectionPos(false, i, link_pos); + if ( + isInsideRectangle( + x, + y, + link_pos[0] - 10, + link_pos[1] - 5, + 20, + 10 + ) + ) { + return { output: output, slot: i, link_pos: link_pos }; + } + } + } + + return null; + }; + + /** + * returns the input slot with a given name (used for dynamic slots), -1 if not found + * @method findInputSlot + * @param {string} name the name of the slot + * @param {boolean} returnObj if the obj itself wanted + * @return {number_or_object} the slot (-1 if not found) + */ + LGraphNode.prototype.findInputSlot = function(name, returnObj) { + if (!this.inputs) { + return -1; + } + for (var i = 0, l = this.inputs.length; i < l; ++i) { + if (name == this.inputs[i].name) { + return !returnObj ? i : this.inputs[i]; + } + } + return -1; + }; + + /** + * returns the output slot with a given name (used for dynamic slots), -1 if not found + * @method findOutputSlot + * @param {string} name the name of the slot + * @param {boolean} returnObj if the obj itself wanted + * @return {number_or_object} the slot (-1 if not found) + */ + LGraphNode.prototype.findOutputSlot = function(name, returnObj) { + returnObj = returnObj || false; + if (!this.outputs) { + return -1; + } + for (var i = 0, l = this.outputs.length; i < l; ++i) { + if (name == this.outputs[i].name) { + return !returnObj ? i : this.outputs[i]; + } + } + return -1; + }; + + // TODO refactor: USE SINGLE findInput/findOutput functions! :: merge options + + /** + * returns the first free input slot + * @method findInputSlotFree + * @param {object} options + * @return {number_or_object} the slot (-1 if not found) + */ + LGraphNode.prototype.findInputSlotFree = function(optsIn) { + var optsIn = optsIn || {}; + var optsDef = {returnObj: false + ,typesNotAccepted: [] + }; + var opts = Object.assign(optsDef,optsIn); + if (!this.inputs) { + return -1; + } + for (var i = 0, l = this.inputs.length; i < l; ++i) { + if (this.inputs[i].link && this.inputs[i].link != null) { + continue; + } + if (opts.typesNotAccepted && opts.typesNotAccepted.includes && opts.typesNotAccepted.includes(this.inputs[i].type)){ + continue; + } + return !opts.returnObj ? i : this.inputs[i]; + } + return -1; + }; + + /** + * returns the first output slot free + * @method findOutputSlotFree + * @param {object} options + * @return {number_or_object} the slot (-1 if not found) + */ + LGraphNode.prototype.findOutputSlotFree = function(optsIn) { + var optsIn = optsIn || {}; + var optsDef = { returnObj: false + ,typesNotAccepted: [] + }; + var opts = Object.assign(optsDef,optsIn); + if (!this.outputs) { + return -1; + } + for (var i = 0, l = this.outputs.length; i < l; ++i) { + if (this.outputs[i].links && this.outputs[i].links != null) { + continue; + } + if (opts.typesNotAccepted && opts.typesNotAccepted.includes && opts.typesNotAccepted.includes(this.outputs[i].type)){ + continue; + } + return !opts.returnObj ? i : this.outputs[i]; + } + return -1; + }; + + /** + * findSlotByType for INPUTS + */ + LGraphNode.prototype.findInputSlotByType = function(type, returnObj, preferFreeSlot, doNotUseOccupied) { + return this.findSlotByType(true, type, returnObj, preferFreeSlot, doNotUseOccupied); + }; + + /** + * findSlotByType for OUTPUTS + */ + LGraphNode.prototype.findOutputSlotByType = function(type, returnObj, preferFreeSlot, doNotUseOccupied) { + return this.findSlotByType(false, type, returnObj, preferFreeSlot, doNotUseOccupied); + }; + + /** + * returns the output (or input) slot with a given type, -1 if not found + * @method findSlotByType + * @param {boolean} input uise inputs instead of outputs + * @param {string} type the type of the slot + * @param {boolean} returnObj if the obj itself wanted + * @param {boolean} preferFreeSlot if we want a free slot (if not found, will return the first of the type anyway) + * @return {number_or_object} the slot (-1 if not found) + */ + LGraphNode.prototype.findSlotByType = function(input, type, returnObj, preferFreeSlot, doNotUseOccupied) { + input = input || false; + returnObj = returnObj || false; + preferFreeSlot = preferFreeSlot || false; + doNotUseOccupied = doNotUseOccupied || false; + var aSlots = input ? this.inputs : this.outputs; + if (!aSlots) { + return -1; + } + // !! empty string type is considered 0, * !! + if (type == "" || type == "*") type = 0; + for (var i = 0, l = aSlots.length; i < l; ++i) { + var tFound = false; + var aSource = (type+"").toLowerCase().split(","); + var aDest = aSlots[i].type=="0"||aSlots[i].type=="*"?"0":aSlots[i].type; + aDest = (aDest+"").toLowerCase().split(","); + for(var sI=0;sI= 0 && target_slot !== null){ + //console.debug("CONNbyTYPE type "+target_slotType+" for "+target_slot) + return this.connect(slot, target_node, target_slot); + }else{ + //console.log("type "+target_slotType+" not found or not free?") + if (opts.createEventInCase && target_slotType == LiteGraph.EVENT){ + // WILL CREATE THE onTrigger IN SLOT + //console.debug("connect WILL CREATE THE onTrigger "+target_slotType+" to "+target_node); + return this.connect(slot, target_node, -1); + } + // connect to the first general output slot if not found a specific type and + if (opts.generalTypeInCase){ + var target_slot = target_node.findInputSlotByType(0, false, true, true); + //console.debug("connect TO a general type (*, 0), if not found the specific type ",target_slotType," to ",target_node,"RES_SLOT:",target_slot); + if (target_slot >= 0){ + return this.connect(slot, target_node, target_slot); + } + } + // connect to the first free input slot if not found a specific type and this output is general + if (opts.firstFreeIfOutputGeneralInCase && (target_slotType == 0 || target_slotType == "*" || target_slotType == "")){ + var target_slot = target_node.findInputSlotFree({typesNotAccepted: [LiteGraph.EVENT] }); + //console.debug("connect TO TheFirstFREE ",target_slotType," to ",target_node,"RES_SLOT:",target_slot); + if (target_slot >= 0){ + return this.connect(slot, target_node, target_slot); + } + } + + console.debug("no way to connect type: ",target_slotType," to targetNODE ",target_node); + //TODO filter + + return null; + } + } + + /** + * connect this node input to the output of another node BY TYPE + * @method connectByType + * @param {number_or_string} slot (could be the number of the slot or the string with the name of the slot) + * @param {LGraphNode} node the target node + * @param {string} target_type the output slot type of the target node + * @return {Object} the link_info is created, otherwise null + */ + LGraphNode.prototype.connectByTypeOutput = function(slot, source_node, source_slotType, optsIn) { + var optsIn = optsIn || {}; + var optsDef = { createEventInCase: true + ,firstFreeIfInputGeneralInCase: true + ,generalTypeInCase: true + }; + var opts = Object.assign(optsDef,optsIn); + if (source_node && source_node.constructor === Number) { + source_node = this.graph.getNodeById(source_node); + } + var source_slot = source_node.findOutputSlotByType(source_slotType, false, true); + if (source_slot >= 0 && source_slot !== null){ + //console.debug("CONNbyTYPE OUT! type "+source_slotType+" for "+source_slot) + return source_node.connect(source_slot, this, slot); + }else{ + + // connect to the first general output slot if not found a specific type and + if (opts.generalTypeInCase){ + var source_slot = source_node.findOutputSlotByType(0, false, true, true); + if (source_slot >= 0){ + return source_node.connect(source_slot, this, slot); + } + } + + if (opts.createEventInCase && source_slotType == LiteGraph.EVENT){ + // WILL CREATE THE onExecuted OUT SLOT + if (LiteGraph.do_add_triggers_slots){ + var source_slot = source_node.addOnExecutedOutput(); + return source_node.connect(source_slot, this, slot); + } + } + // connect to the first free output slot if not found a specific type and this input is general + if (opts.firstFreeIfInputGeneralInCase && (source_slotType == 0 || source_slotType == "*" || source_slotType == "")){ + var source_slot = source_node.findOutputSlotFree({typesNotAccepted: [LiteGraph.EVENT] }); + if (source_slot >= 0){ + return source_node.connect(source_slot, this, slot); + } + } + + console.debug("no way to connect byOUT type: ",source_slotType," to sourceNODE ",source_node); + //TODO filter + + //console.log("type OUT! "+source_slotType+" not found or not free?") + return null; + } + } + + /** + * connect this node output to the input of another node + * @method connect + * @param {number_or_string} slot (could be the number of the slot or the string with the name of the slot) + * @param {LGraphNode} node the target node + * @param {number_or_string} target_slot the input slot of the target node (could be the number of the slot or the string with the name of the slot, or -1 to connect a trigger) + * @return {Object} the link_info is created, otherwise null + */ + LGraphNode.prototype.connect = function(slot, target_node, target_slot) { + target_slot = target_slot || 0; + + if (!this.graph) { + //could be connected before adding it to a graph + console.log( + "Connect: Error, node doesn't belong to any graph. Nodes must be added first to a graph before connecting them." + ); //due to link ids being associated with graphs + return null; + } + + //seek for the output slot + if (slot.constructor === String) { + slot = this.findOutputSlot(slot); + if (slot == -1) { + if (LiteGraph.debug) { + console.log("Connect: Error, no slot of name " + slot); + } + return null; + } + } else if (!this.outputs || slot >= this.outputs.length) { + if (LiteGraph.debug) { + console.log("Connect: Error, slot number not found"); + } + return null; + } + + if (target_node && target_node.constructor === Number) { + target_node = this.graph.getNodeById(target_node); + } + if (!target_node) { + throw "target node is null"; + } + + //avoid loopback + if (target_node == this) { + return null; + } + + //you can specify the slot by name + if (target_slot.constructor === String) { + target_slot = target_node.findInputSlot(target_slot); + if (target_slot == -1) { + if (LiteGraph.debug) { + console.log( + "Connect: Error, no slot of name " + target_slot + ); + } + return null; + } + } else if (target_slot === LiteGraph.EVENT) { + + if (LiteGraph.do_add_triggers_slots){ + //search for first slot with event? :: NO this is done outside + //console.log("Connect: Creating triggerEvent"); + // force mode + target_node.changeMode(LiteGraph.ON_TRIGGER); + target_slot = target_node.findInputSlot("onTrigger"); + }else{ + return null; // -- break -- + } + } else if ( + !target_node.inputs || + target_slot >= target_node.inputs.length + ) { + if (LiteGraph.debug) { + console.log("Connect: Error, slot number not found"); + } + return null; + } + + var changed = false; + + var input = target_node.inputs[target_slot]; + var link_info = null; + var output = this.outputs[slot]; + + if (!this.outputs[slot]){ + /*console.debug("Invalid slot passed: "+slot); + console.debug(this.outputs);*/ + return null; + } + + // allow target node to change slot + if (target_node.onBeforeConnectInput) { + // This way node can choose another slot (or make a new one?) + target_slot = target_node.onBeforeConnectInput(target_slot); //callback + } + + //check target_slot and check connection types + if (target_slot===false || target_slot===null || !LiteGraph.isValidConnection(output.type, input.type)) + { + this.setDirtyCanvas(false, true); + if(changed) + this.graph.connectionChange(this, link_info); + return null; + }else{ + //console.debug("valid connection",output.type, input.type); + } + + //allows nodes to block connection, callback + if (target_node.onConnectInput) { + if ( target_node.onConnectInput(target_slot, output.type, output, this, slot) === false ) { + return null; + } + } + if (this.onConnectOutput) { // callback + if ( this.onConnectOutput(slot, input.type, input, target_node, target_slot) === false ) { + return null; + } + } + + //if there is something already plugged there, disconnect + if (target_node.inputs[target_slot] && target_node.inputs[target_slot].link != null) { + this.graph.beforeChange(); + target_node.disconnectInput(target_slot, {doProcessChange: false}); + changed = true; + } + if (output.links !== null && output.links.length){ + switch(output.type){ + case LiteGraph.EVENT: + if (!LiteGraph.allow_multi_output_for_events){ + this.graph.beforeChange(); + this.disconnectOutput(slot, false, {doProcessChange: false}); // Input(target_slot, {doProcessChange: false}); + changed = true; + } + break; + default: + break; + } + } + + var nextId + if (LiteGraph.use_uuids) + nextId = LiteGraph.uuidv4(); + else + nextId = ++this.graph.last_link_id; + + //create link class + link_info = new LLink( + nextId, + input.type || output.type, + this.id, + slot, + target_node.id, + target_slot + ); + + //add to graph links list + this.graph.links[link_info.id] = link_info; + + //connect in output + if (output.links == null) { + output.links = []; + } + output.links.push(link_info.id); + //connect in input + target_node.inputs[target_slot].link = link_info.id; + if (this.graph) { + this.graph._version++; + } + if (this.onConnectionsChange) { + this.onConnectionsChange( + LiteGraph.OUTPUT, + slot, + true, + link_info, + output + ); + } //link_info has been created now, so its updated + if (target_node.onConnectionsChange) { + target_node.onConnectionsChange( + LiteGraph.INPUT, + target_slot, + true, + link_info, + input + ); + } + if (this.graph && this.graph.onNodeConnectionChange) { + this.graph.onNodeConnectionChange( + LiteGraph.INPUT, + target_node, + target_slot, + this, + slot + ); + this.graph.onNodeConnectionChange( + LiteGraph.OUTPUT, + this, + slot, + target_node, + target_slot + ); + } + + this.setDirtyCanvas(false, true); + this.graph.afterChange(); + this.graph.connectionChange(this, link_info); + + return link_info; + }; + + /** + * disconnect one output to an specific node + * @method disconnectOutput + * @param {number_or_string} slot (could be the number of the slot or the string with the name of the slot) + * @param {LGraphNode} target_node the target node to which this slot is connected [Optional, if not target_node is specified all nodes will be disconnected] + * @return {boolean} if it was disconnected successfully + */ + LGraphNode.prototype.disconnectOutput = function(slot, target_node) { + if (slot.constructor === String) { + slot = this.findOutputSlot(slot); + if (slot == -1) { + if (LiteGraph.debug) { + console.log("Connect: Error, no slot of name " + slot); + } + return false; + } + } else if (!this.outputs || slot >= this.outputs.length) { + if (LiteGraph.debug) { + console.log("Connect: Error, slot number not found"); + } + return false; + } + + //get output slot + var output = this.outputs[slot]; + if (!output || !output.links || output.links.length == 0) { + return false; + } + + //one of the output links in this slot + if (target_node) { + if (target_node.constructor === Number) { + target_node = this.graph.getNodeById(target_node); + } + if (!target_node) { + throw "Target Node not found"; + } + + for (var i = 0, l = output.links.length; i < l; i++) { + var link_id = output.links[i]; + var link_info = this.graph.links[link_id]; + + //is the link we are searching for... + if (link_info.target_id == target_node.id) { + output.links.splice(i, 1); //remove here + var input = target_node.inputs[link_info.target_slot]; + input.link = null; //remove there + delete this.graph.links[link_id]; //remove the link from the links pool + if (this.graph) { + this.graph._version++; + } + if (target_node.onConnectionsChange) { + target_node.onConnectionsChange( + LiteGraph.INPUT, + link_info.target_slot, + false, + link_info, + input + ); + } //link_info hasn't been modified so its ok + if (this.onConnectionsChange) { + this.onConnectionsChange( + LiteGraph.OUTPUT, + slot, + false, + link_info, + output + ); + } + if (this.graph && this.graph.onNodeConnectionChange) { + this.graph.onNodeConnectionChange( + LiteGraph.OUTPUT, + this, + slot + ); + } + if (this.graph && this.graph.onNodeConnectionChange) { + this.graph.onNodeConnectionChange( + LiteGraph.OUTPUT, + this, + slot + ); + this.graph.onNodeConnectionChange( + LiteGraph.INPUT, + target_node, + link_info.target_slot + ); + } + break; + } + } + } //all the links in this output slot + else { + for (var i = 0, l = output.links.length; i < l; i++) { + var link_id = output.links[i]; + var link_info = this.graph.links[link_id]; + if (!link_info) { + //bug: it happens sometimes + continue; + } + + var target_node = this.graph.getNodeById(link_info.target_id); + var input = null; + if (this.graph) { + this.graph._version++; + } + if (target_node) { + input = target_node.inputs[link_info.target_slot]; + input.link = null; //remove other side link + if (target_node.onConnectionsChange) { + target_node.onConnectionsChange( + LiteGraph.INPUT, + link_info.target_slot, + false, + link_info, + input + ); + } //link_info hasn't been modified so its ok + if (this.graph && this.graph.onNodeConnectionChange) { + this.graph.onNodeConnectionChange( + LiteGraph.INPUT, + target_node, + link_info.target_slot + ); + } + } + delete this.graph.links[link_id]; //remove the link from the links pool + if (this.onConnectionsChange) { + this.onConnectionsChange( + LiteGraph.OUTPUT, + slot, + false, + link_info, + output + ); + } + if (this.graph && this.graph.onNodeConnectionChange) { + this.graph.onNodeConnectionChange( + LiteGraph.OUTPUT, + this, + slot + ); + this.graph.onNodeConnectionChange( + LiteGraph.INPUT, + target_node, + link_info.target_slot + ); + } + } + output.links = null; + } + + this.setDirtyCanvas(false, true); + this.graph.connectionChange(this); + return true; + }; + + /** + * disconnect one input + * @method disconnectInput + * @param {number_or_string} slot (could be the number of the slot or the string with the name of the slot) + * @return {boolean} if it was disconnected successfully + */ + LGraphNode.prototype.disconnectInput = function(slot) { + //seek for the output slot + if (slot.constructor === String) { + slot = this.findInputSlot(slot); + if (slot == -1) { + if (LiteGraph.debug) { + console.log("Connect: Error, no slot of name " + slot); + } + return false; + } + } else if (!this.inputs || slot >= this.inputs.length) { + if (LiteGraph.debug) { + console.log("Connect: Error, slot number not found"); + } + return false; + } + + var input = this.inputs[slot]; + if (!input) { + return false; + } + + var link_id = this.inputs[slot].link; + if(link_id != null) + { + this.inputs[slot].link = null; + + //remove other side + var link_info = this.graph.links[link_id]; + if (link_info) { + var target_node = this.graph.getNodeById(link_info.origin_id); + if (!target_node) { + return false; + } + + var output = target_node.outputs[link_info.origin_slot]; + if (!output || !output.links || output.links.length == 0) { + return false; + } + + //search in the inputs list for this link + for (var i = 0, l = output.links.length; i < l; i++) { + if (output.links[i] == link_id) { + output.links.splice(i, 1); + break; + } + } + + delete this.graph.links[link_id]; //remove from the pool + if (this.graph) { + this.graph._version++; + } + if (this.onConnectionsChange) { + this.onConnectionsChange( + LiteGraph.INPUT, + slot, + false, + link_info, + input + ); + } + if (target_node.onConnectionsChange) { + target_node.onConnectionsChange( + LiteGraph.OUTPUT, + i, + false, + link_info, + output + ); + } + if (this.graph && this.graph.onNodeConnectionChange) { + this.graph.onNodeConnectionChange( + LiteGraph.OUTPUT, + target_node, + i + ); + this.graph.onNodeConnectionChange(LiteGraph.INPUT, this, slot); + } + } + } //link != null + + this.setDirtyCanvas(false, true); + if(this.graph) + this.graph.connectionChange(this); + return true; + }; + + /** + * returns the center of a connection point in canvas coords + * @method getConnectionPos + * @param {boolean} is_input true if if a input slot, false if it is an output + * @param {number_or_string} slot (could be the number of the slot or the string with the name of the slot) + * @param {vec2} out [optional] a place to store the output, to free garbage + * @return {[x,y]} the position + **/ + LGraphNode.prototype.getConnectionPos = function( + is_input, + slot_number, + out + ) { + out = out || new Float32Array(2); + var num_slots = 0; + if (is_input && this.inputs) { + num_slots = this.inputs.length; + } + if (!is_input && this.outputs) { + num_slots = this.outputs.length; + } + + var offset = LiteGraph.NODE_SLOT_HEIGHT * 0.5; + + if (this.flags.collapsed) { + var w = this._collapsed_width || LiteGraph.NODE_COLLAPSED_WIDTH; + if (this.horizontal) { + out[0] = this.pos[0] + w * 0.5; + if (is_input) { + out[1] = this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT; + } else { + out[1] = this.pos[1]; + } + } else { + if (is_input) { + out[0] = this.pos[0]; + } else { + out[0] = this.pos[0] + w; + } + out[1] = this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT * 0.5; + } + return out; + } + + //weird feature that never got finished + if (is_input && slot_number == -1) { + out[0] = this.pos[0] + LiteGraph.NODE_TITLE_HEIGHT * 0.5; + out[1] = this.pos[1] + LiteGraph.NODE_TITLE_HEIGHT * 0.5; + return out; + } + + //hard-coded pos + if ( + is_input && + num_slots > slot_number && + this.inputs[slot_number].pos + ) { + out[0] = this.pos[0] + this.inputs[slot_number].pos[0]; + out[1] = this.pos[1] + this.inputs[slot_number].pos[1]; + return out; + } else if ( + !is_input && + num_slots > slot_number && + this.outputs[slot_number].pos + ) { + out[0] = this.pos[0] + this.outputs[slot_number].pos[0]; + out[1] = this.pos[1] + this.outputs[slot_number].pos[1]; + return out; + } + + //horizontal distributed slots + if (this.horizontal) { + out[0] = + this.pos[0] + (slot_number + 0.5) * (this.size[0] / num_slots); + if (is_input) { + out[1] = this.pos[1] - LiteGraph.NODE_TITLE_HEIGHT; + } else { + out[1] = this.pos[1] + this.size[1]; + } + return out; + } + + //default vertical slots + if (is_input) { + out[0] = this.pos[0] + offset; + } else { + out[0] = this.pos[0] + this.size[0] + 1 - offset; + } + out[1] = + this.pos[1] + + (slot_number + 0.7) * LiteGraph.NODE_SLOT_HEIGHT + + (this.constructor.slot_start_y || 0); + return out; + }; + + /* Force align to grid */ + LGraphNode.prototype.alignToGrid = function() { + this.pos[0] = + LiteGraph.CANVAS_GRID_SIZE * + Math.round(this.pos[0] / LiteGraph.CANVAS_GRID_SIZE); + this.pos[1] = + LiteGraph.CANVAS_GRID_SIZE * + Math.round(this.pos[1] / LiteGraph.CANVAS_GRID_SIZE); + }; + + /* Console output */ + LGraphNode.prototype.trace = function(msg) { + if (!this.console) { + this.console = []; + } + + this.console.push(msg); + if (this.console.length > LGraphNode.MAX_CONSOLE) { + this.console.shift(); + } + + if(this.graph.onNodeTrace) + this.graph.onNodeTrace(this, msg); + }; + + /* Forces to redraw or the main canvas (LGraphNode) or the bg canvas (links) */ + LGraphNode.prototype.setDirtyCanvas = function( + dirty_foreground, + dirty_background + ) { + if (!this.graph) { + return; + } + this.graph.sendActionToCanvas("setDirty", [ + dirty_foreground, + dirty_background + ]); + }; + + LGraphNode.prototype.loadImage = function(url) { + var img = new Image(); + img.src = LiteGraph.node_images_path + url; + img.ready = false; + + var that = this; + img.onload = function() { + this.ready = true; + that.setDirtyCanvas(true); + }; + return img; + }; + + //safe LGraphNode action execution (not sure if safe) + /* +LGraphNode.prototype.executeAction = function(action) +{ + if(action == "") return false; + + if( action.indexOf(";") != -1 || action.indexOf("}") != -1) + { + this.trace("Error: Action contains unsafe characters"); + return false; + } + + var tokens = action.split("("); + var func_name = tokens[0]; + if( typeof(this[func_name]) != "function") + { + this.trace("Error: Action not found on node: " + func_name); + return false; + } + + var code = action; + + try + { + var _foo = eval; + eval = null; + (new Function("with(this) { " + code + "}")).call(this); + eval = _foo; + } + catch (err) + { + this.trace("Error executing action {" + action + "} :" + err); + return false; + } + + return true; +} +*/ + + /* Allows to get onMouseMove and onMouseUp events even if the mouse is out of focus */ + LGraphNode.prototype.captureInput = function(v) { + if (!this.graph || !this.graph.list_of_graphcanvas) { + return; + } + + var list = this.graph.list_of_graphcanvas; + + for (var i = 0; i < list.length; ++i) { + var c = list[i]; + //releasing somebody elses capture?! + if (!v && c.node_capturing_input != this) { + continue; + } + + //change + c.node_capturing_input = v ? this : null; + } + }; + + /** + * Collapse the node to make it smaller on the canvas + * @method collapse + **/ + LGraphNode.prototype.collapse = function(force) { + this.graph._version++; + if (this.constructor.collapsable === false && !force) { + return; + } + if (!this.flags.collapsed) { + this.flags.collapsed = true; + } else { + this.flags.collapsed = false; + } + this.setDirtyCanvas(true, true); + }; + + /** + * Forces the node to do not move or realign on Z + * @method pin + **/ + + LGraphNode.prototype.pin = function(v) { + this.graph._version++; + if (v === undefined) { + this.flags.pinned = !this.flags.pinned; + } else { + this.flags.pinned = v; + } + }; + + LGraphNode.prototype.localToScreen = function(x, y, graphcanvas) { + return [ + (x + this.pos[0]) * graphcanvas.scale + graphcanvas.offset[0], + (y + this.pos[1]) * graphcanvas.scale + graphcanvas.offset[1] + ]; + }; + + function LGraphGroup(title) { + this._ctor(title); + } + + global.LGraphGroup = LiteGraph.LGraphGroup = LGraphGroup; + + LGraphGroup.prototype._ctor = function(title) { + this.title = title || "Group"; + this.font_size = 24; + this.color = LGraphCanvas.node_colors.pale_blue + ? LGraphCanvas.node_colors.pale_blue.groupcolor + : "#AAA"; + this._bounding = new Float32Array([10, 10, 140, 80]); + this._pos = this._bounding.subarray(0, 2); + this._size = this._bounding.subarray(2, 4); + this._nodes = []; + this.graph = null; + + Object.defineProperty(this, "pos", { + set: function(v) { + if (!v || v.length < 2) { + return; + } + this._pos[0] = v[0]; + this._pos[1] = v[1]; + }, + get: function() { + return this._pos; + }, + enumerable: true + }); + + Object.defineProperty(this, "size", { + set: function(v) { + if (!v || v.length < 2) { + return; + } + this._size[0] = Math.max(140, v[0]); + this._size[1] = Math.max(80, v[1]); + }, + get: function() { + return this._size; + }, + enumerable: true + }); + }; + + LGraphGroup.prototype.configure = function(o) { + this.title = o.title; + this._bounding.set(o.bounding); + this.color = o.color; + this.font_size = o.font_size; + }; + + LGraphGroup.prototype.serialize = function() { + var b = this._bounding; + return { + title: this.title, + bounding: [ + Math.round(b[0]), + Math.round(b[1]), + Math.round(b[2]), + Math.round(b[3]) + ], + color: this.color, + font_size: this.font_size + }; + }; + + LGraphGroup.prototype.move = function(deltax, deltay, ignore_nodes) { + this._pos[0] += deltax; + this._pos[1] += deltay; + if (ignore_nodes) { + return; + } + for (var i = 0; i < this._nodes.length; ++i) { + var node = this._nodes[i]; + node.pos[0] += deltax; + node.pos[1] += deltay; + } + }; + + LGraphGroup.prototype.recomputeInsideNodes = function() { + this._nodes.length = 0; + var nodes = this.graph._nodes; + var node_bounding = new Float32Array(4); + + for (var i = 0; i < nodes.length; ++i) { + var node = nodes[i]; + node.getBounding(node_bounding); + if (!overlapBounding(this._bounding, node_bounding)) { + continue; + } //out of the visible area + this._nodes.push(node); + } + }; + + LGraphGroup.prototype.isPointInside = LGraphNode.prototype.isPointInside; + LGraphGroup.prototype.setDirtyCanvas = LGraphNode.prototype.setDirtyCanvas; + + //**************************************** + + //Scale and Offset + function DragAndScale(element, skip_events) { + this.offset = new Float32Array([0, 0]); + this.scale = 1; + this.max_scale = 10; + this.min_scale = 0.1; + this.onredraw = null; + this.enabled = true; + this.last_mouse = [0, 0]; + this.element = null; + this.visible_area = new Float32Array(4); + + if (element) { + this.element = element; + if (!skip_events) { + this.bindEvents(element); + } + } + } + + LiteGraph.DragAndScale = DragAndScale; + + DragAndScale.prototype.bindEvents = function(element) { + this.last_mouse = new Float32Array(2); + + this._binded_mouse_callback = this.onMouse.bind(this); + + LiteGraph.pointerListenerAdd(element,"down", this._binded_mouse_callback); + LiteGraph.pointerListenerAdd(element,"move", this._binded_mouse_callback); + LiteGraph.pointerListenerAdd(element,"up", this._binded_mouse_callback); + + element.addEventListener( + "mousewheel", + this._binded_mouse_callback, + false + ); + element.addEventListener("wheel", this._binded_mouse_callback, false); + }; + + DragAndScale.prototype.computeVisibleArea = function( viewport ) { + if (!this.element) { + this.visible_area[0] = this.visible_area[1] = this.visible_area[2] = this.visible_area[3] = 0; + return; + } + var width = this.element.width; + var height = this.element.height; + var startx = -this.offset[0]; + var starty = -this.offset[1]; + if( viewport ) + { + startx += viewport[0] / this.scale; + starty += viewport[1] / this.scale; + width = viewport[2]; + height = viewport[3]; + } + var endx = startx + width / this.scale; + var endy = starty + height / this.scale; + this.visible_area[0] = startx; + this.visible_area[1] = starty; + this.visible_area[2] = endx - startx; + this.visible_area[3] = endy - starty; + }; + + DragAndScale.prototype.onMouse = function(e) { + if (!this.enabled) { + return; + } + + var canvas = this.element; + var rect = canvas.getBoundingClientRect(); + var x = e.clientX - rect.left; + var y = e.clientY - rect.top; + e.canvasx = x; + e.canvasy = y; + e.dragging = this.dragging; + + var is_inside = !this.viewport || ( this.viewport && x >= this.viewport[0] && x < (this.viewport[0] + this.viewport[2]) && y >= this.viewport[1] && y < (this.viewport[1] + this.viewport[3]) ); + + //console.log("pointerevents: DragAndScale onMouse "+e.type+" "+is_inside); + + var ignore = false; + if (this.onmouse) { + ignore = this.onmouse(e); + } + + if (e.type == LiteGraph.pointerevents_method+"down" && is_inside) { + this.dragging = true; + LiteGraph.pointerListenerRemove(canvas,"move",this._binded_mouse_callback); + LiteGraph.pointerListenerAdd(document,"move",this._binded_mouse_callback); + LiteGraph.pointerListenerAdd(document,"up",this._binded_mouse_callback); + } else if (e.type == LiteGraph.pointerevents_method+"move") { + if (!ignore) { + var deltax = x - this.last_mouse[0]; + var deltay = y - this.last_mouse[1]; + if (this.dragging) { + this.mouseDrag(deltax, deltay); + } + } + } else if (e.type == LiteGraph.pointerevents_method+"up") { + this.dragging = false; + LiteGraph.pointerListenerRemove(document,"move",this._binded_mouse_callback); + LiteGraph.pointerListenerRemove(document,"up",this._binded_mouse_callback); + LiteGraph.pointerListenerAdd(canvas,"move",this._binded_mouse_callback); + } else if ( is_inside && + (e.type == "mousewheel" || + e.type == "wheel" || + e.type == "DOMMouseScroll") + ) { + e.eventType = "mousewheel"; + if (e.type == "wheel") { + e.wheel = -e.deltaY; + } else { + e.wheel = + e.wheelDeltaY != null ? e.wheelDeltaY : e.detail * -60; + } + + //from stack overflow + e.delta = e.wheelDelta + ? e.wheelDelta / 40 + : e.deltaY + ? -e.deltaY / 3 + : 0; + this.changeDeltaScale(1.0 + e.delta * 0.05); + } + + this.last_mouse[0] = x; + this.last_mouse[1] = y; + + if(is_inside) + { + e.preventDefault(); + e.stopPropagation(); + return false; + } + }; + + DragAndScale.prototype.toCanvasContext = function(ctx) { + ctx.scale(this.scale, this.scale); + ctx.translate(this.offset[0], this.offset[1]); + }; + + DragAndScale.prototype.convertOffsetToCanvas = function(pos) { + //return [pos[0] / this.scale - this.offset[0], pos[1] / this.scale - this.offset[1]]; + return [ + (pos[0] + this.offset[0]) * this.scale, + (pos[1] + this.offset[1]) * this.scale + ]; + }; + + DragAndScale.prototype.convertCanvasToOffset = function(pos, out) { + out = out || [0, 0]; + out[0] = pos[0] / this.scale - this.offset[0]; + out[1] = pos[1] / this.scale - this.offset[1]; + return out; + }; + + DragAndScale.prototype.mouseDrag = function(x, y) { + this.offset[0] += x / this.scale; + this.offset[1] += y / this.scale; + + if (this.onredraw) { + this.onredraw(this); + } + }; + + DragAndScale.prototype.changeScale = function(value, zooming_center) { + if (value < this.min_scale) { + value = this.min_scale; + } else if (value > this.max_scale) { + value = this.max_scale; + } + + if (value == this.scale) { + return; + } + + if (!this.element) { + return; + } + + var rect = this.element.getBoundingClientRect(); + if (!rect) { + return; + } + + zooming_center = zooming_center || [ + rect.width * 0.5, + rect.height * 0.5 + ]; + var center = this.convertCanvasToOffset(zooming_center); + this.scale = value; + if (Math.abs(this.scale - 1) < 0.01) { + this.scale = 1; + } + + var new_center = this.convertCanvasToOffset(zooming_center); + var delta_offset = [ + new_center[0] - center[0], + new_center[1] - center[1] + ]; + + this.offset[0] += delta_offset[0]; + this.offset[1] += delta_offset[1]; + + if (this.onredraw) { + this.onredraw(this); + } + }; + + DragAndScale.prototype.changeDeltaScale = function(value, zooming_center) { + this.changeScale(this.scale * value, zooming_center); + }; + + DragAndScale.prototype.reset = function() { + this.scale = 1; + this.offset[0] = 0; + this.offset[1] = 0; + }; + + //********************************************************************************* + // LGraphCanvas: LGraph renderer CLASS + //********************************************************************************* + + /** + * This class is in charge of rendering one graph inside a canvas. And provides all the interaction required. + * Valid callbacks are: onNodeSelected, onNodeDeselected, onShowNodePanel, onNodeDblClicked + * + * @class LGraphCanvas + * @constructor + * @param {HTMLCanvas} canvas the canvas where you want to render (it accepts a selector in string format or the canvas element itself) + * @param {LGraph} graph [optional] + * @param {Object} options [optional] { skip_rendering, autoresize, viewport } + */ + function LGraphCanvas(canvas, graph, options) { + this.options = options = options || {}; + + //if(graph === undefined) + // throw ("No graph assigned"); + this.background_image = LGraphCanvas.DEFAULT_BACKGROUND_IMAGE; + + if (canvas && canvas.constructor === String) { + canvas = document.querySelector(canvas); + } + + this.ds = new DragAndScale(); + this.zoom_modify_alpha = true; //otherwise it generates ugly patterns when scaling down too much + + this.title_text_font = "" + LiteGraph.NODE_TEXT_SIZE + "px Arial"; + this.inner_text_font = + "normal " + LiteGraph.NODE_SUBTEXT_SIZE + "px Arial"; + this.node_title_color = LiteGraph.NODE_TITLE_COLOR; + this.default_link_color = LiteGraph.LINK_COLOR; + this.default_connection_color = { + input_off: "#778", + input_on: "#7F7", //"#BBD" + output_off: "#778", + output_on: "#7F7" //"#BBD" + }; + this.default_connection_color_byType = { + /*number: "#7F7", + string: "#77F", + boolean: "#F77",*/ + } + this.default_connection_color_byTypeOff = { + /*number: "#474", + string: "#447", + boolean: "#744",*/ + }; + + this.highquality_render = true; + this.use_gradients = false; //set to true to render titlebar with gradients + this.editor_alpha = 1; //used for transition + this.pause_rendering = false; + this.clear_background = true; + this.clear_background_color = "#222"; + + this.read_only = false; //if set to true users cannot modify the graph + this.render_only_selected = true; + this.live_mode = false; + this.show_info = true; + this.allow_dragcanvas = true; + this.allow_dragnodes = true; + this.allow_interaction = true; //allow to control widgets, buttons, collapse, etc + this.multi_select = false; //allow selecting multi nodes without pressing extra keys + this.allow_searchbox = true; + this.allow_reconnect_links = true; //allows to change a connection with having to redo it again + this.align_to_grid = false; //snap to grid + + this.drag_mode = false; + this.dragging_rectangle = null; + + this.filter = null; //allows to filter to only accept some type of nodes in a graph + + this.set_canvas_dirty_on_mouse_event = true; //forces to redraw the canvas if the mouse does anything + this.always_render_background = false; + this.render_shadows = true; + this.render_canvas_border = true; + this.render_connections_shadows = false; //too much cpu + this.render_connections_border = true; + this.render_curved_connections = false; + this.render_connection_arrows = false; + this.render_collapsed_slots = true; + this.render_execution_order = false; + this.render_title_colored = true; + this.render_link_tooltip = true; + + this.links_render_mode = LiteGraph.SPLINE_LINK; + + this.mouse = [0, 0]; //mouse in canvas coordinates, where 0,0 is the top-left corner of the blue rectangle + this.graph_mouse = [0, 0]; //mouse in graph coordinates, where 0,0 is the top-left corner of the blue rectangle + this.canvas_mouse = this.graph_mouse; //LEGACY: REMOVE THIS, USE GRAPH_MOUSE INSTEAD + + //to personalize the search box + this.onSearchBox = null; + this.onSearchBoxSelection = null; + + //callbacks + this.onMouse = null; + this.onDrawBackground = null; //to render background objects (behind nodes and connections) in the canvas affected by transform + this.onDrawForeground = null; //to render foreground objects (above nodes and connections) in the canvas affected by transform + this.onDrawOverlay = null; //to render foreground objects not affected by transform (for GUIs) + this.onDrawLinkTooltip = null; //called when rendering a tooltip + this.onNodeMoved = null; //called after moving a node + this.onSelectionChange = null; //called if the selection changes + this.onConnectingChange = null; //called before any link changes + this.onBeforeChange = null; //called before modifying the graph + this.onAfterChange = null; //called after modifying the graph + + this.connections_width = 3; + this.round_radius = 8; + + this.current_node = null; + this.node_widget = null; //used for widgets + this.over_link_center = null; + this.last_mouse_position = [0, 0]; + this.visible_area = this.ds.visible_area; + this.visible_links = []; + + this.viewport = options.viewport || null; //to constraint render area to a portion of the canvas + + //link canvas and graph + if (graph) { + graph.attachCanvas(this); + } + + this.setCanvas(canvas,options.skip_events); + this.clear(); + + if (!options.skip_render) { + this.startRendering(); + } + + this.autoresize = options.autoresize; + } + + global.LGraphCanvas = LiteGraph.LGraphCanvas = LGraphCanvas; + + LGraphCanvas.DEFAULT_BACKGROUND_IMAGE = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQBJREFUeNrs1rEKwjAUhlETUkj3vP9rdmr1Ysammk2w5wdxuLgcMHyptfawuZX4pJSWZTnfnu/lnIe/jNNxHHGNn//HNbbv+4dr6V+11uF527arU7+u63qfa/bnmh8sWLBgwYJlqRf8MEptXPBXJXa37BSl3ixYsGDBMliwFLyCV/DeLIMFCxYsWLBMwSt4Be/NggXLYMGCBUvBK3iNruC9WbBgwYJlsGApeAWv4L1ZBgsWLFiwYJmCV/AK3psFC5bBggULloJX8BpdwXuzYMGCBctgwVLwCl7Be7MMFixYsGDBsu8FH1FaSmExVfAxBa/gvVmwYMGCZbBg/W4vAQYA5tRF9QYlv/QAAAAASUVORK5CYII="; + + LGraphCanvas.link_type_colors = { + "-1": LiteGraph.EVENT_LINK_COLOR, + number: "#AAA", + node: "#DCA" + }; + LGraphCanvas.gradients = {}; //cache of gradients + + /** + * clears all the data inside + * + * @method clear + */ + LGraphCanvas.prototype.clear = function() { + this.frame = 0; + this.last_draw_time = 0; + this.render_time = 0; + this.fps = 0; + + //this.scale = 1; + //this.offset = [0,0]; + + this.dragging_rectangle = null; + + this.selected_nodes = {}; + this.selected_group = null; + + this.visible_nodes = []; + this.node_dragged = null; + this.node_over = null; + this.node_capturing_input = null; + this.connecting_node = null; + this.highlighted_links = {}; + + this.dragging_canvas = false; + + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + this.dirty_area = null; + + this.node_in_panel = null; + this.node_widget = null; + + this.last_mouse = [0, 0]; + this.last_mouseclick = 0; + this.pointer_is_down = false; + this.pointer_is_double = false; + this.visible_area.set([0, 0, 0, 0]); + + if (this.onClear) { + this.onClear(); + } + }; + + /** + * assigns a graph, you can reassign graphs to the same canvas + * + * @method setGraph + * @param {LGraph} graph + */ + LGraphCanvas.prototype.setGraph = function(graph, skip_clear) { + if (this.graph == graph) { + return; + } + + if (!skip_clear) { + this.clear(); + } + + if (!graph && this.graph) { + this.graph.detachCanvas(this); + return; + } + + graph.attachCanvas(this); + + //remove the graph stack in case a subgraph was open + if (this._graph_stack) + this._graph_stack = null; + + this.setDirty(true, true); + }; + + /** + * returns the top level graph (in case there are subgraphs open on the canvas) + * + * @method getTopGraph + * @return {LGraph} graph + */ + LGraphCanvas.prototype.getTopGraph = function() + { + if(this._graph_stack.length) + return this._graph_stack[0]; + return this.graph; + } + + /** + * opens a graph contained inside a node in the current graph + * + * @method openSubgraph + * @param {LGraph} graph + */ + LGraphCanvas.prototype.openSubgraph = function(graph) { + if (!graph) { + throw "graph cannot be null"; + } + + if (this.graph == graph) { + throw "graph cannot be the same"; + } + + this.clear(); + + if (this.graph) { + if (!this._graph_stack) { + this._graph_stack = []; + } + this._graph_stack.push(this.graph); + } + + graph.attachCanvas(this); + this.checkPanels(); + this.setDirty(true, true); + }; + + /** + * closes a subgraph contained inside a node + * + * @method closeSubgraph + * @param {LGraph} assigns a graph + */ + LGraphCanvas.prototype.closeSubgraph = function() { + if (!this._graph_stack || this._graph_stack.length == 0) { + return; + } + var subgraph_node = this.graph._subgraph_node; + var graph = this._graph_stack.pop(); + this.selected_nodes = {}; + this.highlighted_links = {}; + graph.attachCanvas(this); + this.setDirty(true, true); + if (subgraph_node) { + this.centerOnNode(subgraph_node); + this.selectNodes([subgraph_node]); + } + // when close sub graph back to offset [0, 0] scale 1 + this.ds.offset = [0, 0] + this.ds.scale = 1 + }; + + /** + * returns the visually active graph (in case there are more in the stack) + * @method getCurrentGraph + * @return {LGraph} the active graph + */ + LGraphCanvas.prototype.getCurrentGraph = function() { + return this.graph; + }; + + /** + * assigns a canvas + * + * @method setCanvas + * @param {Canvas} assigns a canvas (also accepts the ID of the element (not a selector) + */ + LGraphCanvas.prototype.setCanvas = function(canvas, skip_events) { + var that = this; + + if (canvas) { + if (canvas.constructor === String) { + canvas = document.getElementById(canvas); + if (!canvas) { + throw "Error creating LiteGraph canvas: Canvas not found"; + } + } + } + + if (canvas === this.canvas) { + return; + } + + if (!canvas && this.canvas) { + //maybe detach events from old_canvas + if (!skip_events) { + this.unbindEvents(); + } + } + + this.canvas = canvas; + this.ds.element = canvas; + + if (!canvas) { + return; + } + + //this.canvas.tabindex = "1000"; + canvas.className += " lgraphcanvas"; + canvas.data = this; + canvas.tabindex = "1"; //to allow key events + + //bg canvas: used for non changing stuff + this.bgcanvas = null; + if (!this.bgcanvas) { + this.bgcanvas = document.createElement("canvas"); + this.bgcanvas.width = this.canvas.width; + this.bgcanvas.height = this.canvas.height; + } + + if (canvas.getContext == null) { + if (canvas.localName != "canvas") { + throw "Element supplied for LGraphCanvas must be a element, you passed a " + + canvas.localName; + } + throw "This browser doesn't support Canvas"; + } + + var ctx = (this.ctx = canvas.getContext("2d")); + if (ctx == null) { + if (!canvas.webgl_enabled) { + console.warn( + "This canvas seems to be WebGL, enabling WebGL renderer" + ); + } + this.enableWebGL(); + } + + //input: (move and up could be unbinded) + // why here? this._mousemove_callback = this.processMouseMove.bind(this); + // why here? this._mouseup_callback = this.processMouseUp.bind(this); + + if (!skip_events) { + this.bindEvents(); + } + }; + + //used in some events to capture them + LGraphCanvas.prototype._doNothing = function doNothing(e) { + //console.log("pointerevents: _doNothing "+e.type); + e.preventDefault(); + return false; + }; + LGraphCanvas.prototype._doReturnTrue = function doNothing(e) { + e.preventDefault(); + return true; + }; + + /** + * binds mouse, keyboard, touch and drag events to the canvas + * @method bindEvents + **/ + LGraphCanvas.prototype.bindEvents = function() { + if (this._events_binded) { + console.warn("LGraphCanvas: events already binded"); + return; + } + + //console.log("pointerevents: bindEvents"); + + var canvas = this.canvas; + + var ref_window = this.getCanvasWindow(); + var document = ref_window.document; //hack used when moving canvas between windows + + this._mousedown_callback = this.processMouseDown.bind(this); + this._mousewheel_callback = this.processMouseWheel.bind(this); + // why mousemove and mouseup were not binded here? + this._mousemove_callback = this.processMouseMove.bind(this); + this._mouseup_callback = this.processMouseUp.bind(this); + + //touch events -- TODO IMPLEMENT + //this._touch_callback = this.touchHandler.bind(this); + + LiteGraph.pointerListenerAdd(canvas,"down", this._mousedown_callback, true); //down do not need to store the binded + canvas.addEventListener("mousewheel", this._mousewheel_callback, false); + + LiteGraph.pointerListenerAdd(canvas,"up", this._mouseup_callback, true); // CHECK: ??? binded or not + LiteGraph.pointerListenerAdd(canvas,"move", this._mousemove_callback); + + canvas.addEventListener("contextmenu", this._doNothing); + canvas.addEventListener( + "DOMMouseScroll", + this._mousewheel_callback, + false + ); + + //touch events -- THIS WAY DOES NOT WORK, finish implementing pointerevents, than clean the touchevents + /*if( 'touchstart' in document.documentElement ) + { + canvas.addEventListener("touchstart", this._touch_callback, true); + canvas.addEventListener("touchmove", this._touch_callback, true); + canvas.addEventListener("touchend", this._touch_callback, true); + canvas.addEventListener("touchcancel", this._touch_callback, true); + }*/ + + //Keyboard ****************** + this._key_callback = this.processKey.bind(this); + canvas.setAttribute("tabindex",1); //otherwise key events are ignored + canvas.addEventListener("keydown", this._key_callback, true); + document.addEventListener("keyup", this._key_callback, true); //in document, otherwise it doesn't fire keyup + + //Dropping Stuff over nodes ************************************ + this._ondrop_callback = this.processDrop.bind(this); + + canvas.addEventListener("dragover", this._doNothing, false); + canvas.addEventListener("dragend", this._doNothing, false); + canvas.addEventListener("drop", this._ondrop_callback, false); + canvas.addEventListener("dragenter", this._doReturnTrue, false); + + this._events_binded = true; + }; + + /** + * unbinds mouse events from the canvas + * @method unbindEvents + **/ + LGraphCanvas.prototype.unbindEvents = function() { + if (!this._events_binded) { + console.warn("LGraphCanvas: no events binded"); + return; + } + + //console.log("pointerevents: unbindEvents"); + + var ref_window = this.getCanvasWindow(); + var document = ref_window.document; + + LiteGraph.pointerListenerRemove(this.canvas,"move", this._mousedown_callback); + LiteGraph.pointerListenerRemove(this.canvas,"up", this._mousedown_callback); + LiteGraph.pointerListenerRemove(this.canvas,"down", this._mousedown_callback); + this.canvas.removeEventListener( + "mousewheel", + this._mousewheel_callback + ); + this.canvas.removeEventListener( + "DOMMouseScroll", + this._mousewheel_callback + ); + this.canvas.removeEventListener("keydown", this._key_callback); + document.removeEventListener("keyup", this._key_callback); + this.canvas.removeEventListener("contextmenu", this._doNothing); + this.canvas.removeEventListener("drop", this._ondrop_callback); + this.canvas.removeEventListener("dragenter", this._doReturnTrue); + + //touch events -- THIS WAY DOES NOT WORK, finish implementing pointerevents, than clean the touchevents + /*this.canvas.removeEventListener("touchstart", this._touch_callback ); + this.canvas.removeEventListener("touchmove", this._touch_callback ); + this.canvas.removeEventListener("touchend", this._touch_callback ); + this.canvas.removeEventListener("touchcancel", this._touch_callback );*/ + + this._mousedown_callback = null; + this._mousewheel_callback = null; + this._key_callback = null; + this._ondrop_callback = null; + + this._events_binded = false; + }; + + LGraphCanvas.getFileExtension = function(url) { + var question = url.indexOf("?"); + if (question != -1) { + url = url.substr(0, question); + } + var point = url.lastIndexOf("."); + if (point == -1) { + return ""; + } + return url.substr(point + 1).toLowerCase(); + }; + + /** + * this function allows to render the canvas using WebGL instead of Canvas2D + * this is useful if you plant to render 3D objects inside your nodes, it uses litegl.js for webgl and canvas2DtoWebGL to emulate the Canvas2D calls in webGL + * @method enableWebGL + **/ + LGraphCanvas.prototype.enableWebGL = function() { + if (typeof GL === "undefined") { + throw "litegl.js must be included to use a WebGL canvas"; + } + if (typeof enableWebGLCanvas === "undefined") { + throw "webglCanvas.js must be included to use this feature"; + } + + this.gl = this.ctx = enableWebGLCanvas(this.canvas); + this.ctx.webgl = true; + this.bgcanvas = this.canvas; + this.bgctx = this.gl; + this.canvas.webgl_enabled = true; + + /* + GL.create({ canvas: this.bgcanvas }); + this.bgctx = enableWebGLCanvas( this.bgcanvas ); + window.gl = this.gl; + */ + }; + + /** + * marks as dirty the canvas, this way it will be rendered again + * + * @class LGraphCanvas + * @method setDirty + * @param {bool} fgcanvas if the foreground canvas is dirty (the one containing the nodes) + * @param {bool} bgcanvas if the background canvas is dirty (the one containing the wires) + */ + LGraphCanvas.prototype.setDirty = function(fgcanvas, bgcanvas) { + if (fgcanvas) { + this.dirty_canvas = true; + } + if (bgcanvas) { + this.dirty_bgcanvas = true; + } + }; + + /** + * Used to attach the canvas in a popup + * + * @method getCanvasWindow + * @return {window} returns the window where the canvas is attached (the DOM root node) + */ + LGraphCanvas.prototype.getCanvasWindow = function() { + if (!this.canvas) { + return window; + } + var doc = this.canvas.ownerDocument; + return doc.defaultView || doc.parentWindow; + }; + + /** + * starts rendering the content of the canvas when needed + * + * @method startRendering + */ + LGraphCanvas.prototype.startRendering = function() { + if (this.is_rendering) { + return; + } //already rendering + + this.is_rendering = true; + renderFrame.call(this); + + function renderFrame() { + if (!this.pause_rendering) { + this.draw(); + } + + var window = this.getCanvasWindow(); + if (this.is_rendering) { + window.requestAnimationFrame(renderFrame.bind(this)); + } + } + }; + + /** + * stops rendering the content of the canvas (to save resources) + * + * @method stopRendering + */ + LGraphCanvas.prototype.stopRendering = function() { + this.is_rendering = false; + /* + if(this.rendering_timer_id) + { + clearInterval(this.rendering_timer_id); + this.rendering_timer_id = null; + } + */ + }; + + /* LiteGraphCanvas input */ + + //used to block future mouse events (because of im gui) + LGraphCanvas.prototype.blockClick = function() + { + this.block_click = true; + this.last_mouseclick = 0; + } + + LGraphCanvas.prototype.processMouseDown = function(e) { + + if( this.set_canvas_dirty_on_mouse_event ) + this.dirty_canvas = true; + + if (!this.graph) { + return; + } + + this.adjustMouseEvent(e); + + var ref_window = this.getCanvasWindow(); + var document = ref_window.document; + LGraphCanvas.active_canvas = this; + var that = this; + + var x = e.clientX; + var y = e.clientY; + //console.log(y,this.viewport); + //console.log("pointerevents: processMouseDown pointerId:"+e.pointerId+" which:"+e.which+" isPrimary:"+e.isPrimary+" :: x y "+x+" "+y); + + this.ds.viewport = this.viewport; + var is_inside = !this.viewport || ( this.viewport && x >= this.viewport[0] && x < (this.viewport[0] + this.viewport[2]) && y >= this.viewport[1] && y < (this.viewport[1] + this.viewport[3]) ); + + //move mouse move event to the window in case it drags outside of the canvas + if(!this.options.skip_events) + { + LiteGraph.pointerListenerRemove(this.canvas,"move", this._mousemove_callback); + LiteGraph.pointerListenerAdd(ref_window.document,"move", this._mousemove_callback,true); //catch for the entire window + LiteGraph.pointerListenerAdd(ref_window.document,"up", this._mouseup_callback,true); + } + + if(!is_inside){ + return; + } + + var node = this.graph.getNodeOnPos( e.canvasX, e.canvasY, this.visible_nodes, 5 ); + var skip_dragging = false; + var skip_action = false; + var now = LiteGraph.getTime(); + var is_primary = (e.isPrimary === undefined || !e.isPrimary); + var is_double_click = (now - this.last_mouseclick < 300) && is_primary; + this.mouse[0] = e.clientX; + this.mouse[1] = e.clientY; + this.graph_mouse[0] = e.canvasX; + this.graph_mouse[1] = e.canvasY; + this.last_click_position = [this.mouse[0],this.mouse[1]]; + + if (this.pointer_is_down && is_primary ){ + this.pointer_is_double = true; + //console.log("pointerevents: pointer_is_double start"); + }else{ + this.pointer_is_double = false; + } + this.pointer_is_down = true; + + + this.canvas.focus(); + + LiteGraph.closeAllContextMenus(ref_window); + + if (this.onMouse) + { + if (this.onMouse(e) == true) + return; + } + + //left button mouse / single finger + if (e.which == 1 && !this.pointer_is_double) + { + if (e.ctrlKey) + { + this.dragging_rectangle = new Float32Array(4); + this.dragging_rectangle[0] = e.canvasX; + this.dragging_rectangle[1] = e.canvasY; + this.dragging_rectangle[2] = 1; + this.dragging_rectangle[3] = 1; + skip_action = true; + } + + // clone node ALT dragging + if (LiteGraph.alt_drag_do_clone_nodes && e.altKey && node && this.allow_interaction && !skip_action && !this.read_only) + { + if (cloned = node.clone()){ + cloned.pos[0] += 5; + cloned.pos[1] += 5; + this.graph.add(cloned,false,{doCalcSize: false}); + node = cloned; + skip_action = true; + if (!block_drag_node) { + if (this.allow_dragnodes) { + this.graph.beforeChange(); + this.node_dragged = node; + } + if (!this.selected_nodes[node.id]) { + this.processNodeSelected(node, e); + } + } + } + } + + var clicking_canvas_bg = false; + + //when clicked on top of a node + //and it is not interactive + if (node && (this.allow_interaction || node.flags.allow_interaction) && !skip_action && !this.read_only) { + if (!this.live_mode && !node.flags.pinned) { + this.bringToFront(node); + } //if it wasn't selected? + + //not dragging mouse to connect two slots + if ( this.allow_interaction && !this.connecting_node && !node.flags.collapsed && !this.live_mode ) { + //Search for corner for resize + if ( !skip_action && + node.resizable !== false && + isInsideRectangle( e.canvasX, + e.canvasY, + node.pos[0] + node.size[0] - 5, + node.pos[1] + node.size[1] - 5, + 10, + 10 + ) + ) { + this.graph.beforeChange(); + this.resizing_node = node; + this.canvas.style.cursor = "se-resize"; + skip_action = true; + } else { + //search for outputs + if (node.outputs) { + for ( var i = 0, l = node.outputs.length; i < l; ++i ) { + var output = node.outputs[i]; + var link_pos = node.getConnectionPos(false, i); + if ( + isInsideRectangle( + e.canvasX, + e.canvasY, + link_pos[0] - 15, + link_pos[1] - 10, + 30, + 20 + ) + ) { + this.connecting_node = node; + this.connecting_output = output; + this.connecting_output.slot_index = i; + this.connecting_pos = node.getConnectionPos( false, i ); + this.connecting_slot = i; + + if (LiteGraph.shift_click_do_break_link_from){ + if (e.shiftKey) { + node.disconnectOutput(i); + } + } + + if (is_double_click) { + if (node.onOutputDblClick) { + node.onOutputDblClick(i, e); + } + } else { + if (node.onOutputClick) { + node.onOutputClick(i, e); + } + } + + skip_action = true; + break; + } + } + } + + //search for inputs + if (node.inputs) { + for ( var i = 0, l = node.inputs.length; i < l; ++i ) { + var input = node.inputs[i]; + var link_pos = node.getConnectionPos(true, i); + if ( + isInsideRectangle( + e.canvasX, + e.canvasY, + link_pos[0] - 15, + link_pos[1] - 10, + 30, + 20 + ) + ) { + if (is_double_click) { + if (node.onInputDblClick) { + node.onInputDblClick(i, e); + } + } else { + if (node.onInputClick) { + node.onInputClick(i, e); + } + } + + if (input.link !== null) { + var link_info = this.graph.links[ + input.link + ]; //before disconnecting + if (LiteGraph.click_do_break_link_to){ + node.disconnectInput(i); + this.dirty_bgcanvas = true; + skip_action = true; + }else{ + // do same action as has not node ? + } + + if ( + this.allow_reconnect_links || + //this.move_destination_link_without_shift || + e.shiftKey + ) { + if (!LiteGraph.click_do_break_link_to){ + node.disconnectInput(i); + } + this.connecting_node = this.graph._nodes_by_id[ + link_info.origin_id + ]; + this.connecting_slot = + link_info.origin_slot; + this.connecting_output = this.connecting_node.outputs[ + this.connecting_slot + ]; + this.connecting_pos = this.connecting_node.getConnectionPos( false, this.connecting_slot ); + + this.dirty_bgcanvas = true; + skip_action = true; + } + + + }else{ + // has not node + } + + if (!skip_action){ + // connect from in to out, from to to from + this.connecting_node = node; + this.connecting_input = input; + this.connecting_input.slot_index = i; + this.connecting_pos = node.getConnectionPos( true, i ); + this.connecting_slot = i; + + this.dirty_bgcanvas = true; + skip_action = true; + } + } + } + } + } //not resizing + } + + //it wasn't clicked on the links boxes + if (!skip_action) { + var block_drag_node = false; + var pos = [e.canvasX - node.pos[0], e.canvasY - node.pos[1]]; + + //widgets + var widget = this.processNodeWidgets( node, this.graph_mouse, e ); + if (widget) { + block_drag_node = true; + this.node_widget = [node, widget]; + } + + //double clicking + if (this.allow_interaction && is_double_click && this.selected_nodes[node.id]) { + //double click node + if (node.onDblClick) { + node.onDblClick( e, pos, this ); + } + this.processNodeDblClicked(node); + block_drag_node = true; + } + + //if do not capture mouse + if ( node.onMouseDown && node.onMouseDown( e, pos, this ) ) { + block_drag_node = true; + } else { + //open subgraph button + if(node.subgraph && !node.skip_subgraph_button) + { + if ( !node.flags.collapsed && pos[0] > node.size[0] - LiteGraph.NODE_TITLE_HEIGHT && pos[1] < 0 ) { + var that = this; + setTimeout(function() { + that.openSubgraph(node.subgraph); + }, 10); + } + } + + if (this.live_mode) { + clicking_canvas_bg = true; + block_drag_node = true; + } + } + + if (!block_drag_node) { + if (this.allow_dragnodes) { + this.graph.beforeChange(); + this.node_dragged = node; + } + this.processNodeSelected(node, e); + } else { // double-click + /** + * Don't call the function if the block is already selected. + * Otherwise, it could cause the block to be unselected while its panel is open. + */ + if (!node.is_selected) this.processNodeSelected(node, e); + } + + this.dirty_canvas = true; + } + } //clicked outside of nodes + else { + if (!skip_action){ + //search for link connector + if(!this.read_only) { + for (var i = 0; i < this.visible_links.length; ++i) { + var link = this.visible_links[i]; + var center = link._pos; + if ( + !center || + e.canvasX < center[0] - 4 || + e.canvasX > center[0] + 4 || + e.canvasY < center[1] - 4 || + e.canvasY > center[1] + 4 + ) { + continue; + } + //link clicked + this.showLinkMenu(link, e); + this.over_link_center = null; //clear tooltip + break; + } + } + + this.selected_group = this.graph.getGroupOnPos( e.canvasX, e.canvasY ); + this.selected_group_resizing = false; + if (this.selected_group && !this.read_only ) { + if (e.ctrlKey) { + this.dragging_rectangle = null; + } + + var dist = distance( [e.canvasX, e.canvasY], [ this.selected_group.pos[0] + this.selected_group.size[0], this.selected_group.pos[1] + this.selected_group.size[1] ] ); + if (dist * this.ds.scale < 10) { + this.selected_group_resizing = true; + } else { + this.selected_group.recomputeInsideNodes(); + } + } + + if (is_double_click && !this.read_only && this.allow_searchbox) { + this.showSearchBox(e); + e.preventDefault(); + e.stopPropagation(); + } + + clicking_canvas_bg = true; + } + } + + if (!skip_action && clicking_canvas_bg && this.allow_dragcanvas) { + //console.log("pointerevents: dragging_canvas start"); + this.dragging_canvas = true; + } + + } else if (e.which == 2) { + //middle button + + if (LiteGraph.middle_click_slot_add_default_node){ + if (node && this.allow_interaction && !skip_action && !this.read_only){ + //not dragging mouse to connect two slots + if ( + !this.connecting_node && + !node.flags.collapsed && + !this.live_mode + ) { + var mClikSlot = false; + var mClikSlot_index = false; + var mClikSlot_isOut = false; + //search for outputs + if (node.outputs) { + for ( var i = 0, l = node.outputs.length; i < l; ++i ) { + var output = node.outputs[i]; + var link_pos = node.getConnectionPos(false, i); + if (isInsideRectangle(e.canvasX,e.canvasY,link_pos[0] - 15,link_pos[1] - 10,30,20)) { + mClikSlot = output; + mClikSlot_index = i; + mClikSlot_isOut = true; + break; + } + } + } + + //search for inputs + if (node.inputs) { + for ( var i = 0, l = node.inputs.length; i < l; ++i ) { + var input = node.inputs[i]; + var link_pos = node.getConnectionPos(true, i); + if (isInsideRectangle(e.canvasX,e.canvasY,link_pos[0] - 15,link_pos[1] - 10,30,20)) { + mClikSlot = input; + mClikSlot_index = i; + mClikSlot_isOut = false; + break; + } + } + } + //console.log("middleClickSlots? "+mClikSlot+" & "+(mClikSlot_index!==false)); + if (mClikSlot && mClikSlot_index!==false){ + + var alphaPosY = 0.5-((mClikSlot_index+1)/((mClikSlot_isOut?node.outputs.length:node.inputs.length))); + var node_bounding = node.getBounding(); + // estimate a position: this is a bad semi-bad-working mess .. REFACTOR with a correct autoplacement that knows about the others slots and nodes + var posRef = [ (!mClikSlot_isOut?node_bounding[0]:node_bounding[0]+node_bounding[2])// + node_bounding[0]/this.canvas.width*150 + ,e.canvasY-80// + node_bounding[0]/this.canvas.width*66 // vertical "derive" + ]; + var nodeCreated = this.createDefaultNodeForSlot({ nodeFrom: !mClikSlot_isOut?null:node + ,slotFrom: !mClikSlot_isOut?null:mClikSlot_index + ,nodeTo: !mClikSlot_isOut?node:null + ,slotTo: !mClikSlot_isOut?mClikSlot_index:null + ,position: posRef //,e: e + ,nodeType: "AUTO" //nodeNewType + ,posAdd:[!mClikSlot_isOut?-30:30, -alphaPosY*130] //-alphaPosY*30] + ,posSizeFix:[!mClikSlot_isOut?-1:0, 0] //-alphaPosY*2*/ + }); + + } + } + } + } else if (!skip_action && this.allow_dragcanvas) { + //console.log("pointerevents: dragging_canvas start from middle button"); + this.dragging_canvas = true; + } + + + } else if (e.which == 3 || this.pointer_is_double) { + + //right button + if (this.allow_interaction && !skip_action && !this.read_only){ + + // is it hover a node ? + if (node){ + if(Object.keys(this.selected_nodes).length + && (this.selected_nodes[node.id] || e.shiftKey || e.ctrlKey || e.metaKey) + ){ + // is multiselected or using shift to include the now node + if (!this.selected_nodes[node.id]) this.selectNodes([node],true); // add this if not present + }else{ + // update selection + this.selectNodes([node]); + } + } + + // show menu on this node + this.processContextMenu(node, e); + } + + } + + //TODO + //if(this.node_selected != prev_selected) + // this.onNodeSelectionChange(this.node_selected); + + this.last_mouse[0] = e.clientX; + this.last_mouse[1] = e.clientY; + this.last_mouseclick = LiteGraph.getTime(); + this.last_mouse_dragging = true; + + /* + if( (this.dirty_canvas || this.dirty_bgcanvas) && this.rendering_timer_id == null) + this.draw(); + */ + + this.graph.change(); + + //this is to ensure to defocus(blur) if a text input element is on focus + if ( + !ref_window.document.activeElement || + (ref_window.document.activeElement.nodeName.toLowerCase() != + "input" && + ref_window.document.activeElement.nodeName.toLowerCase() != + "textarea") + ) { + e.preventDefault(); + } + e.stopPropagation(); + + if (this.onMouseDown) { + this.onMouseDown(e); + } + + return false; + }; + + /** + * Called when a mouse move event has to be processed + * @method processMouseMove + **/ + LGraphCanvas.prototype.processMouseMove = function(e) { + if (this.autoresize) { + this.resize(); + } + + if( this.set_canvas_dirty_on_mouse_event ) + this.dirty_canvas = true; + + if (!this.graph) { + return; + } + + LGraphCanvas.active_canvas = this; + this.adjustMouseEvent(e); + var mouse = [e.clientX, e.clientY]; + this.mouse[0] = mouse[0]; + this.mouse[1] = mouse[1]; + var delta = [ + mouse[0] - this.last_mouse[0], + mouse[1] - this.last_mouse[1] + ]; + this.last_mouse = mouse; + this.graph_mouse[0] = e.canvasX; + this.graph_mouse[1] = e.canvasY; + + //console.log("pointerevents: processMouseMove "+e.pointerId+" "+e.isPrimary); + + if(this.block_click) + { + //console.log("pointerevents: processMouseMove block_click"); + e.preventDefault(); + return false; + } + + e.dragging = this.last_mouse_dragging; + + if (this.node_widget) { + this.processNodeWidgets( + this.node_widget[0], + this.graph_mouse, + e, + this.node_widget[1] + ); + this.dirty_canvas = true; + } + + //get node over + var node = this.graph.getNodeOnPos(e.canvasX,e.canvasY,this.visible_nodes); + + if (this.dragging_rectangle) + { + this.dragging_rectangle[2] = e.canvasX - this.dragging_rectangle[0]; + this.dragging_rectangle[3] = e.canvasY - this.dragging_rectangle[1]; + this.dirty_canvas = true; + } + else if (this.selected_group && !this.read_only) + { + //moving/resizing a group + if (this.selected_group_resizing) { + this.selected_group.size = [ + e.canvasX - this.selected_group.pos[0], + e.canvasY - this.selected_group.pos[1] + ]; + } else { + var deltax = delta[0] / this.ds.scale; + var deltay = delta[1] / this.ds.scale; + this.selected_group.move(deltax, deltay, e.ctrlKey); + if (this.selected_group._nodes.length) { + this.dirty_canvas = true; + } + } + this.dirty_bgcanvas = true; + } else if (this.dragging_canvas) { + ////console.log("pointerevents: processMouseMove is dragging_canvas"); + this.ds.offset[0] += delta[0] / this.ds.scale; + this.ds.offset[1] += delta[1] / this.ds.scale; + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + } else if ((this.allow_interaction || (node && node.flags.allow_interaction)) && !this.read_only) { + if (this.connecting_node) { + this.dirty_canvas = true; + } + + //remove mouseover flag + for (var i = 0, l = this.graph._nodes.length; i < l; ++i) { + if (this.graph._nodes[i].mouseOver && node != this.graph._nodes[i] ) { + //mouse leave + this.graph._nodes[i].mouseOver = false; + if (this.node_over && this.node_over.onMouseLeave) { + this.node_over.onMouseLeave(e); + } + this.node_over = null; + this.dirty_canvas = true; + } + } + + //mouse over a node + if (node) { + + if(node.redraw_on_mouse) + this.dirty_canvas = true; + + //this.canvas.style.cursor = "move"; + if (!node.mouseOver) { + //mouse enter + node.mouseOver = true; + this.node_over = node; + this.dirty_canvas = true; + + if (node.onMouseEnter) { + node.onMouseEnter(e); + } + } + + //in case the node wants to do something + if (node.onMouseMove) { + node.onMouseMove( e, [e.canvasX - node.pos[0], e.canvasY - node.pos[1]], this ); + } + + //if dragging a link + if (this.connecting_node) { + + if (this.connecting_output){ + + var pos = this._highlight_input || [0, 0]; //to store the output of isOverNodeInput + + //on top of input + if (this.isOverNodeBox(node, e.canvasX, e.canvasY)) { + //mouse on top of the corner box, don't know what to do + } else { + //check if I have a slot below de mouse + var slot = this.isOverNodeInput( node, e.canvasX, e.canvasY, pos ); + if (slot != -1 && node.inputs[slot]) { + var slot_type = node.inputs[slot].type; + if ( LiteGraph.isValidConnection( this.connecting_output.type, slot_type ) ) { + this._highlight_input = pos; + this._highlight_input_slot = node.inputs[slot]; // XXX CHECK THIS + } + } else { + this._highlight_input = null; + this._highlight_input_slot = null; // XXX CHECK THIS + } + } + + }else if(this.connecting_input){ + + var pos = this._highlight_output || [0, 0]; //to store the output of isOverNodeOutput + + //on top of output + if (this.isOverNodeBox(node, e.canvasX, e.canvasY)) { + //mouse on top of the corner box, don't know what to do + } else { + //check if I have a slot below de mouse + var slot = this.isOverNodeOutput( node, e.canvasX, e.canvasY, pos ); + if (slot != -1 && node.outputs[slot]) { + var slot_type = node.outputs[slot].type; + if ( LiteGraph.isValidConnection( this.connecting_input.type, slot_type ) ) { + this._highlight_output = pos; + } + } else { + this._highlight_output = null; + } + } + } + } + + //Search for corner + if (this.canvas) { + if ( + isInsideRectangle( + e.canvasX, + e.canvasY, + node.pos[0] + node.size[0] - 5, + node.pos[1] + node.size[1] - 5, + 5, + 5 + ) + ) { + this.canvas.style.cursor = "se-resize"; + } else { + this.canvas.style.cursor = "crosshair"; + } + } + } else { //not over a node + + //search for link connector + var over_link = null; + for (var i = 0; i < this.visible_links.length; ++i) { + var link = this.visible_links[i]; + var center = link._pos; + if ( + !center || + e.canvasX < center[0] - 4 || + e.canvasX > center[0] + 4 || + e.canvasY < center[1] - 4 || + e.canvasY > center[1] + 4 + ) { + continue; + } + over_link = link; + break; + } + if( over_link != this.over_link_center ) + { + this.over_link_center = over_link; + this.dirty_canvas = true; + } + + if (this.canvas) { + this.canvas.style.cursor = ""; + } + } //end + + //send event to node if capturing input (used with widgets that allow drag outside of the area of the node) + if ( this.node_capturing_input && this.node_capturing_input != node && this.node_capturing_input.onMouseMove ) { + this.node_capturing_input.onMouseMove(e,[e.canvasX - this.node_capturing_input.pos[0],e.canvasY - this.node_capturing_input.pos[1]], this); + } + + //node being dragged + if (this.node_dragged && !this.live_mode) { + //console.log("draggin!",this.selected_nodes); + for (var i in this.selected_nodes) { + var n = this.selected_nodes[i]; + n.pos[0] += delta[0] / this.ds.scale; + n.pos[1] += delta[1] / this.ds.scale; + if (!n.is_selected) this.processNodeSelected(n, e); /* + * Don't call the function if the block is already selected. + * Otherwise, it could cause the block to be unselected while dragging. + */ + } + + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + } + + if (this.resizing_node && !this.live_mode) { + //convert mouse to node space + var desired_size = [ e.canvasX - this.resizing_node.pos[0], e.canvasY - this.resizing_node.pos[1] ]; + var min_size = this.resizing_node.computeSize(); + desired_size[0] = Math.max( min_size[0], desired_size[0] ); + desired_size[1] = Math.max( min_size[1], desired_size[1] ); + this.resizing_node.setSize( desired_size ); + + this.canvas.style.cursor = "se-resize"; + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + } + } + + e.preventDefault(); + return false; + }; + + /** + * Called when a mouse up event has to be processed + * @method processMouseUp + **/ + LGraphCanvas.prototype.processMouseUp = function(e) { + + var is_primary = ( e.isPrimary === undefined || e.isPrimary ); + + //early exit for extra pointer + if(!is_primary){ + /*e.stopPropagation(); + e.preventDefault();*/ + //console.log("pointerevents: processMouseUp pointerN_stop "+e.pointerId+" "+e.isPrimary); + return false; + } + + //console.log("pointerevents: processMouseUp "+e.pointerId+" "+e.isPrimary+" :: "+e.clientX+" "+e.clientY); + + if( this.set_canvas_dirty_on_mouse_event ) + this.dirty_canvas = true; + + if (!this.graph) + return; + + var window = this.getCanvasWindow(); + var document = window.document; + LGraphCanvas.active_canvas = this; + + //restore the mousemove event back to the canvas + if(!this.options.skip_events) + { + //console.log("pointerevents: processMouseUp adjustEventListener"); + LiteGraph.pointerListenerRemove(document,"move", this._mousemove_callback,true); + LiteGraph.pointerListenerAdd(this.canvas,"move", this._mousemove_callback,true); + LiteGraph.pointerListenerRemove(document,"up", this._mouseup_callback,true); + } + + this.adjustMouseEvent(e); + var now = LiteGraph.getTime(); + e.click_time = now - this.last_mouseclick; + this.last_mouse_dragging = false; + this.last_click_position = null; + + if(this.block_click) + { + //console.log("pointerevents: processMouseUp block_clicks"); + this.block_click = false; //used to avoid sending twice a click in a immediate button + } + + //console.log("pointerevents: processMouseUp which: "+e.which); + + if (e.which == 1) { + + if( this.node_widget ) + { + this.processNodeWidgets( this.node_widget[0], this.graph_mouse, e ); + } + + //left button + this.node_widget = null; + + if (this.selected_group) { + var diffx = + this.selected_group.pos[0] - + Math.round(this.selected_group.pos[0]); + var diffy = + this.selected_group.pos[1] - + Math.round(this.selected_group.pos[1]); + this.selected_group.move(diffx, diffy, e.ctrlKey); + this.selected_group.pos[0] = Math.round( + this.selected_group.pos[0] + ); + this.selected_group.pos[1] = Math.round( + this.selected_group.pos[1] + ); + if (this.selected_group._nodes.length) { + this.dirty_canvas = true; + } + this.selected_group = null; + } + this.selected_group_resizing = false; + + var node = this.graph.getNodeOnPos( + e.canvasX, + e.canvasY, + this.visible_nodes + ); + + if (this.dragging_rectangle) { + if (this.graph) { + var nodes = this.graph._nodes; + var node_bounding = new Float32Array(4); + + //compute bounding and flip if left to right + var w = Math.abs(this.dragging_rectangle[2]); + var h = Math.abs(this.dragging_rectangle[3]); + var startx = + this.dragging_rectangle[2] < 0 + ? this.dragging_rectangle[0] - w + : this.dragging_rectangle[0]; + var starty = + this.dragging_rectangle[3] < 0 + ? this.dragging_rectangle[1] - h + : this.dragging_rectangle[1]; + this.dragging_rectangle[0] = startx; + this.dragging_rectangle[1] = starty; + this.dragging_rectangle[2] = w; + this.dragging_rectangle[3] = h; + + // test dragging rect size, if minimun simulate a click + if (!node || (w > 10 && h > 10 )){ + //test against all nodes (not visible because the rectangle maybe start outside + var to_select = []; + for (var i = 0; i < nodes.length; ++i) { + var nodeX = nodes[i]; + nodeX.getBounding(node_bounding); + if ( + !overlapBounding( + this.dragging_rectangle, + node_bounding + ) + ) { + continue; + } //out of the visible area + to_select.push(nodeX); + } + if (to_select.length) { + this.selectNodes(to_select,e.shiftKey); // add to selection with shift + } + }else{ + // will select of update selection + this.selectNodes([node],e.shiftKey||e.ctrlKey); // add to selection add to selection with ctrlKey or shiftKey + } + + } + this.dragging_rectangle = null; + } else if (this.connecting_node) { + //dragging a connection + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + + var connInOrOut = this.connecting_output || this.connecting_input; + var connType = connInOrOut.type; + + //node below mouse + if (node) { + + /* no need to condition on event type.. just another type + if ( + connType == LiteGraph.EVENT && + this.isOverNodeBox(node, e.canvasX, e.canvasY) + ) { + + this.connecting_node.connect( + this.connecting_slot, + node, + LiteGraph.EVENT + ); + + } else {*/ + + //slot below mouse? connect + + if (this.connecting_output){ + + var slot = this.isOverNodeInput( + node, + e.canvasX, + e.canvasY + ); + if (slot != -1) { + this.connecting_node.connect(this.connecting_slot, node, slot); + } else { + //not on top of an input + // look for a good slot + this.connecting_node.connectByType(this.connecting_slot,node,connType); + } + + }else if (this.connecting_input){ + + var slot = this.isOverNodeOutput( + node, + e.canvasX, + e.canvasY + ); + + if (slot != -1) { + node.connect(slot, this.connecting_node, this.connecting_slot); // this is inverted has output-input nature like + } else { + //not on top of an input + // look for a good slot + this.connecting_node.connectByTypeOutput(this.connecting_slot,node,connType); + } + + } + + + //} + + }else{ + + // add menu when releasing link in empty space + if (LiteGraph.release_link_on_empty_shows_menu){ + if (e.shiftKey && this.allow_searchbox){ + if(this.connecting_output){ + this.showSearchBox(e,{node_from: this.connecting_node, slot_from: this.connecting_output, type_filter_in: this.connecting_output.type}); + }else if(this.connecting_input){ + this.showSearchBox(e,{node_to: this.connecting_node, slot_from: this.connecting_input, type_filter_out: this.connecting_input.type}); + } + }else{ + if(this.connecting_output){ + this.showConnectionMenu({nodeFrom: this.connecting_node, slotFrom: this.connecting_output, e: e}); + }else if(this.connecting_input){ + this.showConnectionMenu({nodeTo: this.connecting_node, slotTo: this.connecting_input, e: e}); + } + } + } + } + + this.connecting_output = null; + this.connecting_input = null; + this.connecting_pos = null; + this.connecting_node = null; + this.connecting_slot = -1; + } //not dragging connection + else if (this.resizing_node) { + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + this.graph.afterChange(this.resizing_node); + this.resizing_node = null; + } else if (this.node_dragged) { + //node being dragged? + var node = this.node_dragged; + if ( + node && + e.click_time < 300 && + isInsideRectangle( e.canvasX, e.canvasY, node.pos[0], node.pos[1] - LiteGraph.NODE_TITLE_HEIGHT, LiteGraph.NODE_TITLE_HEIGHT, LiteGraph.NODE_TITLE_HEIGHT ) + ) { + node.collapse(); + } + + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + this.node_dragged.pos[0] = Math.round(this.node_dragged.pos[0]); + this.node_dragged.pos[1] = Math.round(this.node_dragged.pos[1]); + if (this.graph.config.align_to_grid || this.align_to_grid ) { + this.node_dragged.alignToGrid(); + } + if( this.onNodeMoved ) + this.onNodeMoved( this.node_dragged ); + this.graph.afterChange(this.node_dragged); + this.node_dragged = null; + } //no node being dragged + else { + //get node over + var node = this.graph.getNodeOnPos( + e.canvasX, + e.canvasY, + this.visible_nodes + ); + + if (!node && e.click_time < 300) { + this.deselectAllNodes(); + } + + this.dirty_canvas = true; + this.dragging_canvas = false; + + if (this.node_over && this.node_over.onMouseUp) { + this.node_over.onMouseUp( e, [ e.canvasX - this.node_over.pos[0], e.canvasY - this.node_over.pos[1] ], this ); + } + if ( + this.node_capturing_input && + this.node_capturing_input.onMouseUp + ) { + this.node_capturing_input.onMouseUp(e, [ + e.canvasX - this.node_capturing_input.pos[0], + e.canvasY - this.node_capturing_input.pos[1] + ]); + } + } + } else if (e.which == 2) { + //middle button + //trace("middle"); + this.dirty_canvas = true; + this.dragging_canvas = false; + } else if (e.which == 3) { + //right button + //trace("right"); + this.dirty_canvas = true; + this.dragging_canvas = false; + } + + /* + if((this.dirty_canvas || this.dirty_bgcanvas) && this.rendering_timer_id == null) + this.draw(); + */ + + if (is_primary) + { + this.pointer_is_down = false; + this.pointer_is_double = false; + } + + this.graph.change(); + + //console.log("pointerevents: processMouseUp stopPropagation"); + e.stopPropagation(); + e.preventDefault(); + return false; + }; + + /** + * Called when a mouse wheel event has to be processed + * @method processMouseWheel + **/ + LGraphCanvas.prototype.processMouseWheel = function(e) { + if (!this.graph || !this.allow_dragcanvas) { + return; + } + + var delta = e.wheelDeltaY != null ? e.wheelDeltaY : e.detail * -60; + + this.adjustMouseEvent(e); + + var x = e.clientX; + var y = e.clientY; + var is_inside = !this.viewport || ( this.viewport && x >= this.viewport[0] && x < (this.viewport[0] + this.viewport[2]) && y >= this.viewport[1] && y < (this.viewport[1] + this.viewport[3]) ); + if(!is_inside) + return; + + var scale = this.ds.scale; + + if (delta > 0) { + scale *= 1.1; + } else if (delta < 0) { + scale *= 1 / 1.1; + } + + //this.setZoom( scale, [ e.clientX, e.clientY ] ); + this.ds.changeScale(scale, [e.clientX, e.clientY]); + + this.graph.change(); + + e.preventDefault(); + return false; // prevent default + }; + + /** + * returns true if a position (in graph space) is on top of a node little corner box + * @method isOverNodeBox + **/ + LGraphCanvas.prototype.isOverNodeBox = function(node, canvasx, canvasy) { + var title_height = LiteGraph.NODE_TITLE_HEIGHT; + if ( + isInsideRectangle( + canvasx, + canvasy, + node.pos[0] + 2, + node.pos[1] + 2 - title_height, + title_height - 4, + title_height - 4 + ) + ) { + return true; + } + return false; + }; + + /** + * returns the INDEX if a position (in graph space) is on top of a node input slot + * @method isOverNodeInput + **/ + LGraphCanvas.prototype.isOverNodeInput = function( + node, + canvasx, + canvasy, + slot_pos + ) { + if (node.inputs) { + for (var i = 0, l = node.inputs.length; i < l; ++i) { + var input = node.inputs[i]; + var link_pos = node.getConnectionPos(true, i); + var is_inside = false; + if (node.horizontal) { + is_inside = isInsideRectangle( + canvasx, + canvasy, + link_pos[0] - 5, + link_pos[1] - 10, + 10, + 20 + ); + } else { + is_inside = isInsideRectangle( + canvasx, + canvasy, + link_pos[0] - 10, + link_pos[1] - 5, + 40, + 10 + ); + } + if (is_inside) { + if (slot_pos) { + slot_pos[0] = link_pos[0]; + slot_pos[1] = link_pos[1]; + } + return i; + } + } + } + return -1; + }; + + /** + * returns the INDEX if a position (in graph space) is on top of a node output slot + * @method isOverNodeOuput + **/ + LGraphCanvas.prototype.isOverNodeOutput = function( + node, + canvasx, + canvasy, + slot_pos + ) { + if (node.outputs) { + for (var i = 0, l = node.outputs.length; i < l; ++i) { + var output = node.outputs[i]; + var link_pos = node.getConnectionPos(false, i); + var is_inside = false; + if (node.horizontal) { + is_inside = isInsideRectangle( + canvasx, + canvasy, + link_pos[0] - 5, + link_pos[1] - 10, + 10, + 20 + ); + } else { + is_inside = isInsideRectangle( + canvasx, + canvasy, + link_pos[0] - 10, + link_pos[1] - 5, + 40, + 10 + ); + } + if (is_inside) { + if (slot_pos) { + slot_pos[0] = link_pos[0]; + slot_pos[1] = link_pos[1]; + } + return i; + } + } + } + return -1; + }; + + /** + * process a key event + * @method processKey + **/ + LGraphCanvas.prototype.processKey = function(e) { + if (!this.graph) { + return; + } + + var block_default = false; + //console.log(e); //debug + + if (e.target.localName == "input") { + return; + } + + if (e.type == "keydown") { + if (e.keyCode == 32) { + //space + this.dragging_canvas = true; + block_default = true; + } + + if (e.keyCode == 27) { + //esc + if(this.node_panel) this.node_panel.close(); + if(this.options_panel) this.options_panel.close(); + block_default = true; + } + + //select all Control A + if (e.keyCode == 65 && e.ctrlKey) { + this.selectNodes(); + block_default = true; + } + + if ((e.keyCode === 67) && (e.metaKey || e.ctrlKey) && !e.shiftKey) { + //copy + if (this.selected_nodes) { + this.copyToClipboard(); + block_default = true; + } + } + + if ((e.keyCode === 86) && (e.metaKey || e.ctrlKey)) { + //paste + this.pasteFromClipboard(e.shiftKey); + } + + //delete or backspace + if (e.keyCode == 46 || e.keyCode == 8) { + if ( + e.target.localName != "input" && + e.target.localName != "textarea" + ) { + this.deleteSelectedNodes(); + block_default = true; + } + } + + //collapse + //... + + //TODO + if (this.selected_nodes) { + for (var i in this.selected_nodes) { + if (this.selected_nodes[i].onKeyDown) { + this.selected_nodes[i].onKeyDown(e); + } + } + } + } else if (e.type == "keyup") { + if (e.keyCode == 32) { + // space + this.dragging_canvas = false; + } + + if (this.selected_nodes) { + for (var i in this.selected_nodes) { + if (this.selected_nodes[i].onKeyUp) { + this.selected_nodes[i].onKeyUp(e); + } + } + } + } + + this.graph.change(); + + if (block_default) { + e.preventDefault(); + e.stopImmediatePropagation(); + return false; + } + }; + + LGraphCanvas.prototype.copyToClipboard = function() { + var clipboard_info = { + nodes: [], + links: [] + }; + var index = 0; + var selected_nodes_array = []; + for (var i in this.selected_nodes) { + var node = this.selected_nodes[i]; + if (node.clonable === false) + continue; + node._relative_id = index; + selected_nodes_array.push(node); + index += 1; + } + + for (var i = 0; i < selected_nodes_array.length; ++i) { + var node = selected_nodes_array[i]; + if(node.clonable === false) + continue; + var cloned = node.clone(); + if(!cloned) + { + console.warn("node type not found: " + node.type ); + continue; + } + clipboard_info.nodes.push(cloned.serialize()); + if (node.inputs && node.inputs.length) { + for (var j = 0; j < node.inputs.length; ++j) { + var input = node.inputs[j]; + if (!input || input.link == null) { + continue; + } + var link_info = this.graph.links[input.link]; + if (!link_info) { + continue; + } + var target_node = this.graph.getNodeById( + link_info.origin_id + ); + if (!target_node) { + continue; + } + clipboard_info.links.push([ + target_node._relative_id, + link_info.origin_slot, //j, + node._relative_id, + link_info.target_slot, + target_node.id + ]); + } + } + } + localStorage.setItem( + "litegrapheditor_clipboard", + JSON.stringify(clipboard_info) + ); + }; + + LGraphCanvas.prototype.pasteFromClipboard = function(isConnectUnselected = false) { + // if ctrl + shift + v is off, return when isConnectUnselected is true (shift is pressed) to maintain old behavior + if (!LiteGraph.ctrl_shift_v_paste_connect_unselected_outputs && isConnectUnselected) { + return; + } + var data = localStorage.getItem("litegrapheditor_clipboard"); + if (!data) { + return; + } + + this.graph.beforeChange(); + + //create nodes + var clipboard_info = JSON.parse(data); + // calculate top-left node, could work without this processing but using diff with last node pos :: clipboard_info.nodes[clipboard_info.nodes.length-1].pos + var posMin = false; + var posMinIndexes = false; + for (var i = 0; i < clipboard_info.nodes.length; ++i) { + if (posMin){ + if(posMin[0]>clipboard_info.nodes[i].pos[0]){ + posMin[0] = clipboard_info.nodes[i].pos[0]; + posMinIndexes[0] = i; + } + if(posMin[1]>clipboard_info.nodes[i].pos[1]){ + posMin[1] = clipboard_info.nodes[i].pos[1]; + posMinIndexes[1] = i; + } + } + else{ + posMin = [clipboard_info.nodes[i].pos[0], clipboard_info.nodes[i].pos[1]]; + posMinIndexes = [i, i]; + } + } + var nodes = []; + for (var i = 0; i < clipboard_info.nodes.length; ++i) { + var node_data = clipboard_info.nodes[i]; + var node = LiteGraph.createNode(node_data.type); + if (node) { + node.configure(node_data); + + //paste in last known mouse position + node.pos[0] += this.graph_mouse[0] - posMin[0]; //+= 5; + node.pos[1] += this.graph_mouse[1] - posMin[1]; //+= 5; + + //node.setSize( node.computeSize() ); + + this.graph.add(node,{doProcessChange:false}); + + nodes.push(node); + } + } + + //create links + for (var i = 0; i < clipboard_info.links.length; ++i) { + var link_info = clipboard_info.links[i]; + var origin_node; + var origin_node_relative_id = link_info[0]; + if (origin_node_relative_id != null) { + origin_node = nodes[origin_node_relative_id]; + } else if (LiteGraph.ctrl_shift_v_paste_connect_unselected_outputs && isConnectUnselected) { + var origin_node_id = link_info[4]; + if (origin_node_id) { + origin_node = this.graph.getNodeById(origin_node_id); + } + } + var target_node = nodes[link_info[2]]; + if( origin_node && target_node ) + origin_node.connect(link_info[1], target_node, link_info[3]); + else + console.warn("Warning, nodes missing on pasting"); + } + + this.selectNodes(nodes); + + this.graph.afterChange(); + }; + + /** + * process a item drop event on top the canvas + * @method processDrop + **/ + LGraphCanvas.prototype.processDrop = function(e) { + e.preventDefault(); + this.adjustMouseEvent(e); + var x = e.clientX; + var y = e.clientY; + var is_inside = !this.viewport || ( this.viewport && x >= this.viewport[0] && x < (this.viewport[0] + this.viewport[2]) && y >= this.viewport[1] && y < (this.viewport[1] + this.viewport[3]) ); + if(!is_inside){ + return; + // --- BREAK --- + } + + var pos = [e.canvasX, e.canvasY]; + + + var node = this.graph ? this.graph.getNodeOnPos(pos[0], pos[1]) : null; + + if (!node) { + var r = null; + if (this.onDropItem) { + r = this.onDropItem(event); + } + if (!r) { + this.checkDropItem(e); + } + return; + } + + if (node.onDropFile || node.onDropData) { + var files = e.dataTransfer.files; + if (files && files.length) { + for (var i = 0; i < files.length; i++) { + var file = e.dataTransfer.files[0]; + var filename = file.name; + var ext = LGraphCanvas.getFileExtension(filename); + //console.log(file); + + if (node.onDropFile) { + node.onDropFile(file); + } + + if (node.onDropData) { + //prepare reader + var reader = new FileReader(); + reader.onload = function(event) { + //console.log(event.target); + var data = event.target.result; + node.onDropData(data, filename, file); + }; + + //read data + var type = file.type.split("/")[0]; + if (type == "text" || type == "") { + reader.readAsText(file); + } else if (type == "image") { + reader.readAsDataURL(file); + } else { + reader.readAsArrayBuffer(file); + } + } + } + } + } + + if (node.onDropItem) { + if (node.onDropItem(event)) { + return true; + } + } + + if (this.onDropItem) { + return this.onDropItem(event); + } + + return false; + }; + + //called if the graph doesn't have a default drop item behaviour + LGraphCanvas.prototype.checkDropItem = function(e) { + if (e.dataTransfer.files.length) { + var file = e.dataTransfer.files[0]; + var ext = LGraphCanvas.getFileExtension(file.name).toLowerCase(); + var nodetype = LiteGraph.node_types_by_file_extension[ext]; + if (nodetype) { + this.graph.beforeChange(); + var node = LiteGraph.createNode(nodetype.type); + node.pos = [e.canvasX, e.canvasY]; + this.graph.add(node); + if (node.onDropFile) { + node.onDropFile(file); + } + this.graph.afterChange(); + } + } + }; + + LGraphCanvas.prototype.processNodeDblClicked = function(n) { + if (this.onShowNodePanel) { + this.onShowNodePanel(n); + } + else + { + this.showShowNodePanel(n); + } + + if (this.onNodeDblClicked) { + this.onNodeDblClicked(n); + } + + this.setDirty(true); + }; + + LGraphCanvas.prototype.processNodeSelected = function(node, e) { + this.selectNode(node, e && (e.shiftKey || e.ctrlKey || this.multi_select)); + if (this.onNodeSelected) { + this.onNodeSelected(node); + } + }; + + /** + * selects a given node (or adds it to the current selection) + * @method selectNode + **/ + LGraphCanvas.prototype.selectNode = function( + node, + add_to_current_selection + ) { + if (node == null) { + this.deselectAllNodes(); + } else { + this.selectNodes([node], add_to_current_selection); + } + }; + + /** + * selects several nodes (or adds them to the current selection) + * @method selectNodes + **/ + LGraphCanvas.prototype.selectNodes = function( nodes, add_to_current_selection ) + { + if (!add_to_current_selection) { + this.deselectAllNodes(); + } + + nodes = nodes || this.graph._nodes; + if (typeof nodes == "string") nodes = [nodes]; + for (var i in nodes) { + var node = nodes[i]; + if (node.is_selected) { + this.deselectNode(node); + continue; + } + + if (!node.is_selected && node.onSelected) { + node.onSelected(); + } + node.is_selected = true; + this.selected_nodes[node.id] = node; + + if (node.inputs) { + for (var j = 0; j < node.inputs.length; ++j) { + this.highlighted_links[node.inputs[j].link] = true; + } + } + if (node.outputs) { + for (var j = 0; j < node.outputs.length; ++j) { + var out = node.outputs[j]; + if (out.links) { + for (var k = 0; k < out.links.length; ++k) { + this.highlighted_links[out.links[k]] = true; + } + } + } + } + } + + if( this.onSelectionChange ) + this.onSelectionChange( this.selected_nodes ); + + this.setDirty(true); + }; + + /** + * removes a node from the current selection + * @method deselectNode + **/ + LGraphCanvas.prototype.deselectNode = function(node) { + if (!node.is_selected) { + return; + } + if (node.onDeselected) { + node.onDeselected(); + } + node.is_selected = false; + + if (this.onNodeDeselected) { + this.onNodeDeselected(node); + } + + //remove highlighted + if (node.inputs) { + for (var i = 0; i < node.inputs.length; ++i) { + delete this.highlighted_links[node.inputs[i].link]; + } + } + if (node.outputs) { + for (var i = 0; i < node.outputs.length; ++i) { + var out = node.outputs[i]; + if (out.links) { + for (var j = 0; j < out.links.length; ++j) { + delete this.highlighted_links[out.links[j]]; + } + } + } + } + }; + + /** + * removes all nodes from the current selection + * @method deselectAllNodes + **/ + LGraphCanvas.prototype.deselectAllNodes = function() { + if (!this.graph) { + return; + } + var nodes = this.graph._nodes; + for (var i = 0, l = nodes.length; i < l; ++i) { + var node = nodes[i]; + if (!node.is_selected) { + continue; + } + if (node.onDeselected) { + node.onDeselected(); + } + node.is_selected = false; + if (this.onNodeDeselected) { + this.onNodeDeselected(node); + } + } + this.selected_nodes = {}; + this.current_node = null; + this.highlighted_links = {}; + if( this.onSelectionChange ) + this.onSelectionChange( this.selected_nodes ); + this.setDirty(true); + }; + + /** + * deletes all nodes in the current selection from the graph + * @method deleteSelectedNodes + **/ + LGraphCanvas.prototype.deleteSelectedNodes = function() { + + this.graph.beforeChange(); + + for (var i in this.selected_nodes) { + var node = this.selected_nodes[i]; + + if(node.block_delete) + continue; + + //autoconnect when possible (very basic, only takes into account first input-output) + if(node.inputs && node.inputs.length && node.outputs && node.outputs.length && LiteGraph.isValidConnection( node.inputs[0].type, node.outputs[0].type ) && node.inputs[0].link && node.outputs[0].links && node.outputs[0].links.length ) + { + var input_link = node.graph.links[ node.inputs[0].link ]; + var output_link = node.graph.links[ node.outputs[0].links[0] ]; + var input_node = node.getInputNode(0); + var output_node = node.getOutputNodes(0)[0]; + if(input_node && output_node) + input_node.connect( input_link.origin_slot, output_node, output_link.target_slot ); + } + this.graph.remove(node); + if (this.onNodeDeselected) { + this.onNodeDeselected(node); + } + } + this.selected_nodes = {}; + this.current_node = null; + this.highlighted_links = {}; + this.setDirty(true); + this.graph.afterChange(); + }; + + /** + * centers the camera on a given node + * @method centerOnNode + **/ + LGraphCanvas.prototype.centerOnNode = function(node) { + this.ds.offset[0] = + -node.pos[0] - + node.size[0] * 0.5 + + (this.canvas.width * 0.5) / this.ds.scale; + this.ds.offset[1] = + -node.pos[1] - + node.size[1] * 0.5 + + (this.canvas.height * 0.5) / this.ds.scale; + this.setDirty(true, true); + }; + + /** + * adds some useful properties to a mouse event, like the position in graph coordinates + * @method adjustMouseEvent + **/ + LGraphCanvas.prototype.adjustMouseEvent = function(e) { + var clientX_rel = 0; + var clientY_rel = 0; + + if (this.canvas) { + var b = this.canvas.getBoundingClientRect(); + clientX_rel = e.clientX - b.left; + clientY_rel = e.clientY - b.top; + } else { + clientX_rel = e.clientX; + clientY_rel = e.clientY; + } + + // e.deltaX = clientX_rel - this.last_mouse_position[0]; + // e.deltaY = clientY_rel- this.last_mouse_position[1]; + + this.last_mouse_position[0] = clientX_rel; + this.last_mouse_position[1] = clientY_rel; + + e.canvasX = clientX_rel / this.ds.scale - this.ds.offset[0]; + e.canvasY = clientY_rel / this.ds.scale - this.ds.offset[1]; + + //console.log("pointerevents: adjustMouseEvent "+e.clientX+":"+e.clientY+" "+clientX_rel+":"+clientY_rel+" "+e.canvasX+":"+e.canvasY); + }; + + /** + * changes the zoom level of the graph (default is 1), you can pass also a place used to pivot the zoom + * @method setZoom + **/ + LGraphCanvas.prototype.setZoom = function(value, zooming_center) { + this.ds.changeScale(value, zooming_center); + /* + if(!zooming_center && this.canvas) + zooming_center = [this.canvas.width * 0.5,this.canvas.height * 0.5]; + + var center = this.convertOffsetToCanvas( zooming_center ); + + this.ds.scale = value; + + if(this.scale > this.max_zoom) + this.scale = this.max_zoom; + else if(this.scale < this.min_zoom) + this.scale = this.min_zoom; + + var new_center = this.convertOffsetToCanvas( zooming_center ); + var delta_offset = [new_center[0] - center[0], new_center[1] - center[1]]; + + this.offset[0] += delta_offset[0]; + this.offset[1] += delta_offset[1]; + */ + + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + }; + + /** + * converts a coordinate from graph coordinates to canvas2D coordinates + * @method convertOffsetToCanvas + **/ + LGraphCanvas.prototype.convertOffsetToCanvas = function(pos, out) { + return this.ds.convertOffsetToCanvas(pos, out); + }; + + /** + * converts a coordinate from Canvas2D coordinates to graph space + * @method convertCanvasToOffset + **/ + LGraphCanvas.prototype.convertCanvasToOffset = function(pos, out) { + return this.ds.convertCanvasToOffset(pos, out); + }; + + //converts event coordinates from canvas2D to graph coordinates + LGraphCanvas.prototype.convertEventToCanvasOffset = function(e) { + var rect = this.canvas.getBoundingClientRect(); + return this.convertCanvasToOffset([ + e.clientX - rect.left, + e.clientY - rect.top + ]); + }; + + /** + * brings a node to front (above all other nodes) + * @method bringToFront + **/ + LGraphCanvas.prototype.bringToFront = function(node) { + var i = this.graph._nodes.indexOf(node); + if (i == -1) { + return; + } + + this.graph._nodes.splice(i, 1); + this.graph._nodes.push(node); + }; + + /** + * sends a node to the back (below all other nodes) + * @method sendToBack + **/ + LGraphCanvas.prototype.sendToBack = function(node) { + var i = this.graph._nodes.indexOf(node); + if (i == -1) { + return; + } + + this.graph._nodes.splice(i, 1); + this.graph._nodes.unshift(node); + }; + + /* Interaction */ + + /* LGraphCanvas render */ + var temp = new Float32Array(4); + + /** + * checks which nodes are visible (inside the camera area) + * @method computeVisibleNodes + **/ + LGraphCanvas.prototype.computeVisibleNodes = function(nodes, out) { + var visible_nodes = out || []; + visible_nodes.length = 0; + nodes = nodes || this.graph._nodes; + for (var i = 0, l = nodes.length; i < l; ++i) { + var n = nodes[i]; + + //skip rendering nodes in live mode + if (this.live_mode && !n.onDrawBackground && !n.onDrawForeground) { + continue; + } + + if (!overlapBounding(this.visible_area, n.getBounding(temp, true))) { + continue; + } //out of the visible area + + visible_nodes.push(n); + } + return visible_nodes; + }; + + /** + * renders the whole canvas content, by rendering in two separated canvas, one containing the background grid and the connections, and one containing the nodes) + * @method draw + **/ + LGraphCanvas.prototype.draw = function(force_canvas, force_bgcanvas) { + if (!this.canvas || this.canvas.width == 0 || this.canvas.height == 0) { + return; + } + + //fps counting + var now = LiteGraph.getTime(); + this.render_time = (now - this.last_draw_time) * 0.001; + this.last_draw_time = now; + + if (this.graph) { + this.ds.computeVisibleArea(this.viewport); + } + + if ( + this.dirty_bgcanvas || + force_bgcanvas || + this.always_render_background || + (this.graph && + this.graph._last_trigger_time && + now - this.graph._last_trigger_time < 1000) + ) { + this.drawBackCanvas(); + } + + if (this.dirty_canvas || force_canvas) { + this.drawFrontCanvas(); + } + + this.fps = this.render_time ? 1.0 / this.render_time : 0; + this.frame += 1; + }; + + /** + * draws the front canvas (the one containing all the nodes) + * @method drawFrontCanvas + **/ + LGraphCanvas.prototype.drawFrontCanvas = function() { + this.dirty_canvas = false; + + if (!this.ctx) { + this.ctx = this.bgcanvas.getContext("2d"); + } + var ctx = this.ctx; + if (!ctx) { + //maybe is using webgl... + return; + } + + var canvas = this.canvas; + if ( ctx.start2D && !this.viewport ) { + ctx.start2D(); + ctx.restore(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + } + + //clip dirty area if there is one, otherwise work in full canvas + var area = this.viewport || this.dirty_area; + if (area) { + ctx.save(); + ctx.beginPath(); + ctx.rect( area[0],area[1],area[2],area[3] ); + ctx.clip(); + } + + //clear + //canvas.width = canvas.width; + if (this.clear_background) { + if(area) + ctx.clearRect( area[0],area[1],area[2],area[3] ); + else + ctx.clearRect(0, 0, canvas.width, canvas.height); + } + + //draw bg canvas + if (this.bgcanvas == this.canvas) { + this.drawBackCanvas(); + } else { + ctx.drawImage( this.bgcanvas, 0, 0 ); + } + + //rendering + if (this.onRender) { + this.onRender(canvas, ctx); + } + + //info widget + if (this.show_info) { + this.renderInfo(ctx, area ? area[0] : 0, area ? area[1] : 0 ); + } + + if (this.graph) { + //apply transformations + ctx.save(); + this.ds.toCanvasContext(ctx); + + //draw nodes + var drawn_nodes = 0; + var visible_nodes = this.computeVisibleNodes( + null, + this.visible_nodes + ); + + for (var i = 0; i < visible_nodes.length; ++i) { + var node = visible_nodes[i]; + + //transform coords system + ctx.save(); + ctx.translate(node.pos[0], node.pos[1]); + + //Draw + this.drawNode(node, ctx); + drawn_nodes += 1; + + //Restore + ctx.restore(); + } + + //on top (debug) + if (this.render_execution_order) { + this.drawExecutionOrder(ctx); + } + + //connections ontop? + if (this.graph.config.links_ontop) { + if (!this.live_mode) { + this.drawConnections(ctx); + } + } + + //current connection (the one being dragged by the mouse) + if (this.connecting_pos != null) { + ctx.lineWidth = this.connections_width; + var link_color = null; + + var connInOrOut = this.connecting_output || this.connecting_input; + + var connType = connInOrOut.type; + var connDir = connInOrOut.dir; + if(connDir == null) + { + if (this.connecting_output) + connDir = this.connecting_node.horizontal ? LiteGraph.DOWN : LiteGraph.RIGHT; + else + connDir = this.connecting_node.horizontal ? LiteGraph.UP : LiteGraph.LEFT; + } + var connShape = connInOrOut.shape; + + switch (connType) { + case LiteGraph.EVENT: + link_color = LiteGraph.EVENT_LINK_COLOR; + break; + default: + link_color = LiteGraph.CONNECTING_LINK_COLOR; + } + + //the connection being dragged by the mouse + this.renderLink( + ctx, + this.connecting_pos, + [this.graph_mouse[0], this.graph_mouse[1]], + null, + false, + null, + link_color, + connDir, + LiteGraph.CENTER + ); + + ctx.beginPath(); + if ( + connType === LiteGraph.EVENT || + connShape === LiteGraph.BOX_SHAPE + ) { + ctx.rect( + this.connecting_pos[0] - 6 + 0.5, + this.connecting_pos[1] - 5 + 0.5, + 14, + 10 + ); + ctx.fill(); + ctx.beginPath(); + ctx.rect( + this.graph_mouse[0] - 6 + 0.5, + this.graph_mouse[1] - 5 + 0.5, + 14, + 10 + ); + } else if (connShape === LiteGraph.ARROW_SHAPE) { + ctx.moveTo(this.connecting_pos[0] + 8, this.connecting_pos[1] + 0.5); + ctx.lineTo(this.connecting_pos[0] - 4, this.connecting_pos[1] + 6 + 0.5); + ctx.lineTo(this.connecting_pos[0] - 4, this.connecting_pos[1] - 6 + 0.5); + ctx.closePath(); + } + else { + ctx.arc( + this.connecting_pos[0], + this.connecting_pos[1], + 4, + 0, + Math.PI * 2 + ); + ctx.fill(); + ctx.beginPath(); + ctx.arc( + this.graph_mouse[0], + this.graph_mouse[1], + 4, + 0, + Math.PI * 2 + ); + } + ctx.fill(); + + ctx.fillStyle = "#ffcc00"; + if (this._highlight_input) { + ctx.beginPath(); + var shape = this._highlight_input_slot.shape; + if (shape === LiteGraph.ARROW_SHAPE) { + ctx.moveTo(this._highlight_input[0] + 8, this._highlight_input[1] + 0.5); + ctx.lineTo(this._highlight_input[0] - 4, this._highlight_input[1] + 6 + 0.5); + ctx.lineTo(this._highlight_input[0] - 4, this._highlight_input[1] - 6 + 0.5); + ctx.closePath(); + } else { + ctx.arc( + this._highlight_input[0], + this._highlight_input[1], + 6, + 0, + Math.PI * 2 + ); + } + ctx.fill(); + } + if (this._highlight_output) { + ctx.beginPath(); + if (shape === LiteGraph.ARROW_SHAPE) { + ctx.moveTo(this._highlight_output[0] + 8, this._highlight_output[1] + 0.5); + ctx.lineTo(this._highlight_output[0] - 4, this._highlight_output[1] + 6 + 0.5); + ctx.lineTo(this._highlight_output[0] - 4, this._highlight_output[1] - 6 + 0.5); + ctx.closePath(); + } else { + ctx.arc( + this._highlight_output[0], + this._highlight_output[1], + 6, + 0, + Math.PI * 2 + ); + } + ctx.fill(); + } + } + + //the selection rectangle + if (this.dragging_rectangle) { + ctx.strokeStyle = "#FFF"; + ctx.strokeRect( + this.dragging_rectangle[0], + this.dragging_rectangle[1], + this.dragging_rectangle[2], + this.dragging_rectangle[3] + ); + } + + //on top of link center + if(this.over_link_center && this.render_link_tooltip) + this.drawLinkTooltip( ctx, this.over_link_center ); + else + if(this.onDrawLinkTooltip) //to remove + this.onDrawLinkTooltip(ctx,null); + + //custom info + if (this.onDrawForeground) { + this.onDrawForeground(ctx, this.visible_rect); + } + + ctx.restore(); + } + + //draws panel in the corner + if (this._graph_stack && this._graph_stack.length) { + this.drawSubgraphPanel( ctx ); + } + + + if (this.onDrawOverlay) { + this.onDrawOverlay(ctx); + } + + if (area){ + ctx.restore(); + } + + if (ctx.finish2D) { + //this is a function I use in webgl renderer + ctx.finish2D(); + } + }; + + /** + * draws the panel in the corner that shows subgraph properties + * @method drawSubgraphPanel + **/ + LGraphCanvas.prototype.drawSubgraphPanel = function (ctx) { + var subgraph = this.graph; + var subnode = subgraph._subgraph_node; + if (!subnode) { + console.warn("subgraph without subnode"); + return; + } + this.drawSubgraphPanelLeft(subgraph, subnode, ctx) + //this.drawSubgraphPanelRight(subgraph, subnode, ctx) + } + + LGraphCanvas.prototype.drawSubgraphPanelLeft = function (subgraph, subnode, ctx) { + var num = 0;//subnode.inputs ? subnode.inputs.length : 0; + var w = 200; + var h = Math.floor(LiteGraph.NODE_SLOT_HEIGHT * 1.6); + + ctx.fillStyle = "#111"; + ctx.globalAlpha = 0.6; + ctx.beginPath(); + ctx.roundRect(10, 10, w, (num + 1) * h + 10, [8]); + ctx.fill(); + ctx.globalAlpha = 1; + + ctx.fillStyle = "#888"; + ctx.font = "14px Arial"; + ctx.textAlign = "left"; + ctx.fillText(subnode.title, 20, 34); + // var pos = this.mouse; + + if (this.drawButton(w - 20, 20, 20, 20, "X", "#151515")) { + this.closeSubgraph(); + return; + } + + return; + + var y = 50; + ctx.font = "14px Arial"; + if (subnode.inputs) + for (var i = 0; i < subnode.inputs.length; ++i) { + var input = subnode.inputs[i]; + if (input.not_subgraph_input) + continue; + + //input button clicked + if (this.drawButton(20, y + 2, w - 20, h - 2)) { + var type = subnode.constructor.input_node_type || "graph/input"; + this.graph.beforeChange(); + var newnode = LiteGraph.createNode(type); + if (newnode) { + subgraph.add(newnode); + this.block_click = false; + this.last_click_position = null; + this.selectNodes([newnode]); + this.node_dragged = newnode; + this.dragging_canvas = false; + newnode.setProperty("name", input.name); + newnode.setProperty("type", input.type); + this.node_dragged.pos[0] = this.graph_mouse[0] - 5; + this.node_dragged.pos[1] = this.graph_mouse[1] - 5; + this.graph.afterChange(); + } + else + console.error("graph input node not found:", type); + } + ctx.fillStyle = "#9C9"; + ctx.beginPath(); + ctx.arc(w - 16, y + h * 0.5, 5, 0, 2 * Math.PI); + ctx.fill(); + ctx.fillStyle = "#AAA"; + ctx.fillText(input.name, 30, y + h * 0.75); + // var tw = ctx.measureText(input.name); + ctx.fillStyle = "#777"; + ctx.fillText(input.type, 130, y + h * 0.75); + y += h; + } + //add + button + //if (this.drawButton(20, y + 2, w - 20, h - 2, "+", "#151515", "#222")) { + // this.showSubgraphPropertiesDialog(subnode); + //} + } + LGraphCanvas.prototype.drawSubgraphPanelRight = function (subgraph, subnode, ctx) { + var num = subnode.outputs ? subnode.outputs.length : 0; + var canvas_w = this.bgcanvas.width + var w = 200; + var h = Math.floor(LiteGraph.NODE_SLOT_HEIGHT * 1.6); + + ctx.fillStyle = "#111"; + ctx.globalAlpha = 0.8; + ctx.beginPath(); + ctx.roundRect(canvas_w - w - 10, 10, w, (num + 1) * h + 50, [8]); + ctx.fill(); + ctx.globalAlpha = 1; + + ctx.fillStyle = "#888"; + ctx.font = "14px Arial"; + ctx.textAlign = "left"; + var title_text = "Graph Outputs" + var tw = ctx.measureText(title_text).width + ctx.fillText(title_text, (canvas_w - tw) - 20, 34); + // var pos = this.mouse; + if (this.drawButton(canvas_w - w, 20, 20, 20, "X", "#151515")) { + this.closeSubgraph(); + return; + } + + var y = 50; + ctx.font = "14px Arial"; + if (subnode.outputs) + for (var i = 0; i < subnode.outputs.length; ++i) { + var output = subnode.outputs[i]; + if (output.not_subgraph_input) + continue; + + //output button clicked + if (this.drawButton(canvas_w - w, y + 2, w - 20, h - 2)) { + var type = subnode.constructor.output_node_type || "graph/output"; + this.graph.beforeChange(); + var newnode = LiteGraph.createNode(type); + if (newnode) { + subgraph.add(newnode); + this.block_click = false; + this.last_click_position = null; + this.selectNodes([newnode]); + this.node_dragged = newnode; + this.dragging_canvas = false; + newnode.setProperty("name", output.name); + newnode.setProperty("type", output.type); + this.node_dragged.pos[0] = this.graph_mouse[0] - 5; + this.node_dragged.pos[1] = this.graph_mouse[1] - 5; + this.graph.afterChange(); + } + else + console.error("graph input node not found:", type); + } + ctx.fillStyle = "#9C9"; + ctx.beginPath(); + ctx.arc(canvas_w - w + 16, y + h * 0.5, 5, 0, 2 * Math.PI); + ctx.fill(); + ctx.fillStyle = "#AAA"; + ctx.fillText(output.name, canvas_w - w + 30, y + h * 0.75); + // var tw = ctx.measureText(input.name); + ctx.fillStyle = "#777"; + ctx.fillText(output.type, canvas_w - w + 130, y + h * 0.75); + y += h; + } + //add + button + //if (this.drawButton(canvas_w - w, y + 2, w - 20, h - 2, "+", "#151515", "#222")) { + // this.showSubgraphPropertiesDialogRight(subnode); + //} + } + //Draws a button into the canvas overlay and computes if it was clicked using the immediate gui paradigm + LGraphCanvas.prototype.drawButton = function( x,y,w,h, text, bgcolor, hovercolor, textcolor ) + { + var ctx = this.ctx; + bgcolor = bgcolor || LiteGraph.NODE_DEFAULT_COLOR; + hovercolor = hovercolor || "#555"; + textcolor = textcolor || LiteGraph.NODE_TEXT_COLOR; + var pos = this.ds.convertOffsetToCanvas(this.graph_mouse); + var hover = LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h ); + pos = this.last_click_position ? [this.last_click_position[0], this.last_click_position[1]] : null; + if(pos) { + var rect = this.canvas.getBoundingClientRect(); + pos[0] -= rect.left; + pos[1] -= rect.top; + } + var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h ); + + ctx.fillStyle = hover ? hovercolor : bgcolor; + if(clicked) + ctx.fillStyle = "#AAA"; + ctx.beginPath(); + ctx.roundRect(x,y,w,h,[4] ); + ctx.fill(); + + if(text != null) + { + if(text.constructor == String) + { + ctx.fillStyle = textcolor; + ctx.textAlign = "center"; + ctx.font = ((h * 0.65)|0) + "px Arial"; + ctx.fillText( text, x + w * 0.5,y + h * 0.75 ); + ctx.textAlign = "left"; + } + } + + var was_clicked = clicked && !this.block_click; + if(clicked) + this.blockClick(); + return was_clicked; + } + + LGraphCanvas.prototype.isAreaClicked = function( x,y,w,h, hold_click ) + { + var pos = this.mouse; + var hover = LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h ); + pos = this.last_click_position; + var clicked = pos && LiteGraph.isInsideRectangle( pos[0], pos[1], x,y,w,h ); + var was_clicked = clicked && !this.block_click; + if(clicked && hold_click) + this.blockClick(); + return was_clicked; + } + + /** + * draws some useful stats in the corner of the canvas + * @method renderInfo + **/ + LGraphCanvas.prototype.renderInfo = function(ctx, x, y) { + x = x || 10; + y = y || this.canvas.height - 80; + + ctx.save(); + ctx.translate(x, y); + + ctx.font = "10px Arial"; + ctx.fillStyle = "#888"; + ctx.textAlign = "left"; + if (this.graph) { + ctx.fillText( "T: " + this.graph.globaltime.toFixed(2) + "s", 5, 13 * 1 ); + ctx.fillText("I: " + this.graph.iteration, 5, 13 * 2 ); + ctx.fillText("N: " + this.graph._nodes.length + " [" + this.visible_nodes.length + "]", 5, 13 * 3 ); + ctx.fillText("V: " + this.graph._version, 5, 13 * 4); + ctx.fillText("FPS:" + this.fps.toFixed(2), 5, 13 * 5); + } else { + ctx.fillText("No graph selected", 5, 13 * 1); + } + ctx.restore(); + }; + + /** + * draws the back canvas (the one containing the background and the connections) + * @method drawBackCanvas + **/ + LGraphCanvas.prototype.drawBackCanvas = function() { + var canvas = this.bgcanvas; + if ( + canvas.width != this.canvas.width || + canvas.height != this.canvas.height + ) { + canvas.width = this.canvas.width; + canvas.height = this.canvas.height; + } + + if (!this.bgctx) { + this.bgctx = this.bgcanvas.getContext("2d"); + } + var ctx = this.bgctx; + if (ctx.start) { + ctx.start(); + } + + var viewport = this.viewport || [0,0,ctx.canvas.width,ctx.canvas.height]; + + //clear + if (this.clear_background) { + ctx.clearRect( viewport[0], viewport[1], viewport[2], viewport[3] ); + } + + //show subgraph stack header + if (this._graph_stack && this._graph_stack.length) { + ctx.save(); + var parent_graph = this._graph_stack[this._graph_stack.length - 1]; + var subgraph_node = this.graph._subgraph_node; + ctx.strokeStyle = subgraph_node.bgcolor; + ctx.lineWidth = 10; + ctx.strokeRect(1, 1, canvas.width - 2, canvas.height - 2); + ctx.lineWidth = 1; + ctx.font = "40px Arial"; + ctx.textAlign = "center"; + ctx.fillStyle = subgraph_node.bgcolor || "#AAA"; + var title = ""; + for (var i = 1; i < this._graph_stack.length; ++i) { + title += + this._graph_stack[i]._subgraph_node.getTitle() + " >> "; + } + ctx.fillText( + title + subgraph_node.getTitle(), + canvas.width * 0.5, + 40 + ); + ctx.restore(); + } + + var bg_already_painted = false; + if (this.onRenderBackground) { + bg_already_painted = this.onRenderBackground(canvas, ctx); + } + + //reset in case of error + if ( !this.viewport ) + { + ctx.restore(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + } + this.visible_links.length = 0; + + if (this.graph) { + //apply transformations + ctx.save(); + this.ds.toCanvasContext(ctx); + + //render BG + if ( this.ds.scale < 1.5 && !bg_already_painted && this.clear_background_color ) + { + ctx.fillStyle = this.clear_background_color; + ctx.fillRect( + this.visible_area[0], + this.visible_area[1], + this.visible_area[2], + this.visible_area[3] + ); + } + + // draw a grid + /* + var w = this.visible_area[1] - this.visible_area[0]; + var h = this.visible_area[3] - this.visible_area[2]; + ctx.strokeStyle = 'white'; + ctx.lineWidth = 1; + for (var x = 0; x < w; x += 20) { + ctx.beginPath(); + ctx.moveTo(x, 0); + ctx.lineTo(x, h); + ctx.stroke(); + } + for (var y = 0; y < h; y += 20) { + ctx.beginPath(); + ctx.moveTo(0, y); + ctx.lineTo(w, y); + ctx.stroke(); + } */ + + if ( + this.background_image && + this.ds.scale > 0.5 && + !bg_already_painted + ) { + if (this.zoom_modify_alpha) { + ctx.globalAlpha = + (1.0 - 0.5 / this.ds.scale) * this.editor_alpha; + } else { + ctx.globalAlpha = this.editor_alpha; + } + ctx.imageSmoothingEnabled = ctx.imageSmoothingEnabled = false; // ctx.mozImageSmoothingEnabled = + if ( + !this._bg_img || + this._bg_img.name != this.background_image + ) { + this._bg_img = new Image(); + this._bg_img.name = this.background_image; + this._bg_img.src = this.background_image; + var that = this; + this._bg_img.onload = function() { + that.draw(true, true); + }; + } + + var pattern = null; + if (this._pattern == null && this._bg_img.width > 0) { + pattern = ctx.createPattern(this._bg_img, "repeat"); + this._pattern_img = this._bg_img; + this._pattern = pattern; + } else { + pattern = this._pattern; + } + if (pattern) { + ctx.fillStyle = pattern; + ctx.fillRect( + this.visible_area[0], + this.visible_area[1], + this.visible_area[2], + this.visible_area[3] + ); + ctx.fillStyle = "transparent"; + } + + ctx.globalAlpha = 1.0; + ctx.imageSmoothingEnabled = ctx.imageSmoothingEnabled = true; //= ctx.mozImageSmoothingEnabled + } + + //groups + if (this.graph._groups.length && !this.live_mode) { + this.drawGroups(canvas, ctx); + } + + if (this.onDrawBackground) { + this.onDrawBackground(ctx, this.visible_area); + } + if (this.onBackgroundRender) { + //LEGACY + console.error( + "WARNING! onBackgroundRender deprecated, now is named onDrawBackground " + ); + this.onBackgroundRender = null; + } + + //DEBUG: show clipping area + //ctx.fillStyle = "red"; + //ctx.fillRect( this.visible_area[0] + 10, this.visible_area[1] + 10, this.visible_area[2] - 20, this.visible_area[3] - 20); + + //bg + if (this.render_canvas_border) { + ctx.strokeStyle = "#235"; + ctx.strokeRect(0, 0, canvas.width, canvas.height); + } + + if (this.render_connections_shadows) { + ctx.shadowColor = "#000"; + ctx.shadowOffsetX = 0; + ctx.shadowOffsetY = 0; + ctx.shadowBlur = 6; + } else { + ctx.shadowColor = "rgba(0,0,0,0)"; + } + + //draw connections + if (!this.live_mode) { + this.drawConnections(ctx); + } + + ctx.shadowColor = "rgba(0,0,0,0)"; + + //restore state + ctx.restore(); + } + + if (ctx.finish) { + ctx.finish(); + } + + this.dirty_bgcanvas = false; + this.dirty_canvas = true; //to force to repaint the front canvas with the bgcanvas + }; + + var temp_vec2 = new Float32Array(2); + + /** + * draws the given node inside the canvas + * @method drawNode + **/ + LGraphCanvas.prototype.drawNode = function(node, ctx) { + var glow = false; + this.current_node = node; + + var color = node.color || node.constructor.color || LiteGraph.NODE_DEFAULT_COLOR; + var bgcolor = node.bgcolor || node.constructor.bgcolor || LiteGraph.NODE_DEFAULT_BGCOLOR; + + //shadow and glow + if (node.mouseOver) { + glow = true; + } + + var low_quality = this.ds.scale < 0.6; //zoomed out + + //only render if it forces it to do it + if (this.live_mode) { + if (!node.flags.collapsed) { + ctx.shadowColor = "transparent"; + if (node.onDrawForeground) { + node.onDrawForeground(ctx, this, this.canvas); + } + } + return; + } + + var editor_alpha = this.editor_alpha; + ctx.globalAlpha = editor_alpha; + + if (this.render_shadows && !low_quality) { + ctx.shadowColor = LiteGraph.DEFAULT_SHADOW_COLOR; + ctx.shadowOffsetX = 2 * this.ds.scale; + ctx.shadowOffsetY = 2 * this.ds.scale; + ctx.shadowBlur = 3 * this.ds.scale; + } else { + ctx.shadowColor = "transparent"; + } + + //custom draw collapsed method (draw after shadows because they are affected) + if ( + node.flags.collapsed && + node.onDrawCollapsed && + node.onDrawCollapsed(ctx, this) == true + ) { + return; + } + + //clip if required (mask) + var shape = node._shape || LiteGraph.BOX_SHAPE; + var size = temp_vec2; + temp_vec2.set(node.size); + var horizontal = node.horizontal; // || node.flags.horizontal; + + if (node.flags.collapsed) { + ctx.font = this.inner_text_font; + var title = node.getTitle ? node.getTitle() : node.title; + if (title != null) { + node._collapsed_width = Math.min( + node.size[0], + ctx.measureText(title).width + + LiteGraph.NODE_TITLE_HEIGHT * 2 + ); //LiteGraph.NODE_COLLAPSED_WIDTH; + size[0] = node._collapsed_width; + size[1] = 0; + } + } + + if (node.clip_area) { + //Start clipping + ctx.save(); + ctx.beginPath(); + if (shape == LiteGraph.BOX_SHAPE) { + ctx.rect(0, 0, size[0], size[1]); + } else if (shape == LiteGraph.ROUND_SHAPE) { + ctx.roundRect(0, 0, size[0], size[1], [10]); + } else if (shape == LiteGraph.CIRCLE_SHAPE) { + ctx.arc( + size[0] * 0.5, + size[1] * 0.5, + size[0] * 0.5, + 0, + Math.PI * 2 + ); + } + ctx.clip(); + } + + //draw shape + if (node.has_errors) { + bgcolor = "red"; + } + this.drawNodeShape( + node, + ctx, + size, + color, + bgcolor, + node.is_selected, + node.mouseOver + ); + ctx.shadowColor = "transparent"; + + //draw foreground + if (node.onDrawForeground) { + node.onDrawForeground(ctx, this, this.canvas); + } + + //connection slots + ctx.textAlign = horizontal ? "center" : "left"; + ctx.font = this.inner_text_font; + + var render_text = !low_quality; + + var out_slot = this.connecting_output; + var in_slot = this.connecting_input; + ctx.lineWidth = 1; + + var max_y = 0; + var slot_pos = new Float32Array(2); //to reuse + + //render inputs and outputs + if (!node.flags.collapsed) { + //input connection slots + if (node.inputs) { + for (var i = 0; i < node.inputs.length; i++) { + var slot = node.inputs[i]; + + var slot_type = slot.type; + var slot_shape = slot.shape; + + ctx.globalAlpha = editor_alpha; + //change opacity of incompatible slots when dragging a connection + if ( this.connecting_output && !LiteGraph.isValidConnection( slot.type , out_slot.type) ) { + ctx.globalAlpha = 0.4 * editor_alpha; + } + + ctx.fillStyle = + slot.link != null + ? slot.color_on || + this.default_connection_color_byType[slot_type] || + this.default_connection_color.input_on + : slot.color_off || + this.default_connection_color_byTypeOff[slot_type] || + this.default_connection_color_byType[slot_type] || + this.default_connection_color.input_off; + + var pos = node.getConnectionPos(true, i, slot_pos); + pos[0] -= node.pos[0]; + pos[1] -= node.pos[1]; + if (max_y < pos[1] + LiteGraph.NODE_SLOT_HEIGHT * 0.5) { + max_y = pos[1] + LiteGraph.NODE_SLOT_HEIGHT * 0.5; + } + + ctx.beginPath(); + + if (slot_type == "array"){ + slot_shape = LiteGraph.GRID_SHAPE; // place in addInput? addOutput instead? + } + + var doStroke = true; + + if ( + slot.type === LiteGraph.EVENT || + slot.shape === LiteGraph.BOX_SHAPE + ) { + if (horizontal) { + ctx.rect( + pos[0] - 5 + 0.5, + pos[1] - 8 + 0.5, + 10, + 14 + ); + } else { + ctx.rect( + pos[0] - 6 + 0.5, + pos[1] - 5 + 0.5, + 14, + 10 + ); + } + } else if (slot_shape === LiteGraph.ARROW_SHAPE) { + ctx.moveTo(pos[0] + 8, pos[1] + 0.5); + ctx.lineTo(pos[0] - 4, pos[1] + 6 + 0.5); + ctx.lineTo(pos[0] - 4, pos[1] - 6 + 0.5); + ctx.closePath(); + } else if (slot_shape === LiteGraph.GRID_SHAPE) { + ctx.rect(pos[0] - 4, pos[1] - 4, 2, 2); + ctx.rect(pos[0] - 1, pos[1] - 4, 2, 2); + ctx.rect(pos[0] + 2, pos[1] - 4, 2, 2); + ctx.rect(pos[0] - 4, pos[1] - 1, 2, 2); + ctx.rect(pos[0] - 1, pos[1] - 1, 2, 2); + ctx.rect(pos[0] + 2, pos[1] - 1, 2, 2); + ctx.rect(pos[0] - 4, pos[1] + 2, 2, 2); + ctx.rect(pos[0] - 1, pos[1] + 2, 2, 2); + ctx.rect(pos[0] + 2, pos[1] + 2, 2, 2); + doStroke = false; + } else { + if(low_quality) + ctx.rect(pos[0] - 4, pos[1] - 4, 8, 8 ); //faster + else + ctx.arc(pos[0], pos[1], 4, 0, Math.PI * 2); + } + ctx.fill(); + + //render name + if (render_text) { + var text = slot.label != null ? slot.label : slot.name; + if (text) { + ctx.fillStyle = LiteGraph.NODE_TEXT_COLOR; + if (horizontal || slot.dir == LiteGraph.UP) { + ctx.fillText(text, pos[0], pos[1] - 10); + } else { + ctx.fillText(text, pos[0] + 10, pos[1] + 5); + } + } + } + } + } + + //output connection slots + + ctx.textAlign = horizontal ? "center" : "right"; + ctx.strokeStyle = "black"; + if (node.outputs) { + for (var i = 0; i < node.outputs.length; i++) { + var slot = node.outputs[i]; + + var slot_type = slot.type; + var slot_shape = slot.shape; + + //change opacity of incompatible slots when dragging a connection + if (this.connecting_input && !LiteGraph.isValidConnection( slot_type , in_slot.type) ) { + ctx.globalAlpha = 0.4 * editor_alpha; + } + + var pos = node.getConnectionPos(false, i, slot_pos); + pos[0] -= node.pos[0]; + pos[1] -= node.pos[1]; + if (max_y < pos[1] + LiteGraph.NODE_SLOT_HEIGHT * 0.5) { + max_y = pos[1] + LiteGraph.NODE_SLOT_HEIGHT * 0.5; + } + + ctx.fillStyle = + slot.links && slot.links.length + ? slot.color_on || + this.default_connection_color_byType[slot_type] || + this.default_connection_color.output_on + : slot.color_off || + this.default_connection_color_byTypeOff[slot_type] || + this.default_connection_color_byType[slot_type] || + this.default_connection_color.output_off; + ctx.beginPath(); + //ctx.rect( node.size[0] - 14,i*14,10,10); + + if (slot_type == "array"){ + slot_shape = LiteGraph.GRID_SHAPE; + } + + var doStroke = true; + + if ( + slot_type === LiteGraph.EVENT || + slot_shape === LiteGraph.BOX_SHAPE + ) { + if (horizontal) { + ctx.rect( + pos[0] - 5 + 0.5, + pos[1] - 8 + 0.5, + 10, + 14 + ); + } else { + ctx.rect( + pos[0] - 6 + 0.5, + pos[1] - 5 + 0.5, + 14, + 10 + ); + } + } else if (slot_shape === LiteGraph.ARROW_SHAPE) { + ctx.moveTo(pos[0] + 8, pos[1] + 0.5); + ctx.lineTo(pos[0] - 4, pos[1] + 6 + 0.5); + ctx.lineTo(pos[0] - 4, pos[1] - 6 + 0.5); + ctx.closePath(); + } else if (slot_shape === LiteGraph.GRID_SHAPE) { + ctx.rect(pos[0] - 4, pos[1] - 4, 2, 2); + ctx.rect(pos[0] - 1, pos[1] - 4, 2, 2); + ctx.rect(pos[0] + 2, pos[1] - 4, 2, 2); + ctx.rect(pos[0] - 4, pos[1] - 1, 2, 2); + ctx.rect(pos[0] - 1, pos[1] - 1, 2, 2); + ctx.rect(pos[0] + 2, pos[1] - 1, 2, 2); + ctx.rect(pos[0] - 4, pos[1] + 2, 2, 2); + ctx.rect(pos[0] - 1, pos[1] + 2, 2, 2); + ctx.rect(pos[0] + 2, pos[1] + 2, 2, 2); + doStroke = false; + } else { + if(low_quality) + ctx.rect(pos[0] - 4, pos[1] - 4, 8, 8 ); + else + ctx.arc(pos[0], pos[1], 4, 0, Math.PI * 2); + } + + //trigger + //if(slot.node_id != null && slot.slot == -1) + // ctx.fillStyle = "#F85"; + + //if(slot.links != null && slot.links.length) + ctx.fill(); + if(!low_quality && doStroke) + ctx.stroke(); + + //render output name + if (render_text) { + var text = slot.label != null ? slot.label : slot.name; + if (text) { + ctx.fillStyle = LiteGraph.NODE_TEXT_COLOR; + if (horizontal || slot.dir == LiteGraph.DOWN) { + ctx.fillText(text, pos[0], pos[1] - 8); + } else { + ctx.fillText(text, pos[0] - 10, pos[1] + 5); + } + } + } + } + } + + ctx.textAlign = "left"; + ctx.globalAlpha = 1; + + if (node.widgets) { + var widgets_y = max_y; + if (horizontal || node.widgets_up) { + widgets_y = 2; + } + if( node.widgets_start_y != null ) + widgets_y = node.widgets_start_y; + this.drawNodeWidgets( + node, + widgets_y, + ctx, + this.node_widget && this.node_widget[0] == node + ? this.node_widget[1] + : null + ); + } + } else if (this.render_collapsed_slots) { + //if collapsed + var input_slot = null; + var output_slot = null; + + //get first connected slot to render + if (node.inputs) { + for (var i = 0; i < node.inputs.length; i++) { + var slot = node.inputs[i]; + if (slot.link == null) { + continue; + } + input_slot = slot; + break; + } + } + if (node.outputs) { + for (var i = 0; i < node.outputs.length; i++) { + var slot = node.outputs[i]; + if (!slot.links || !slot.links.length) { + continue; + } + output_slot = slot; + } + } + + if (input_slot) { + var x = 0; + var y = LiteGraph.NODE_TITLE_HEIGHT * -0.5; //center + if (horizontal) { + x = node._collapsed_width * 0.5; + y = -LiteGraph.NODE_TITLE_HEIGHT; + } + ctx.fillStyle = "#686"; + ctx.beginPath(); + if ( + slot.type === LiteGraph.EVENT || + slot.shape === LiteGraph.BOX_SHAPE + ) { + ctx.rect(x - 7 + 0.5, y - 4, 14, 8); + } else if (slot.shape === LiteGraph.ARROW_SHAPE) { + ctx.moveTo(x + 8, y); + ctx.lineTo(x + -4, y - 4); + ctx.lineTo(x + -4, y + 4); + ctx.closePath(); + } else { + ctx.arc(x, y, 4, 0, Math.PI * 2); + } + ctx.fill(); + } + + if (output_slot) { + var x = node._collapsed_width; + var y = LiteGraph.NODE_TITLE_HEIGHT * -0.5; //center + if (horizontal) { + x = node._collapsed_width * 0.5; + y = 0; + } + ctx.fillStyle = "#686"; + ctx.strokeStyle = "black"; + ctx.beginPath(); + if ( + slot.type === LiteGraph.EVENT || + slot.shape === LiteGraph.BOX_SHAPE + ) { + ctx.rect(x - 7 + 0.5, y - 4, 14, 8); + } else if (slot.shape === LiteGraph.ARROW_SHAPE) { + ctx.moveTo(x + 6, y); + ctx.lineTo(x - 6, y - 4); + ctx.lineTo(x - 6, y + 4); + ctx.closePath(); + } else { + ctx.arc(x, y, 4, 0, Math.PI * 2); + } + ctx.fill(); + //ctx.stroke(); + } + } + + if (node.clip_area) { + ctx.restore(); + } + + ctx.globalAlpha = 1.0; + }; + + //used by this.over_link_center + LGraphCanvas.prototype.drawLinkTooltip = function( ctx, link ) + { + var pos = link._pos; + ctx.fillStyle = "black"; + ctx.beginPath(); + ctx.arc( pos[0], pos[1], 3, 0, Math.PI * 2 ); + ctx.fill(); + + if(link.data == null) + return; + + if(this.onDrawLinkTooltip) + if( this.onDrawLinkTooltip(ctx,link,this) == true ) + return; + + var data = link.data; + var text = null; + + if( data.constructor === Number ) + text = data.toFixed(2); + else if( data.constructor === String ) + text = "\"" + data + "\""; + else if( data.constructor === Boolean ) + text = String(data); + else if (data.toToolTip) + text = data.toToolTip(); + else + text = "[" + data.constructor.name + "]"; + + if(text == null) + return; + text = text.substr(0,30); //avoid weird + + ctx.font = "14px Courier New"; + var info = ctx.measureText(text); + var w = info.width + 20; + var h = 24; + ctx.shadowColor = "black"; + ctx.shadowOffsetX = 2; + ctx.shadowOffsetY = 2; + ctx.shadowBlur = 3; + ctx.fillStyle = "#454"; + ctx.beginPath(); + ctx.roundRect( pos[0] - w*0.5, pos[1] - 15 - h, w, h, [3]); + ctx.moveTo( pos[0] - 10, pos[1] - 15 ); + ctx.lineTo( pos[0] + 10, pos[1] - 15 ); + ctx.lineTo( pos[0], pos[1] - 5 ); + ctx.fill(); + ctx.shadowColor = "transparent"; + ctx.textAlign = "center"; + ctx.fillStyle = "#CEC"; + ctx.fillText(text, pos[0], pos[1] - 15 - h * 0.3); + } + + /** + * draws the shape of the given node in the canvas + * @method drawNodeShape + **/ + var tmp_area = new Float32Array(4); + + LGraphCanvas.prototype.drawNodeShape = function( + node, + ctx, + size, + fgcolor, + bgcolor, + selected, + mouse_over + ) { + //bg rect + ctx.strokeStyle = fgcolor; + ctx.fillStyle = bgcolor; + + var title_height = LiteGraph.NODE_TITLE_HEIGHT; + var low_quality = this.ds.scale < 0.5; + + //render node area depending on shape + var shape = + node._shape || node.constructor.shape || LiteGraph.ROUND_SHAPE; + + var title_mode = node.constructor.title_mode; + + var render_title = true; + if (title_mode == LiteGraph.TRANSPARENT_TITLE || title_mode == LiteGraph.NO_TITLE) { + render_title = false; + } else if (title_mode == LiteGraph.AUTOHIDE_TITLE && mouse_over) { + render_title = true; + } + + var area = tmp_area; + area[0] = 0; //x + area[1] = render_title ? -title_height : 0; //y + area[2] = size[0] + 1; //w + area[3] = render_title ? size[1] + title_height : size[1]; //h + + var old_alpha = ctx.globalAlpha; + + //full node shape + //if(node.flags.collapsed) + { + ctx.beginPath(); + if (shape == LiteGraph.BOX_SHAPE || low_quality) { + ctx.fillRect(area[0], area[1], area[2], area[3]); + } else if ( + shape == LiteGraph.ROUND_SHAPE || + shape == LiteGraph.CARD_SHAPE + ) { + ctx.roundRect( + area[0], + area[1], + area[2], + area[3], + shape == LiteGraph.CARD_SHAPE ? [this.round_radius,this.round_radius,0,0] : [this.round_radius] + ); + } else if (shape == LiteGraph.CIRCLE_SHAPE) { + ctx.arc( + size[0] * 0.5, + size[1] * 0.5, + size[0] * 0.5, + 0, + Math.PI * 2 + ); + } + ctx.fill(); + + //separator + if(!node.flags.collapsed && render_title) + { + ctx.shadowColor = "transparent"; + ctx.fillStyle = "rgba(0,0,0,0.2)"; + ctx.fillRect(0, -1, area[2], 2); + } + } + ctx.shadowColor = "transparent"; + + if (node.onDrawBackground) { + node.onDrawBackground(ctx, this, this.canvas, this.graph_mouse ); + } + + //title bg (remember, it is rendered ABOVE the node) + if (render_title || title_mode == LiteGraph.TRANSPARENT_TITLE) { + //title bar + if (node.onDrawTitleBar) { + node.onDrawTitleBar( ctx, title_height, size, this.ds.scale, fgcolor ); + } else if ( + title_mode != LiteGraph.TRANSPARENT_TITLE && + (node.constructor.title_color || this.render_title_colored) + ) { + var title_color = node.constructor.title_color || fgcolor; + + if (node.flags.collapsed) { + ctx.shadowColor = LiteGraph.DEFAULT_SHADOW_COLOR; + } + + //* gradient test + if (this.use_gradients) { + var grad = LGraphCanvas.gradients[title_color]; + if (!grad) { + grad = LGraphCanvas.gradients[ title_color ] = ctx.createLinearGradient(0, 0, 400, 0); + grad.addColorStop(0, title_color); // TODO refactor: validate color !! prevent DOMException + grad.addColorStop(1, "#000"); + } + ctx.fillStyle = grad; + } else { + ctx.fillStyle = title_color; + } + + //ctx.globalAlpha = 0.5 * old_alpha; + ctx.beginPath(); + if (shape == LiteGraph.BOX_SHAPE || low_quality) { + ctx.rect(0, -title_height, size[0] + 1, title_height); + } else if ( shape == LiteGraph.ROUND_SHAPE || shape == LiteGraph.CARD_SHAPE ) { + ctx.roundRect( + 0, + -title_height, + size[0] + 1, + title_height, + node.flags.collapsed ? [this.round_radius] : [this.round_radius,this.round_radius,0,0] + ); + } + ctx.fill(); + ctx.shadowColor = "transparent"; + } + + var colState = false; + if (LiteGraph.node_box_coloured_by_mode){ + if(LiteGraph.NODE_MODES_COLORS[node.mode]){ + colState = LiteGraph.NODE_MODES_COLORS[node.mode]; + } + } + if (LiteGraph.node_box_coloured_when_on){ + colState = node.action_triggered ? "#FFF" : (node.execute_triggered ? "#AAA" : colState); + } + + //title box + var box_size = 10; + if (node.onDrawTitleBox) { + node.onDrawTitleBox(ctx, title_height, size, this.ds.scale); + } else if ( + shape == LiteGraph.ROUND_SHAPE || + shape == LiteGraph.CIRCLE_SHAPE || + shape == LiteGraph.CARD_SHAPE + ) { + if (low_quality) { + ctx.fillStyle = "black"; + ctx.beginPath(); + ctx.arc( + title_height * 0.5, + title_height * -0.5, + box_size * 0.5 + 1, + 0, + Math.PI * 2 + ); + ctx.fill(); + } + + ctx.fillStyle = node.boxcolor || colState || LiteGraph.NODE_DEFAULT_BOXCOLOR; + if(low_quality) + ctx.fillRect( title_height * 0.5 - box_size *0.5, title_height * -0.5 - box_size *0.5, box_size , box_size ); + else + { + ctx.beginPath(); + ctx.arc( + title_height * 0.5, + title_height * -0.5, + box_size * 0.5, + 0, + Math.PI * 2 + ); + ctx.fill(); + } + } else { + if (low_quality) { + ctx.fillStyle = "black"; + ctx.fillRect( + (title_height - box_size) * 0.5 - 1, + (title_height + box_size) * -0.5 - 1, + box_size + 2, + box_size + 2 + ); + } + ctx.fillStyle = node.boxcolor || colState || LiteGraph.NODE_DEFAULT_BOXCOLOR; + ctx.fillRect( + (title_height - box_size) * 0.5, + (title_height + box_size) * -0.5, + box_size, + box_size + ); + } + ctx.globalAlpha = old_alpha; + + //title text + if (node.onDrawTitleText) { + node.onDrawTitleText( + ctx, + title_height, + size, + this.ds.scale, + this.title_text_font, + selected + ); + } + if (!low_quality) { + ctx.font = this.title_text_font; + var title = String(node.getTitle()); + if (title) { + if (selected) { + ctx.fillStyle = LiteGraph.NODE_SELECTED_TITLE_COLOR; + } else { + ctx.fillStyle = + node.constructor.title_text_color || + this.node_title_color; + } + if (node.flags.collapsed) { + ctx.textAlign = "left"; + var measure = ctx.measureText(title); + ctx.fillText( + title.substr(0,20), //avoid urls too long + title_height,// + measure.width * 0.5, + LiteGraph.NODE_TITLE_TEXT_Y - title_height + ); + ctx.textAlign = "left"; + } else { + ctx.textAlign = "left"; + ctx.fillText( + title, + title_height, + LiteGraph.NODE_TITLE_TEXT_Y - title_height + ); + } + } + } + + //subgraph box + if (!node.flags.collapsed && node.subgraph && !node.skip_subgraph_button) { + var w = LiteGraph.NODE_TITLE_HEIGHT; + var x = node.size[0] - w; + var over = LiteGraph.isInsideRectangle( this.graph_mouse[0] - node.pos[0], this.graph_mouse[1] - node.pos[1], x+2, -w+2, w-4, w-4 ); + ctx.fillStyle = over ? "#888" : "#555"; + if( shape == LiteGraph.BOX_SHAPE || low_quality) + ctx.fillRect(x+2, -w+2, w-4, w-4); + else + { + ctx.beginPath(); + ctx.roundRect(x+2, -w+2, w-4, w-4,[4]); + ctx.fill(); + } + ctx.fillStyle = "#333"; + ctx.beginPath(); + ctx.moveTo(x + w * 0.2, -w * 0.6); + ctx.lineTo(x + w * 0.8, -w * 0.6); + ctx.lineTo(x + w * 0.5, -w * 0.3); + ctx.fill(); + } + + //custom title render + if (node.onDrawTitle) { + node.onDrawTitle(ctx); + } + } + + //render selection marker + if (selected) { + if (node.onBounding) { + node.onBounding(area); + } + + if (title_mode == LiteGraph.TRANSPARENT_TITLE) { + area[1] -= title_height; + area[3] += title_height; + } + ctx.lineWidth = 1; + ctx.globalAlpha = 0.8; + ctx.beginPath(); + if (shape == LiteGraph.BOX_SHAPE) { + ctx.rect( + -6 + area[0], + -6 + area[1], + 12 + area[2], + 12 + area[3] + ); + } else if ( + shape == LiteGraph.ROUND_SHAPE || + (shape == LiteGraph.CARD_SHAPE && node.flags.collapsed) + ) { + ctx.roundRect( + -6 + area[0], + -6 + area[1], + 12 + area[2], + 12 + area[3], + [this.round_radius * 2] + ); + } else if (shape == LiteGraph.CARD_SHAPE) { + ctx.roundRect( + -6 + area[0], + -6 + area[1], + 12 + area[2], + 12 + area[3], + [this.round_radius * 2,2,this.round_radius * 2,2] + ); + } else if (shape == LiteGraph.CIRCLE_SHAPE) { + ctx.arc( + size[0] * 0.5, + size[1] * 0.5, + size[0] * 0.5 + 6, + 0, + Math.PI * 2 + ); + } + ctx.strokeStyle = LiteGraph.NODE_BOX_OUTLINE_COLOR; + ctx.stroke(); + ctx.strokeStyle = fgcolor; + ctx.globalAlpha = 1; + } + + // these counter helps in conditioning drawing based on if the node has been executed or an action occurred + if (node.execute_triggered>0) node.execute_triggered--; + if (node.action_triggered>0) node.action_triggered--; + }; + + var margin_area = new Float32Array(4); + var link_bounding = new Float32Array(4); + var tempA = new Float32Array(2); + var tempB = new Float32Array(2); + + /** + * draws every connection visible in the canvas + * OPTIMIZE THIS: pre-catch connections position instead of recomputing them every time + * @method drawConnections + **/ + LGraphCanvas.prototype.drawConnections = function(ctx) { + var now = LiteGraph.getTime(); + var visible_area = this.visible_area; + margin_area[0] = visible_area[0] - 20; + margin_area[1] = visible_area[1] - 20; + margin_area[2] = visible_area[2] + 40; + margin_area[3] = visible_area[3] + 40; + + //draw connections + ctx.lineWidth = this.connections_width; + + ctx.fillStyle = "#AAA"; + ctx.strokeStyle = "#AAA"; + ctx.globalAlpha = this.editor_alpha; + //for every node + var nodes = this.graph._nodes; + for (var n = 0, l = nodes.length; n < l; ++n) { + var node = nodes[n]; + //for every input (we render just inputs because it is easier as every slot can only have one input) + if (!node.inputs || !node.inputs.length) { + continue; + } + + for (var i = 0; i < node.inputs.length; ++i) { + var input = node.inputs[i]; + if (!input || input.link == null) { + continue; + } + var link_id = input.link; + var link = this.graph.links[link_id]; + if (!link) { + continue; + } + + //find link info + var start_node = this.graph.getNodeById(link.origin_id); + if (start_node == null) { + continue; + } + var start_node_slot = link.origin_slot; + var start_node_slotpos = null; + if (start_node_slot == -1) { + start_node_slotpos = [ + start_node.pos[0] + 10, + start_node.pos[1] + 10 + ]; + } else { + start_node_slotpos = start_node.getConnectionPos( + false, + start_node_slot, + tempA + ); + } + var end_node_slotpos = node.getConnectionPos(true, i, tempB); + + //compute link bounding + link_bounding[0] = start_node_slotpos[0]; + link_bounding[1] = start_node_slotpos[1]; + link_bounding[2] = end_node_slotpos[0] - start_node_slotpos[0]; + link_bounding[3] = end_node_slotpos[1] - start_node_slotpos[1]; + if (link_bounding[2] < 0) { + link_bounding[0] += link_bounding[2]; + link_bounding[2] = Math.abs(link_bounding[2]); + } + if (link_bounding[3] < 0) { + link_bounding[1] += link_bounding[3]; + link_bounding[3] = Math.abs(link_bounding[3]); + } + + //skip links outside of the visible area of the canvas + if (!overlapBounding(link_bounding, margin_area)) { + continue; + } + + var start_slot = start_node.outputs[start_node_slot]; + var end_slot = node.inputs[i]; + if (!start_slot || !end_slot) { + continue; + } + var start_dir = + start_slot.dir || + (start_node.horizontal ? LiteGraph.DOWN : LiteGraph.RIGHT); + var end_dir = + end_slot.dir || + (node.horizontal ? LiteGraph.UP : LiteGraph.LEFT); + + this.renderLink( + ctx, + start_node_slotpos, + end_node_slotpos, + link, + false, + 0, + null, + start_dir, + end_dir + ); + + //event triggered rendered on top + if (link && link._last_time && now - link._last_time < 1000) { + var f = 2.0 - (now - link._last_time) * 0.002; + var tmp = ctx.globalAlpha; + ctx.globalAlpha = tmp * f; + this.renderLink( + ctx, + start_node_slotpos, + end_node_slotpos, + link, + true, + f, + "white", + start_dir, + end_dir + ); + ctx.globalAlpha = tmp; + } + } + } + ctx.globalAlpha = 1; + }; + + /** + * draws a link between two points + * @method renderLink + * @param {vec2} a start pos + * @param {vec2} b end pos + * @param {Object} link the link object with all the link info + * @param {boolean} skip_border ignore the shadow of the link + * @param {boolean} flow show flow animation (for events) + * @param {string} color the color for the link + * @param {number} start_dir the direction enum + * @param {number} end_dir the direction enum + * @param {number} num_sublines number of sublines (useful to represent vec3 or rgb) + **/ + LGraphCanvas.prototype.renderLink = function( + ctx, + a, + b, + link, + skip_border, + flow, + color, + start_dir, + end_dir, + num_sublines + ) { + if (link) { + this.visible_links.push(link); + } + + //choose color + if (!color && link) { + color = link.color || LGraphCanvas.link_type_colors[link.type]; + } + if (!color) { + color = this.default_link_color; + } + if (link != null && this.highlighted_links[link.id]) { + color = "#FFF"; + } + + start_dir = start_dir || LiteGraph.RIGHT; + end_dir = end_dir || LiteGraph.LEFT; + + var dist = distance(a, b); + + if (this.render_connections_border && this.ds.scale > 0.6) { + ctx.lineWidth = this.connections_width + 4; + } + ctx.lineJoin = "round"; + num_sublines = num_sublines || 1; + if (num_sublines > 1) { + ctx.lineWidth = 0.5; + } + + //begin line shape + ctx.beginPath(); + for (var i = 0; i < num_sublines; i += 1) { + var offsety = (i - (num_sublines - 1) * 0.5) * 5; + + if (this.links_render_mode == LiteGraph.SPLINE_LINK) { + ctx.moveTo(a[0], a[1] + offsety); + var start_offset_x = 0; + var start_offset_y = 0; + var end_offset_x = 0; + var end_offset_y = 0; + switch (start_dir) { + case LiteGraph.LEFT: + start_offset_x = dist * -0.25; + break; + case LiteGraph.RIGHT: + start_offset_x = dist * 0.25; + break; + case LiteGraph.UP: + start_offset_y = dist * -0.25; + break; + case LiteGraph.DOWN: + start_offset_y = dist * 0.25; + break; + } + switch (end_dir) { + case LiteGraph.LEFT: + end_offset_x = dist * -0.25; + break; + case LiteGraph.RIGHT: + end_offset_x = dist * 0.25; + break; + case LiteGraph.UP: + end_offset_y = dist * -0.25; + break; + case LiteGraph.DOWN: + end_offset_y = dist * 0.25; + break; + } + ctx.bezierCurveTo( + a[0] + start_offset_x, + a[1] + start_offset_y + offsety, + b[0] + end_offset_x, + b[1] + end_offset_y + offsety, + b[0], + b[1] + offsety + ); + } else if (this.links_render_mode == LiteGraph.LINEAR_LINK) { + ctx.moveTo(a[0], a[1] + offsety); + var start_offset_x = 0; + var start_offset_y = 0; + var end_offset_x = 0; + var end_offset_y = 0; + switch (start_dir) { + case LiteGraph.LEFT: + start_offset_x = -1; + break; + case LiteGraph.RIGHT: + start_offset_x = 1; + break; + case LiteGraph.UP: + start_offset_y = -1; + break; + case LiteGraph.DOWN: + start_offset_y = 1; + break; + } + switch (end_dir) { + case LiteGraph.LEFT: + end_offset_x = -1; + break; + case LiteGraph.RIGHT: + end_offset_x = 1; + break; + case LiteGraph.UP: + end_offset_y = -1; + break; + case LiteGraph.DOWN: + end_offset_y = 1; + break; + } + var l = 15; + ctx.lineTo( + a[0] + start_offset_x * l, + a[1] + start_offset_y * l + offsety + ); + ctx.lineTo( + b[0] + end_offset_x * l, + b[1] + end_offset_y * l + offsety + ); + ctx.lineTo(b[0], b[1] + offsety); + } else if (this.links_render_mode == LiteGraph.STRAIGHT_LINK) { + ctx.moveTo(a[0], a[1]); + var start_x = a[0]; + var start_y = a[1]; + var end_x = b[0]; + var end_y = b[1]; + if (start_dir == LiteGraph.RIGHT) { + start_x += 10; + } else { + start_y += 10; + } + if (end_dir == LiteGraph.LEFT) { + end_x -= 10; + } else { + end_y -= 10; + } + ctx.lineTo(start_x, start_y); + ctx.lineTo((start_x + end_x) * 0.5, start_y); + ctx.lineTo((start_x + end_x) * 0.5, end_y); + ctx.lineTo(end_x, end_y); + ctx.lineTo(b[0], b[1]); + } else { + return; + } //unknown + } + + //rendering the outline of the connection can be a little bit slow + if ( + this.render_connections_border && + this.ds.scale > 0.6 && + !skip_border + ) { + ctx.strokeStyle = "rgba(0,0,0,0.5)"; + ctx.stroke(); + } + + ctx.lineWidth = this.connections_width; + ctx.fillStyle = ctx.strokeStyle = color; + ctx.stroke(); + //end line shape + + var pos = this.computeConnectionPoint(a, b, 0.5, start_dir, end_dir); + if (link && link._pos) { + link._pos[0] = pos[0]; + link._pos[1] = pos[1]; + } + + //render arrow in the middle + if ( + this.ds.scale >= 0.6 && + this.highquality_render && + end_dir != LiteGraph.CENTER + ) { + //render arrow + if (this.render_connection_arrows) { + //compute two points in the connection + var posA = this.computeConnectionPoint( + a, + b, + 0.25, + start_dir, + end_dir + ); + var posB = this.computeConnectionPoint( + a, + b, + 0.26, + start_dir, + end_dir + ); + var posC = this.computeConnectionPoint( + a, + b, + 0.75, + start_dir, + end_dir + ); + var posD = this.computeConnectionPoint( + a, + b, + 0.76, + start_dir, + end_dir + ); + + //compute the angle between them so the arrow points in the right direction + var angleA = 0; + var angleB = 0; + if (this.render_curved_connections) { + angleA = -Math.atan2(posB[0] - posA[0], posB[1] - posA[1]); + angleB = -Math.atan2(posD[0] - posC[0], posD[1] - posC[1]); + } else { + angleB = angleA = b[1] > a[1] ? 0 : Math.PI; + } + + //render arrow + ctx.save(); + ctx.translate(posA[0], posA[1]); + ctx.rotate(angleA); + ctx.beginPath(); + ctx.moveTo(-5, -3); + ctx.lineTo(0, +7); + ctx.lineTo(+5, -3); + ctx.fill(); + ctx.restore(); + ctx.save(); + ctx.translate(posC[0], posC[1]); + ctx.rotate(angleB); + ctx.beginPath(); + ctx.moveTo(-5, -3); + ctx.lineTo(0, +7); + ctx.lineTo(+5, -3); + ctx.fill(); + ctx.restore(); + } + + //circle + ctx.beginPath(); + ctx.arc(pos[0], pos[1], 5, 0, Math.PI * 2); + ctx.fill(); + } + + //render flowing points + if (flow) { + ctx.fillStyle = color; + for (var i = 0; i < 5; ++i) { + var f = (LiteGraph.getTime() * 0.001 + i * 0.2) % 1; + var pos = this.computeConnectionPoint( + a, + b, + f, + start_dir, + end_dir + ); + ctx.beginPath(); + ctx.arc(pos[0], pos[1], 5, 0, 2 * Math.PI); + ctx.fill(); + } + } + }; + + //returns the link center point based on curvature + LGraphCanvas.prototype.computeConnectionPoint = function( + a, + b, + t, + start_dir, + end_dir + ) { + start_dir = start_dir || LiteGraph.RIGHT; + end_dir = end_dir || LiteGraph.LEFT; + + var dist = distance(a, b); + var p0 = a; + var p1 = [a[0], a[1]]; + var p2 = [b[0], b[1]]; + var p3 = b; + + switch (start_dir) { + case LiteGraph.LEFT: + p1[0] += dist * -0.25; + break; + case LiteGraph.RIGHT: + p1[0] += dist * 0.25; + break; + case LiteGraph.UP: + p1[1] += dist * -0.25; + break; + case LiteGraph.DOWN: + p1[1] += dist * 0.25; + break; + } + switch (end_dir) { + case LiteGraph.LEFT: + p2[0] += dist * -0.25; + break; + case LiteGraph.RIGHT: + p2[0] += dist * 0.25; + break; + case LiteGraph.UP: + p2[1] += dist * -0.25; + break; + case LiteGraph.DOWN: + p2[1] += dist * 0.25; + break; + } + + var c1 = (1 - t) * (1 - t) * (1 - t); + var c2 = 3 * ((1 - t) * (1 - t)) * t; + var c3 = 3 * (1 - t) * (t * t); + var c4 = t * t * t; + + var x = c1 * p0[0] + c2 * p1[0] + c3 * p2[0] + c4 * p3[0]; + var y = c1 * p0[1] + c2 * p1[1] + c3 * p2[1] + c4 * p3[1]; + return [x, y]; + }; + + LGraphCanvas.prototype.drawExecutionOrder = function(ctx) { + ctx.shadowColor = "transparent"; + ctx.globalAlpha = 0.25; + + ctx.textAlign = "center"; + ctx.strokeStyle = "white"; + ctx.globalAlpha = 0.75; + + var visible_nodes = this.visible_nodes; + for (var i = 0; i < visible_nodes.length; ++i) { + var node = visible_nodes[i]; + ctx.fillStyle = "black"; + ctx.fillRect( + node.pos[0] - LiteGraph.NODE_TITLE_HEIGHT, + node.pos[1] - LiteGraph.NODE_TITLE_HEIGHT, + LiteGraph.NODE_TITLE_HEIGHT, + LiteGraph.NODE_TITLE_HEIGHT + ); + if (node.order == 0) { + ctx.strokeRect( + node.pos[0] - LiteGraph.NODE_TITLE_HEIGHT + 0.5, + node.pos[1] - LiteGraph.NODE_TITLE_HEIGHT + 0.5, + LiteGraph.NODE_TITLE_HEIGHT, + LiteGraph.NODE_TITLE_HEIGHT + ); + } + ctx.fillStyle = "#FFF"; + ctx.fillText( + node.order, + node.pos[0] + LiteGraph.NODE_TITLE_HEIGHT * -0.5, + node.pos[1] - 6 + ); + } + ctx.globalAlpha = 1; + }; + + /** + * draws the widgets stored inside a node + * @method drawNodeWidgets + **/ + LGraphCanvas.prototype.drawNodeWidgets = function( + node, + posY, + ctx, + active_widget + ) { + if (!node.widgets || !node.widgets.length) { + return 0; + } + var width = node.size[0]; + var widgets = node.widgets; + posY += 2; + var H = LiteGraph.NODE_WIDGET_HEIGHT; + var show_text = this.ds.scale > 0.5; + ctx.save(); + ctx.globalAlpha = this.editor_alpha; + var outline_color = LiteGraph.WIDGET_OUTLINE_COLOR; + var background_color = LiteGraph.WIDGET_BGCOLOR; + var text_color = LiteGraph.WIDGET_TEXT_COLOR; + var secondary_text_color = LiteGraph.WIDGET_SECONDARY_TEXT_COLOR; + var margin = 15; + + for (var i = 0; i < widgets.length; ++i) { + var w = widgets[i]; + var y = posY; + if (w.y) { + y = w.y; + } + w.last_y = y; + ctx.strokeStyle = outline_color; + ctx.fillStyle = "#222"; + ctx.textAlign = "left"; + //ctx.lineWidth = 2; + if(w.disabled) + ctx.globalAlpha *= 0.5; + var widget_width = w.width || width; + + switch (w.type) { + case "button": + if (w.clicked) { + ctx.fillStyle = "#AAA"; + w.clicked = false; + this.dirty_canvas = true; + } + ctx.fillRect(margin, y, widget_width - margin * 2, H); + if(show_text && !w.disabled) + ctx.strokeRect( margin, y, widget_width - margin * 2, H ); + if (show_text) { + ctx.textAlign = "center"; + ctx.fillStyle = text_color; + ctx.fillText(w.label || w.name, widget_width * 0.5, y + H * 0.7); + } + break; + case "toggle": + ctx.textAlign = "left"; + ctx.strokeStyle = outline_color; + ctx.fillStyle = background_color; + ctx.beginPath(); + if (show_text) + ctx.roundRect(margin, y, widget_width - margin * 2, H, [H * 0.5]); + else + ctx.rect(margin, y, widget_width - margin * 2, H ); + ctx.fill(); + if(show_text && !w.disabled) + ctx.stroke(); + ctx.fillStyle = w.value ? "#89A" : "#333"; + ctx.beginPath(); + ctx.arc( widget_width - margin * 2, y + H * 0.5, H * 0.36, 0, Math.PI * 2 ); + ctx.fill(); + if (show_text) { + ctx.fillStyle = secondary_text_color; + const label = w.label || w.name; + if (label != null) { + ctx.fillText(label, margin * 2, y + H * 0.7); + } + ctx.fillStyle = w.value ? text_color : secondary_text_color; + ctx.textAlign = "right"; + ctx.fillText( + w.value + ? w.options.on || "true" + : w.options.off || "false", + widget_width - 40, + y + H * 0.7 + ); + } + break; + case "slider": + ctx.fillStyle = background_color; + ctx.fillRect(margin, y, widget_width - margin * 2, H); + var range = w.options.max - w.options.min; + var nvalue = (w.value - w.options.min) / range; + if(nvalue < 0.0) nvalue = 0.0; + if(nvalue > 1.0) nvalue = 1.0; + ctx.fillStyle = w.options.hasOwnProperty("slider_color") ? w.options.slider_color : (active_widget == w ? "#89A" : "#678"); + ctx.fillRect(margin, y, nvalue * (widget_width - margin * 2), H); + if(show_text && !w.disabled) + ctx.strokeRect(margin, y, widget_width - margin * 2, H); + if (w.marker) { + var marker_nvalue = (w.marker - w.options.min) / range; + if(marker_nvalue < 0.0) marker_nvalue = 0.0; + if(marker_nvalue > 1.0) marker_nvalue = 1.0; + ctx.fillStyle = w.options.hasOwnProperty("marker_color") ? w.options.marker_color : "#AA9"; + ctx.fillRect( margin + marker_nvalue * (widget_width - margin * 2), y, 2, H ); + } + if (show_text) { + ctx.textAlign = "center"; + ctx.fillStyle = text_color; + ctx.fillText( + w.label || w.name + " " + Number(w.value).toFixed( + w.options.precision != null + ? w.options.precision + : 3 + ), + widget_width * 0.5, + y + H * 0.7 + ); + } + break; + case "number": + case "combo": + ctx.textAlign = "left"; + ctx.strokeStyle = outline_color; + ctx.fillStyle = background_color; + ctx.beginPath(); + if(show_text) + ctx.roundRect(margin, y, widget_width - margin * 2, H, [H * 0.5] ); + else + ctx.rect(margin, y, widget_width - margin * 2, H ); + ctx.fill(); + if (show_text) { + if(!w.disabled) + ctx.stroke(); + ctx.fillStyle = text_color; + if(!w.disabled) + { + ctx.beginPath(); + ctx.moveTo(margin + 16, y + 5); + ctx.lineTo(margin + 6, y + H * 0.5); + ctx.lineTo(margin + 16, y + H - 5); + ctx.fill(); + ctx.beginPath(); + ctx.moveTo(widget_width - margin - 16, y + 5); + ctx.lineTo(widget_width - margin - 6, y + H * 0.5); + ctx.lineTo(widget_width - margin - 16, y + H - 5); + ctx.fill(); + } + ctx.fillStyle = secondary_text_color; + ctx.fillText(w.label || w.name, margin * 2 + 5, y + H * 0.7); + ctx.fillStyle = text_color; + ctx.textAlign = "right"; + if (w.type == "number") { + ctx.fillText( + Number(w.value).toFixed( + w.options.precision !== undefined + ? w.options.precision + : 3 + ), + widget_width - margin * 2 - 20, + y + H * 0.7 + ); + } else { + var v = w.value; + if( w.options.values ) + { + var values = w.options.values; + if( values.constructor === Function ) + values = values(); + if(values && values.constructor !== Array) + v = values[ w.value ]; + } + ctx.fillText( + v, + widget_width - margin * 2 - 20, + y + H * 0.7 + ); + } + } + break; + case "string": + case "text": + ctx.textAlign = "left"; + ctx.strokeStyle = outline_color; + ctx.fillStyle = background_color; + ctx.beginPath(); + if (show_text) + ctx.roundRect(margin, y, widget_width - margin * 2, H, [H * 0.5]); + else + ctx.rect( margin, y, widget_width - margin * 2, H ); + ctx.fill(); + if (show_text) { + if(!w.disabled) + ctx.stroke(); + ctx.save(); + ctx.beginPath(); + ctx.rect(margin, y, widget_width - margin * 2, H); + ctx.clip(); + + //ctx.stroke(); + ctx.fillStyle = secondary_text_color; + const label = w.label || w.name; + if (label != null) { + ctx.fillText(label, margin * 2, y + H * 0.7); + } + ctx.fillStyle = text_color; + ctx.textAlign = "right"; + ctx.fillText(String(w.value).substr(0,30), widget_width - margin * 2, y + H * 0.7); //30 chars max + ctx.restore(); + } + break; + default: + if (w.draw) { + w.draw(ctx, node, widget_width, y, H); + } + break; + } + posY += (w.computeSize ? w.computeSize(widget_width)[1] : H) + 4; + ctx.globalAlpha = this.editor_alpha; + + } + ctx.restore(); + ctx.textAlign = "left"; + }; + + /** + * process an event on widgets + * @method processNodeWidgets + **/ + LGraphCanvas.prototype.processNodeWidgets = function( + node, + pos, + event, + active_widget + ) { + if (!node.widgets || !node.widgets.length || (!this.allow_interaction && !node.flags.allow_interaction)) { + return null; + } + + var x = pos[0] - node.pos[0]; + var y = pos[1] - node.pos[1]; + var width = node.size[0]; + var deltaX = event.deltaX || event.deltax || 0; + var that = this; + var ref_window = this.getCanvasWindow(); + + for (var i = 0; i < node.widgets.length; ++i) { + var w = node.widgets[i]; + if(!w || w.disabled) + continue; + var widget_height = w.computeSize ? w.computeSize(width)[1] : LiteGraph.NODE_WIDGET_HEIGHT; + var widget_width = w.width || width; + //outside + if ( w != active_widget && + (x < 6 || x > widget_width - 12 || y < w.last_y || y > w.last_y + widget_height || w.last_y === undefined) ) + continue; + + var old_value = w.value; + + //if ( w == active_widget || (x > 6 && x < widget_width - 12 && y > w.last_y && y < w.last_y + widget_height) ) { + //inside widget + switch (w.type) { + case "button": + if (event.type === LiteGraph.pointerevents_method+"down") { + if (w.callback) { + setTimeout(function() { + w.callback(w, that, node, pos, event); + }, 20); + } + w.clicked = true; + this.dirty_canvas = true; + } + break; + case "slider": + var old_value = w.value; + var nvalue = clamp((x - 15) / (widget_width - 30), 0, 1); + if(w.options.read_only) break; + w.value = w.options.min + (w.options.max - w.options.min) * nvalue; + if (old_value != w.value) { + setTimeout(function() { + inner_value_change(w, w.value); + }, 20); + } + this.dirty_canvas = true; + break; + case "number": + case "combo": + var old_value = w.value; + if (event.type == LiteGraph.pointerevents_method+"move" && w.type == "number") { + if(deltaX) + w.value += deltaX * 0.1 * (w.options.step || 1); + if ( w.options.min != null && w.value < w.options.min ) { + w.value = w.options.min; + } + if ( w.options.max != null && w.value > w.options.max ) { + w.value = w.options.max; + } + } else if (event.type == LiteGraph.pointerevents_method+"down") { + var values = w.options.values; + if (values && values.constructor === Function) { + values = w.options.values(w, node); + } + var values_list = null; + + if( w.type != "number") + values_list = values.constructor === Array ? values : Object.keys(values); + + var delta = x < 40 ? -1 : x > widget_width - 40 ? 1 : 0; + if (w.type == "number") { + w.value += delta * 0.1 * (w.options.step || 1); + if ( w.options.min != null && w.value < w.options.min ) { + w.value = w.options.min; + } + if ( w.options.max != null && w.value > w.options.max ) { + w.value = w.options.max; + } + } else if (delta) { //clicked in arrow, used for combos + var index = -1; + this.last_mouseclick = 0; //avoids dobl click event + if(values.constructor === Object) + index = values_list.indexOf( String( w.value ) ) + delta; + else + index = values_list.indexOf( w.value ) + delta; + if (index >= values_list.length) { + index = values_list.length - 1; + } + if (index < 0) { + index = 0; + } + if( values.constructor === Array ) + w.value = values[index]; + else + w.value = index; + } else { //combo clicked + var text_values = values != values_list ? Object.values(values) : values; + var menu = new LiteGraph.ContextMenu(text_values, { + scale: Math.max(1, this.ds.scale), + event: event, + className: "dark", + callback: inner_clicked.bind(w) + }, + ref_window); + function inner_clicked(v, option, event) { + if(values != values_list) + v = text_values.indexOf(v); + this.value = v; + inner_value_change(this, v); + that.dirty_canvas = true; + return false; + } + } + } //end mousedown + else if(event.type == LiteGraph.pointerevents_method+"up" && w.type == "number") + { + var delta = x < 40 ? -1 : x > widget_width - 40 ? 1 : 0; + if (event.click_time < 200 && delta == 0) { + this.prompt("Value",w.value,function(v) { + // check if v is a valid equation or a number + if (/^[0-9+\-*/()\s]+|\d+\.\d+$/.test(v)) { + try {//solve the equation if possible + v = eval(v); + } catch (e) { } + } + this.value = Number(v); + inner_value_change(this, this.value); + }.bind(w), + event); + } + } + + if( old_value != w.value ) + setTimeout( + function() { + inner_value_change(this, this.value); + }.bind(w), + 20 + ); + this.dirty_canvas = true; + break; + case "toggle": + if (event.type == LiteGraph.pointerevents_method+"down") { + w.value = !w.value; + setTimeout(function() { + inner_value_change(w, w.value); + }, 20); + } + break; + case "string": + case "text": + if (event.type == LiteGraph.pointerevents_method+"down") { + this.prompt("Value",w.value,function(v) { + inner_value_change(this, v); + }.bind(w), + event,w.options ? w.options.multiline : false ); + } + break; + default: + if (w.mouse) { + this.dirty_canvas = w.mouse(event, [x, y], node); + } + break; + } //end switch + + //value changed + if( old_value != w.value ) + { + if(node.onWidgetChanged) + node.onWidgetChanged( w.name,w.value,old_value,w ); + node.graph._version++; + } + + return w; + }//end for + + function inner_value_change(widget, value) { + if(widget.type == "number"){ + value = Number(value); + } + widget.value = value; + if ( widget.options && widget.options.property && node.properties[widget.options.property] !== undefined ) { + node.setProperty( widget.options.property, value ); + } + if (widget.callback) { + widget.callback(widget.value, that, node, pos, event); + } + } + + return null; + }; + + /** + * draws every group area in the background + * @method drawGroups + **/ + LGraphCanvas.prototype.drawGroups = function(canvas, ctx) { + if (!this.graph) { + return; + } + + var groups = this.graph._groups; + + ctx.save(); + ctx.globalAlpha = 0.5 * this.editor_alpha; + + for (var i = 0; i < groups.length; ++i) { + var group = groups[i]; + + if (!overlapBounding(this.visible_area, group._bounding)) { + continue; + } //out of the visible area + + ctx.fillStyle = group.color || "#335"; + ctx.strokeStyle = group.color || "#335"; + var pos = group._pos; + var size = group._size; + ctx.globalAlpha = 0.25 * this.editor_alpha; + ctx.beginPath(); + ctx.rect(pos[0] + 0.5, pos[1] + 0.5, size[0], size[1]); + ctx.fill(); + ctx.globalAlpha = this.editor_alpha; + ctx.stroke(); + + ctx.beginPath(); + ctx.moveTo(pos[0] + size[0], pos[1] + size[1]); + ctx.lineTo(pos[0] + size[0] - 10, pos[1] + size[1]); + ctx.lineTo(pos[0] + size[0], pos[1] + size[1] - 10); + ctx.fill(); + + var font_size = + group.font_size || LiteGraph.DEFAULT_GROUP_FONT_SIZE; + ctx.font = font_size + "px Arial"; + ctx.textAlign = "left"; + ctx.fillText(group.title, pos[0] + 4, pos[1] + font_size); + } + + ctx.restore(); + }; + + LGraphCanvas.prototype.adjustNodesSize = function() { + var nodes = this.graph._nodes; + for (var i = 0; i < nodes.length; ++i) { + nodes[i].size = nodes[i].computeSize(); + } + this.setDirty(true, true); + }; + + /** + * resizes the canvas to a given size, if no size is passed, then it tries to fill the parentNode + * @method resize + **/ + LGraphCanvas.prototype.resize = function(width, height) { + if (!width && !height) { + var parent = this.canvas.parentNode; + width = parent.offsetWidth; + height = parent.offsetHeight; + } + + if (this.canvas.width == width && this.canvas.height == height) { + return; + } + + this.canvas.width = width; + this.canvas.height = height; + this.bgcanvas.width = this.canvas.width; + this.bgcanvas.height = this.canvas.height; + this.setDirty(true, true); + }; + + /** + * switches to live mode (node shapes are not rendered, only the content) + * this feature was designed when graphs where meant to create user interfaces + * @method switchLiveMode + **/ + LGraphCanvas.prototype.switchLiveMode = function(transition) { + if (!transition) { + this.live_mode = !this.live_mode; + this.dirty_canvas = true; + this.dirty_bgcanvas = true; + return; + } + + var self = this; + var delta = this.live_mode ? 1.1 : 0.9; + if (this.live_mode) { + this.live_mode = false; + this.editor_alpha = 0.1; + } + + var t = setInterval(function() { + self.editor_alpha *= delta; + self.dirty_canvas = true; + self.dirty_bgcanvas = true; + + if (delta < 1 && self.editor_alpha < 0.01) { + clearInterval(t); + if (delta < 1) { + self.live_mode = true; + } + } + if (delta > 1 && self.editor_alpha > 0.99) { + clearInterval(t); + self.editor_alpha = 1; + } + }, 1); + }; + + LGraphCanvas.prototype.onNodeSelectionChange = function(node) { + return; //disabled + }; + + /* this is an implementation for touch not in production and not ready + */ + /*LGraphCanvas.prototype.touchHandler = function(event) { + //alert("foo"); + var touches = event.changedTouches, + first = touches[0], + type = ""; + + switch (event.type) { + case "touchstart": + type = "mousedown"; + break; + case "touchmove": + type = "mousemove"; + break; + case "touchend": + type = "mouseup"; + break; + default: + return; + } + + //initMouseEvent(type, canBubble, cancelable, view, clickCount, + // screenX, screenY, clientX, clientY, ctrlKey, + // altKey, shiftKey, metaKey, button, relatedTarget); + + // this is eventually a Dom object, get the LGraphCanvas back + if(typeof this.getCanvasWindow == "undefined"){ + var window = this.lgraphcanvas.getCanvasWindow(); + }else{ + var window = this.getCanvasWindow(); + } + + var document = window.document; + + var simulatedEvent = document.createEvent("MouseEvent"); + simulatedEvent.initMouseEvent( + type, + true, + true, + window, + 1, + first.screenX, + first.screenY, + first.clientX, + first.clientY, + false, + false, + false, + false, + 0, //left + null + ); + first.target.dispatchEvent(simulatedEvent); + event.preventDefault(); + };*/ + + /* CONTEXT MENU ********************/ + + LGraphCanvas.onGroupAdd = function(info, entry, mouse_event) { + var canvas = LGraphCanvas.active_canvas; + var ref_window = canvas.getCanvasWindow(); + + var group = new LiteGraph.LGraphGroup(); + group.pos = canvas.convertEventToCanvasOffset(mouse_event); + canvas.graph.add(group); + }; + + /** + * Determines the furthest nodes in each direction + * @param nodes {LGraphNode[]} the nodes to from which boundary nodes will be extracted + * @return {{left: LGraphNode, top: LGraphNode, right: LGraphNode, bottom: LGraphNode}} + */ + LGraphCanvas.getBoundaryNodes = function(nodes) { + let top = null; + let right = null; + let bottom = null; + let left = null; + for (const nID in nodes) { + const node = nodes[nID]; + const [x, y] = node.pos; + const [width, height] = node.size; + + if (top === null || y < top.pos[1]) { + top = node; + } + if (right === null || x + width > right.pos[0] + right.size[0]) { + right = node; + } + if (bottom === null || y + height > bottom.pos[1] + bottom.size[1]) { + bottom = node; + } + if (left === null || x < left.pos[0]) { + left = node; + } + } + + return { + "top": top, + "right": right, + "bottom": bottom, + "left": left + }; + } + /** + * Determines the furthest nodes in each direction for the currently selected nodes + * @return {{left: LGraphNode, top: LGraphNode, right: LGraphNode, bottom: LGraphNode}} + */ + LGraphCanvas.prototype.boundaryNodesForSelection = function() { + return LGraphCanvas.getBoundaryNodes(Object.values(this.selected_nodes)); + } + + /** + * + * @param {LGraphNode[]} nodes a list of nodes + * @param {"top"|"bottom"|"left"|"right"} direction Direction to align the nodes + * @param {LGraphNode?} align_to Node to align to (if null, align to the furthest node in the given direction) + */ + LGraphCanvas.alignNodes = function (nodes, direction, align_to) { + if (!nodes) { + return; + } + + const canvas = LGraphCanvas.active_canvas; + let boundaryNodes = [] + if (align_to === undefined) { + boundaryNodes = LGraphCanvas.getBoundaryNodes(nodes) + } else { + boundaryNodes = { + "top": align_to, + "right": align_to, + "bottom": align_to, + "left": align_to + } + } + + for (const [_, node] of Object.entries(canvas.selected_nodes)) { + switch (direction) { + case "right": + node.pos[0] = boundaryNodes["right"].pos[0] + boundaryNodes["right"].size[0] - node.size[0]; + break; + case "left": + node.pos[0] = boundaryNodes["left"].pos[0]; + break; + case "top": + node.pos[1] = boundaryNodes["top"].pos[1]; + break; + case "bottom": + node.pos[1] = boundaryNodes["bottom"].pos[1] + boundaryNodes["bottom"].size[1] - node.size[1]; + break; + } + } + + canvas.dirty_canvas = true; + canvas.dirty_bgcanvas = true; + }; + + LGraphCanvas.onNodeAlign = function(value, options, event, prev_menu, node) { + new LiteGraph.ContextMenu(["Top", "Bottom", "Left", "Right"], { + event: event, + callback: inner_clicked, + parentMenu: prev_menu, + }); + + function inner_clicked(value) { + LGraphCanvas.alignNodes(LGraphCanvas.active_canvas.selected_nodes, value.toLowerCase(), node); + } + } + + LGraphCanvas.onGroupAlign = function(value, options, event, prev_menu) { + new LiteGraph.ContextMenu(["Top", "Bottom", "Left", "Right"], { + event: event, + callback: inner_clicked, + parentMenu: prev_menu, + }); + + function inner_clicked(value) { + LGraphCanvas.alignNodes(LGraphCanvas.active_canvas.selected_nodes, value.toLowerCase()); + } + } + + LGraphCanvas.onMenuAdd = function (node, options, e, prev_menu, callback) { + + var canvas = LGraphCanvas.active_canvas; + var ref_window = canvas.getCanvasWindow(); + var graph = canvas.graph; + if (!graph) + return; + + function inner_onMenuAdded(base_category ,prev_menu){ + + var categories = LiteGraph.getNodeTypesCategories(canvas.filter || graph.filter).filter(function(category){return category.startsWith(base_category)}); + var entries = []; + + categories.map(function(category){ + + if (!category) + return; + + var base_category_regex = new RegExp('^(' + base_category + ')'); + var category_name = category.replace(base_category_regex,"").split('/')[0]; + var category_path = base_category === '' ? category_name + '/' : base_category + category_name + '/'; + + var name = category_name; + if(name.indexOf("::") != -1) //in case it has a namespace like "shader::math/rand" it hides the namespace + name = name.split("::")[1]; + + var index = entries.findIndex(function(entry){return entry.value === category_path}); + if (index === -1) { + entries.push({ value: category_path, content: name, has_submenu: true, callback : function(value, event, mouseEvent, contextMenu){ + inner_onMenuAdded(value.value, contextMenu) + }}); + } + + }); + + var nodes = LiteGraph.getNodeTypesInCategory(base_category.slice(0, -1), canvas.filter || graph.filter ); + nodes.map(function(node){ + + if (node.skip_list) + return; + + var entry = { value: node.type, content: node.title, has_submenu: false , callback : function(value, event, mouseEvent, contextMenu){ + + var first_event = contextMenu.getFirstEvent(); + canvas.graph.beforeChange(); + var node = LiteGraph.createNode(value.value); + if (node) { + node.pos = canvas.convertEventToCanvasOffset(first_event); + canvas.graph.add(node); + } + if(callback) + callback(node); + canvas.graph.afterChange(); + + } + } + + entries.push(entry); + + }); + + new LiteGraph.ContextMenu( entries, { event: e, parentMenu: prev_menu }, ref_window ); + + } + + inner_onMenuAdded('',prev_menu); + return false; + + }; + + LGraphCanvas.onMenuCollapseAll = function() {}; + + LGraphCanvas.onMenuNodeEdit = function() {}; + + LGraphCanvas.showMenuNodeOptionalInputs = function( + v, + options, + e, + prev_menu, + node + ) { + if (!node) { + return; + } + + var that = this; + var canvas = LGraphCanvas.active_canvas; + var ref_window = canvas.getCanvasWindow(); + + var options = node.optional_inputs; + if (node.onGetInputs) { + options = node.onGetInputs(); + } + + var entries = []; + if (options) { + for (var i=0; i < options.length; i++) { + var entry = options[i]; + if (!entry) { + entries.push(null); + continue; + } + var label = entry[0]; + if(!entry[2]) + entry[2] = {}; + + if (entry[2].label) { + label = entry[2].label; + } + + entry[2].removable = true; + var data = { content: label, value: entry }; + if (entry[1] == LiteGraph.ACTION) { + data.className = "event"; + } + entries.push(data); + } + } + + if (node.onMenuNodeInputs) { + var retEntries = node.onMenuNodeInputs(entries); + if(retEntries) entries = retEntries; + } + + if (!entries.length) { + console.log("no input entries"); + return; + } + + var menu = new LiteGraph.ContextMenu( + entries, + { + event: e, + callback: inner_clicked, + parentMenu: prev_menu, + node: node + }, + ref_window + ); + + function inner_clicked(v, e, prev) { + if (!node) { + return; + } + + if (v.callback) { + v.callback.call(that, node, v, e, prev); + } + + if (v.value) { + node.graph.beforeChange(); + node.addInput(v.value[0], v.value[1], v.value[2]); + + if (node.onNodeInputAdd) { // callback to the node when adding a slot + node.onNodeInputAdd(v.value); + } + node.setDirtyCanvas(true, true); + node.graph.afterChange(); + } + } + + return false; + }; + + LGraphCanvas.showMenuNodeOptionalOutputs = function( + v, + options, + e, + prev_menu, + node + ) { + if (!node) { + return; + } + + var that = this; + var canvas = LGraphCanvas.active_canvas; + var ref_window = canvas.getCanvasWindow(); + + var options = node.optional_outputs; + if (node.onGetOutputs) { + options = node.onGetOutputs(); + } + + var entries = []; + if (options) { + for (var i=0; i < options.length; i++) { + var entry = options[i]; + if (!entry) { + //separator? + entries.push(null); + continue; + } + + if ( + node.flags && + node.flags.skip_repeated_outputs && + node.findOutputSlot(entry[0]) != -1 + ) { + continue; + } //skip the ones already on + var label = entry[0]; + if(!entry[2]) + entry[2] = {}; + if (entry[2].label) { + label = entry[2].label; + } + entry[2].removable = true; + var data = { content: label, value: entry }; + if (entry[1] == LiteGraph.EVENT) { + data.className = "event"; + } + entries.push(data); + } + } + + if (this.onMenuNodeOutputs) { + entries = this.onMenuNodeOutputs(entries); + } + if (LiteGraph.do_add_triggers_slots){ //canvas.allow_addOutSlot_onExecuted + if (node.findOutputSlot("onExecuted") == -1){ + entries.push({content: "On Executed", value: ["onExecuted", LiteGraph.EVENT, {nameLocked: true}], className: "event"}); //, opts: {} + } + } + // add callback for modifing the menu elements onMenuNodeOutputs + if (node.onMenuNodeOutputs) { + var retEntries = node.onMenuNodeOutputs(entries); + if(retEntries) entries = retEntries; + } + + if (!entries.length) { + return; + } + + var menu = new LiteGraph.ContextMenu( + entries, + { + event: e, + callback: inner_clicked, + parentMenu: prev_menu, + node: node + }, + ref_window + ); + + function inner_clicked(v, e, prev) { + if (!node) { + return; + } + + if (v.callback) { + v.callback.call(that, node, v, e, prev); + } + + if (!v.value) { + return; + } + + var value = v.value[1]; + + if ( + value && + (value.constructor === Object || value.constructor === Array) + ) { + //submenu why? + var entries = []; + for (var i in value) { + entries.push({ content: i, value: value[i] }); + } + new LiteGraph.ContextMenu(entries, { + event: e, + callback: inner_clicked, + parentMenu: prev_menu, + node: node + }); + return false; + } else { + node.graph.beforeChange(); + node.addOutput(v.value[0], v.value[1], v.value[2]); + + if (node.onNodeOutputAdd) { // a callback to the node when adding a slot + node.onNodeOutputAdd(v.value); + } + node.setDirtyCanvas(true, true); + node.graph.afterChange(); + } + } + + return false; + }; + + LGraphCanvas.onShowMenuNodeProperties = function( + value, + options, + e, + prev_menu, + node + ) { + if (!node || !node.properties) { + return; + } + + var that = this; + var canvas = LGraphCanvas.active_canvas; + var ref_window = canvas.getCanvasWindow(); + + var entries = []; + for (var i in node.properties) { + var value = node.properties[i] !== undefined ? node.properties[i] : " "; + if( typeof value == "object" ) + value = JSON.stringify(value); + var info = node.getPropertyInfo(i); + if(info.type == "enum" || info.type == "combo") + value = LGraphCanvas.getPropertyPrintableValue( value, info.values ); + + //value could contain invalid html characters, clean that + value = LGraphCanvas.decodeHTML(value); + entries.push({ + content: + "" + + (info.label ? info.label : i) + + "" + + "" + + value + + "", + value: i + }); + } + if (!entries.length) { + return; + } + + var menu = new LiteGraph.ContextMenu( + entries, + { + event: e, + callback: inner_clicked, + parentMenu: prev_menu, + allow_html: true, + node: node + }, + ref_window + ); + + function inner_clicked(v, options, e, prev) { + if (!node) { + return; + } + var rect = this.getBoundingClientRect(); + canvas.showEditPropertyValue(node, v.value, { + position: [rect.left, rect.top] + }); + } + + return false; + }; + + LGraphCanvas.decodeHTML = function(str) { + var e = document.createElement("div"); + e.innerText = str; + return e.innerHTML; + }; + + LGraphCanvas.onMenuResizeNode = function(value, options, e, menu, node) { + if (!node) { + return; + } + + var fApplyMultiNode = function(node){ + node.size = node.computeSize(); + if (node.onResize) + node.onResize(node.size); + } + + var graphcanvas = LGraphCanvas.active_canvas; + if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1){ + fApplyMultiNode(node); + }else{ + for (var i in graphcanvas.selected_nodes) { + fApplyMultiNode(graphcanvas.selected_nodes[i]); + } + } + + node.setDirtyCanvas(true, true); + }; + + LGraphCanvas.prototype.showLinkMenu = function(link, e) { + var that = this; + // console.log(link); + var node_left = that.graph.getNodeById( link.origin_id ); + var node_right = that.graph.getNodeById( link.target_id ); + var fromType = false; + if (node_left && node_left.outputs && node_left.outputs[link.origin_slot]) fromType = node_left.outputs[link.origin_slot].type; + var destType = false; + if (node_right && node_right.outputs && node_right.outputs[link.target_slot]) destType = node_right.inputs[link.target_slot].type; + + var options = ["Add Node",null,"Delete",null]; + + + var menu = new LiteGraph.ContextMenu(options, { + event: e, + title: link.data != null ? link.data.constructor.name : null, + callback: inner_clicked + }); + + function inner_clicked(v,options,e) { + switch (v) { + case "Add Node": + LGraphCanvas.onMenuAdd(null, null, e, menu, function(node){ + // console.debug("node autoconnect"); + if(!node.inputs || !node.inputs.length || !node.outputs || !node.outputs.length){ + return; + } + // leave the connection type checking inside connectByType + if (node_left.connectByType( link.origin_slot, node, fromType )){ + node.connectByType( link.target_slot, node_right, destType ); + node.pos[0] -= node.size[0] * 0.5; + } + }); + break; + + case "Delete": + that.graph.removeLink(link.id); + break; + default: + /*var nodeCreated = createDefaultNodeForSlot({ nodeFrom: node_left + ,slotFrom: link.origin_slot + ,nodeTo: node + ,slotTo: link.target_slot + ,e: e + ,nodeType: "AUTO" + }); + if(nodeCreated) console.log("new node in beetween "+v+" created");*/ + } + } + + return false; + }; + + LGraphCanvas.prototype.createDefaultNodeForSlot = function(optPass) { // addNodeMenu for connection + var optPass = optPass || {}; + var opts = Object.assign({ nodeFrom: null // input + ,slotFrom: null // input + ,nodeTo: null // output + ,slotTo: null // output + ,position: [] // pass the event coords + ,nodeType: null // choose a nodetype to add, AUTO to set at first good + ,posAdd:[0,0] // adjust x,y + ,posSizeFix:[0,0] // alpha, adjust the position x,y based on the new node size w,h + } + ,optPass + ); + var that = this; + + var isFrom = opts.nodeFrom && opts.slotFrom!==null; + var isTo = !isFrom && opts.nodeTo && opts.slotTo!==null; + + if (!isFrom && !isTo){ + console.warn("No data passed to createDefaultNodeForSlot "+opts.nodeFrom+" "+opts.slotFrom+" "+opts.nodeTo+" "+opts.slotTo); + return false; + } + if (!opts.nodeType){ + console.warn("No type to createDefaultNodeForSlot"); + return false; + } + + var nodeX = isFrom ? opts.nodeFrom : opts.nodeTo; + var slotX = isFrom ? opts.slotFrom : opts.slotTo; + + var iSlotConn = false; + switch (typeof slotX){ + case "string": + iSlotConn = isFrom ? nodeX.findOutputSlot(slotX,false) : nodeX.findInputSlot(slotX,false); + slotX = isFrom ? nodeX.outputs[slotX] : nodeX.inputs[slotX]; + break; + case "object": + // ok slotX + iSlotConn = isFrom ? nodeX.findOutputSlot(slotX.name) : nodeX.findInputSlot(slotX.name); + break; + case "number": + iSlotConn = slotX; + slotX = isFrom ? nodeX.outputs[slotX] : nodeX.inputs[slotX]; + break; + case "undefined": + default: + // bad ? + //iSlotConn = 0; + console.warn("Cant get slot information "+slotX); + return false; + } + + if (slotX===false || iSlotConn===false){ + console.warn("createDefaultNodeForSlot bad slotX "+slotX+" "+iSlotConn); + } + + // check for defaults nodes for this slottype + var fromSlotType = slotX.type==LiteGraph.EVENT?"_event_":slotX.type; + var slotTypesDefault = isFrom ? LiteGraph.slot_types_default_out : LiteGraph.slot_types_default_in; + if(slotTypesDefault && slotTypesDefault[fromSlotType]){ + if (slotX.link !== null) { + // is connected + }else{ + // is not not connected + } + nodeNewType = false; + if(typeof slotTypesDefault[fromSlotType] == "object" || typeof slotTypesDefault[fromSlotType] == "array"){ + for(var typeX in slotTypesDefault[fromSlotType]){ + if (opts.nodeType == slotTypesDefault[fromSlotType][typeX] || opts.nodeType == "AUTO"){ + nodeNewType = slotTypesDefault[fromSlotType][typeX]; + // console.log("opts.nodeType == slotTypesDefault[fromSlotType][typeX] :: "+opts.nodeType); + break; // -------- + } + } + }else{ + if (opts.nodeType == slotTypesDefault[fromSlotType] || opts.nodeType == "AUTO") nodeNewType = slotTypesDefault[fromSlotType]; + } + if (nodeNewType) { + var nodeNewOpts = false; + if (typeof nodeNewType == "object" && nodeNewType.node){ + nodeNewOpts = nodeNewType; + nodeNewType = nodeNewType.node; + } + + //that.graph.beforeChange(); + + var newNode = LiteGraph.createNode(nodeNewType); + if(newNode){ + // if is object pass options + if (nodeNewOpts){ + if (nodeNewOpts.properties) { + for (var i in nodeNewOpts.properties) { + newNode.addProperty( i, nodeNewOpts.properties[i] ); + } + } + if (nodeNewOpts.inputs) { + newNode.inputs = []; + for (var i in nodeNewOpts.inputs) { + newNode.addOutput( + nodeNewOpts.inputs[i][0], + nodeNewOpts.inputs[i][1] + ); + } + } + if (nodeNewOpts.outputs) { + newNode.outputs = []; + for (var i in nodeNewOpts.outputs) { + newNode.addOutput( + nodeNewOpts.outputs[i][0], + nodeNewOpts.outputs[i][1] + ); + } + } + if (nodeNewOpts.title) { + newNode.title = nodeNewOpts.title; + } + if (nodeNewOpts.json) { + newNode.configure(nodeNewOpts.json); + } + + } + + // add the node + that.graph.add(newNode); + newNode.pos = [ opts.position[0]+opts.posAdd[0]+(opts.posSizeFix[0]?opts.posSizeFix[0]*newNode.size[0]:0) + ,opts.position[1]+opts.posAdd[1]+(opts.posSizeFix[1]?opts.posSizeFix[1]*newNode.size[1]:0)]; //that.last_click_position; //[e.canvasX+30, e.canvasX+5];*/ + + //that.graph.afterChange(); + + // connect the two! + if (isFrom){ + opts.nodeFrom.connectByType( iSlotConn, newNode, fromSlotType ); + }else{ + opts.nodeTo.connectByTypeOutput( iSlotConn, newNode, fromSlotType ); + } + + // if connecting in between + if (isFrom && isTo){ + // TODO + } + + return true; + + }else{ + console.log("failed creating "+nodeNewType); + } + } + } + return false; + } + + LGraphCanvas.prototype.showConnectionMenu = function(optPass) { // addNodeMenu for connection + var optPass = optPass || {}; + var opts = Object.assign({ nodeFrom: null // input + ,slotFrom: null // input + ,nodeTo: null // output + ,slotTo: null // output + ,e: null + } + ,optPass + ); + var that = this; + + var isFrom = opts.nodeFrom && opts.slotFrom; + var isTo = !isFrom && opts.nodeTo && opts.slotTo; + + if (!isFrom && !isTo){ + console.warn("No data passed to showConnectionMenu"); + return false; + } + + var nodeX = isFrom ? opts.nodeFrom : opts.nodeTo; + var slotX = isFrom ? opts.slotFrom : opts.slotTo; + + var iSlotConn = false; + switch (typeof slotX){ + case "string": + iSlotConn = isFrom ? nodeX.findOutputSlot(slotX,false) : nodeX.findInputSlot(slotX,false); + slotX = isFrom ? nodeX.outputs[slotX] : nodeX.inputs[slotX]; + break; + case "object": + // ok slotX + iSlotConn = isFrom ? nodeX.findOutputSlot(slotX.name) : nodeX.findInputSlot(slotX.name); + break; + case "number": + iSlotConn = slotX; + slotX = isFrom ? nodeX.outputs[slotX] : nodeX.inputs[slotX]; + break; + default: + // bad ? + //iSlotConn = 0; + console.warn("Cant get slot information "+slotX); + return false; + } + + var options = ["Add Node",null]; + + if (that.allow_searchbox){ + options.push("Search"); + options.push(null); + } + + // get defaults nodes for this slottype + var fromSlotType = slotX.type==LiteGraph.EVENT?"_event_":slotX.type; + var slotTypesDefault = isFrom ? LiteGraph.slot_types_default_out : LiteGraph.slot_types_default_in; + if(slotTypesDefault && slotTypesDefault[fromSlotType]){ + if(typeof slotTypesDefault[fromSlotType] == "object" || typeof slotTypesDefault[fromSlotType] == "array"){ + for(var typeX in slotTypesDefault[fromSlotType]){ + options.push(slotTypesDefault[fromSlotType][typeX]); + } + }else{ + options.push(slotTypesDefault[fromSlotType]); + } + } + + // build menu + var menu = new LiteGraph.ContextMenu(options, { + event: opts.e, + title: (slotX && slotX.name!="" ? (slotX.name + (fromSlotType?" | ":"")) : "")+(slotX && fromSlotType ? fromSlotType : ""), + callback: inner_clicked + }); + + // callback + function inner_clicked(v,options,e) { + //console.log("Process showConnectionMenu selection"); + switch (v) { + case "Add Node": + LGraphCanvas.onMenuAdd(null, null, e, menu, function(node){ + if (isFrom){ + opts.nodeFrom.connectByType( iSlotConn, node, fromSlotType ); + }else{ + opts.nodeTo.connectByTypeOutput( iSlotConn, node, fromSlotType ); + } + }); + break; + case "Search": + if(isFrom){ + that.showSearchBox(e,{node_from: opts.nodeFrom, slot_from: slotX, type_filter_in: fromSlotType}); + }else{ + that.showSearchBox(e,{node_to: opts.nodeTo, slot_from: slotX, type_filter_out: fromSlotType}); + } + break; + default: + // check for defaults nodes for this slottype + var nodeCreated = that.createDefaultNodeForSlot(Object.assign(opts,{ position: [opts.e.canvasX, opts.e.canvasY] + ,nodeType: v + })); + if (nodeCreated){ + // new node created + //console.log("node "+v+" created") + }else{ + // failed or v is not in defaults + } + break; + } + } + + return false; + }; + + // TODO refactor :: this is used fot title but not for properties! + LGraphCanvas.onShowPropertyEditor = function(item, options, e, menu, node) { + var input_html = ""; + var property = item.property || "title"; + var value = node[property]; + + // TODO refactor :: use createDialog ? + + var dialog = document.createElement("div"); + dialog.is_modified = false; + dialog.className = "graphdialog"; + dialog.innerHTML = + ""; + dialog.close = function() { + if (dialog.parentNode) { + dialog.parentNode.removeChild(dialog); + } + }; + var title = dialog.querySelector(".name"); + title.innerText = property; + var input = dialog.querySelector(".value"); + if (input) { + input.value = value; + input.addEventListener("blur", function(e) { + this.focus(); + }); + input.addEventListener("keydown", function(e) { + dialog.is_modified = true; + if (e.keyCode == 27) { + //ESC + dialog.close(); + } else if (e.keyCode == 13) { + inner(); // save + } else if (e.keyCode != 13 && e.target.localName != "textarea") { + return; + } + e.preventDefault(); + e.stopPropagation(); + }); + } + + var graphcanvas = LGraphCanvas.active_canvas; + var canvas = graphcanvas.canvas; + + var rect = canvas.getBoundingClientRect(); + var offsetx = -20; + var offsety = -20; + if (rect) { + offsetx -= rect.left; + offsety -= rect.top; + } + + if (event) { + dialog.style.left = event.clientX + offsetx + "px"; + dialog.style.top = event.clientY + offsety + "px"; + } else { + dialog.style.left = canvas.width * 0.5 + offsetx + "px"; + dialog.style.top = canvas.height * 0.5 + offsety + "px"; + } + + var button = dialog.querySelector("button"); + button.addEventListener("click", inner); + canvas.parentNode.appendChild(dialog); + + if(input) input.focus(); + + var dialogCloseTimer = null; + dialog.addEventListener("mouseleave", function(e) { + if(LiteGraph.dialog_close_on_mouse_leave) + if (!dialog.is_modified && LiteGraph.dialog_close_on_mouse_leave) + dialogCloseTimer = setTimeout(dialog.close, LiteGraph.dialog_close_on_mouse_leave_delay); //dialog.close(); + }); + dialog.addEventListener("mouseenter", function(e) { + if(LiteGraph.dialog_close_on_mouse_leave) + if(dialogCloseTimer) clearTimeout(dialogCloseTimer); + }); + + function inner() { + if(input) setValue(input.value); + } + + function setValue(value) { + if (item.type == "Number") { + value = Number(value); + } else if (item.type == "Boolean") { + value = Boolean(value); + } + node[property] = value; + if (dialog.parentNode) { + dialog.parentNode.removeChild(dialog); + } + node.setDirtyCanvas(true, true); + } + }; + + // refactor: there are different dialogs, some uses createDialog some dont + LGraphCanvas.prototype.prompt = function(title, value, callback, event, multiline) { + var that = this; + var input_html = ""; + title = title || ""; + + var dialog = document.createElement("div"); + dialog.is_modified = false; + dialog.className = "graphdialog rounded"; + if(multiline) + dialog.innerHTML = " "; + else + dialog.innerHTML = " "; + dialog.close = function() { + that.prompt_box = null; + if (dialog.parentNode) { + dialog.parentNode.removeChild(dialog); + } + }; + + var graphcanvas = LGraphCanvas.active_canvas; + var canvas = graphcanvas.canvas; + canvas.parentNode.appendChild(dialog); + + if (this.ds.scale > 1) { + dialog.style.transform = "scale(" + this.ds.scale + ")"; + } + + var dialogCloseTimer = null; + var prevent_timeout = false; + LiteGraph.pointerListenerAdd(dialog,"leave", function(e) { + if (prevent_timeout) + return; + if(LiteGraph.dialog_close_on_mouse_leave) + if (!dialog.is_modified && LiteGraph.dialog_close_on_mouse_leave) + dialogCloseTimer = setTimeout(dialog.close, LiteGraph.dialog_close_on_mouse_leave_delay); //dialog.close(); + }); + LiteGraph.pointerListenerAdd(dialog,"enter", function(e) { + if(LiteGraph.dialog_close_on_mouse_leave) + if(dialogCloseTimer) clearTimeout(dialogCloseTimer); + }); + var selInDia = dialog.querySelectorAll("select"); + if (selInDia){ + // if filtering, check focus changed to comboboxes and prevent closing + selInDia.forEach(function(selIn) { + selIn.addEventListener("click", function(e) { + prevent_timeout++; + }); + selIn.addEventListener("blur", function(e) { + prevent_timeout = 0; + }); + selIn.addEventListener("change", function(e) { + prevent_timeout = -1; + }); + }); + } + + if (that.prompt_box) { + that.prompt_box.close(); + } + that.prompt_box = dialog; + + var first = null; + var timeout = null; + var selected = null; + + var name_element = dialog.querySelector(".name"); + name_element.innerText = title; + var value_element = dialog.querySelector(".value"); + value_element.value = value; + + var input = value_element; + input.addEventListener("keydown", function(e) { + dialog.is_modified = true; + if (e.keyCode == 27) { + //ESC + dialog.close(); + } else if (e.keyCode == 13 && e.target.localName != "textarea") { + if (callback) { + callback(this.value); + } + dialog.close(); + } else { + return; + } + e.preventDefault(); + e.stopPropagation(); + }); + + var button = dialog.querySelector("button"); + button.addEventListener("click", function(e) { + if (callback) { + callback(input.value); + } + that.setDirty(true); + dialog.close(); + }); + + var rect = canvas.getBoundingClientRect(); + var offsetx = -20; + var offsety = -20; + if (rect) { + offsetx -= rect.left; + offsety -= rect.top; + } + + if (event) { + dialog.style.left = event.clientX + offsetx + "px"; + dialog.style.top = event.clientY + offsety + "px"; + } else { + dialog.style.left = canvas.width * 0.5 + offsetx + "px"; + dialog.style.top = canvas.height * 0.5 + offsety + "px"; + } + + setTimeout(function() { + input.focus(); + }, 10); + + return dialog; + }; + + LGraphCanvas.search_limit = -1; + LGraphCanvas.prototype.showSearchBox = function(event, options) { + // proposed defaults + var def_options = { slot_from: null + ,node_from: null + ,node_to: null + ,do_type_filter: LiteGraph.search_filter_enabled // TODO check for registered_slot_[in/out]_types not empty // this will be checked for functionality enabled : filter on slot type, in and out + ,type_filter_in: false // these are default: pass to set initially set values + ,type_filter_out: false + ,show_general_if_none_on_typefilter: true + ,show_general_after_typefiltered: true + ,hide_on_mouse_leave: LiteGraph.search_hide_on_mouse_leave + ,show_all_if_empty: true + ,show_all_on_open: LiteGraph.search_show_all_on_open + }; + options = Object.assign(def_options, options || {}); + + //console.log(options); + + var that = this; + var input_html = ""; + var graphcanvas = LGraphCanvas.active_canvas; + var canvas = graphcanvas.canvas; + var root_document = canvas.ownerDocument || document; + + var dialog = document.createElement("div"); + dialog.className = "litegraph litesearchbox graphdialog rounded"; + dialog.innerHTML = "Search "; + if (options.do_type_filter){ + dialog.innerHTML += ""; + dialog.innerHTML += ""; + } + dialog.innerHTML += "
                            "; + + if( root_document.fullscreenElement ) + root_document.fullscreenElement.appendChild(dialog); + else + { + root_document.body.appendChild(dialog); + root_document.body.style.overflow = "hidden"; + } + // dialog element has been appended + + if (options.do_type_filter){ + var selIn = dialog.querySelector(".slot_in_type_filter"); + var selOut = dialog.querySelector(".slot_out_type_filter"); + } + + dialog.close = function() { + that.search_box = null; + this.blur(); + canvas.focus(); + root_document.body.style.overflow = ""; + + setTimeout(function() { + that.canvas.focus(); + }, 20); //important, if canvas loses focus keys wont be captured + if (dialog.parentNode) { + dialog.parentNode.removeChild(dialog); + } + }; + + if (this.ds.scale > 1) { + dialog.style.transform = "scale(" + this.ds.scale + ")"; + } + + // hide on mouse leave + if(options.hide_on_mouse_leave){ + var prevent_timeout = false; + var timeout_close = null; + LiteGraph.pointerListenerAdd(dialog,"enter", function(e) { + if (timeout_close) { + clearTimeout(timeout_close); + timeout_close = null; + } + }); + LiteGraph.pointerListenerAdd(dialog,"leave", function(e) { + if (prevent_timeout){ + return; + } + timeout_close = setTimeout(function() { + dialog.close(); + }, 500); + }); + // if filtering, check focus changed to comboboxes and prevent closing + if (options.do_type_filter){ + selIn.addEventListener("click", function(e) { + prevent_timeout++; + }); + selIn.addEventListener("blur", function(e) { + prevent_timeout = 0; + }); + selIn.addEventListener("change", function(e) { + prevent_timeout = -1; + }); + selOut.addEventListener("click", function(e) { + prevent_timeout++; + }); + selOut.addEventListener("blur", function(e) { + prevent_timeout = 0; + }); + selOut.addEventListener("change", function(e) { + prevent_timeout = -1; + }); + } + } + + if (that.search_box) { + that.search_box.close(); + } + that.search_box = dialog; + + var helper = dialog.querySelector(".helper"); + + var first = null; + var timeout = null; + var selected = null; + + var input = dialog.querySelector("input"); + if (input) { + input.addEventListener("blur", function(e) { + if(that.search_box) + this.focus(); + }); + input.addEventListener("keydown", function(e) { + if (e.keyCode == 38) { + //UP + changeSelection(false); + } else if (e.keyCode == 40) { + //DOWN + changeSelection(true); + } else if (e.keyCode == 27) { + //ESC + dialog.close(); + } else if (e.keyCode == 13) { + refreshHelper(); + if (selected) { + select(selected.innerHTML); + } else if (first) { + select(first); + } else { + dialog.close(); + } + } else { + if (timeout) { + clearInterval(timeout); + } + timeout = setTimeout(refreshHelper, 250); + return; + } + e.preventDefault(); + e.stopPropagation(); + e.stopImmediatePropagation(); + return true; + }); + } + + // if should filter on type, load and fill selected and choose elements if passed + if (options.do_type_filter){ + if (selIn){ + var aSlots = LiteGraph.slot_types_in; + var nSlots = aSlots.length; // this for object :: Object.keys(aSlots).length; + + if (options.type_filter_in == LiteGraph.EVENT || options.type_filter_in == LiteGraph.ACTION) + options.type_filter_in = "_event_"; + /* this will filter on * .. but better do it manually in case + else if(options.type_filter_in === "" || options.type_filter_in === 0) + options.type_filter_in = "*";*/ + + for (var iK=0; iK (rect.height - 200)) + helper.style.maxHeight = (rect.height - event.layerY - 20) + "px"; + + /* + var offsetx = -20; + var offsety = -20; + if (rect) { + offsetx -= rect.left; + offsety -= rect.top; + } + + if (event) { + dialog.style.left = event.clientX + offsetx + "px"; + dialog.style.top = event.clientY + offsety + "px"; + } else { + dialog.style.left = canvas.width * 0.5 + offsetx + "px"; + dialog.style.top = canvas.height * 0.5 + offsety + "px"; + } + canvas.parentNode.appendChild(dialog); + */ + + input.focus(); + if (options.show_all_on_open) refreshHelper(); + + function select(name) { + if (name) { + if (that.onSearchBoxSelection) { + that.onSearchBoxSelection(name, event, graphcanvas); + } else { + var extra = LiteGraph.searchbox_extras[name.toLowerCase()]; + if (extra) { + name = extra.type; + } + + graphcanvas.graph.beforeChange(); + var node = LiteGraph.createNode(name); + if (node) { + node.pos = graphcanvas.convertEventToCanvasOffset( + event + ); + graphcanvas.graph.add(node, false); + } + + if (extra && extra.data) { + if (extra.data.properties) { + for (var i in extra.data.properties) { + node.addProperty( i, extra.data.properties[i] ); + } + } + if (extra.data.inputs) { + node.inputs = []; + for (var i in extra.data.inputs) { + node.addOutput( + extra.data.inputs[i][0], + extra.data.inputs[i][1] + ); + } + } + if (extra.data.outputs) { + node.outputs = []; + for (var i in extra.data.outputs) { + node.addOutput( + extra.data.outputs[i][0], + extra.data.outputs[i][1] + ); + } + } + if (extra.data.title) { + node.title = extra.data.title; + } + if (extra.data.json) { + node.configure(extra.data.json); + } + + } + + // join node after inserting + if (options.node_from){ + var iS = false; + switch (typeof options.slot_from){ + case "string": + iS = options.node_from.findOutputSlot(options.slot_from); + break; + case "object": + if (options.slot_from.name){ + iS = options.node_from.findOutputSlot(options.slot_from.name); + }else{ + iS = -1; + } + if (iS==-1 && typeof options.slot_from.slot_index !== "undefined") iS = options.slot_from.slot_index; + break; + case "number": + iS = options.slot_from; + break; + default: + iS = 0; // try with first if no name set + } + if (typeof options.node_from.outputs[iS] !== "undefined"){ + if (iS!==false && iS>-1){ + options.node_from.connectByType( iS, node, options.node_from.outputs[iS].type ); + } + }else{ + // console.warn("cant find slot " + options.slot_from); + } + } + if (options.node_to){ + var iS = false; + switch (typeof options.slot_from){ + case "string": + iS = options.node_to.findInputSlot(options.slot_from); + break; + case "object": + if (options.slot_from.name){ + iS = options.node_to.findInputSlot(options.slot_from.name); + }else{ + iS = -1; + } + if (iS==-1 && typeof options.slot_from.slot_index !== "undefined") iS = options.slot_from.slot_index; + break; + case "number": + iS = options.slot_from; + break; + default: + iS = 0; // try with first if no name set + } + if (typeof options.node_to.inputs[iS] !== "undefined"){ + if (iS!==false && iS>-1){ + // try connection + options.node_to.connectByTypeOutput(iS,node,options.node_to.inputs[iS].type); + } + }else{ + // console.warn("cant find slot_nodeTO " + options.slot_from); + } + } + + graphcanvas.graph.afterChange(); + } + } + + dialog.close(); + } + + function changeSelection(forward) { + var prev = selected; + if (selected) { + selected.classList.remove("selected"); + } + if (!selected) { + selected = forward + ? helper.childNodes[0] + : helper.childNodes[helper.childNodes.length]; + } else { + selected = forward + ? selected.nextSibling + : selected.previousSibling; + if (!selected) { + selected = prev; + } + } + if (!selected) { + return; + } + selected.classList.add("selected"); + selected.scrollIntoView({block: "end", behavior: "smooth"}); + } + + function refreshHelper() { + timeout = null; + var str = input.value; + first = null; + helper.innerHTML = ""; + if (!str && !options.show_all_if_empty) { + return; + } + + if (that.onSearchBox) { + var list = that.onSearchBox(helper, str, graphcanvas); + if (list) { + for (var i = 0; i < list.length; ++i) { + addResult(list[i]); + } + } + } else { + var c = 0; + str = str.toLowerCase(); + var filter = graphcanvas.filter || graphcanvas.graph.filter; + + // filter by type preprocess + if(options.do_type_filter && that.search_box){ + var sIn = that.search_box.querySelector(".slot_in_type_filter"); + var sOut = that.search_box.querySelector(".slot_out_type_filter"); + }else{ + var sIn = false; + var sOut = false; + } + + //extras + for (var i in LiteGraph.searchbox_extras) { + var extra = LiteGraph.searchbox_extras[i]; + if ((!options.show_all_if_empty || str) && extra.desc.toLowerCase().indexOf(str) === -1) { + continue; + } + var ctor = LiteGraph.registered_node_types[ extra.type ]; + if( ctor && ctor.filter != filter ) + continue; + if( ! inner_test_filter(extra.type) ) + continue; + addResult( extra.desc, "searchbox_extra" ); + if ( LGraphCanvas.search_limit !== -1 && c++ > LGraphCanvas.search_limit ) { + break; + } + } + + var filtered = null; + if (Array.prototype.filter) { //filter supported + var keys = Object.keys( LiteGraph.registered_node_types ); //types + var filtered = keys.filter( inner_test_filter ); + } else { + filtered = []; + for (var i in LiteGraph.registered_node_types) { + if( inner_test_filter(i) ) + filtered.push(i); + } + } + + for (var i = 0; i < filtered.length; i++) { + addResult(filtered[i]); + if ( LGraphCanvas.search_limit !== -1 && c++ > LGraphCanvas.search_limit ) { + break; + } + } + + // add general type if filtering + if (options.show_general_after_typefiltered + && (sIn.value || sOut.value) + ){ + filtered_extra = []; + for (var i in LiteGraph.registered_node_types) { + if( inner_test_filter(i, {inTypeOverride: sIn&&sIn.value?"*":false, outTypeOverride: sOut&&sOut.value?"*":false}) ) + filtered_extra.push(i); + } + for (var i = 0; i < filtered_extra.length; i++) { + addResult(filtered_extra[i], "generic_type"); + if ( LGraphCanvas.search_limit !== -1 && c++ > LGraphCanvas.search_limit ) { + break; + } + } + } + + // check il filtering gave no results + if ((sIn.value || sOut.value) && + ( (helper.childNodes.length == 0 && options.show_general_if_none_on_typefilter) ) + ){ + filtered_extra = []; + for (var i in LiteGraph.registered_node_types) { + if( inner_test_filter(i, {skipFilter: true}) ) + filtered_extra.push(i); + } + for (var i = 0; i < filtered_extra.length; i++) { + addResult(filtered_extra[i], "not_in_filter"); + if ( LGraphCanvas.search_limit !== -1 && c++ > LGraphCanvas.search_limit ) { + break; + } + } + } + + function inner_test_filter( type, optsIn ) + { + var optsIn = optsIn || {}; + var optsDef = { skipFilter: false + ,inTypeOverride: false + ,outTypeOverride: false + }; + var opts = Object.assign(optsDef,optsIn); + var ctor = LiteGraph.registered_node_types[ type ]; + if(filter && ctor.filter != filter ) + return false; + if ((!options.show_all_if_empty || str) && type.toLowerCase().indexOf(str) === -1) + return false; + + // filter by slot IN, OUT types + if(options.do_type_filter && !opts.skipFilter){ + var sType = type; + + var sV = sIn.value; + if (opts.inTypeOverride!==false) sV = opts.inTypeOverride; + //if (sV.toLowerCase() == "_event_") sV = LiteGraph.EVENT; // -1 + + if(sIn && sV){ + //console.log("will check filter against "+sV); + if (LiteGraph.registered_slot_in_types[sV] && LiteGraph.registered_slot_in_types[sV].nodes){ // type is stored + //console.debug("check "+sType+" in "+LiteGraph.registered_slot_in_types[sV].nodes); + var doesInc = LiteGraph.registered_slot_in_types[sV].nodes.includes(sType); + if (doesInc!==false){ + //console.log(sType+" HAS "+sV); + }else{ + /*console.debug(LiteGraph.registered_slot_in_types[sV]); + console.log(+" DONT includes "+type);*/ + return false; + } + } + } + + var sV = sOut.value; + if (opts.outTypeOverride!==false) sV = opts.outTypeOverride; + //if (sV.toLowerCase() == "_event_") sV = LiteGraph.EVENT; // -1 + + if(sOut && sV){ + //console.log("search will check filter against "+sV); + if (LiteGraph.registered_slot_out_types[sV] && LiteGraph.registered_slot_out_types[sV].nodes){ // type is stored + //console.debug("check "+sType+" in "+LiteGraph.registered_slot_out_types[sV].nodes); + var doesInc = LiteGraph.registered_slot_out_types[sV].nodes.includes(sType); + if (doesInc!==false){ + //console.log(sType+" HAS "+sV); + }else{ + /*console.debug(LiteGraph.registered_slot_out_types[sV]); + console.log(+" DONT includes "+type);*/ + return false; + } + } + } + } + return true; + } + } + + function addResult(type, className) { + var help = document.createElement("div"); + if (!first) { + first = type; + } + help.innerText = type; + help.dataset["type"] = escape(type); + help.className = "litegraph lite-search-item"; + if (className) { + help.className += " " + className; + } + help.addEventListener("click", function(e) { + select(unescape(this.dataset["type"])); + }); + helper.appendChild(help); + } + } + + return dialog; + }; + + LGraphCanvas.prototype.showEditPropertyValue = function( node, property, options ) { + if (!node || node.properties[property] === undefined) { + return; + } + + options = options || {}; + var that = this; + + var info = node.getPropertyInfo(property); + var type = info.type; + + var input_html = ""; + + if (type == "string" || type == "number" || type == "array" || type == "object") { + input_html = ""; + } else if ( (type == "enum" || type == "combo") && info.values) { + input_html = ""; + } else if (type == "boolean" || type == "toggle") { + input_html = + ""; + } else { + console.warn("unknown type: " + type); + return; + } + + var dialog = this.createDialog( + "" + + (info.label ? info.label : property) + + "" + + input_html + + "", + options + ); + + var input = false; + if ((type == "enum" || type == "combo") && info.values) { + input = dialog.querySelector("select"); + input.addEventListener("change", function(e) { + dialog.modified(); + setValue(e.target.value); + //var index = e.target.value; + //setValue( e.options[e.selectedIndex].value ); + }); + } else if (type == "boolean" || type == "toggle") { + input = dialog.querySelector("input"); + if (input) { + input.addEventListener("click", function(e) { + dialog.modified(); + setValue(!!input.checked); + }); + } + } else { + input = dialog.querySelector("input"); + if (input) { + input.addEventListener("blur", function(e) { + this.focus(); + }); + + var v = node.properties[property] !== undefined ? node.properties[property] : ""; + if (type !== 'string') { + v = JSON.stringify(v); + } + + input.value = v; + input.addEventListener("keydown", function(e) { + if (e.keyCode == 27) { + //ESC + dialog.close(); + } else if (e.keyCode == 13) { + // ENTER + inner(); // save + } else if (e.keyCode != 13) { + dialog.modified(); + return; + } + e.preventDefault(); + e.stopPropagation(); + }); + } + } + if (input) input.focus(); + + var button = dialog.querySelector("button"); + button.addEventListener("click", inner); + + function inner() { + setValue(input.value); + } + + function setValue(value) { + + if(info && info.values && info.values.constructor === Object && info.values[value] != undefined ) + value = info.values[value]; + + if (typeof node.properties[property] == "number") { + value = Number(value); + } + if (type == "array" || type == "object") { + value = JSON.parse(value); + } + node.properties[property] = value; + if (node.graph) { + node.graph._version++; + } + if (node.onPropertyChanged) { + node.onPropertyChanged(property, value); + } + if(options.onclose) + options.onclose(); + dialog.close(); + node.setDirtyCanvas(true, true); + } + + return dialog; + }; + + // TODO refactor, theer are different dialog, some uses createDialog, some dont + LGraphCanvas.prototype.createDialog = function(html, options) { + var def_options = { checkForInput: false, closeOnLeave: true, closeOnLeave_checkModified: true }; + options = Object.assign(def_options, options || {}); + + var dialog = document.createElement("div"); + dialog.className = "graphdialog"; + dialog.innerHTML = html; + dialog.is_modified = false; + + var rect = this.canvas.getBoundingClientRect(); + var offsetx = -20; + var offsety = -20; + if (rect) { + offsetx -= rect.left; + offsety -= rect.top; + } + + if (options.position) { + offsetx += options.position[0]; + offsety += options.position[1]; + } else if (options.event) { + offsetx += options.event.clientX; + offsety += options.event.clientY; + } //centered + else { + offsetx += this.canvas.width * 0.5; + offsety += this.canvas.height * 0.5; + } + + dialog.style.left = offsetx + "px"; + dialog.style.top = offsety + "px"; + + this.canvas.parentNode.appendChild(dialog); + + // acheck for input and use default behaviour: save on enter, close on esc + if (options.checkForInput){ + var aI = []; + var focused = false; + if (aI = dialog.querySelectorAll("input")){ + aI.forEach(function(iX) { + iX.addEventListener("keydown",function(e){ + dialog.modified(); + if (e.keyCode == 27) { + dialog.close(); + } else if (e.keyCode != 13) { + return; + } + // set value ? + e.preventDefault(); + e.stopPropagation(); + }); + if (!focused) iX.focus(); + }); + } + } + + dialog.modified = function(){ + dialog.is_modified = true; + } + dialog.close = function() { + if (dialog.parentNode) { + dialog.parentNode.removeChild(dialog); + } + }; + + var dialogCloseTimer = null; + var prevent_timeout = false; + dialog.addEventListener("mouseleave", function(e) { + if (prevent_timeout) + return; + if(options.closeOnLeave || LiteGraph.dialog_close_on_mouse_leave) + if (!dialog.is_modified && LiteGraph.dialog_close_on_mouse_leave) + dialogCloseTimer = setTimeout(dialog.close, LiteGraph.dialog_close_on_mouse_leave_delay); //dialog.close(); + }); + dialog.addEventListener("mouseenter", function(e) { + if(options.closeOnLeave || LiteGraph.dialog_close_on_mouse_leave) + if(dialogCloseTimer) clearTimeout(dialogCloseTimer); + }); + var selInDia = dialog.querySelectorAll("select"); + if (selInDia){ + // if filtering, check focus changed to comboboxes and prevent closing + selInDia.forEach(function(selIn) { + selIn.addEventListener("click", function(e) { + prevent_timeout++; + }); + selIn.addEventListener("blur", function(e) { + prevent_timeout = 0; + }); + selIn.addEventListener("change", function(e) { + prevent_timeout = -1; + }); + }); + } + + return dialog; + }; + + LGraphCanvas.prototype.createPanel = function(title, options) { + options = options || {}; + + var ref_window = options.window || window; + var root = document.createElement("div"); + root.className = "litegraph dialog"; + root.innerHTML = "
                            "; + root.header = root.querySelector(".dialog-header"); + + if(options.width) + root.style.width = options.width + (options.width.constructor === Number ? "px" : ""); + if(options.height) + root.style.height = options.height + (options.height.constructor === Number ? "px" : ""); + if(options.closable) + { + var close = document.createElement("span"); + close.innerHTML = "✕"; + close.classList.add("close"); + close.addEventListener("click",function(){ + root.close(); + }); + root.header.appendChild(close); + } + root.title_element = root.querySelector(".dialog-title"); + root.title_element.innerText = title; + root.content = root.querySelector(".dialog-content"); + root.alt_content = root.querySelector(".dialog-alt-content"); + root.footer = root.querySelector(".dialog-footer"); + + root.close = function() + { + if (root.onClose && typeof root.onClose == "function"){ + root.onClose(); + } + if(root.parentNode) + root.parentNode.removeChild(root); + /* XXX CHECK THIS */ + if(this.parentNode){ + this.parentNode.removeChild(this); + } + /* XXX this was not working, was fixed with an IF, check this */ + } + + // function to swap panel content + root.toggleAltContent = function(force){ + if (typeof force != "undefined"){ + var vTo = force ? "block" : "none"; + var vAlt = force ? "none" : "block"; + }else{ + var vTo = root.alt_content.style.display != "block" ? "block" : "none"; + var vAlt = root.alt_content.style.display != "block" ? "none" : "block"; + } + root.alt_content.style.display = vTo; + root.content.style.display = vAlt; + } + + root.toggleFooterVisibility = function(force){ + if (typeof force != "undefined"){ + var vTo = force ? "block" : "none"; + }else{ + var vTo = root.footer.style.display != "block" ? "block" : "none"; + } + root.footer.style.display = vTo; + } + + root.clear = function() + { + this.content.innerHTML = ""; + } + + root.addHTML = function(code, classname, on_footer) + { + var elem = document.createElement("div"); + if(classname) + elem.className = classname; + elem.innerHTML = code; + if(on_footer) + root.footer.appendChild(elem); + else + root.content.appendChild(elem); + return elem; + } + + root.addButton = function( name, callback, options ) + { + var elem = document.createElement("button"); + elem.innerText = name; + elem.options = options; + elem.classList.add("btn"); + elem.addEventListener("click",callback); + root.footer.appendChild(elem); + return elem; + } + + root.addSeparator = function() + { + var elem = document.createElement("div"); + elem.className = "separator"; + root.content.appendChild(elem); + } + + root.addWidget = function( type, name, value, options, callback ) + { + options = options || {}; + var str_value = String(value); + type = type.toLowerCase(); + if(type == "number") + str_value = value.toFixed(3); + + var elem = document.createElement("div"); + elem.className = "property"; + elem.innerHTML = ""; + elem.querySelector(".property_name").innerText = options.label || name; + var value_element = elem.querySelector(".property_value"); + value_element.innerText = str_value; + elem.dataset["property"] = name; + elem.dataset["type"] = options.type || type; + elem.options = options; + elem.value = value; + + if( type == "code" ) + elem.addEventListener("click", function(e){ root.inner_showCodePad( this.dataset["property"] ); }); + else if (type == "boolean") + { + elem.classList.add("boolean"); + if(value) + elem.classList.add("bool-on"); + elem.addEventListener("click", function(){ + //var v = node.properties[this.dataset["property"]]; + //node.setProperty(this.dataset["property"],!v); this.innerText = v ? "true" : "false"; + var propname = this.dataset["property"]; + this.value = !this.value; + this.classList.toggle("bool-on"); + this.querySelector(".property_value").innerText = this.value ? "true" : "false"; + innerChange(propname, this.value ); + }); + } + else if (type == "string" || type == "number") + { + value_element.setAttribute("contenteditable",true); + value_element.addEventListener("keydown", function(e){ + if(e.code == "Enter" && (type != "string" || !e.shiftKey)) // allow for multiline + { + e.preventDefault(); + this.blur(); + } + }); + value_element.addEventListener("blur", function(){ + var v = this.innerText; + var propname = this.parentNode.dataset["property"]; + var proptype = this.parentNode.dataset["type"]; + if( proptype == "number") + v = Number(v); + innerChange(propname, v); + }); + } + else if (type == "enum" || type == "combo") { + var str_value = LGraphCanvas.getPropertyPrintableValue( value, options.values ); + value_element.innerText = str_value; + + value_element.addEventListener("click", function(event){ + var values = options.values || []; + var propname = this.parentNode.dataset["property"]; + var elem_that = this; + var menu = new LiteGraph.ContextMenu(values,{ + event: event, + className: "dark", + callback: inner_clicked + }, + ref_window); + function inner_clicked(v, option, event) { + //node.setProperty(propname,v); + //graphcanvas.dirty_canvas = true; + elem_that.innerText = v; + innerChange(propname,v); + return false; + } + }); + } + + root.content.appendChild(elem); + + function innerChange(name, value) + { + //console.log("change",name,value); + //that.dirty_canvas = true; + if(options.callback) + options.callback(name,value,options); + if(callback) + callback(name,value,options); + } + + return elem; + } + + if (root.onOpen && typeof root.onOpen == "function") root.onOpen(); + + return root; + }; + + LGraphCanvas.getPropertyPrintableValue = function(value, values) + { + if(!values) + return String(value); + + if(values.constructor === Array) + { + return String(value); + } + + if(values.constructor === Object) + { + var desc_value = ""; + for(var k in values) + { + if(values[k] != value) + continue; + desc_value = k; + break; + } + return String(value) + " ("+desc_value+")"; + } + } + + LGraphCanvas.prototype.closePanels = function(){ + var panel = document.querySelector("#node-panel"); + if(panel) + panel.close(); + var panel = document.querySelector("#option-panel"); + if(panel) + panel.close(); + } + + LGraphCanvas.prototype.showShowGraphOptionsPanel = function(refOpts, obEv, refMenu, refMenu2){ + if(this.constructor && this.constructor.name == "HTMLDivElement"){ + // assume coming from the menu event click + if (!obEv || !obEv.event || !obEv.event.target || !obEv.event.target.lgraphcanvas){ + console.warn("Canvas not found"); // need a ref to canvas obj + /*console.debug(event); + console.debug(event.target);*/ + return; + } + var graphcanvas = obEv.event.target.lgraphcanvas; + }else{ + // assume called internally + var graphcanvas = this; + } + graphcanvas.closePanels(); + var ref_window = graphcanvas.getCanvasWindow(); + panel = graphcanvas.createPanel("Options",{ + closable: true + ,window: ref_window + ,onOpen: function(){ + graphcanvas.OPTIONPANEL_IS_OPEN = true; + } + ,onClose: function(){ + graphcanvas.OPTIONPANEL_IS_OPEN = false; + graphcanvas.options_panel = null; + } + }); + graphcanvas.options_panel = panel; + panel.id = "option-panel"; + panel.classList.add("settings"); + + function inner_refresh(){ + + panel.content.innerHTML = ""; //clear + + var fUpdate = function(name, value, options){ + switch(name){ + /*case "Render mode": + // Case "".. + if (options.values && options.key){ + var kV = Object.values(options.values).indexOf(value); + if (kV>=0 && options.values[kV]){ + console.debug("update graph options: "+options.key+": "+kV); + graphcanvas[options.key] = kV; + //console.debug(graphcanvas); + break; + } + } + console.warn("unexpected options"); + console.debug(options); + break;*/ + default: + //console.debug("want to update graph options: "+name+": "+value); + if (options && options.key){ + name = options.key; + } + if (options.values){ + value = Object.values(options.values).indexOf(value); + } + //console.debug("update graph option: "+name+": "+value); + graphcanvas[name] = value; + break; + } + }; + + // panel.addWidget( "string", "Graph name", "", {}, fUpdate); // implement + + var aProps = LiteGraph.availableCanvasOptions; + aProps.sort(); + for(var pI in aProps){ + var pX = aProps[pI]; + panel.addWidget( "boolean", pX, graphcanvas[pX], {key: pX, on: "True", off: "False"}, fUpdate); + } + + var aLinks = [ graphcanvas.links_render_mode ]; + panel.addWidget( "combo", "Render mode", LiteGraph.LINK_RENDER_MODES[graphcanvas.links_render_mode], {key: "links_render_mode", values: LiteGraph.LINK_RENDER_MODES}, fUpdate); + + panel.addSeparator(); + + panel.footer.innerHTML = ""; // clear + + } + inner_refresh(); + + graphcanvas.canvas.parentNode.appendChild( panel ); + } + + LGraphCanvas.prototype.showShowNodePanel = function( node ) + { + this.SELECTED_NODE = node; + this.closePanels(); + var ref_window = this.getCanvasWindow(); + var that = this; + var graphcanvas = this; + var panel = this.createPanel(node.title || "",{ + closable: true + ,window: ref_window + ,onOpen: function(){ + graphcanvas.NODEPANEL_IS_OPEN = true; + } + ,onClose: function(){ + graphcanvas.NODEPANEL_IS_OPEN = false; + graphcanvas.node_panel = null; + } + }); + graphcanvas.node_panel = panel; + panel.id = "node-panel"; + panel.node = node; + panel.classList.add("settings"); + + function inner_refresh() + { + panel.content.innerHTML = ""; //clear + panel.addHTML(""+node.type+""+(node.constructor.desc || "")+""); + + panel.addHTML("

                            Properties

                            "); + + var fUpdate = function(name,value){ + graphcanvas.graph.beforeChange(node); + switch(name){ + case "Title": + node.title = value; + break; + case "Mode": + var kV = Object.values(LiteGraph.NODE_MODES).indexOf(value); + if (kV>=0 && LiteGraph.NODE_MODES[kV]){ + node.changeMode(kV); + }else{ + console.warn("unexpected mode: "+value); + } + break; + case "Color": + if (LGraphCanvas.node_colors[value]){ + node.color = LGraphCanvas.node_colors[value].color; + node.bgcolor = LGraphCanvas.node_colors[value].bgcolor; + }else{ + console.warn("unexpected color: "+value); + } + break; + default: + node.setProperty(name,value); + break; + } + graphcanvas.graph.afterChange(); + graphcanvas.dirty_canvas = true; + }; + + panel.addWidget( "string", "Title", node.title, {}, fUpdate); + + panel.addWidget( "combo", "Mode", LiteGraph.NODE_MODES[node.mode], {values: LiteGraph.NODE_MODES}, fUpdate); + + var nodeCol = ""; + if (node.color !== undefined){ + nodeCol = Object.keys(LGraphCanvas.node_colors).filter(function(nK){ return LGraphCanvas.node_colors[nK].color == node.color; }); + } + + panel.addWidget( "combo", "Color", nodeCol, {values: Object.keys(LGraphCanvas.node_colors)}, fUpdate); + + for(var pName in node.properties) + { + var value = node.properties[pName]; + var info = node.getPropertyInfo(pName); + var type = info.type || "string"; + + //in case the user wants control over the side panel widget + if( node.onAddPropertyToPanel && node.onAddPropertyToPanel(pName,panel) ) + continue; + + panel.addWidget( info.widget || info.type, pName, value, info, fUpdate); + } + + panel.addSeparator(); + + if(node.onShowCustomPanelInfo) + node.onShowCustomPanelInfo(panel); + + panel.footer.innerHTML = ""; // clear + panel.addButton("Delete",function(){ + if(node.block_delete) + return; + node.graph.remove(node); + panel.close(); + }).classList.add("delete"); + } + + panel.inner_showCodePad = function( propname ) + { + panel.classList.remove("settings"); + panel.classList.add("centered"); + + + /*if(window.CodeFlask) //disabled for now + { + panel.content.innerHTML = "
                            "; + var flask = new CodeFlask( "div.code", { language: 'js' }); + flask.updateCode(node.properties[propname]); + flask.onUpdate( function(code) { + node.setProperty(propname, code); + }); + } + else + {*/ + panel.alt_content.innerHTML = ""; + var textarea = panel.alt_content.querySelector("textarea"); + var fDoneWith = function(){ + panel.toggleAltContent(false); //if(node_prop_div) node_prop_div.style.display = "block"; // panel.close(); + panel.toggleFooterVisibility(true); + textarea.parentNode.removeChild(textarea); + panel.classList.add("settings"); + panel.classList.remove("centered"); + inner_refresh(); + } + textarea.value = node.properties[propname]; + textarea.addEventListener("keydown", function(e){ + if(e.code == "Enter" && e.ctrlKey ) + { + node.setProperty(propname, textarea.value); + fDoneWith(); + } + }); + panel.toggleAltContent(true); + panel.toggleFooterVisibility(false); + textarea.style.height = "calc(100% - 40px)"; + /*}*/ + var assign = panel.addButton( "Assign", function(){ + node.setProperty(propname, textarea.value); + fDoneWith(); + }); + panel.alt_content.appendChild(assign); //panel.content.appendChild(assign); + var button = panel.addButton( "Close", fDoneWith); + button.style.float = "right"; + panel.alt_content.appendChild(button); // panel.content.appendChild(button); + } + + inner_refresh(); + + this.canvas.parentNode.appendChild( panel ); + } + + LGraphCanvas.prototype.showSubgraphPropertiesDialog = function(node) + { + console.log("showing subgraph properties dialog"); + + var old_panel = this.canvas.parentNode.querySelector(".subgraph_dialog"); + if(old_panel) + old_panel.close(); + + var panel = this.createPanel("Subgraph Inputs",{closable:true, width: 500}); + panel.node = node; + panel.classList.add("subgraph_dialog"); + + function inner_refresh() + { + panel.clear(); + + //show currents + if(node.inputs) + for(var i = 0; i < node.inputs.length; ++i) + { + var input = node.inputs[i]; + if(input.not_subgraph_input) + continue; + var html = " "; + var elem = panel.addHTML(html,"subgraph_property"); + elem.dataset["name"] = input.name; + elem.dataset["slot"] = i; + elem.querySelector(".name").innerText = input.name; + elem.querySelector(".type").innerText = input.type; + elem.querySelector("button").addEventListener("click",function(e){ + node.removeInput( Number( this.parentNode.dataset["slot"] ) ); + inner_refresh(); + }); + } + } + + //add extra + var html = " + NameType"; + var elem = panel.addHTML(html,"subgraph_property extra", true); + elem.querySelector("button").addEventListener("click", function(e){ + var elem = this.parentNode; + var name = elem.querySelector(".name").value; + var type = elem.querySelector(".type").value; + if(!name || node.findInputSlot(name) != -1) + return; + node.addInput(name,type); + elem.querySelector(".name").value = ""; + elem.querySelector(".type").value = ""; + inner_refresh(); + }); + + inner_refresh(); + this.canvas.parentNode.appendChild(panel); + return panel; + } + LGraphCanvas.prototype.showSubgraphPropertiesDialogRight = function (node) { + + // console.log("showing subgraph properties dialog"); + var that = this; + // old_panel if old_panel is exist close it + var old_panel = this.canvas.parentNode.querySelector(".subgraph_dialog"); + if (old_panel) + old_panel.close(); + // new panel + var panel = this.createPanel("Subgraph Outputs", { closable: true, width: 500 }); + panel.node = node; + panel.classList.add("subgraph_dialog"); + + function inner_refresh() { + panel.clear(); + //show currents + if (node.outputs) + for (var i = 0; i < node.outputs.length; ++i) { + var input = node.outputs[i]; + if (input.not_subgraph_output) + continue; + var html = " "; + var elem = panel.addHTML(html, "subgraph_property"); + elem.dataset["name"] = input.name; + elem.dataset["slot"] = i; + elem.querySelector(".name").innerText = input.name; + elem.querySelector(".type").innerText = input.type; + elem.querySelector("button").addEventListener("click", function (e) { + node.removeOutput(Number(this.parentNode.dataset["slot"])); + inner_refresh(); + }); + } + } + + //add extra + var html = " + NameType"; + var elem = panel.addHTML(html, "subgraph_property extra", true); + elem.querySelector(".name").addEventListener("keydown", function (e) { + if (e.keyCode == 13) { + addOutput.apply(this) + } + }) + elem.querySelector("button").addEventListener("click", function (e) { + addOutput.apply(this) + }); + function addOutput() { + var elem = this.parentNode; + var name = elem.querySelector(".name").value; + var type = elem.querySelector(".type").value; + if (!name || node.findOutputSlot(name) != -1) + return; + node.addOutput(name, type); + elem.querySelector(".name").value = ""; + elem.querySelector(".type").value = ""; + inner_refresh(); + } + + inner_refresh(); + this.canvas.parentNode.appendChild(panel); + return panel; + } + LGraphCanvas.prototype.checkPanels = function() + { + if(!this.canvas) + return; + var panels = this.canvas.parentNode.querySelectorAll(".litegraph.dialog"); + for(var i = 0; i < panels.length; ++i) + { + var panel = panels[i]; + if( !panel.node ) + continue; + if( !panel.node.graph || panel.graph != this.graph ) + panel.close(); + } + } + + LGraphCanvas.onMenuNodeCollapse = function(value, options, e, menu, node) { + node.graph.beforeChange(/*?*/); + + var fApplyMultiNode = function(node){ + node.collapse(); + } + + var graphcanvas = LGraphCanvas.active_canvas; + if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1){ + fApplyMultiNode(node); + }else{ + for (var i in graphcanvas.selected_nodes) { + fApplyMultiNode(graphcanvas.selected_nodes[i]); + } + } + + node.graph.afterChange(/*?*/); + }; + + LGraphCanvas.onMenuNodePin = function(value, options, e, menu, node) { + node.pin(); + }; + + LGraphCanvas.onMenuNodeMode = function(value, options, e, menu, node) { + new LiteGraph.ContextMenu( + LiteGraph.NODE_MODES, + { event: e, callback: inner_clicked, parentMenu: menu, node: node } + ); + + function inner_clicked(v) { + if (!node) { + return; + } + var kV = Object.values(LiteGraph.NODE_MODES).indexOf(v); + var fApplyMultiNode = function(node){ + if (kV>=0 && LiteGraph.NODE_MODES[kV]) + node.changeMode(kV); + else{ + console.warn("unexpected mode: "+v); + node.changeMode(LiteGraph.ALWAYS); + } + } + + var graphcanvas = LGraphCanvas.active_canvas; + if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1){ + fApplyMultiNode(node); + }else{ + for (var i in graphcanvas.selected_nodes) { + fApplyMultiNode(graphcanvas.selected_nodes[i]); + } + } + } + + return false; + }; + + LGraphCanvas.onMenuNodeColors = function(value, options, e, menu, node) { + if (!node) { + throw "no node for color"; + } + + var values = []; + values.push({ + value: null, + content: + "No color" + }); + + for (var i in LGraphCanvas.node_colors) { + var color = LGraphCanvas.node_colors[i]; + var value = { + value: i, + content: + "" + + i + + "" + }; + values.push(value); + } + new LiteGraph.ContextMenu(values, { + event: e, + callback: inner_clicked, + parentMenu: menu, + node: node + }); + + function inner_clicked(v) { + if (!node) { + return; + } + + var color = v.value ? LGraphCanvas.node_colors[v.value] : null; + + var fApplyColor = function(node){ + if (color) { + if (node.constructor === LiteGraph.LGraphGroup) { + node.color = color.groupcolor; + } else { + node.color = color.color; + node.bgcolor = color.bgcolor; + } + } else { + delete node.color; + delete node.bgcolor; + } + } + + var graphcanvas = LGraphCanvas.active_canvas; + if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1){ + fApplyColor(node); + }else{ + for (var i in graphcanvas.selected_nodes) { + fApplyColor(graphcanvas.selected_nodes[i]); + } + } + node.setDirtyCanvas(true, true); + } + + return false; + }; + + LGraphCanvas.onMenuNodeShapes = function(value, options, e, menu, node) { + if (!node) { + throw "no node passed"; + } + + new LiteGraph.ContextMenu(LiteGraph.VALID_SHAPES, { + event: e, + callback: inner_clicked, + parentMenu: menu, + node: node + }); + + function inner_clicked(v) { + if (!node) { + return; + } + node.graph.beforeChange(/*?*/); //node + + var fApplyMultiNode = function(node){ + node.shape = v; + } + + var graphcanvas = LGraphCanvas.active_canvas; + if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1){ + fApplyMultiNode(node); + }else{ + for (var i in graphcanvas.selected_nodes) { + fApplyMultiNode(graphcanvas.selected_nodes[i]); + } + } + + node.graph.afterChange(/*?*/); //node + node.setDirtyCanvas(true); + } + + return false; + }; + + LGraphCanvas.onMenuNodeRemove = function(value, options, e, menu, node) { + if (!node) { + throw "no node passed"; + } + + var graph = node.graph; + graph.beforeChange(); + + + var fApplyMultiNode = function(node){ + if (node.removable === false) { + return; + } + graph.remove(node); + } + + var graphcanvas = LGraphCanvas.active_canvas; + if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1){ + fApplyMultiNode(node); + }else{ + for (var i in graphcanvas.selected_nodes) { + fApplyMultiNode(graphcanvas.selected_nodes[i]); + } + } + + graph.afterChange(); + node.setDirtyCanvas(true, true); + }; + + LGraphCanvas.onMenuNodeToSubgraph = function(value, options, e, menu, node) { + var graph = node.graph; + var graphcanvas = LGraphCanvas.active_canvas; + if(!graphcanvas) //?? + return; + + var nodes_list = Object.values( graphcanvas.selected_nodes || {} ); + if( !nodes_list.length ) + nodes_list = [ node ]; + + var subgraph_node = LiteGraph.createNode("graph/subgraph"); + subgraph_node.pos = node.pos.concat(); + graph.add(subgraph_node); + + subgraph_node.buildFromNodes( nodes_list ); + + graphcanvas.deselectAllNodes(); + node.setDirtyCanvas(true, true); + }; + + LGraphCanvas.onMenuNodeClone = function(value, options, e, menu, node) { + + node.graph.beforeChange(); + + var newSelected = {}; + + var fApplyMultiNode = function(node){ + if (node.clonable === false) { + return; + } + var newnode = node.clone(); + if (!newnode) { + return; + } + newnode.pos = [node.pos[0] + 5, node.pos[1] + 5]; + node.graph.add(newnode); + newSelected[newnode.id] = newnode; + } + + var graphcanvas = LGraphCanvas.active_canvas; + if (!graphcanvas.selected_nodes || Object.keys(graphcanvas.selected_nodes).length <= 1){ + fApplyMultiNode(node); + }else{ + for (var i in graphcanvas.selected_nodes) { + fApplyMultiNode(graphcanvas.selected_nodes[i]); + } + } + + if(Object.keys(newSelected).length){ + graphcanvas.selectNodes(newSelected); + } + + node.graph.afterChange(); + + node.setDirtyCanvas(true, true); + }; + + LGraphCanvas.node_colors = { + red: { color: "#322", bgcolor: "#533", groupcolor: "#A88" }, + brown: { color: "#332922", bgcolor: "#593930", groupcolor: "#b06634" }, + green: { color: "#232", bgcolor: "#353", groupcolor: "#8A8" }, + blue: { color: "#223", bgcolor: "#335", groupcolor: "#88A" }, + pale_blue: { + color: "#2a363b", + bgcolor: "#3f5159", + groupcolor: "#3f789e" + }, + cyan: { color: "#233", bgcolor: "#355", groupcolor: "#8AA" }, + purple: { color: "#323", bgcolor: "#535", groupcolor: "#a1309b" }, + yellow: { color: "#432", bgcolor: "#653", groupcolor: "#b58b2a" }, + black: { color: "#222", bgcolor: "#000", groupcolor: "#444" } + }; + + LGraphCanvas.prototype.getCanvasMenuOptions = function() { + var options = null; + var that = this; + if (this.getMenuOptions) { + options = this.getMenuOptions(); + } else { + options = [ + { + content: "Add Node", + has_submenu: true, + callback: LGraphCanvas.onMenuAdd + }, + { content: "Add Group", callback: LGraphCanvas.onGroupAdd }, + //{ content: "Arrange", callback: that.graph.arrange }, + //{content:"Collapse All", callback: LGraphCanvas.onMenuCollapseAll } + ]; + /*if (LiteGraph.showCanvasOptions){ + options.push({ content: "Options", callback: that.showShowGraphOptionsPanel }); + }*/ + + if (Object.keys(this.selected_nodes).length > 1) { + options.push({ + content: "Align", + has_submenu: true, + callback: LGraphCanvas.onGroupAlign, + }) + } + + if (this._graph_stack && this._graph_stack.length > 0) { + options.push(null, { + content: "Close subgraph", + callback: this.closeSubgraph.bind(this) + }); + } + } + + if (this.getExtraMenuOptions) { + var extra = this.getExtraMenuOptions(this, options); + if (extra) { + options = options.concat(extra); + } + } + + return options; + }; + + //called by processContextMenu to extract the menu list + LGraphCanvas.prototype.getNodeMenuOptions = function(node) { + var options = null; + + if (node.getMenuOptions) { + options = node.getMenuOptions(this); + } else { + options = [ + /* + { + content: "Inputs", + has_submenu: true, + disabled: true, + callback: LGraphCanvas.showMenuNodeOptionalInputs + }, + { + content: "Outputs", + has_submenu: true, + disabled: true, + callback: LGraphCanvas.showMenuNodeOptionalOutputs + }, + null, + { + content: "Properties", + has_submenu: true, + callback: LGraphCanvas.onShowMenuNodeProperties + }, + */ + null, + /* { + content: "Title", + callback: LGraphCanvas.onShowPropertyEditor + }, */ + /* + { + content: "Mode", + has_submenu: true, + callback: LGraphCanvas.onMenuNodeMode + }*/ + ]; + /* + if(node.resizable !== false){ + options.push({ + content: "Resize", callback: LGraphCanvas.onMenuResizeNode + }); + } + options.push( + { + content: "Collapse", + callback: LGraphCanvas.onMenuNodeCollapse + }, + { content: "Pin", callback: LGraphCanvas.onMenuNodePin }, + { + content: "Colors", + has_submenu: true, + callback: LGraphCanvas.onMenuNodeColors + }, + { + content: "Shapes", + has_submenu: true, + callback: LGraphCanvas.onMenuNodeShapes + }, + null + );*/ + } + + /* + if (node.onGetInputs) { + var inputs = node.onGetInputs(); + if (inputs && inputs.length) { + options[0].disabled = false; + } + } + + if (node.onGetOutputs) { + var outputs = node.onGetOutputs(); + if (outputs && outputs.length) { + options[1].disabled = false; + } + } */ + + if (node.getExtraMenuOptions) { + var extra = node.getExtraMenuOptions(this, options); + if (extra) { + extra.push(null); + options = extra.concat(options); + } + } + + if (node.clonable !== false) { + options.push({ + content: "Clone", + callback: LGraphCanvas.onMenuNodeClone + }); + } + + if(0) //TODO + options.push({ + content: "To Subgraph", + callback: LGraphCanvas.onMenuNodeToSubgraph + }); + + if (Object.keys(this.selected_nodes).length > 1) { + options.push({ + content: "Align Selected To", + has_submenu: true, + callback: LGraphCanvas.onNodeAlign, + }) + } + + options.push(null, { + content: "Remove", + disabled: !(node.removable !== false && !node.block_delete ), + callback: LGraphCanvas.onMenuNodeRemove + }); + + // TODO: Override this in application. + if (node.graph && node.graph.onGetNodeMenuOptions) { + node.graph.onGetNodeMenuOptions(options, node); + } + + return options; + }; + + LGraphCanvas.prototype.getGroupMenuOptions = function(node) { + var o = [ + { content: "Title", callback: LGraphCanvas.onShowPropertyEditor }, + { + content: "Color", + has_submenu: true, + callback: LGraphCanvas.onMenuNodeColors + }, + { + content: "Font size", + property: "font_size", + type: "Number", + callback: LGraphCanvas.onShowPropertyEditor + }, + null, + { content: "Remove", callback: LGraphCanvas.onMenuNodeRemove } + ]; + + return o; + }; + + LGraphCanvas.prototype.processContextMenu = function(node, event) { + var that = this; + var canvas = LGraphCanvas.active_canvas; + var ref_window = canvas.getCanvasWindow(); + + var menu_info = null; + var options = { + event: event, + callback: inner_option_clicked, + extra: node + }; + + if(node) + options.title = node.title; + + //check if mouse is in input + var slot = null; + if (node) { + slot = node.getSlotInPosition(event.canvasX, event.canvasY); + LGraphCanvas.active_node = node; + } + + if (slot) { + //on slot + menu_info = []; + if (node.getSlotMenuOptions) { + menu_info = node.getSlotMenuOptions(slot); + } else { + if ( + slot && + slot.output && + slot.output.links && + slot.output.links.length + ) { + menu_info.push({ content: "Disconnect Links", slot: slot }); + } + var _slot = slot.input || slot.output; + if (_slot.removable){ + menu_info.push( + _slot.locked + ? "Cannot remove" + : { content: "Remove Slot", slot: slot } + ); + } + if (!_slot.nameLocked){ + menu_info.push({ content: "Rename Slot", slot: slot }); + } + + } + options.title = + (slot.input ? slot.input.type : slot.output.type) || "*"; + if (slot.input && slot.input.type == LiteGraph.ACTION) { + options.title = "Action"; + } + if (slot.output && slot.output.type == LiteGraph.EVENT) { + options.title = "Event"; + } + } else { + if (node) { + //on node + menu_info = this.getNodeMenuOptions(node); + } else { + menu_info = this.getCanvasMenuOptions(); + var group = this.graph.getGroupOnPos( + event.canvasX, + event.canvasY + ); + if (group) { + //on group + menu_info.push(null, { + content: "Edit Group", + has_submenu: true, + submenu: { + title: "Group", + extra: group, + options: this.getGroupMenuOptions(group) + } + }); + } + } + } + + //show menu + if (!menu_info) { + return; + } + + var menu = new LiteGraph.ContextMenu(menu_info, options, ref_window); + + function inner_option_clicked(v, options, e) { + if (!v) { + return; + } + + if (v.content == "Remove Slot") { + var info = v.slot; + node.graph.beforeChange(); + if (info.input) { + node.removeInput(info.slot); + } else if (info.output) { + node.removeOutput(info.slot); + } + node.graph.afterChange(); + return; + } else if (v.content == "Disconnect Links") { + var info = v.slot; + node.graph.beforeChange(); + if (info.output) { + node.disconnectOutput(info.slot); + } else if (info.input) { + node.disconnectInput(info.slot); + } + node.graph.afterChange(); + return; + } else if (v.content == "Rename Slot") { + var info = v.slot; + var slot_info = info.input + ? node.getInputInfo(info.slot) + : node.getOutputInfo(info.slot); + var dialog = that.createDialog( + "Name", + options + ); + var input = dialog.querySelector("input"); + if (input && slot_info) { + input.value = slot_info.label || ""; + } + var inner = function(){ + node.graph.beforeChange(); + if (input.value) { + if (slot_info) { + slot_info.label = input.value; + } + that.setDirty(true); + } + dialog.close(); + node.graph.afterChange(); + } + dialog.querySelector("button").addEventListener("click", inner); + input.addEventListener("keydown", function(e) { + dialog.is_modified = true; + if (e.keyCode == 27) { + //ESC + dialog.close(); + } else if (e.keyCode == 13) { + inner(); // save + } else if (e.keyCode != 13 && e.target.localName != "textarea") { + return; + } + e.preventDefault(); + e.stopPropagation(); + }); + input.focus(); + } + + //if(v.callback) + // return v.callback.call(that, node, options, e, menu, that, event ); + } + }; + + //API ************************************************* + function compareObjects(a, b) { + for (var i in a) { + if (a[i] != b[i]) { + return false; + } + } + return true; + } + LiteGraph.compareObjects = compareObjects; + + function distance(a, b) { + return Math.sqrt( + (b[0] - a[0]) * (b[0] - a[0]) + (b[1] - a[1]) * (b[1] - a[1]) + ); + } + LiteGraph.distance = distance; + + function colorToString(c) { + return ( + "rgba(" + + Math.round(c[0] * 255).toFixed() + + "," + + Math.round(c[1] * 255).toFixed() + + "," + + Math.round(c[2] * 255).toFixed() + + "," + + (c.length == 4 ? c[3].toFixed(2) : "1.0") + + ")" + ); + } + LiteGraph.colorToString = colorToString; + + function isInsideRectangle(x, y, left, top, width, height) { + if (left < x && left + width > x && top < y && top + height > y) { + return true; + } + return false; + } + LiteGraph.isInsideRectangle = isInsideRectangle; + + //[minx,miny,maxx,maxy] + function growBounding(bounding, x, y) { + if (x < bounding[0]) { + bounding[0] = x; + } else if (x > bounding[2]) { + bounding[2] = x; + } + + if (y < bounding[1]) { + bounding[1] = y; + } else if (y > bounding[3]) { + bounding[3] = y; + } + } + LiteGraph.growBounding = growBounding; + + //point inside bounding box + function isInsideBounding(p, bb) { + if ( + p[0] < bb[0][0] || + p[1] < bb[0][1] || + p[0] > bb[1][0] || + p[1] > bb[1][1] + ) { + return false; + } + return true; + } + LiteGraph.isInsideBounding = isInsideBounding; + + //bounding overlap, format: [ startx, starty, width, height ] + function overlapBounding(a, b) { + var A_end_x = a[0] + a[2]; + var A_end_y = a[1] + a[3]; + var B_end_x = b[0] + b[2]; + var B_end_y = b[1] + b[3]; + + if ( + a[0] > B_end_x || + a[1] > B_end_y || + A_end_x < b[0] || + A_end_y < b[1] + ) { + return false; + } + return true; + } + LiteGraph.overlapBounding = overlapBounding; + + //Convert a hex value to its decimal value - the inputted hex must be in the + // format of a hex triplet - the kind we use for HTML colours. The function + // will return an array with three values. + function hex2num(hex) { + if (hex.charAt(0) == "#") { + hex = hex.slice(1); + } //Remove the '#' char - if there is one. + hex = hex.toUpperCase(); + var hex_alphabets = "0123456789ABCDEF"; + var value = new Array(3); + var k = 0; + var int1, int2; + for (var i = 0; i < 6; i += 2) { + int1 = hex_alphabets.indexOf(hex.charAt(i)); + int2 = hex_alphabets.indexOf(hex.charAt(i + 1)); + value[k] = int1 * 16 + int2; + k++; + } + return value; + } + + LiteGraph.hex2num = hex2num; + + //Give a array with three values as the argument and the function will return + // the corresponding hex triplet. + function num2hex(triplet) { + var hex_alphabets = "0123456789ABCDEF"; + var hex = "#"; + var int1, int2; + for (var i = 0; i < 3; i++) { + int1 = triplet[i] / 16; + int2 = triplet[i] % 16; + + hex += hex_alphabets.charAt(int1) + hex_alphabets.charAt(int2); + } + return hex; + } + + LiteGraph.num2hex = num2hex; + + /* LiteGraph GUI elements used for canvas editing *************************************/ + + /** + * ContextMenu from LiteGUI + * + * @class ContextMenu + * @constructor + * @param {Array} values (allows object { title: "Nice text", callback: function ... }) + * @param {Object} options [optional] Some options:\ + * - title: title to show on top of the menu + * - callback: function to call when an option is clicked, it receives the item information + * - ignore_item_callbacks: ignores the callback inside the item, it just calls the options.callback + * - event: you can pass a MouseEvent, this way the ContextMenu appears in that position + */ + function ContextMenu(values, options) { + options = options || {}; + this.options = options; + var that = this; + + //to link a menu with its parent + if (options.parentMenu) { + if (options.parentMenu.constructor !== this.constructor) { + console.error( + "parentMenu must be of class ContextMenu, ignoring it" + ); + options.parentMenu = null; + } else { + this.parentMenu = options.parentMenu; + this.parentMenu.lock = true; + this.parentMenu.current_submenu = this; + } + } + + var eventClass = null; + if(options.event) //use strings because comparing classes between windows doesnt work + eventClass = options.event.constructor.name; + if ( eventClass !== "MouseEvent" && + eventClass !== "CustomEvent" && + eventClass !== "PointerEvent" + ) { + console.error( + "Event passed to ContextMenu is not of type MouseEvent or CustomEvent. Ignoring it. ("+eventClass+")" + ); + options.event = null; + } + + var root = document.createElement("div"); + root.className = "litegraph litecontextmenu litemenubar-panel"; + if (options.className) { + root.className += " " + options.className; + } + root.style.minWidth = 100; + root.style.minHeight = 100; + root.style.pointerEvents = "none"; + setTimeout(function() { + root.style.pointerEvents = "auto"; + }, 100); //delay so the mouse up event is not caught by this element + + //this prevents the default context browser menu to open in case this menu was created when pressing right button + LiteGraph.pointerListenerAdd(root,"up", + function(e) { + //console.log("pointerevents: ContextMenu up root prevent"); + e.preventDefault(); + return true; + }, + true + ); + root.addEventListener( + "contextmenu", + function(e) { + if (e.button != 2) { + //right button + return false; + } + e.preventDefault(); + return false; + }, + true + ); + + LiteGraph.pointerListenerAdd(root,"down", + function(e) { + //console.log("pointerevents: ContextMenu down"); + if (e.button == 2) { + that.close(); + e.preventDefault(); + return true; + } + }, + true + ); + + function on_mouse_wheel(e) { + var pos = parseInt(root.style.top); + root.style.top = + (pos + e.deltaY * options.scroll_speed).toFixed() + "px"; + e.preventDefault(); + return true; + } + + if (!options.scroll_speed) { + options.scroll_speed = 0.1; + } + + root.addEventListener("wheel", on_mouse_wheel, true); + root.addEventListener("mousewheel", on_mouse_wheel, true); + + this.root = root; + + //title + if (options.title) { + var element = document.createElement("div"); + element.className = "litemenu-title"; + element.innerHTML = options.title; + root.appendChild(element); + } + + //entries + var num = 0; + for (var i=0; i < values.length; i++) { + var name = values.constructor == Array ? values[i] : i; + if (name != null && name.constructor !== String) { + name = name.content === undefined ? String(name) : name.content; + } + var value = values[i]; + this.addItem(name, value, options); + num++; + } + + //close on leave? touch enabled devices won't work TODO use a global device detector and condition on that + /*LiteGraph.pointerListenerAdd(root,"leave", function(e) { + console.log("pointerevents: ContextMenu leave"); + if (that.lock) { + return; + } + if (root.closing_timer) { + clearTimeout(root.closing_timer); + } + root.closing_timer = setTimeout(that.close.bind(that, e), 500); + //that.close(e); + });*/ + + LiteGraph.pointerListenerAdd(root,"enter", function(e) { + //console.log("pointerevents: ContextMenu enter"); + if (root.closing_timer) { + clearTimeout(root.closing_timer); + } + }); + + //insert before checking position + var root_document = document; + if (options.event) { + root_document = options.event.target.ownerDocument; + } + + if (!root_document) { + root_document = document; + } + + if( root_document.fullscreenElement ) + root_document.fullscreenElement.appendChild(root); + else + root_document.body.appendChild(root); + + //compute best position + var left = options.left || 0; + var top = options.top || 0; + if (options.event) { + left = options.event.clientX - 10; + top = options.event.clientY - 10; + if (options.title) { + top -= 20; + } + + if (options.parentMenu) { + var rect = options.parentMenu.root.getBoundingClientRect(); + left = rect.left + rect.width; + } + + var body_rect = document.body.getBoundingClientRect(); + var root_rect = root.getBoundingClientRect(); + if(body_rect.height == 0) + console.error("document.body height is 0. That is dangerous, set html,body { height: 100%; }"); + + if (body_rect.width && left > body_rect.width - root_rect.width - 10) { + left = body_rect.width - root_rect.width - 10; + } + if (body_rect.height && top > body_rect.height - root_rect.height - 10) { + top = body_rect.height - root_rect.height - 10; + } + } + + root.style.left = left + "px"; + root.style.top = top + "px"; + + if (options.scale) { + root.style.transform = "scale(" + options.scale + ")"; + } + } + + ContextMenu.prototype.addItem = function(name, value, options) { + var that = this; + options = options || {}; + + var element = document.createElement("div"); + element.className = "litemenu-entry submenu"; + + var disabled = false; + + if (value === null) { + element.classList.add("separator"); + //element.innerHTML = "
                            " + //continue; + } else { + element.innerHTML = value && value.title ? value.title : name; + element.value = value; + + if (value) { + if (value.disabled) { + disabled = true; + element.classList.add("disabled"); + } + if (value.submenu || value.has_submenu) { + element.classList.add("has_submenu"); + } + } + + if (typeof value == "function") { + element.dataset["value"] = name; + element.onclick_callback = value; + } else { + element.dataset["value"] = value; + } + + if (value.className) { + element.className += " " + value.className; + } + } + + this.root.appendChild(element); + if (!disabled) { + element.addEventListener("click", inner_onclick); + } + if (!disabled && options.autoopen) { + LiteGraph.pointerListenerAdd(element,"enter",inner_over); + } + + function inner_over(e) { + var value = this.value; + if (!value || !value.has_submenu) { + return; + } + //if it is a submenu, autoopen like the item was clicked + inner_onclick.call(this, e); + } + + //menu option clicked + function inner_onclick(e) { + var value = this.value; + var close_parent = true; + + if (that.current_submenu) { + that.current_submenu.close(e); + } + + //global callback + if (options.callback) { + var r = options.callback.call( + this, + value, + options, + e, + that, + options.node + ); + if (r === true) { + close_parent = false; + } + } + + //special cases + if (value) { + if ( + value.callback && + !options.ignore_item_callbacks && + value.disabled !== true + ) { + //item callback + var r = value.callback.call( + this, + value, + options, + e, + that, + options.extra + ); + if (r === true) { + close_parent = false; + } + } + if (value.submenu) { + if (!value.submenu.options) { + throw "ContextMenu submenu needs options"; + } + var submenu = new that.constructor(value.submenu.options, { + callback: value.submenu.callback, + event: e, + parentMenu: that, + ignore_item_callbacks: + value.submenu.ignore_item_callbacks, + title: value.submenu.title, + extra: value.submenu.extra, + autoopen: options.autoopen + }); + close_parent = false; + } + } + + if (close_parent && !that.lock) { + that.close(); + } + } + + return element; + }; + + ContextMenu.prototype.close = function(e, ignore_parent_menu) { + if (this.root.parentNode) { + this.root.parentNode.removeChild(this.root); + } + if (this.parentMenu && !ignore_parent_menu) { + this.parentMenu.lock = false; + this.parentMenu.current_submenu = null; + if (e === undefined) { + this.parentMenu.close(); + } else if ( + e && + !ContextMenu.isCursorOverElement(e, this.parentMenu.root) + ) { + ContextMenu.trigger(this.parentMenu.root, LiteGraph.pointerevents_method+"leave", e); + } + } + if (this.current_submenu) { + this.current_submenu.close(e, true); + } + + if (this.root.closing_timer) { + clearTimeout(this.root.closing_timer); + } + + // TODO implement : LiteGraph.contextMenuClosed(); :: keep track of opened / closed / current ContextMenu + // on key press, allow filtering/selecting the context menu elements + }; + + //this code is used to trigger events easily (used in the context menu mouseleave + ContextMenu.trigger = function(element, event_name, params, origin) { + var evt = document.createEvent("CustomEvent"); + evt.initCustomEvent(event_name, true, true, params); //canBubble, cancelable, detail + evt.srcElement = origin; + if (element.dispatchEvent) { + element.dispatchEvent(evt); + } else if (element.__events) { + element.__events.dispatchEvent(evt); + } + //else nothing seems binded here so nothing to do + return evt; + }; + + //returns the top most menu + ContextMenu.prototype.getTopMenu = function() { + if (this.options.parentMenu) { + return this.options.parentMenu.getTopMenu(); + } + return this; + }; + + ContextMenu.prototype.getFirstEvent = function() { + if (this.options.parentMenu) { + return this.options.parentMenu.getFirstEvent(); + } + return this.options.event; + }; + + ContextMenu.isCursorOverElement = function(event, element) { + var left = event.clientX; + var top = event.clientY; + var rect = element.getBoundingClientRect(); + if (!rect) { + return false; + } + if ( + top > rect.top && + top < rect.top + rect.height && + left > rect.left && + left < rect.left + rect.width + ) { + return true; + } + return false; + }; + + LiteGraph.ContextMenu = ContextMenu; + + LiteGraph.closeAllContextMenus = function(ref_window) { + ref_window = ref_window || window; + + var elements = ref_window.document.querySelectorAll(".litecontextmenu"); + if (!elements.length) { + return; + } + + var result = []; + for (var i = 0; i < elements.length; i++) { + result.push(elements[i]); + } + + for (var i=0; i < result.length; i++) { + if (result[i].close) { + result[i].close(); + } else if (result[i].parentNode) { + result[i].parentNode.removeChild(result[i]); + } + } + }; + + LiteGraph.extendClass = function(target, origin) { + for (var i in origin) { + //copy class properties + if (target.hasOwnProperty(i)) { + continue; + } + target[i] = origin[i]; + } + + if (origin.prototype) { + //copy prototype properties + for (var i in origin.prototype) { + //only enumerable + if (!origin.prototype.hasOwnProperty(i)) { + continue; + } + + if (target.prototype.hasOwnProperty(i)) { + //avoid overwriting existing ones + continue; + } + + //copy getters + if (origin.prototype.__lookupGetter__(i)) { + target.prototype.__defineGetter__( + i, + origin.prototype.__lookupGetter__(i) + ); + } else { + target.prototype[i] = origin.prototype[i]; + } + + //and setters + if (origin.prototype.__lookupSetter__(i)) { + target.prototype.__defineSetter__( + i, + origin.prototype.__lookupSetter__(i) + ); + } + } + } + }; + + //used by some widgets to render a curve editor + function CurveEditor( points ) + { + this.points = points; + this.selected = -1; + this.nearest = -1; + this.size = null; //stores last size used + this.must_update = true; + this.margin = 5; + } + + CurveEditor.sampleCurve = function(f,points) + { + if(!points) + return; + for(var i = 0; i < points.length - 1; ++i) + { + var p = points[i]; + var pn = points[i+1]; + if(pn[0] < f) + continue; + var r = (pn[0] - p[0]); + if( Math.abs(r) < 0.00001 ) + return p[1]; + var local_f = (f - p[0]) / r; + return p[1] * (1.0 - local_f) + pn[1] * local_f; + } + return 0; + } + + CurveEditor.prototype.draw = function( ctx, size, graphcanvas, background_color, line_color, inactive ) + { + var points = this.points; + if(!points) + return; + this.size = size; + var w = size[0] - this.margin * 2; + var h = size[1] - this.margin * 2; + + line_color = line_color || "#666"; + + ctx.save(); + ctx.translate(this.margin,this.margin); + + if(background_color) + { + ctx.fillStyle = "#111"; + ctx.fillRect(0,0,w,h); + ctx.fillStyle = "#222"; + ctx.fillRect(w*0.5,0,1,h); + ctx.strokeStyle = "#333"; + ctx.strokeRect(0,0,w,h); + } + ctx.strokeStyle = line_color; + if(inactive) + ctx.globalAlpha = 0.5; + ctx.beginPath(); + for(var i = 0; i < points.length; ++i) + { + var p = points[i]; + ctx.lineTo( p[0] * w, (1.0 - p[1]) * h ); + } + ctx.stroke(); + ctx.globalAlpha = 1; + if(!inactive) + for(var i = 0; i < points.length; ++i) + { + var p = points[i]; + ctx.fillStyle = this.selected == i ? "#FFF" : (this.nearest == i ? "#DDD" : "#AAA"); + ctx.beginPath(); + ctx.arc( p[0] * w, (1.0 - p[1]) * h, 2, 0, Math.PI * 2 ); + ctx.fill(); + } + ctx.restore(); + } + + //localpos is mouse in curve editor space + CurveEditor.prototype.onMouseDown = function( localpos, graphcanvas ) + { + var points = this.points; + if(!points) + return; + if( localpos[1] < 0 ) + return; + + //this.captureInput(true); + var w = this.size[0] - this.margin * 2; + var h = this.size[1] - this.margin * 2; + var x = localpos[0] - this.margin; + var y = localpos[1] - this.margin; + var pos = [x,y]; + var max_dist = 30 / graphcanvas.ds.scale; + //search closer one + this.selected = this.getCloserPoint(pos, max_dist); + //create one + if(this.selected == -1) + { + var point = [x / w, 1 - y / h]; + points.push(point); + points.sort(function(a,b){ return a[0] - b[0]; }); + this.selected = points.indexOf(point); + this.must_update = true; + } + if(this.selected != -1) + return true; + } + + CurveEditor.prototype.onMouseMove = function( localpos, graphcanvas ) + { + var points = this.points; + if(!points) + return; + var s = this.selected; + if(s < 0) + return; + var x = (localpos[0] - this.margin) / (this.size[0] - this.margin * 2 ); + var y = (localpos[1] - this.margin) / (this.size[1] - this.margin * 2 ); + var curvepos = [(localpos[0] - this.margin),(localpos[1] - this.margin)]; + var max_dist = 30 / graphcanvas.ds.scale; + this._nearest = this.getCloserPoint(curvepos, max_dist); + var point = points[s]; + if(point) + { + var is_edge_point = s == 0 || s == points.length - 1; + if( !is_edge_point && (localpos[0] < -10 || localpos[0] > this.size[0] + 10 || localpos[1] < -10 || localpos[1] > this.size[1] + 10) ) + { + points.splice(s,1); + this.selected = -1; + return; + } + if( !is_edge_point ) //not edges + point[0] = clamp(x, 0, 1); + else + point[0] = s == 0 ? 0 : 1; + point[1] = 1.0 - clamp(y, 0, 1); + points.sort(function(a,b){ return a[0] - b[0]; }); + this.selected = points.indexOf(point); + this.must_update = true; + } + } + + CurveEditor.prototype.onMouseUp = function( localpos, graphcanvas ) + { + this.selected = -1; + return false; + } + + CurveEditor.prototype.getCloserPoint = function(pos, max_dist) + { + var points = this.points; + if(!points) + return -1; + max_dist = max_dist || 30; + var w = (this.size[0] - this.margin * 2); + var h = (this.size[1] - this.margin * 2); + var num = points.length; + var p2 = [0,0]; + var min_dist = 1000000; + var closest = -1; + var last_valid = -1; + for(var i = 0; i < num; ++i) + { + var p = points[i]; + p2[0] = p[0] * w; + p2[1] = (1.0 - p[1]) * h; + if(p2[0] < pos[0]) + last_valid = i; + var dist = vec2.distance(pos,p2); + if(dist > min_dist || dist > max_dist) + continue; + closest = i; + min_dist = dist; + } + return closest; + } + + LiteGraph.CurveEditor = CurveEditor; + + //used to create nodes from wrapping functions + LiteGraph.getParameterNames = function(func) { + return (func + "") + .replace(/[/][/].*$/gm, "") // strip single-line comments + .replace(/\s+/g, "") // strip white space + .replace(/[/][*][^/*]*[*][/]/g, "") // strip multi-line comments /**/ + .split("){", 1)[0] + .replace(/^[^(]*[(]/, "") // extract the parameters + .replace(/=[^,]+/g, "") // strip any ES6 defaults + .split(",") + .filter(Boolean); // split & filter [""] + }; + + /* helper for interaction: pointer, touch, mouse Listeners + used by LGraphCanvas DragAndScale ContextMenu*/ + LiteGraph.pointerListenerAdd = function(oDOM, sEvIn, fCall, capture=false) { + if (!oDOM || !oDOM.addEventListener || !sEvIn || typeof fCall!=="function"){ + //console.log("cant pointerListenerAdd "+oDOM+", "+sEvent+", "+fCall); + return; // -- break -- + } + + var sMethod = LiteGraph.pointerevents_method; + var sEvent = sEvIn; + + // UNDER CONSTRUCTION + // convert pointerevents to touch event when not available + if (sMethod=="pointer" && !window.PointerEvent){ + console.warn("sMethod=='pointer' && !window.PointerEvent"); + console.log("Converting pointer["+sEvent+"] : down move up cancel enter TO touchstart touchmove touchend, etc .."); + switch(sEvent){ + case "down":{ + sMethod = "touch"; + sEvent = "start"; + break; + } + case "move":{ + sMethod = "touch"; + //sEvent = "move"; + break; + } + case "up":{ + sMethod = "touch"; + sEvent = "end"; + break; + } + case "cancel":{ + sMethod = "touch"; + //sEvent = "cancel"; + break; + } + case "enter":{ + console.log("debug: Should I send a move event?"); // ??? + break; + } + // case "over": case "out": not used at now + default:{ + console.warn("PointerEvent not available in this browser ? The event "+sEvent+" would not be called"); + } + } + } + + switch(sEvent){ + //both pointer and move events + case "down": case "up": case "move": case "over": case "out": case "enter": + { + oDOM.addEventListener(sMethod+sEvent, fCall, capture); + } + // only pointerevents + case "leave": case "cancel": case "gotpointercapture": case "lostpointercapture": + { + if (sMethod!="mouse"){ + return oDOM.addEventListener(sMethod+sEvent, fCall, capture); + } + } + // not "pointer" || "mouse" + default: + return oDOM.addEventListener(sEvent, fCall, capture); + } + } + LiteGraph.pointerListenerRemove = function(oDOM, sEvent, fCall, capture=false) { + if (!oDOM || !oDOM.removeEventListener || !sEvent || typeof fCall!=="function"){ + //console.log("cant pointerListenerRemove "+oDOM+", "+sEvent+", "+fCall); + return; // -- break -- + } + switch(sEvent){ + //both pointer and move events + case "down": case "up": case "move": case "over": case "out": case "enter": + { + if (LiteGraph.pointerevents_method=="pointer" || LiteGraph.pointerevents_method=="mouse"){ + oDOM.removeEventListener(LiteGraph.pointerevents_method+sEvent, fCall, capture); + } + } + // only pointerevents + case "leave": case "cancel": case "gotpointercapture": case "lostpointercapture": + { + if (LiteGraph.pointerevents_method=="pointer"){ + return oDOM.removeEventListener(LiteGraph.pointerevents_method+sEvent, fCall, capture); + } + } + // not "pointer" || "mouse" + default: + return oDOM.removeEventListener(sEvent, fCall, capture); + } + } + + function clamp(v, a, b) { + return a > v ? a : b < v ? b : v; + }; + global.clamp = clamp; + + if (typeof window != "undefined" && !window["requestAnimationFrame"]) { + window.requestAnimationFrame = + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + function(callback) { + window.setTimeout(callback, 1000 / 60); + }; + } +})(this); + +if (typeof exports != "undefined") { + exports.LiteGraph = this.LiteGraph; + exports.LGraph = this.LGraph; + exports.LLink = this.LLink; + exports.LGraphNode = this.LGraphNode; + exports.LGraphGroup = this.LGraphGroup; + exports.DragAndScale = this.DragAndScale; + exports.LGraphCanvas = this.LGraphCanvas; + exports.ContextMenu = this.ContextMenu; +} + diff --git a/javascript/materialxtoy/litegraph/math.js b/javascript/materialxtoy/litegraph/math.js new file mode 100644 index 00000000..d60e3bd6 --- /dev/null +++ b/javascript/materialxtoy/litegraph/math.js @@ -0,0 +1,1333 @@ +(function(global) { + var LiteGraph = global.LiteGraph; + + //Converter + function Converter() { + this.addInput("in", 0); + this.addOutput("out", 0); + this.size = [80, 30]; + } + + Converter.title = "Converter"; + Converter.desc = "type A to type B"; + + Converter.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + return; + } + + if (this.outputs) { + for (var i = 0; i < this.outputs.length; i++) { + var output = this.outputs[i]; + if (!output.links || !output.links.length) { + continue; + } + + var result = null; + switch (output.name) { + case "number": + result = v.length ? v[0] : parseFloat(v); + break; + case "vec2": + case "vec3": + case "vec4": + var result = null; + var count = 1; + switch (output.name) { + case "vec2": + count = 2; + break; + case "vec3": + count = 3; + break; + case "vec4": + count = 4; + break; + } + + var result = new Float32Array(count); + if (v.length) { + for ( + var j = 0; + j < v.length && j < result.length; + j++ + ) { + result[j] = v[j]; + } + } else { + result[0] = parseFloat(v); + } + break; + } + this.setOutputData(i, result); + } + } + }; + + Converter.prototype.onGetOutputs = function() { + return [ + ["number", "number"], + ["vec2", "vec2"], + ["vec3", "vec3"], + ["vec4", "vec4"] + ]; + }; + + LiteGraph.registerNodeType("math/converter", Converter); + + //Bypass + function Bypass() { + this.addInput("in"); + this.addOutput("out"); + this.size = [80, 30]; + } + + Bypass.title = "Bypass"; + Bypass.desc = "removes the type"; + + Bypass.prototype.onExecute = function() { + var v = this.getInputData(0); + this.setOutputData(0, v); + }; + + LiteGraph.registerNodeType("math/bypass", Bypass); + + function ToNumber() { + this.addInput("in"); + this.addOutput("out"); + } + + ToNumber.title = "to Number"; + ToNumber.desc = "Cast to number"; + + ToNumber.prototype.onExecute = function() { + var v = this.getInputData(0); + this.setOutputData(0, Number(v)); + }; + + LiteGraph.registerNodeType("math/to_number", ToNumber); + + function MathRange() { + this.addInput("in", "number", { locked: true }); + this.addOutput("out", "number", { locked: true }); + this.addOutput("clamped", "number", { locked: true }); + + this.addProperty("in", 0); + this.addProperty("in_min", 0); + this.addProperty("in_max", 1); + this.addProperty("out_min", 0); + this.addProperty("out_max", 1); + + this.size = [120, 50]; + } + + MathRange.title = "Range"; + MathRange.desc = "Convert a number from one range to another"; + + MathRange.prototype.getTitle = function() { + if (this.flags.collapsed) { + return (this._last_v || 0).toFixed(2); + } + return this.title; + }; + + MathRange.prototype.onExecute = function() { + if (this.inputs) { + for (var i = 0; i < this.inputs.length; i++) { + var input = this.inputs[i]; + var v = this.getInputData(i); + if (v === undefined) { + continue; + } + this.properties[input.name] = v; + } + } + + var v = this.properties["in"]; + if (v === undefined || v === null || v.constructor !== Number) { + v = 0; + } + + var in_min = this.properties.in_min; + var in_max = this.properties.in_max; + var out_min = this.properties.out_min; + var out_max = this.properties.out_max; + /* + if( in_min > in_max ) + { + in_min = in_max; + in_max = this.properties.in_min; + } + if( out_min > out_max ) + { + out_min = out_max; + out_max = this.properties.out_min; + } + */ + + this._last_v = ((v - in_min) / (in_max - in_min)) * (out_max - out_min) + out_min; + this.setOutputData(0, this._last_v); + this.setOutputData(1, clamp( this._last_v, out_min, out_max )); + }; + + MathRange.prototype.onDrawBackground = function(ctx) { + //show the current value + if (this._last_v) { + this.outputs[0].label = this._last_v.toFixed(3); + } else { + this.outputs[0].label = "?"; + } + }; + + MathRange.prototype.onGetInputs = function() { + return [ + ["in_min", "number"], + ["in_max", "number"], + ["out_min", "number"], + ["out_max", "number"] + ]; + }; + + LiteGraph.registerNodeType("math/range", MathRange); + + function MathRand() { + this.addOutput("value", "number"); + this.addProperty("min", 0); + this.addProperty("max", 1); + this.size = [80, 30]; + } + + MathRand.title = "Rand"; + MathRand.desc = "Random number"; + + MathRand.prototype.onExecute = function() { + if (this.inputs) { + for (var i = 0; i < this.inputs.length; i++) { + var input = this.inputs[i]; + var v = this.getInputData(i); + if (v === undefined) { + continue; + } + this.properties[input.name] = v; + } + } + + var min = this.properties.min; + var max = this.properties.max; + this._last_v = Math.random() * (max - min) + min; + this.setOutputData(0, this._last_v); + }; + + MathRand.prototype.onDrawBackground = function(ctx) { + //show the current value + this.outputs[0].label = (this._last_v || 0).toFixed(3); + }; + + MathRand.prototype.onGetInputs = function() { + return [["min", "number"], ["max", "number"]]; + }; + + LiteGraph.registerNodeType("math/rand", MathRand); + + //basic continuous noise + function MathNoise() { + this.addInput("in", "number"); + this.addOutput("out", "number"); + this.addProperty("min", 0); + this.addProperty("max", 1); + this.addProperty("smooth", true); + this.addProperty("seed", 0); + this.addProperty("octaves", 1); + this.addProperty("persistence", 0.8); + this.addProperty("speed", 1); + this.size = [90, 30]; + } + + MathNoise.title = "Noise"; + MathNoise.desc = "Random number with temporal continuity"; + MathNoise.data = null; + + MathNoise.getValue = function(f, smooth) { + if (!MathNoise.data) { + MathNoise.data = new Float32Array(1024); + for (var i = 0; i < MathNoise.data.length; ++i) { + MathNoise.data[i] = Math.random(); + } + } + f = f % 1024; + if (f < 0) { + f += 1024; + } + var f_min = Math.floor(f); + var f = f - f_min; + var r1 = MathNoise.data[f_min]; + var r2 = MathNoise.data[f_min == 1023 ? 0 : f_min + 1]; + if (smooth) { + f = f * f * f * (f * (f * 6.0 - 15.0) + 10.0); + } + return r1 * (1 - f) + r2 * f; + }; + + MathNoise.prototype.onExecute = function() { + var f = this.getInputData(0) || 0; + var iterations = this.properties.octaves || 1; + var r = 0; + var amp = 1; + var seed = this.properties.seed || 0; + f += seed; + var speed = this.properties.speed || 1; + var total_amp = 0; + for(var i = 0; i < iterations; ++i) + { + r += MathNoise.getValue(f * (1+i) * speed, this.properties.smooth) * amp; + total_amp += amp; + amp *= this.properties.persistence; + if(amp < 0.001) + break; + } + r /= total_amp; + var min = this.properties.min; + var max = this.properties.max; + this._last_v = r * (max - min) + min; + this.setOutputData(0, this._last_v); + }; + + MathNoise.prototype.onDrawBackground = function(ctx) { + //show the current value + this.outputs[0].label = (this._last_v || 0).toFixed(3); + }; + + LiteGraph.registerNodeType("math/noise", MathNoise); + + //generates spikes every random time + function MathSpikes() { + this.addOutput("out", "number"); + this.addProperty("min_time", 1); + this.addProperty("max_time", 2); + this.addProperty("duration", 0.2); + this.size = [90, 30]; + this._remaining_time = 0; + this._blink_time = 0; + } + + MathSpikes.title = "Spikes"; + MathSpikes.desc = "spike every random time"; + + MathSpikes.prototype.onExecute = function() { + var dt = this.graph.elapsed_time; //in secs + + this._remaining_time -= dt; + this._blink_time -= dt; + + var v = 0; + if (this._blink_time > 0) { + var f = this._blink_time / this.properties.duration; + v = 1 / (Math.pow(f * 8 - 4, 4) + 1); + } + + if (this._remaining_time < 0) { + this._remaining_time = + Math.random() * + (this.properties.max_time - this.properties.min_time) + + this.properties.min_time; + this._blink_time = this.properties.duration; + this.boxcolor = "#FFF"; + } else { + this.boxcolor = "#000"; + } + this.setOutputData(0, v); + }; + + LiteGraph.registerNodeType("math/spikes", MathSpikes); + + //Math clamp + function MathClamp() { + this.addInput("in", "number"); + this.addOutput("out", "number"); + this.size = [80, 30]; + this.addProperty("min", 0); + this.addProperty("max", 1); + } + + MathClamp.title = "Clamp"; + MathClamp.desc = "Clamp number between min and max"; + //MathClamp.filter = "shader"; + + MathClamp.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + return; + } + v = Math.max(this.properties.min, v); + v = Math.min(this.properties.max, v); + this.setOutputData(0, v); + }; + + MathClamp.prototype.getCode = function(lang) { + var code = ""; + if (this.isInputConnected(0)) { + code += + "clamp({{0}}," + + this.properties.min + + "," + + this.properties.max + + ")"; + } + return code; + }; + + LiteGraph.registerNodeType("math/clamp", MathClamp); + + //Math ABS + function MathLerp() { + this.properties = { f: 0.5 }; + this.addInput("A", "number"); + this.addInput("B", "number"); + + this.addOutput("out", "number"); + } + + MathLerp.title = "Lerp"; + MathLerp.desc = "Linear Interpolation"; + + MathLerp.prototype.onExecute = function() { + var v1 = this.getInputData(0); + if (v1 == null) { + v1 = 0; + } + var v2 = this.getInputData(1); + if (v2 == null) { + v2 = 0; + } + + var f = this.properties.f; + + var _f = this.getInputData(2); + if (_f !== undefined) { + f = _f; + } + + this.setOutputData(0, v1 * (1 - f) + v2 * f); + }; + + MathLerp.prototype.onGetInputs = function() { + return [["f", "number"]]; + }; + + LiteGraph.registerNodeType("math/lerp", MathLerp); + + //Math ABS + function MathAbs() { + this.addInput("in", "number"); + this.addOutput("out", "number"); + this.size = [80, 30]; + } + + MathAbs.title = "Abs"; + MathAbs.desc = "Absolute"; + + MathAbs.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + return; + } + this.setOutputData(0, Math.abs(v)); + }; + + LiteGraph.registerNodeType("math/abs", MathAbs); + + //Math Floor + function MathFloor() { + this.addInput("in", "number"); + this.addOutput("out", "number"); + this.size = [80, 30]; + } + + MathFloor.title = "Floor"; + MathFloor.desc = "Floor number to remove fractional part"; + + MathFloor.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + return; + } + this.setOutputData(0, Math.floor(v)); + }; + + LiteGraph.registerNodeType("math/floor", MathFloor); + + //Math frac + function MathFrac() { + this.addInput("in", "number"); + this.addOutput("out", "number"); + this.size = [80, 30]; + } + + MathFrac.title = "Frac"; + MathFrac.desc = "Returns fractional part"; + + MathFrac.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + return; + } + this.setOutputData(0, v % 1); + }; + + LiteGraph.registerNodeType("math/frac", MathFrac); + + //Math Floor + function MathSmoothStep() { + this.addInput("in", "number"); + this.addOutput("out", "number"); + this.size = [80, 30]; + this.properties = { A: 0, B: 1 }; + } + + MathSmoothStep.title = "Smoothstep"; + MathSmoothStep.desc = "Smoothstep"; + + MathSmoothStep.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v === undefined) { + return; + } + + var edge0 = this.properties.A; + var edge1 = this.properties.B; + + // Scale, bias and saturate x to 0..1 range + v = clamp((v - edge0) / (edge1 - edge0), 0.0, 1.0); + // Evaluate polynomial + v = v * v * (3 - 2 * v); + + this.setOutputData(0, v); + }; + + LiteGraph.registerNodeType("math/smoothstep", MathSmoothStep); + + //Math scale + function MathScale() { + this.addInput("in", "number", { label: "" }); + this.addOutput("out", "number", { label: "" }); + this.size = [80, 30]; + this.addProperty("factor", 1); + } + + MathScale.title = "Scale"; + MathScale.desc = "v * factor"; + + MathScale.prototype.onExecute = function() { + var value = this.getInputData(0); + if (value != null) { + this.setOutputData(0, value * this.properties.factor); + } + }; + + LiteGraph.registerNodeType("math/scale", MathScale); + + //Gate + function Gate() { + this.addInput("v","boolean"); + this.addInput("A"); + this.addInput("B"); + this.addOutput("out"); + } + + Gate.title = "Gate"; + Gate.desc = "if v is true, then outputs A, otherwise B"; + + Gate.prototype.onExecute = function() { + var v = this.getInputData(0); + this.setOutputData(0, this.getInputData( v ? 1 : 2 )); + }; + + LiteGraph.registerNodeType("math/gate", Gate); + + + //Math Average + function MathAverageFilter() { + this.addInput("in", "number"); + this.addOutput("out", "number"); + this.size = [80, 30]; + this.addProperty("samples", 10); + this._values = new Float32Array(10); + this._current = 0; + } + + MathAverageFilter.title = "Average"; + MathAverageFilter.desc = "Average Filter"; + + MathAverageFilter.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + v = 0; + } + + var num_samples = this._values.length; + + this._values[this._current % num_samples] = v; + this._current += 1; + if (this._current > num_samples) { + this._current = 0; + } + + var avr = 0; + for (var i = 0; i < num_samples; ++i) { + avr += this._values[i]; + } + + this.setOutputData(0, avr / num_samples); + }; + + MathAverageFilter.prototype.onPropertyChanged = function(name, value) { + if (value < 1) { + value = 1; + } + this.properties.samples = Math.round(value); + var old = this._values; + + this._values = new Float32Array(this.properties.samples); + if (old.length <= this._values.length) { + this._values.set(old); + } else { + this._values.set(old.subarray(0, this._values.length)); + } + }; + + LiteGraph.registerNodeType("math/average", MathAverageFilter); + + //Math + function MathTendTo() { + this.addInput("in", "number"); + this.addOutput("out", "number"); + this.addProperty("factor", 0.1); + this.size = [80, 30]; + this._value = null; + } + + MathTendTo.title = "TendTo"; + MathTendTo.desc = "moves the output value always closer to the input"; + + MathTendTo.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + v = 0; + } + var f = this.properties.factor; + if (this._value == null) { + this._value = v; + } else { + this._value = this._value * (1 - f) + v * f; + } + this.setOutputData(0, this._value); + }; + + LiteGraph.registerNodeType("math/tendTo", MathTendTo); + + //Math operation + function MathOperation() { + this.addInput("A", "number,array,object"); + this.addInput("B", "number"); + this.addOutput("=", "number"); + this.addProperty("A", 1); + this.addProperty("B", 1); + this.addProperty("OP", "+", "enum", { values: MathOperation.values }); + this._func = MathOperation.funcs[this.properties.OP]; + this._result = []; //only used for arrays + } + + MathOperation.values = ["+", "-", "*", "/", "%", "^", "max", "min"]; + MathOperation.funcs = { + "+": function(A,B) { return A + B; }, + "-": function(A,B) { return A - B; }, + "x": function(A,B) { return A * B; }, + "X": function(A,B) { return A * B; }, + "*": function(A,B) { return A * B; }, + "/": function(A,B) { return A / B; }, + "%": function(A,B) { return A % B; }, + "^": function(A,B) { return Math.pow(A, B); }, + "max": function(A,B) { return Math.max(A, B); }, + "min": function(A,B) { return Math.min(A, B); } + }; + + MathOperation.title = "Operation"; + MathOperation.desc = "Easy math operators"; + MathOperation["@OP"] = { + type: "enum", + title: "operation", + values: MathOperation.values + }; + MathOperation.size = [100, 60]; + + MathOperation.prototype.getTitle = function() { + if(this.properties.OP == "max" || this.properties.OP == "min") + return this.properties.OP + "(A,B)"; + return "A " + this.properties.OP + " B"; + }; + + MathOperation.prototype.setValue = function(v) { + if (typeof v == "string") { + v = parseFloat(v); + } + this.properties["value"] = v; + }; + + MathOperation.prototype.onPropertyChanged = function(name, value) + { + if (name != "OP") + return; + this._func = MathOperation.funcs[this.properties.OP]; + if(!this._func) + { + console.warn("Unknown operation: " + this.properties.OP); + this._func = function(A) { return A; }; + } + } + + MathOperation.prototype.onExecute = function() { + var A = this.getInputData(0); + var B = this.getInputData(1); + if ( A != null ) { + if( A.constructor === Number ) + this.properties["A"] = A; + } else { + A = this.properties["A"]; + } + + if (B != null) { + this.properties["B"] = B; + } else { + B = this.properties["B"]; + } + + var func = MathOperation.funcs[this.properties.OP]; + + var result; + if(A.constructor === Number) + { + result = 0; + result = func(A,B); + } + else if(A.constructor === Array) + { + result = this._result; + result.length = A.length; + for(var i = 0; i < A.length; ++i) + result[i] = func(A[i],B); + } + else + { + result = {}; + for(var i in A) + result[i] = func(A[i],B); + } + this.setOutputData(0, result); + }; + + MathOperation.prototype.onDrawBackground = function(ctx) { + if (this.flags.collapsed) { + return; + } + + ctx.font = "40px Arial"; + ctx.fillStyle = "#666"; + ctx.textAlign = "center"; + ctx.fillText( + this.properties.OP, + this.size[0] * 0.5, + (this.size[1] + LiteGraph.NODE_TITLE_HEIGHT) * 0.5 + ); + ctx.textAlign = "left"; + }; + + LiteGraph.registerNodeType("math/operation", MathOperation); + + LiteGraph.registerSearchboxExtra("math/operation", "MAX", { + properties: {OP:"max"}, + title: "MAX()" + }); + + LiteGraph.registerSearchboxExtra("math/operation", "MIN", { + properties: {OP:"min"}, + title: "MIN()" + }); + + + //Math compare + function MathCompare() { + this.addInput("A", "number"); + this.addInput("B", "number"); + this.addOutput("A==B", "boolean"); + this.addOutput("A!=B", "boolean"); + this.addProperty("A", 0); + this.addProperty("B", 0); + } + + MathCompare.title = "Compare"; + MathCompare.desc = "compares between two values"; + + MathCompare.prototype.onExecute = function() { + var A = this.getInputData(0); + var B = this.getInputData(1); + if (A !== undefined) { + this.properties["A"] = A; + } else { + A = this.properties["A"]; + } + + if (B !== undefined) { + this.properties["B"] = B; + } else { + B = this.properties["B"]; + } + + for (var i = 0, l = this.outputs.length; i < l; ++i) { + var output = this.outputs[i]; + if (!output.links || !output.links.length) { + continue; + } + var value; + switch (output.name) { + case "A==B": + value = A == B; + break; + case "A!=B": + value = A != B; + break; + case "A>B": + value = A > B; + break; + case "A=B": + value = A >= B; + break; + } + this.setOutputData(i, value); + } + }; + + MathCompare.prototype.onGetOutputs = function() { + return [ + ["A==B", "boolean"], + ["A!=B", "boolean"], + ["A>B", "boolean"], + ["A=B", "boolean"], + ["A<=B", "boolean"] + ]; + }; + + LiteGraph.registerNodeType("math/compare", MathCompare); + + LiteGraph.registerSearchboxExtra("math/compare", "==", { + outputs: [["A==B", "boolean"]], + title: "A==B" + }); + LiteGraph.registerSearchboxExtra("math/compare", "!=", { + outputs: [["A!=B", "boolean"]], + title: "A!=B" + }); + LiteGraph.registerSearchboxExtra("math/compare", ">", { + outputs: [["A>B", "boolean"]], + title: "A>B" + }); + LiteGraph.registerSearchboxExtra("math/compare", "<", { + outputs: [["A=", { + outputs: [["A>=B", "boolean"]], + title: "A>=B" + }); + LiteGraph.registerSearchboxExtra("math/compare", "<=", { + outputs: [["A<=B", "boolean"]], + title: "A<=B" + }); + + function MathCondition() { + this.addInput("A", "number"); + this.addInput("B", "number"); + this.addOutput("true", "boolean"); + this.addOutput("false", "boolean"); + this.addProperty("A", 1); + this.addProperty("B", 1); + this.addProperty("OP", ">", "enum", { values: MathCondition.values }); + this.addWidget("combo","Cond.",this.properties.OP,{ property: "OP", values: MathCondition.values } ); + + this.size = [80, 60]; + } + + MathCondition.values = [">", "<", "==", "!=", "<=", ">=", "||", "&&" ]; + MathCondition["@OP"] = { + type: "enum", + title: "operation", + values: MathCondition.values + }; + + MathCondition.title = "Condition"; + MathCondition.desc = "evaluates condition between A and B"; + + MathCondition.prototype.getTitle = function() { + return "A " + this.properties.OP + " B"; + }; + + MathCondition.prototype.onExecute = function() { + var A = this.getInputData(0); + if (A === undefined) { + A = this.properties.A; + } else { + this.properties.A = A; + } + + var B = this.getInputData(1); + if (B === undefined) { + B = this.properties.B; + } else { + this.properties.B = B; + } + + var result = true; + switch (this.properties.OP) { + case ">": + result = A > B; + break; + case "<": + result = A < B; + break; + case "==": + result = A == B; + break; + case "!=": + result = A != B; + break; + case "<=": + result = A <= B; + break; + case ">=": + result = A >= B; + break; + case "||": + result = A || B; + break; + case "&&": + result = A && B; + break; + } + + this.setOutputData(0, result); + this.setOutputData(1, !result); + }; + + LiteGraph.registerNodeType("math/condition", MathCondition); + + + function MathBranch() { + this.addInput("in", 0); + this.addInput("cond", "boolean"); + this.addOutput("true", 0); + this.addOutput("false", 0); + this.size = [80, 60]; + } + + MathBranch.title = "Branch"; + MathBranch.desc = "If condition is true, outputs IN in true, otherwise in false"; + + MathBranch.prototype.onExecute = function() { + var V = this.getInputData(0); + var cond = this.getInputData(1); + + if(cond) + { + this.setOutputData(0, V); + this.setOutputData(1, null); + } + else + { + this.setOutputData(0, null); + this.setOutputData(1, V); + } + } + + LiteGraph.registerNodeType("math/branch", MathBranch); + + + function MathAccumulate() { + this.addInput("inc", "number"); + this.addOutput("total", "number"); + this.addProperty("increment", 1); + this.addProperty("value", 0); + } + + MathAccumulate.title = "Accumulate"; + MathAccumulate.desc = "Increments a value every time"; + + MathAccumulate.prototype.onExecute = function() { + if (this.properties.value === null) { + this.properties.value = 0; + } + + var inc = this.getInputData(0); + if (inc !== null) { + this.properties.value += inc; + } else { + this.properties.value += this.properties.increment; + } + this.setOutputData(0, this.properties.value); + }; + + LiteGraph.registerNodeType("math/accumulate", MathAccumulate); + + //Math Trigonometry + function MathTrigonometry() { + this.addInput("v", "number"); + this.addOutput("sin", "number"); + + this.addProperty("amplitude", 1); + this.addProperty("offset", 0); + this.bgImageUrl = "nodes/imgs/icon-sin.png"; + } + + MathTrigonometry.title = "Trigonometry"; + MathTrigonometry.desc = "Sin Cos Tan"; + //MathTrigonometry.filter = "shader"; + + MathTrigonometry.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + v = 0; + } + var amplitude = this.properties["amplitude"]; + var slot = this.findInputSlot("amplitude"); + if (slot != -1) { + amplitude = this.getInputData(slot); + } + var offset = this.properties["offset"]; + slot = this.findInputSlot("offset"); + if (slot != -1) { + offset = this.getInputData(slot); + } + + for (var i = 0, l = this.outputs.length; i < l; ++i) { + var output = this.outputs[i]; + var value; + switch (output.name) { + case "sin": + value = Math.sin(v); + break; + case "cos": + value = Math.cos(v); + break; + case "tan": + value = Math.tan(v); + break; + case "asin": + value = Math.asin(v); + break; + case "acos": + value = Math.acos(v); + break; + case "atan": + value = Math.atan(v); + break; + } + this.setOutputData(i, amplitude * value + offset); + } + }; + + MathTrigonometry.prototype.onGetInputs = function() { + return [["v", "number"], ["amplitude", "number"], ["offset", "number"]]; + }; + + MathTrigonometry.prototype.onGetOutputs = function() { + return [ + ["sin", "number"], + ["cos", "number"], + ["tan", "number"], + ["asin", "number"], + ["acos", "number"], + ["atan", "number"] + ]; + }; + + LiteGraph.registerNodeType("math/trigonometry", MathTrigonometry); + + LiteGraph.registerSearchboxExtra("math/trigonometry", "SIN()", { + outputs: [["sin", "number"]], + title: "SIN()" + }); + LiteGraph.registerSearchboxExtra("math/trigonometry", "COS()", { + outputs: [["cos", "number"]], + title: "COS()" + }); + LiteGraph.registerSearchboxExtra("math/trigonometry", "TAN()", { + outputs: [["tan", "number"]], + title: "TAN()" + }); + + //math library for safe math operations without eval + function MathFormula() { + this.addInput("x", "number"); + this.addInput("y", "number"); + this.addOutput("", "number"); + this.properties = { x: 1.0, y: 1.0, formula: "x+y" }; + this.code_widget = this.addWidget( + "text", + "F(x,y)", + this.properties.formula, + function(v, canvas, node) { + node.properties.formula = v; + } + ); + this.addWidget("toggle", "allow", LiteGraph.allow_scripts, function(v) { + LiteGraph.allow_scripts = v; + }); + this._func = null; + } + + MathFormula.title = "Formula"; + MathFormula.desc = "Compute formula"; + MathFormula.size = [160, 100]; + + MathAverageFilter.prototype.onPropertyChanged = function(name, value) { + if (name == "formula") { + this.code_widget.value = value; + } + }; + + MathFormula.prototype.onExecute = function() { + if (!LiteGraph.allow_scripts) { + return; + } + + var x = this.getInputData(0); + var y = this.getInputData(1); + if (x != null) { + this.properties["x"] = x; + } else { + x = this.properties["x"]; + } + + if (y != null) { + this.properties["y"] = y; + } else { + y = this.properties["y"]; + } + + var f = this.properties["formula"]; + + var value; + try { + if (!this._func || this._func_code != this.properties.formula) { + this._func = new Function( + "x", + "y", + "TIME", + "return " + this.properties.formula + ); + this._func_code = this.properties.formula; + } + value = this._func(x, y, this.graph.globaltime); + this.boxcolor = null; + } catch (err) { + this.boxcolor = "red"; + } + this.setOutputData(0, value); + }; + + MathFormula.prototype.getTitle = function() { + return this._func_code || "Formula"; + }; + + MathFormula.prototype.onDrawBackground = function() { + var f = this.properties["formula"]; + if (this.outputs && this.outputs.length) { + this.outputs[0].label = f; + } + }; + + LiteGraph.registerNodeType("math/formula", MathFormula); + + function Math3DVec2ToXY() { + this.addInput("vec2", "vec2"); + this.addOutput("x", "number"); + this.addOutput("y", "number"); + } + + Math3DVec2ToXY.title = "Vec2->XY"; + Math3DVec2ToXY.desc = "vector 2 to components"; + + Math3DVec2ToXY.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + return; + } + + this.setOutputData(0, v[0]); + this.setOutputData(1, v[1]); + }; + + LiteGraph.registerNodeType("math3d/vec2-to-xy", Math3DVec2ToXY); + + function Math3DXYToVec2() { + this.addInputs([["x", "number"], ["y", "number"]]); + this.addOutput("vec2", "vec2"); + this.properties = { x: 0, y: 0 }; + this._data = new Float32Array(2); + } + + Math3DXYToVec2.title = "XY->Vec2"; + Math3DXYToVec2.desc = "components to vector2"; + + Math3DXYToVec2.prototype.onExecute = function() { + var x = this.getInputData(0); + if (x == null) { + x = this.properties.x; + } + var y = this.getInputData(1); + if (y == null) { + y = this.properties.y; + } + + var data = this._data; + data[0] = x; + data[1] = y; + + this.setOutputData(0, data); + }; + + LiteGraph.registerNodeType("math3d/xy-to-vec2", Math3DXYToVec2); + + function Math3DVec3ToXYZ() { + this.addInput("vec3", "vec3"); + this.addOutput("x", "number"); + this.addOutput("y", "number"); + this.addOutput("z", "number"); + } + + Math3DVec3ToXYZ.title = "Vec3->XYZ"; + Math3DVec3ToXYZ.desc = "vector 3 to components"; + + Math3DVec3ToXYZ.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + return; + } + + this.setOutputData(0, v[0]); + this.setOutputData(1, v[1]); + this.setOutputData(2, v[2]); + }; + + LiteGraph.registerNodeType("math3d/vec3-to-xyz", Math3DVec3ToXYZ); + + function Math3DXYZToVec3() { + this.addInputs([["x", "number"], ["y", "number"], ["z", "number"]]); + this.addOutput("vec3", "vec3"); + this.properties = { x: 0, y: 0, z: 0 }; + this._data = new Float32Array(3); + } + + Math3DXYZToVec3.title = "XYZ->Vec3"; + Math3DXYZToVec3.desc = "components to vector3"; + + Math3DXYZToVec3.prototype.onExecute = function() { + var x = this.getInputData(0); + if (x == null) { + x = this.properties.x; + } + var y = this.getInputData(1); + if (y == null) { + y = this.properties.y; + } + var z = this.getInputData(2); + if (z == null) { + z = this.properties.z; + } + + var data = this._data; + data[0] = x; + data[1] = y; + data[2] = z; + + this.setOutputData(0, data); + }; + + LiteGraph.registerNodeType("math3d/xyz-to-vec3", Math3DXYZToVec3); + + function Math3DVec4ToXYZW() { + this.addInput("vec4", "vec4"); + this.addOutput("x", "number"); + this.addOutput("y", "number"); + this.addOutput("z", "number"); + this.addOutput("w", "number"); + } + + Math3DVec4ToXYZW.title = "Vec4->XYZW"; + Math3DVec4ToXYZW.desc = "vector 4 to components"; + + Math3DVec4ToXYZW.prototype.onExecute = function() { + var v = this.getInputData(0); + if (v == null) { + return; + } + + this.setOutputData(0, v[0]); + this.setOutputData(1, v[1]); + this.setOutputData(2, v[2]); + this.setOutputData(3, v[3]); + }; + + LiteGraph.registerNodeType("math3d/vec4-to-xyzw", Math3DVec4ToXYZW); + + function Math3DXYZWToVec4() { + this.addInputs([ + ["x", "number"], + ["y", "number"], + ["z", "number"], + ["w", "number"] + ]); + this.addOutput("vec4", "vec4"); + this.properties = { x: 0, y: 0, z: 0, w: 0 }; + this._data = new Float32Array(4); + } + + Math3DXYZWToVec4.title = "XYZW->Vec4"; + Math3DXYZWToVec4.desc = "components to vector4"; + + Math3DXYZWToVec4.prototype.onExecute = function() { + var x = this.getInputData(0); + if (x == null) { + x = this.properties.x; + } + var y = this.getInputData(1); + if (y == null) { + y = this.properties.y; + } + var z = this.getInputData(2); + if (z == null) { + z = this.properties.z; + } + var w = this.getInputData(3); + if (w == null) { + w = this.properties.w; + } + + var data = this._data; + data[0] = x; + data[1] = y; + data[2] = z; + data[3] = w; + + this.setOutputData(0, data); + }; + + LiteGraph.registerNodeType("math3d/xyzw-to-vec4", Math3DXYZWToVec4); + +})(this); diff --git a/javascript/materialxtoy/litegraph/style.css b/javascript/materialxtoy/litegraph/style.css new file mode 100644 index 00000000..feb73e77 --- /dev/null +++ b/javascript/materialxtoy/litegraph/style.css @@ -0,0 +1,260 @@ +html,body { + width: 100%; + height: 100%; + margin: 0; + padding: 0; +} + +body { + background-color: #333; + color: #EEE; + font: 14px Tahoma; +} + +h1 { + font-family: "Metro Light",Tahoma; +} + +h2 { + font-family: "Metro Light"; +} + +#main { + width: 100%; + height: 100%; + background-color: #222; +} + + +#status { + position: absolute; + top: 10px; + right: 10px; + color: #FAA; + font-size: 18px; + padding: 5px; + /*border-radius: 5px;*/ + width: -moz-calc( 50% - 30px); + min-height: 30px; + overflow: hidden; + background-color: #644; +} + +#help-message { + padding: 2px; + font-size: 0.8em; + background-color: #464; + /*border-radius: 2px;*/ +} + +#content { + position: relative; + min-height: 500px; + overflow: hidden; +} + +.fullscreen #content { + min-height: -moz-calc(100% - 80px); + min-height: -webkit-calc(100% - 80px); + min-height: calc(100% - 80px); +} + +.info-section p { + padding-left: 20px; + margin: 2px; +} + +.info-section strong { + color: #FEA; +} + +#visual { + position: absolute; + top: 0; + left: 0; + background-color: black; + width: 100%; + height: 100%; +} + + +.item-list .item { + margin: 5px; + padding: 5px; + font-size: 1.2em; + + background-color: transparent; + color: #999; + padding-left: 5px; + transition: background-color 300ms, color 300ms, padding-left 300ms; + -moz-transition: background-color 300ms, color 300ms, padding-left 300ms; + -webkit-transition: background-color 300ms, color 300ms, padding-left 300ms; +} + +.item-list .item:hover { + background-color: #33A; + /*border-radius: 4px;*/ + color: white; + padding-left: 15px; + transition: background-color 300ms, color 300ms, padding-left 300ms; + -moz-transition: background-color 300ms, color 300ms, padding-left 300ms; + -webkit-transition: background-color 300ms, color 300ms, padding-left 300ms; + cursor: pointer; +} + +#gallery .item-list .item:hover { + background-color: #A83; +} + +.item-list .item strong { + display: inline-block; + width: 200px; +} + +.form label { + font-size: 1.2em; + width: 200px; + display: inline-block; + text-align: right; +} + +label { + font-weight: bold; + color: #AAF; +} + +.header input { + color: #EEE; + background-color: #555; + font-size: 1.2em; + border: 1px solid black; + /*border-radius: 4px;*/ + padding: 2px; + /*box-shadow: inset 0 0 3px #333; */ + font-family: Verdana; + width: 250px; +} + +textarea { + vertical-align: top; +} + +#block-app { + width:100%; + height:100%; + position: absolute; + top: 0; + left: 0; + background-color: rgba(0,0,0,0.5); + text-align: center; + z-index: 6; +} + +#block-app span { + display: block; + font-size: 30px; + margin: auto; + margin-top: 300px; +} + +#block-app span a { + display: inline-block; + /*border-radius: 4px;*/ + text-decoration: none; + color: black; + background-color: red; + padding: 0 4px 0 4px; +} + +::-webkit-scrollbar { + height: 12px; + width: 6px; + background: #222; +} +::-webkit-scrollbar-thumb { + background: rgba(200,200,200,0.4); +} +::-webkit-scrollbar-corner { + background: #766; +} + +#editor { + position: relative; + width: 50%; + height: 100%; + display: inline-block; + margin: 0; + padding: 0; +} + +#editor .toolsbar { + width: 100%; + height: 30px; + background-color: #262626; + margin: 0; + padding: 0; +} + +#editor .toolsbar button { + padding: 2px; + padding-left: 10px; + padding-right: 10px; + margin: 3px 0 0 3px; +} + +#editor .toolsbar button.enabled { + background-color: #66A; +} + +#world { + position: absolute; + top: 0; + right: 0; + width: 50%; + height: 100%; +} + +#worldcanvas { + background-color: #343; +} + +.popup { + position: absolute; + top: 0; + background-color: rgba(50,50,90,0.8); + width: 100%; + height: 100%; +} + +.popup .header, .nodepanel .header { + width: 100%; + height: 30px; + font-size: 20px; + padding: 2px; +} + +#help { + color: #eee; +} + +#help p { + margin: 10px; +} + +.selector { + font-size: 1.8em; +} + + +.selector select { + color: white; + background-color: black; + border: 0; + font-size: 1em; +} + +.graphcanvas{ + /*touch-action: manipulation; WONT WORK*/ + /*touch-action: none; DESIDERABLE: implement zoom and pan*/ + touch-action: pinch-zoom; +} \ No newline at end of file diff --git a/javascript/materialxtoy/mtlx_stdlib.js b/javascript/materialxtoy/mtlx_stdlib.js new file mode 100644 index 00000000..d9ef2fc5 --- /dev/null +++ b/javascript/materialxtoy/mtlx_stdlib.js @@ -0,0 +1,27895 @@ + +// MaterialX node type: mtlx/input/input_float +// +function mtlx_input_input_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_float'; + this.nodedef_node = 'input'; + this.nodedef_type = 'float'; + this.nodedef_group = 'input'; + this.addInput('in', 'float'); + this.addProperty('in', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'float'); + this.title = 'input_float'; + this.desc = "MaterialX:mtlx/input/input_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#753'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_float', mtlx_input_input_float); + +// MaterialX node type: mtlx/input/input_color3 +// +function mtlx_input_input_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_color3'; + this.nodedef_node = 'input'; + this.nodedef_type = 'color3'; + this.nodedef_group = 'input'; + this.addInput('in', 'color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'color3'); + this.title = 'input_color3'; + this.desc = "MaterialX:mtlx/input/input_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#679'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_color3', mtlx_input_input_color3); + +// MaterialX node type: mtlx/input/input_color4 +// +function mtlx_input_input_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_color4'; + this.nodedef_node = 'input'; + this.nodedef_type = 'color4'; + this.nodedef_group = 'input'; + this.addInput('in', 'color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'color4'); + this.title = 'input_color4'; + this.desc = "MaterialX:mtlx/input/input_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#899'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_color4', mtlx_input_input_color4); + +// MaterialX node type: mtlx/input/input_vector2 +// +function mtlx_input_input_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_vector2'; + this.nodedef_node = 'input'; + this.nodedef_type = 'vector2'; + this.nodedef_group = 'input'; + this.addInput('in', 'vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'vector2'); + this.title = 'input_vector2'; + this.desc = "MaterialX:mtlx/input/input_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#A32'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_vector2', mtlx_input_input_vector2); + +// MaterialX node type: mtlx/input/input_vector3 +// +function mtlx_input_input_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_vector3'; + this.nodedef_node = 'input'; + this.nodedef_type = 'vector3'; + this.nodedef_group = 'input'; + this.addInput('in', 'vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'vector3'); + this.title = 'input_vector3'; + this.desc = "MaterialX:mtlx/input/input_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#A76'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_vector3', mtlx_input_input_vector3); + +// MaterialX node type: mtlx/input/input_vector4 +// +function mtlx_input_input_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_vector4'; + this.nodedef_node = 'input'; + this.nodedef_type = 'vector4'; + this.nodedef_group = 'input'; + this.addInput('in', 'vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'vector4'); + this.title = 'input_vector4'; + this.desc = "MaterialX:mtlx/input/input_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#A98'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_vector4', mtlx_input_input_vector4); + +// MaterialX node type: mtlx/input/input_matrix33 +// +function mtlx_input_input_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_matrix33'; + this.nodedef_node = 'input'; + this.nodedef_type = 'matrix33'; + this.nodedef_group = 'input'; + this.addInput('in', 'matrix33'); + this.addProperty('in', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'matrix33'); + this.title = 'input_matrix33'; + this.desc = "MaterialX:mtlx/input/input_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#333'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_matrix33', mtlx_input_input_matrix33); + +// MaterialX node type: mtlx/input/input_matrix44 +// +function mtlx_input_input_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_matrix44'; + this.nodedef_node = 'input'; + this.nodedef_type = 'matrix44'; + this.nodedef_group = 'input'; + this.addInput('in', 'matrix44'); + this.addProperty('in', [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'matrix44'); + this.title = 'input_matrix44'; + this.desc = "MaterialX:mtlx/input/input_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#444'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_matrix44', mtlx_input_input_matrix44); + +// MaterialX node type: mtlx/input/input_integer +// +function mtlx_input_input_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_integer'; + this.nodedef_node = 'input'; + this.nodedef_type = 'integer'; + this.nodedef_group = 'input'; + this.addInput('in', 'integer'); + this.addProperty('in', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'integer'); + this.title = 'input_integer'; + this.desc = "MaterialX:mtlx/input/input_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#A32'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_integer', mtlx_input_input_integer); + +// MaterialX node type: mtlx/input/input_string +// +function mtlx_input_input_string() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_string'; + this.nodedef_node = 'input'; + this.nodedef_type = 'string'; + this.nodedef_group = 'input'; + this.addInput('in', 'string'); + this.addProperty('in', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'string'); + this.title = 'input_string'; + this.desc = "MaterialX:mtlx/input/input_string"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#888'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_string', mtlx_input_input_string); + +// MaterialX node type: mtlx/input/input_boolean +// +function mtlx_input_input_boolean() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_boolean'; + this.nodedef_node = 'input'; + this.nodedef_type = 'boolean'; + this.nodedef_group = 'input'; + this.addInput('in', 'boolean'); + this.addProperty('in', false, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'boolean'); + this.title = 'input_boolean'; + this.desc = "MaterialX:mtlx/input/input_boolean"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#48A'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_boolean', mtlx_input_input_boolean); + +// MaterialX node type: mtlx/input/input_filename +// +function mtlx_input_input_filename() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_filename'; + this.nodedef_node = 'input'; + this.nodedef_type = 'filename'; + this.nodedef_group = 'input'; + this.addInput('in', 'filename'); + this.addProperty('in', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'filename'); + this.title = 'input_filename'; + this.desc = "MaterialX:mtlx/input/input_filename"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#58E'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_filename', mtlx_input_input_filename); + +// MaterialX node type: mtlx/input/input_BSDF +// +function mtlx_input_input_BSDF() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_BSDF'; + this.nodedef_node = 'input'; + this.nodedef_type = 'BSDF'; + this.nodedef_group = 'input'; + this.addInput('in', 'BSDF'); + this.addProperty('in', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'BSDF'); + this.title = 'input_BSDF'; + this.desc = "MaterialX:mtlx/input/input_BSDF"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_BSDF', mtlx_input_input_BSDF); + +// MaterialX node type: mtlx/input/input_EDF +// +function mtlx_input_input_EDF() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_EDF'; + this.nodedef_node = 'input'; + this.nodedef_type = 'EDF'; + this.nodedef_group = 'input'; + this.addInput('in', 'EDF'); + this.addProperty('in', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'EDF'); + this.title = 'input_EDF'; + this.desc = "MaterialX:mtlx/input/input_EDF"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_EDF', mtlx_input_input_EDF); + +// MaterialX node type: mtlx/input/input_VDF +// +function mtlx_input_input_VDF() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_VDF'; + this.nodedef_node = 'input'; + this.nodedef_type = 'VDF'; + this.nodedef_group = 'input'; + this.addInput('in', 'VDF'); + this.addProperty('in', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'VDF'); + this.title = 'input_VDF'; + this.desc = "MaterialX:mtlx/input/input_VDF"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_VDF', mtlx_input_input_VDF); + +// MaterialX node type: mtlx/input/input_surfaceshader +// +function mtlx_input_input_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_surfaceshader'; + this.nodedef_node = 'input'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_group = 'input'; + this.addInput('in', 'surfaceshader'); + this.addProperty('in', '', 'surfaceshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'surfaceshader'); + this.title = 'input_surfaceshader'; + this.desc = "MaterialX:mtlx/input/input_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_surfaceshader', mtlx_input_input_surfaceshader); + +// MaterialX node type: mtlx/input/input_volumeshader +// +function mtlx_input_input_volumeshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_volumeshader'; + this.nodedef_node = 'input'; + this.nodedef_type = 'volumeshader'; + this.nodedef_group = 'input'; + this.addInput('in', 'volumeshader'); + this.addProperty('in', '', 'volumeshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'volumeshader'); + this.title = 'input_volumeshader'; + this.desc = "MaterialX:mtlx/input/input_volumeshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_volumeshader', mtlx_input_input_volumeshader); + +// MaterialX node type: mtlx/input/input_displacementshader +// +function mtlx_input_input_displacementshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_displacementshader'; + this.nodedef_node = 'input'; + this.nodedef_type = 'displacementshader'; + this.nodedef_group = 'input'; + this.addInput('in', 'displacementshader'); + this.addProperty('in', '', 'displacementshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'displacementshader'); + this.title = 'input_displacementshader'; + this.desc = "MaterialX:mtlx/input/input_displacementshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_displacementshader', mtlx_input_input_displacementshader); + +// MaterialX node type: mtlx/input/input_lightshader +// +function mtlx_input_input_lightshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_lightshader'; + this.nodedef_node = 'input'; + this.nodedef_type = 'lightshader'; + this.nodedef_group = 'input'; + this.addInput('in', 'lightshader'); + this.addProperty('in', '', 'lightshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'lightshader'); + this.title = 'input_lightshader'; + this.desc = "MaterialX:mtlx/input/input_lightshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_lightshader', mtlx_input_input_lightshader); + +// MaterialX node type: mtlx/input/input_material +// +function mtlx_input_input_material() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_material'; + this.nodedef_node = 'input'; + this.nodedef_type = 'material'; + this.nodedef_group = 'input'; + this.addInput('in', 'material'); + this.addProperty('in', '', 'material',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'material'); + this.title = 'input_material'; + this.desc = "MaterialX:mtlx/input/input_material"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_material', mtlx_input_input_material); + +// MaterialX node type: mtlx/input/input_vector2array +// +function mtlx_input_input_vector2array() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_input_vector2array'; + this.nodedef_node = 'input'; + this.nodedef_type = 'vector2array'; + this.nodedef_group = 'input'; + this.addInput('in', 'vector2array'); + this.addProperty('in', '', 'vector2array',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out', 'vector2array'); + this.title = 'input_vector2array'; + this.desc = "MaterialX:mtlx/input/input_vector2array"; + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node: ', this); + } +} +LiteGraph.registerNodeType('mtlx/input/input_vector2array', mtlx_input_input_vector2array); + +// MaterialX node type: mtlx/output/output_float +// +function mtlx_output_output_float() { + this.title = 'output_float'; + this.desc = "MaterialX Node :mtlx/output/output_float"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'float'; + this.nodedef_group = 'output'; + this.addInput('in', 'float'); + this.addProperty('in', 0, 'float'); + this.addOutput('out', 'float'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#753'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_float', mtlx_output_output_float); + +// MaterialX node type: mtlx/output/output_color3 +// +function mtlx_output_output_color3() { + this.title = 'output_color3'; + this.desc = "MaterialX Node :mtlx/output/output_color3"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'color3'; + this.nodedef_group = 'output'; + this.addInput('in', 'color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3'); + this.addOutput('out', 'color3'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#679'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_color3', mtlx_output_output_color3); + +// MaterialX node type: mtlx/output/output_color4 +// +function mtlx_output_output_color4() { + this.title = 'output_color4'; + this.desc = "MaterialX Node :mtlx/output/output_color4"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'color4'; + this.nodedef_group = 'output'; + this.addInput('in', 'color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4'); + this.addOutput('out', 'color4'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#899'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_color4', mtlx_output_output_color4); + +// MaterialX node type: mtlx/output/output_vector2 +// +function mtlx_output_output_vector2() { + this.title = 'output_vector2'; + this.desc = "MaterialX Node :mtlx/output/output_vector2"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'vector2'; + this.nodedef_group = 'output'; + this.addInput('in', 'vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2'); + this.addOutput('out', 'vector2'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#A32'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_vector2', mtlx_output_output_vector2); + +// MaterialX node type: mtlx/output/output_vector3 +// +function mtlx_output_output_vector3() { + this.title = 'output_vector3'; + this.desc = "MaterialX Node :mtlx/output/output_vector3"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'vector3'; + this.nodedef_group = 'output'; + this.addInput('in', 'vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3'); + this.addOutput('out', 'vector3'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#A76'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_vector3', mtlx_output_output_vector3); + +// MaterialX node type: mtlx/output/output_vector4 +// +function mtlx_output_output_vector4() { + this.title = 'output_vector4'; + this.desc = "MaterialX Node :mtlx/output/output_vector4"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'vector4'; + this.nodedef_group = 'output'; + this.addInput('in', 'vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4'); + this.addOutput('out', 'vector4'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#A98'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_vector4', mtlx_output_output_vector4); + +// MaterialX node type: mtlx/output/output_matrix33 +// +function mtlx_output_output_matrix33() { + this.title = 'output_matrix33'; + this.desc = "MaterialX Node :mtlx/output/output_matrix33"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'matrix33'; + this.nodedef_group = 'output'; + this.addInput('in', 'matrix33'); + this.addProperty('in', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0], 'matrix33'); + this.addOutput('out', 'matrix33'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#333'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_matrix33', mtlx_output_output_matrix33); + +// MaterialX node type: mtlx/output/output_matrix44 +// +function mtlx_output_output_matrix44() { + this.title = 'output_matrix44'; + this.desc = "MaterialX Node :mtlx/output/output_matrix44"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'matrix44'; + this.nodedef_group = 'output'; + this.addInput('in', 'matrix44'); + this.addProperty('in', [1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0], 'matrix44'); + this.addOutput('out', 'matrix44'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#444'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_matrix44', mtlx_output_output_matrix44); + +// MaterialX node type: mtlx/output/output_integer +// +function mtlx_output_output_integer() { + this.title = 'output_integer'; + this.desc = "MaterialX Node :mtlx/output/output_integer"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'integer'; + this.nodedef_group = 'output'; + this.addInput('in', 'integer'); + this.addProperty('in', 0, 'integer'); + this.addOutput('out', 'integer'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#A32'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_integer', mtlx_output_output_integer); + +// MaterialX node type: mtlx/output/output_string +// +function mtlx_output_output_string() { + this.title = 'output_string'; + this.desc = "MaterialX Node :mtlx/output/output_string"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'string'; + this.nodedef_group = 'output'; + this.addInput('in', 'string'); + this.addProperty('in', '', 'string'); + this.addOutput('out', 'string'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#888'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_string', mtlx_output_output_string); + +// MaterialX node type: mtlx/output/output_boolean +// +function mtlx_output_output_boolean() { + this.title = 'output_boolean'; + this.desc = "MaterialX Node :mtlx/output/output_boolean"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'boolean'; + this.nodedef_group = 'output'; + this.addInput('in', 'boolean'); + this.addProperty('in', false, 'boolean'); + this.addOutput('out', 'boolean'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#48A'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_boolean', mtlx_output_output_boolean); + +// MaterialX node type: mtlx/output/output_filename +// +function mtlx_output_output_filename() { + this.title = 'output_filename'; + this.desc = "MaterialX Node :mtlx/output/output_filename"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'filename'; + this.nodedef_group = 'output'; + this.addInput('in', 'filename'); + this.addProperty('in', '', 'filename'); + this.addOutput('out', 'filename'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.boxcolor = '#58E'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_filename', mtlx_output_output_filename); + +// MaterialX node type: mtlx/output/output_BSDF +// +function mtlx_output_output_BSDF() { + this.title = 'output_BSDF'; + this.desc = "MaterialX Node :mtlx/output/output_BSDF"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'BSDF'; + this.nodedef_group = 'output'; + this.addInput('in', 'BSDF'); + this.addProperty('in', '', 'BSDF'); + this.addOutput('out', 'BSDF'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_BSDF', mtlx_output_output_BSDF); + +// MaterialX node type: mtlx/output/output_EDF +// +function mtlx_output_output_EDF() { + this.title = 'output_EDF'; + this.desc = "MaterialX Node :mtlx/output/output_EDF"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'EDF'; + this.nodedef_group = 'output'; + this.addInput('in', 'EDF'); + this.addProperty('in', '', 'EDF'); + this.addOutput('out', 'EDF'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_EDF', mtlx_output_output_EDF); + +// MaterialX node type: mtlx/output/output_VDF +// +function mtlx_output_output_VDF() { + this.title = 'output_VDF'; + this.desc = "MaterialX Node :mtlx/output/output_VDF"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'VDF'; + this.nodedef_group = 'output'; + this.addInput('in', 'VDF'); + this.addProperty('in', '', 'VDF'); + this.addOutput('out', 'VDF'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_VDF', mtlx_output_output_VDF); + +// MaterialX node type: mtlx/output/output_surfaceshader +// +function mtlx_output_output_surfaceshader() { + this.title = 'output_surfaceshader'; + this.desc = "MaterialX Node :mtlx/output/output_surfaceshader"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_group = 'output'; + this.addInput('in', 'surfaceshader'); + this.addProperty('in', '', 'surfaceshader'); + this.addOutput('out', 'surfaceshader'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_surfaceshader', mtlx_output_output_surfaceshader); + +// MaterialX node type: mtlx/output/output_volumeshader +// +function mtlx_output_output_volumeshader() { + this.title = 'output_volumeshader'; + this.desc = "MaterialX Node :mtlx/output/output_volumeshader"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'volumeshader'; + this.nodedef_group = 'output'; + this.addInput('in', 'volumeshader'); + this.addProperty('in', '', 'volumeshader'); + this.addOutput('out', 'volumeshader'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_volumeshader', mtlx_output_output_volumeshader); + +// MaterialX node type: mtlx/output/output_displacementshader +// +function mtlx_output_output_displacementshader() { + this.title = 'output_displacementshader'; + this.desc = "MaterialX Node :mtlx/output/output_displacementshader"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'displacementshader'; + this.nodedef_group = 'output'; + this.addInput('in', 'displacementshader'); + this.addProperty('in', '', 'displacementshader'); + this.addOutput('out', 'displacementshader'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_displacementshader', mtlx_output_output_displacementshader); + +// MaterialX node type: mtlx/output/output_lightshader +// +function mtlx_output_output_lightshader() { + this.title = 'output_lightshader'; + this.desc = "MaterialX Node :mtlx/output/output_lightshader"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'lightshader'; + this.nodedef_group = 'output'; + this.addInput('in', 'lightshader'); + this.addProperty('in', '', 'lightshader'); + this.addOutput('out', 'lightshader'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_lightshader', mtlx_output_output_lightshader); + +// MaterialX node type: mtlx/output/output_material +// +function mtlx_output_output_material() { + this.title = 'output_material'; + this.desc = "MaterialX Node :mtlx/output/output_material"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'material'; + this.nodedef_group = 'output'; + this.addInput('in', 'material'); + this.addProperty('in', '', 'material'); + this.addOutput('out', 'material'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_material', mtlx_output_output_material); + +// MaterialX node type: mtlx/output/output_vector2array +// +function mtlx_output_output_vector2array() { + this.title = 'output_vector2array'; + this.desc = "MaterialX Node :mtlx/output/output_vector2array"; + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_output_NaN'; + this.nodedef_node = 'output'; + this.nodedef_type = 'vector2array'; + this.nodedef_group = 'output'; + this.addInput('in', 'vector2array'); + this.addProperty('in', '', 'vector2array'); + this.addOutput('out', 'vector2array'); + this.onNodeCreated = function() { + //console.log('Node created:', this); + } + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.color = '#004C94'; + this.bgcolor = '#000'; + this.shape = LiteGraph.ROUND_SHAPE; + this.onExecute = function() { + console.log('Executing node:', this); + } +} +LiteGraph.registerNodeType('mtlx/output/output_vector2array', mtlx_output_output_vector2array); + +// MaterialX node type: mtlx/pbr/oren_nayar_diffuse_bsdf +// +function mtlx_pbr_oren_nayar_diffuse_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_oren_nayar_diffuse_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'oren_nayar_diffuse_bsdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/oren_nayar_diffuse_bsdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_oren_nayar_diffuse_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('weight','float'); + this.addProperty('weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('color','color3'); + this.addProperty('color', [0.18, 0.18, 0.18], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'oren_nayar_diffuse_bsdf_BSDF'; + this.desc = "MaterialX:mtlx/pbr/oren_nayar_diffuse_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_oren_nayar_diffuse_bsdf.nodedef_name = 'ND_oren_nayar_diffuse_bsdf'; +mtlx_pbr_oren_nayar_diffuse_bsdf.nodedef_node = 'oren_nayar_diffuse_bsdf'; +mtlx_pbr_oren_nayar_diffuse_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/oren_nayar_diffuse_bsdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/oren_nayar_diffuse_bsdf',mtlx_pbr_oren_nayar_diffuse_bsdf); + +// MaterialX node type: mtlx/pbr/burley_diffuse_bsdf +// +function mtlx_pbr_burley_diffuse_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_burley_diffuse_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'burley_diffuse_bsdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/burley_diffuse_bsdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_burley_diffuse_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('weight','float'); + this.addProperty('weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('color','color3'); + this.addProperty('color', [0.18, 0.18, 0.18], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'burley_diffuse_bsdf_BSDF'; + this.desc = "MaterialX:mtlx/pbr/burley_diffuse_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_burley_diffuse_bsdf.nodedef_name = 'ND_burley_diffuse_bsdf'; +mtlx_pbr_burley_diffuse_bsdf.nodedef_node = 'burley_diffuse_bsdf'; +mtlx_pbr_burley_diffuse_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/burley_diffuse_bsdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/burley_diffuse_bsdf',mtlx_pbr_burley_diffuse_bsdf); + +// MaterialX node type: mtlx/pbr/translucent_bsdf +// +function mtlx_pbr_translucent_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_translucent_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'translucent_bsdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/translucent_bsdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_translucent_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('weight','float'); + this.addProperty('weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('color','color3'); + this.addProperty('color', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'translucent_bsdf_BSDF'; + this.desc = "MaterialX:mtlx/pbr/translucent_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_translucent_bsdf.nodedef_name = 'ND_translucent_bsdf'; +mtlx_pbr_translucent_bsdf.nodedef_node = 'translucent_bsdf'; +mtlx_pbr_translucent_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/translucent_bsdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/translucent_bsdf',mtlx_pbr_translucent_bsdf); + +// MaterialX node type: mtlx/pbr/dielectric_bsdf +// +function mtlx_pbr_dielectric_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dielectric_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'dielectric_bsdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dielectric_bsdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dielectric_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('weight','float'); + this.addProperty('weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('tint','color3'); + this.addProperty('tint', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('ior','float'); + this.addProperty('ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','vector2'); + this.addProperty('roughness', [0.05, 0.05], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thinfilm_thickness','float'); + this.addProperty('thinfilm_thickness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thinfilm_ior','float'); + this.addProperty('thinfilm_ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('distribution','string'); + this.addProperty('distribution', 'ggx', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scatter_mode','string'); + this.addProperty('scatter_mode', 'R', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'dielectric_bsdf_BSDF'; + this.desc = "MaterialX:mtlx/pbr/dielectric_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_dielectric_bsdf.nodedef_name = 'ND_dielectric_bsdf'; +mtlx_pbr_dielectric_bsdf.nodedef_node = 'dielectric_bsdf'; +mtlx_pbr_dielectric_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dielectric_bsdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/dielectric_bsdf',mtlx_pbr_dielectric_bsdf); + +// MaterialX node type: mtlx/pbr/conductor_bsdf +// +function mtlx_pbr_conductor_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_conductor_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'conductor_bsdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/conductor_bsdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_conductor_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('weight','float'); + this.addProperty('weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('ior','color3'); + this.addProperty('ior', [0.183, 0.421, 1.373], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('extinction','color3'); + this.addProperty('extinction', [3.424, 2.346, 1.770], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','vector2'); + this.addProperty('roughness', [0.05, 0.05], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thinfilm_thickness','float'); + this.addProperty('thinfilm_thickness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thinfilm_ior','float'); + this.addProperty('thinfilm_ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('distribution','string'); + this.addProperty('distribution', 'ggx', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'conductor_bsdf_BSDF'; + this.desc = "MaterialX:mtlx/pbr/conductor_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_conductor_bsdf.nodedef_name = 'ND_conductor_bsdf'; +mtlx_pbr_conductor_bsdf.nodedef_node = 'conductor_bsdf'; +mtlx_pbr_conductor_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/conductor_bsdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/conductor_bsdf',mtlx_pbr_conductor_bsdf); + +// MaterialX node type: mtlx/pbr/generalized_schlick_bsdf +// +function mtlx_pbr_generalized_schlick_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_generalized_schlick_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'generalized_schlick_bsdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/generalized_schlick_bsdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_generalized_schlick_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('weight','float'); + this.addProperty('weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('color0','color3'); + this.addProperty('color0', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('color82','color3'); + this.addProperty('color82', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('color90','color3'); + this.addProperty('color90', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('exponent','float'); + this.addProperty('exponent', 5.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','vector2'); + this.addProperty('roughness', [0.05, 0.05], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thinfilm_thickness','float'); + this.addProperty('thinfilm_thickness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thinfilm_ior','float'); + this.addProperty('thinfilm_ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('distribution','string'); + this.addProperty('distribution', 'ggx', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scatter_mode','string'); + this.addProperty('scatter_mode', 'R', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'generalized_schlick_bsdf_BSDF'; + this.desc = "MaterialX:mtlx/pbr/generalized_schlick_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_generalized_schlick_bsdf.nodedef_name = 'ND_generalized_schlick_bsdf'; +mtlx_pbr_generalized_schlick_bsdf.nodedef_node = 'generalized_schlick_bsdf'; +mtlx_pbr_generalized_schlick_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/generalized_schlick_bsdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/generalized_schlick_bsdf',mtlx_pbr_generalized_schlick_bsdf); + +// MaterialX node type: mtlx/pbr/subsurface_bsdf +// +function mtlx_pbr_subsurface_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subsurface_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'subsurface_bsdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subsurface_bsdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subsurface_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('weight','float'); + this.addProperty('weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('color','color3'); + this.addProperty('color', [0.18, 0.18, 0.18], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('radius','vector3'); + this.addProperty('radius', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('anisotropy','float'); + this.addProperty('anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'subsurface_bsdf_BSDF'; + this.desc = "MaterialX:mtlx/pbr/subsurface_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_subsurface_bsdf.nodedef_name = 'ND_subsurface_bsdf'; +mtlx_pbr_subsurface_bsdf.nodedef_node = 'subsurface_bsdf'; +mtlx_pbr_subsurface_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subsurface_bsdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/subsurface_bsdf',mtlx_pbr_subsurface_bsdf); + +// MaterialX node type: mtlx/pbr/sheen_bsdf +// +function mtlx_pbr_sheen_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sheen_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'sheen_bsdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sheen_bsdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sheen_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('weight','float'); + this.addProperty('weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('color','color3'); + this.addProperty('color', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.3, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'sheen_bsdf_BSDF'; + this.desc = "MaterialX:mtlx/pbr/sheen_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_sheen_bsdf.nodedef_name = 'ND_sheen_bsdf'; +mtlx_pbr_sheen_bsdf.nodedef_node = 'sheen_bsdf'; +mtlx_pbr_sheen_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sheen_bsdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/sheen_bsdf',mtlx_pbr_sheen_bsdf); + +// MaterialX node type: mtlx/pbr/uniform_edf +// +function mtlx_pbr_uniform_edf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_uniform_edf'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'uniform_edf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/uniform_edf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_uniform_edf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color','color3'); + this.addProperty('color', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'uniform_edf_EDF'; + this.desc = "MaterialX:mtlx/pbr/uniform_edf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_uniform_edf.nodedef_name = 'ND_uniform_edf'; +mtlx_pbr_uniform_edf.nodedef_node = 'uniform_edf'; +mtlx_pbr_uniform_edf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/uniform_edf.html'; +LiteGraph.registerNodeType('mtlx/pbr/uniform_edf',mtlx_pbr_uniform_edf); + +// MaterialX node type: mtlx/pbr/conical_edf +// +function mtlx_pbr_conical_edf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_conical_edf'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'conical_edf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/conical_edf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_conical_edf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color','color3'); + this.addProperty('color', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inner_angle','float'); + this.addProperty('inner_angle', 60.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outer_angle','float'); + this.addProperty('outer_angle', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'conical_edf_EDF'; + this.desc = "MaterialX:mtlx/pbr/conical_edf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_conical_edf.nodedef_name = 'ND_conical_edf'; +mtlx_pbr_conical_edf.nodedef_node = 'conical_edf'; +mtlx_pbr_conical_edf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/conical_edf.html'; +LiteGraph.registerNodeType('mtlx/pbr/conical_edf',mtlx_pbr_conical_edf); + +// MaterialX node type: mtlx/pbr/measured_edf +// +function mtlx_pbr_measured_edf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_measured_edf'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'measured_edf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/measured_edf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_measured_edf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color','color3'); + this.addProperty('color', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'measured_edf_EDF'; + this.desc = "MaterialX:mtlx/pbr/measured_edf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_measured_edf.nodedef_name = 'ND_measured_edf'; +mtlx_pbr_measured_edf.nodedef_node = 'measured_edf'; +mtlx_pbr_measured_edf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/measured_edf.html'; +LiteGraph.registerNodeType('mtlx/pbr/measured_edf',mtlx_pbr_measured_edf); + +// MaterialX node type: mtlx/pbr/generalized_schlick_edf +// +function mtlx_pbr_generalized_schlick_edf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_generalized_schlick_edf'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'generalized_schlick_edf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/generalized_schlick_edf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_generalized_schlick_edf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color0','color3'); + this.addProperty('color0', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('color90','color3'); + this.addProperty('color90', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('exponent','float'); + this.addProperty('exponent', 5.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('base','EDF'); + this.addProperty('base', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'generalized_schlick_edf_EDF'; + this.desc = "MaterialX:mtlx/pbr/generalized_schlick_edf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_generalized_schlick_edf.nodedef_name = 'ND_generalized_schlick_edf'; +mtlx_pbr_generalized_schlick_edf.nodedef_node = 'generalized_schlick_edf'; +mtlx_pbr_generalized_schlick_edf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/generalized_schlick_edf.html'; +LiteGraph.registerNodeType('mtlx/pbr/generalized_schlick_edf',mtlx_pbr_generalized_schlick_edf); + +// MaterialX node type: mtlx/pbr/absorption_vdf +// +function mtlx_pbr_absorption_vdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_absorption_vdf'; + this.nodedef_type = 'VDF'; + this.nodedef_node = 'absorption_vdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absorption_vdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_absorption_vdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('absorption','vector3'); + this.addProperty('absorption', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','VDF'); + this.title = 'absorption_vdf_VDF'; + this.desc = "MaterialX:mtlx/pbr/absorption_vdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_absorption_vdf.nodedef_name = 'ND_absorption_vdf'; +mtlx_pbr_absorption_vdf.nodedef_node = 'absorption_vdf'; +mtlx_pbr_absorption_vdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absorption_vdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/absorption_vdf',mtlx_pbr_absorption_vdf); + +// MaterialX node type: mtlx/pbr/anisotropic_vdf +// +function mtlx_pbr_anisotropic_vdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_anisotropic_vdf'; + this.nodedef_type = 'VDF'; + this.nodedef_node = 'anisotropic_vdf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/anisotropic_vdf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_anisotropic_vdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('absorption','vector3'); + this.addProperty('absorption', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scattering','vector3'); + this.addProperty('scattering', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('anisotropy','float'); + this.addProperty('anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','VDF'); + this.title = 'anisotropic_vdf_VDF'; + this.desc = "MaterialX:mtlx/pbr/anisotropic_vdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_anisotropic_vdf.nodedef_name = 'ND_anisotropic_vdf'; +mtlx_pbr_anisotropic_vdf.nodedef_node = 'anisotropic_vdf'; +mtlx_pbr_anisotropic_vdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/anisotropic_vdf.html'; +LiteGraph.registerNodeType('mtlx/pbr/anisotropic_vdf',mtlx_pbr_anisotropic_vdf); + +// MaterialX node type: mtlx/pbr/surface +// +function mtlx_pbr_surface() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_surface'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'surface'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/surface.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_surface_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('bsdf','BSDF'); + this.addProperty('bsdf', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('edf','EDF'); + this.addProperty('edf', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('opacity','float'); + this.addProperty('opacity', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'surface_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/surface"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_surface.nodedef_name = 'ND_surface'; +mtlx_pbr_surface.nodedef_node = 'surface'; +mtlx_pbr_surface.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/surface.html'; +LiteGraph.registerNodeType('mtlx/pbr/surface',mtlx_pbr_surface); + +// MaterialX node type: mtlx/pbr/thin_surface +// +function mtlx_pbr_thin_surface() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_thin_surface'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'thin_surface'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/thin_surface.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_thin_surface_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('front_bsdf','BSDF'); + this.addProperty('front_bsdf', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('front_edf','EDF'); + this.addProperty('front_edf', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('back_bsdf','BSDF'); + this.addProperty('back_bsdf', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('back_edf','EDF'); + this.addProperty('back_edf', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('opacity','float'); + this.addProperty('opacity', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'thin_surface_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/thin_surface"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_thin_surface.nodedef_name = 'ND_thin_surface'; +mtlx_pbr_thin_surface.nodedef_node = 'thin_surface'; +mtlx_pbr_thin_surface.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/thin_surface.html'; +LiteGraph.registerNodeType('mtlx/pbr/thin_surface',mtlx_pbr_thin_surface); + +// MaterialX node type: mtlx/pbr/volume +// +function mtlx_pbr_volume() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_volume'; + this.nodedef_type = 'volumeshader'; + this.nodedef_node = 'volume'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/volume.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_volume_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('vdf','VDF'); + this.addProperty('vdf', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('edf','EDF'); + this.addProperty('edf', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','volumeshader'); + this.title = 'volume_volumeshader'; + this.desc = "MaterialX:mtlx/pbr/volume"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_volume.nodedef_name = 'ND_volume'; +mtlx_pbr_volume.nodedef_node = 'volume'; +mtlx_pbr_volume.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/volume.html'; +LiteGraph.registerNodeType('mtlx/pbr/volume',mtlx_pbr_volume); + +// MaterialX node type: mtlx/pbr/light +// +function mtlx_pbr_light() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_light'; + this.nodedef_type = 'lightshader'; + this.nodedef_node = 'light'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/light.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_light_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('edf','EDF'); + this.addProperty('edf', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('intensity','float'); + this.addProperty('intensity', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('exposure','float'); + this.addProperty('exposure', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','lightshader'); + this.title = 'light_lightshader'; + this.desc = "MaterialX:mtlx/pbr/light"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_light.nodedef_name = 'ND_light'; +mtlx_pbr_light.nodedef_node = 'light'; +mtlx_pbr_light.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/light.html'; +LiteGraph.registerNodeType('mtlx/pbr/light',mtlx_pbr_light); + +// MaterialX node type: mtlx/pbr/displacement_float +// +function mtlx_pbr_displacement_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_displacement_float'; + this.nodedef_type = 'displacementshader'; + this.nodedef_node = 'displacement'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/displacement.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_displacement_float_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('displacement','float'); + this.addProperty('displacement', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','float'); + this.addProperty('scale', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','displacementshader'); + this.title = 'displacement_displacementshader'; + this.desc = "MaterialX:mtlx/pbr/displacement_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_displacement_float.nodedef_name = 'ND_displacement_float'; +mtlx_pbr_displacement_float.nodedef_node = 'displacement'; +mtlx_pbr_displacement_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/displacement.html'; +LiteGraph.registerNodeType('mtlx/pbr/displacement_float',mtlx_pbr_displacement_float); + +// MaterialX node type: mtlx/pbr/displacement_vector3 +// +function mtlx_pbr_displacement_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_displacement_vector3'; + this.nodedef_type = 'displacementshader'; + this.nodedef_node = 'displacement'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/displacement.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_displacement_vector3_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('displacement','vector3'); + this.addProperty('displacement', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','float'); + this.addProperty('scale', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','displacementshader'); + this.title = 'displacement_displacementshader'; + this.desc = "MaterialX:mtlx/pbr/displacement_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_displacement_vector3.nodedef_name = 'ND_displacement_vector3'; +mtlx_pbr_displacement_vector3.nodedef_node = 'displacement'; +mtlx_pbr_displacement_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/displacement.html'; +LiteGraph.registerNodeType('mtlx/pbr/displacement_vector3',mtlx_pbr_displacement_vector3); + +// MaterialX node type: mtlx/pbr/layer_bsdf +// +function mtlx_pbr_layer_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_layer_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'layer'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/layer.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_layer_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('top','BSDF'); + this.addProperty('top', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('base','BSDF'); + this.addProperty('base', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'layer_BSDF'; + this.desc = "MaterialX:mtlx/pbr/layer_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_layer_bsdf.nodedef_name = 'ND_layer_bsdf'; +mtlx_pbr_layer_bsdf.nodedef_node = 'layer'; +mtlx_pbr_layer_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/layer.html'; +LiteGraph.registerNodeType('mtlx/pbr/layer_bsdf',mtlx_pbr_layer_bsdf); + +// MaterialX node type: mtlx/pbr/layer_vdf +// +function mtlx_pbr_layer_vdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_layer_vdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'layer'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/layer.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_layer_vdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('top','BSDF'); + this.addProperty('top', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('base','VDF'); + this.addProperty('base', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'layer_BSDF'; + this.desc = "MaterialX:mtlx/pbr/layer_vdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_layer_vdf.nodedef_name = 'ND_layer_vdf'; +mtlx_pbr_layer_vdf.nodedef_node = 'layer'; +mtlx_pbr_layer_vdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/layer.html'; +LiteGraph.registerNodeType('mtlx/pbr/layer_vdf',mtlx_pbr_layer_vdf); + +// MaterialX node type: mtlx/pbr/mix_bsdf +// +function mtlx_pbr_mix_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('fg','BSDF'); + this.addProperty('fg', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','BSDF'); + this.addProperty('bg', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'mix_BSDF'; + this.desc = "MaterialX:mtlx/pbr/mix_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_mix_bsdf.nodedef_name = 'ND_mix_bsdf'; +mtlx_pbr_mix_bsdf.nodedef_node = 'mix'; +mtlx_pbr_mix_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/pbr/mix_bsdf',mtlx_pbr_mix_bsdf); + +// MaterialX node type: mtlx/pbr/mix_edf +// +function mtlx_pbr_mix_edf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_edf'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_edf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('fg','EDF'); + this.addProperty('fg', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','EDF'); + this.addProperty('bg', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'mix_EDF'; + this.desc = "MaterialX:mtlx/pbr/mix_edf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_mix_edf.nodedef_name = 'ND_mix_edf'; +mtlx_pbr_mix_edf.nodedef_node = 'mix'; +mtlx_pbr_mix_edf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/pbr/mix_edf',mtlx_pbr_mix_edf); + +// MaterialX node type: mtlx/pbr/mix_vdf +// +function mtlx_pbr_mix_vdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_vdf'; + this.nodedef_type = 'VDF'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_vdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('fg','VDF'); + this.addProperty('fg', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','VDF'); + this.addProperty('bg', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','VDF'); + this.title = 'mix_VDF'; + this.desc = "MaterialX:mtlx/pbr/mix_vdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_mix_vdf.nodedef_name = 'ND_mix_vdf'; +mtlx_pbr_mix_vdf.nodedef_node = 'mix'; +mtlx_pbr_mix_vdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/pbr/mix_vdf',mtlx_pbr_mix_vdf); + +// MaterialX node type: mtlx/pbr/add_bsdf +// +function mtlx_pbr_add_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','BSDF'); + this.addProperty('in1', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','BSDF'); + this.addProperty('in2', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'add_BSDF'; + this.desc = "MaterialX:mtlx/pbr/add_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_add_bsdf.nodedef_name = 'ND_add_bsdf'; +mtlx_pbr_add_bsdf.nodedef_node = 'add'; +mtlx_pbr_add_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/pbr/add_bsdf',mtlx_pbr_add_bsdf); + +// MaterialX node type: mtlx/pbr/add_edf +// +function mtlx_pbr_add_edf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_edf'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_edf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','EDF'); + this.addProperty('in1', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','EDF'); + this.addProperty('in2', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'add_EDF'; + this.desc = "MaterialX:mtlx/pbr/add_edf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_add_edf.nodedef_name = 'ND_add_edf'; +mtlx_pbr_add_edf.nodedef_node = 'add'; +mtlx_pbr_add_edf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/pbr/add_edf',mtlx_pbr_add_edf); + +// MaterialX node type: mtlx/pbr/add_vdf +// +function mtlx_pbr_add_vdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_vdf'; + this.nodedef_type = 'VDF'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_vdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','VDF'); + this.addProperty('in1', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','VDF'); + this.addProperty('in2', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','VDF'); + this.title = 'add_VDF'; + this.desc = "MaterialX:mtlx/pbr/add_vdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_add_vdf.nodedef_name = 'ND_add_vdf'; +mtlx_pbr_add_vdf.nodedef_node = 'add'; +mtlx_pbr_add_vdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/pbr/add_vdf',mtlx_pbr_add_vdf); + +// MaterialX node type: mtlx/pbr/multiply_bsdfC +// +function mtlx_pbr_multiply_bsdfC() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_bsdfC'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_bsdfC_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','BSDF'); + this.addProperty('in1', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'multiply_BSDF'; + this.desc = "MaterialX:mtlx/pbr/multiply_bsdfC"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_multiply_bsdfC.nodedef_name = 'ND_multiply_bsdfC'; +mtlx_pbr_multiply_bsdfC.nodedef_node = 'multiply'; +mtlx_pbr_multiply_bsdfC.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/pbr/multiply_bsdfC',mtlx_pbr_multiply_bsdfC); + +// MaterialX node type: mtlx/pbr/multiply_bsdfF +// +function mtlx_pbr_multiply_bsdfF() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_bsdfF'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_bsdfF_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','BSDF'); + this.addProperty('in1', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'multiply_BSDF'; + this.desc = "MaterialX:mtlx/pbr/multiply_bsdfF"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_multiply_bsdfF.nodedef_name = 'ND_multiply_bsdfF'; +mtlx_pbr_multiply_bsdfF.nodedef_node = 'multiply'; +mtlx_pbr_multiply_bsdfF.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/pbr/multiply_bsdfF',mtlx_pbr_multiply_bsdfF); + +// MaterialX node type: mtlx/pbr/multiply_edfC +// +function mtlx_pbr_multiply_edfC() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_edfC'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_edfC_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','EDF'); + this.addProperty('in1', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'multiply_EDF'; + this.desc = "MaterialX:mtlx/pbr/multiply_edfC"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_multiply_edfC.nodedef_name = 'ND_multiply_edfC'; +mtlx_pbr_multiply_edfC.nodedef_node = 'multiply'; +mtlx_pbr_multiply_edfC.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/pbr/multiply_edfC',mtlx_pbr_multiply_edfC); + +// MaterialX node type: mtlx/pbr/multiply_edfF +// +function mtlx_pbr_multiply_edfF() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_edfF'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_edfF_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','EDF'); + this.addProperty('in1', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'multiply_EDF'; + this.desc = "MaterialX:mtlx/pbr/multiply_edfF"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_multiply_edfF.nodedef_name = 'ND_multiply_edfF'; +mtlx_pbr_multiply_edfF.nodedef_node = 'multiply'; +mtlx_pbr_multiply_edfF.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/pbr/multiply_edfF',mtlx_pbr_multiply_edfF); + +// MaterialX node type: mtlx/pbr/multiply_vdfC +// +function mtlx_pbr_multiply_vdfC() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_vdfC'; + this.nodedef_type = 'VDF'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_vdfC_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','VDF'); + this.addProperty('in1', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','VDF'); + this.title = 'multiply_VDF'; + this.desc = "MaterialX:mtlx/pbr/multiply_vdfC"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_multiply_vdfC.nodedef_name = 'ND_multiply_vdfC'; +mtlx_pbr_multiply_vdfC.nodedef_node = 'multiply'; +mtlx_pbr_multiply_vdfC.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/pbr/multiply_vdfC',mtlx_pbr_multiply_vdfC); + +// MaterialX node type: mtlx/pbr/multiply_vdfF +// +function mtlx_pbr_multiply_vdfF() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_vdfF'; + this.nodedef_type = 'VDF'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_vdfF_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('in1','VDF'); + this.addProperty('in1', '', 'VDF',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','VDF'); + this.title = 'multiply_VDF'; + this.desc = "MaterialX:mtlx/pbr/multiply_vdfF"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_multiply_vdfF.nodedef_name = 'ND_multiply_vdfF'; +mtlx_pbr_multiply_vdfF.nodedef_node = 'multiply'; +mtlx_pbr_multiply_vdfF.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/pbr/multiply_vdfF',mtlx_pbr_multiply_vdfF); + +// MaterialX node type: mtlx/pbr/roughness_anisotropy +// +function mtlx_pbr_roughness_anisotropy() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_roughness_anisotropy'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'roughness_anisotropy'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/roughness_anisotropy.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_roughness_anisotropy_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('roughness','float'); + this.addProperty('roughness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('anisotropy','float'); + this.addProperty('anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'roughness_anisotropy_vector2'; + this.desc = "MaterialX:mtlx/pbr/roughness_anisotropy"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_pbr_roughness_anisotropy.nodedef_name = 'ND_roughness_anisotropy'; +mtlx_pbr_roughness_anisotropy.nodedef_node = 'roughness_anisotropy'; +mtlx_pbr_roughness_anisotropy.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/roughness_anisotropy.html'; +LiteGraph.registerNodeType('mtlx/pbr/roughness_anisotropy',mtlx_pbr_roughness_anisotropy); + +// MaterialX node type: mtlx/pbr/roughness_dual +// +function mtlx_pbr_roughness_dual() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_roughness_dual'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'roughness_dual'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/roughness_dual.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_roughness_dual_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('roughness','vector2'); + this.addProperty('roughness', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'roughness_dual_vector2'; + this.desc = "MaterialX:mtlx/pbr/roughness_dual"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_pbr_roughness_dual.nodedef_name = 'ND_roughness_dual'; +mtlx_pbr_roughness_dual.nodedef_node = 'roughness_dual'; +mtlx_pbr_roughness_dual.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/roughness_dual.html'; +LiteGraph.registerNodeType('mtlx/pbr/roughness_dual',mtlx_pbr_roughness_dual); + +// MaterialX node type: mtlx/pbr/glossiness_anisotropy +// +function mtlx_pbr_glossiness_anisotropy() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_glossiness_anisotropy'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'glossiness_anisotropy'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/glossiness_anisotropy.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_glossiness_anisotropy_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('glossiness','float'); + this.addProperty('glossiness', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('anisotropy','float'); + this.addProperty('anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'glossiness_anisotropy_vector2'; + this.desc = "MaterialX:mtlx/pbr/glossiness_anisotropy"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_pbr_glossiness_anisotropy.nodedef_name = 'ND_glossiness_anisotropy'; +mtlx_pbr_glossiness_anisotropy.nodedef_node = 'glossiness_anisotropy'; +mtlx_pbr_glossiness_anisotropy.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/glossiness_anisotropy.html'; +LiteGraph.registerNodeType('mtlx/pbr/glossiness_anisotropy',mtlx_pbr_glossiness_anisotropy); + +// MaterialX node type: mtlx/pbr/blackbody +// +function mtlx_pbr_blackbody() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_blackbody'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'blackbody'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blackbody.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_blackbody_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('temperature','float'); + this.addProperty('temperature', 5000.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'blackbody_color3'; + this.desc = "MaterialX:mtlx/pbr/blackbody"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_pbr_blackbody.nodedef_name = 'ND_blackbody'; +mtlx_pbr_blackbody.nodedef_node = 'blackbody'; +mtlx_pbr_blackbody.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blackbody.html'; +LiteGraph.registerNodeType('mtlx/pbr/blackbody',mtlx_pbr_blackbody); + +// MaterialX node type: mtlx/pbr/artistic_ior +// +function mtlx_pbr_artistic_ior() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_artistic_ior'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'artistic_ior'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/artistic_ior.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_artistic_ior_ior_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('reflectivity','color3'); + this.addProperty('reflectivity', [0.944, 0.776, 0.373], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('edge_color','color3'); + this.addProperty('edge_color', [0.998, 0.981, 0.751], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('ior','color3'); + this.addOutput('extinction','color3'); + this.title = 'artistic_ior_multioutput'; + this.desc = "MaterialX:mtlx/pbr/artistic_ior"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_artistic_ior.nodedef_name = 'ND_artistic_ior'; +mtlx_pbr_artistic_ior.nodedef_node = 'artistic_ior'; +mtlx_pbr_artistic_ior.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/artistic_ior.html'; +LiteGraph.registerNodeType('mtlx/pbr/artistic_ior',mtlx_pbr_artistic_ior); + +// MaterialX node type: mtlx/colortransform/g18_rec709_to_lin_rec709_color3 +// +function mtlx_colortransform_g18_rec709_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_g18_rec709_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'g18_rec709_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g18_rec709_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_g18_rec709_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'g18_rec709_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/g18_rec709_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_g18_rec709_to_lin_rec709_color3.nodedef_name = 'ND_g18_rec709_to_lin_rec709_color3'; +mtlx_colortransform_g18_rec709_to_lin_rec709_color3.nodedef_node = 'g18_rec709_to_lin_rec709'; +mtlx_colortransform_g18_rec709_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g18_rec709_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/g18_rec709_to_lin_rec709_color3',mtlx_colortransform_g18_rec709_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/g18_rec709_to_lin_rec709_color4 +// +function mtlx_colortransform_g18_rec709_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_g18_rec709_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'g18_rec709_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g18_rec709_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_g18_rec709_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'g18_rec709_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/g18_rec709_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_g18_rec709_to_lin_rec709_color4.nodedef_name = 'ND_g18_rec709_to_lin_rec709_color4'; +mtlx_colortransform_g18_rec709_to_lin_rec709_color4.nodedef_node = 'g18_rec709_to_lin_rec709'; +mtlx_colortransform_g18_rec709_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g18_rec709_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/g18_rec709_to_lin_rec709_color4',mtlx_colortransform_g18_rec709_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/g22_rec709_to_lin_rec709_color3 +// +function mtlx_colortransform_g22_rec709_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_g22_rec709_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'g22_rec709_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g22_rec709_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_g22_rec709_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'g22_rec709_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/g22_rec709_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_g22_rec709_to_lin_rec709_color3.nodedef_name = 'ND_g22_rec709_to_lin_rec709_color3'; +mtlx_colortransform_g22_rec709_to_lin_rec709_color3.nodedef_node = 'g22_rec709_to_lin_rec709'; +mtlx_colortransform_g22_rec709_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g22_rec709_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/g22_rec709_to_lin_rec709_color3',mtlx_colortransform_g22_rec709_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/g22_rec709_to_lin_rec709_color4 +// +function mtlx_colortransform_g22_rec709_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_g22_rec709_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'g22_rec709_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g22_rec709_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_g22_rec709_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'g22_rec709_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/g22_rec709_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_g22_rec709_to_lin_rec709_color4.nodedef_name = 'ND_g22_rec709_to_lin_rec709_color4'; +mtlx_colortransform_g22_rec709_to_lin_rec709_color4.nodedef_node = 'g22_rec709_to_lin_rec709'; +mtlx_colortransform_g22_rec709_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g22_rec709_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/g22_rec709_to_lin_rec709_color4',mtlx_colortransform_g22_rec709_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/rec709_display_to_lin_rec709_color3 +// +function mtlx_colortransform_rec709_display_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_rec709_display_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'rec709_display_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rec709_display_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_rec709_display_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'rec709_display_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/rec709_display_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_rec709_display_to_lin_rec709_color3.nodedef_name = 'ND_rec709_display_to_lin_rec709_color3'; +mtlx_colortransform_rec709_display_to_lin_rec709_color3.nodedef_node = 'rec709_display_to_lin_rec709'; +mtlx_colortransform_rec709_display_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rec709_display_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/rec709_display_to_lin_rec709_color3',mtlx_colortransform_rec709_display_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/rec709_display_to_lin_rec709_color4 +// +function mtlx_colortransform_rec709_display_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_rec709_display_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'rec709_display_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rec709_display_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_rec709_display_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'rec709_display_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/rec709_display_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_rec709_display_to_lin_rec709_color4.nodedef_name = 'ND_rec709_display_to_lin_rec709_color4'; +mtlx_colortransform_rec709_display_to_lin_rec709_color4.nodedef_node = 'rec709_display_to_lin_rec709'; +mtlx_colortransform_rec709_display_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rec709_display_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/rec709_display_to_lin_rec709_color4',mtlx_colortransform_rec709_display_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/acescg_to_lin_rec709_color3 +// +function mtlx_colortransform_acescg_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_acescg_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'acescg_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acescg_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_acescg_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'acescg_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/acescg_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_acescg_to_lin_rec709_color3.nodedef_name = 'ND_acescg_to_lin_rec709_color3'; +mtlx_colortransform_acescg_to_lin_rec709_color3.nodedef_node = 'acescg_to_lin_rec709'; +mtlx_colortransform_acescg_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acescg_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/acescg_to_lin_rec709_color3',mtlx_colortransform_acescg_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/acescg_to_lin_rec709_color4 +// +function mtlx_colortransform_acescg_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_acescg_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'acescg_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acescg_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_acescg_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'acescg_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/acescg_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_acescg_to_lin_rec709_color4.nodedef_name = 'ND_acescg_to_lin_rec709_color4'; +mtlx_colortransform_acescg_to_lin_rec709_color4.nodedef_node = 'acescg_to_lin_rec709'; +mtlx_colortransform_acescg_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acescg_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/acescg_to_lin_rec709_color4',mtlx_colortransform_acescg_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/g22_ap1_to_lin_rec709_color3 +// +function mtlx_colortransform_g22_ap1_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_g22_ap1_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'g22_ap1_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g22_ap1_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_g22_ap1_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'g22_ap1_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/g22_ap1_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_g22_ap1_to_lin_rec709_color3.nodedef_name = 'ND_g22_ap1_to_lin_rec709_color3'; +mtlx_colortransform_g22_ap1_to_lin_rec709_color3.nodedef_node = 'g22_ap1_to_lin_rec709'; +mtlx_colortransform_g22_ap1_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g22_ap1_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/g22_ap1_to_lin_rec709_color3',mtlx_colortransform_g22_ap1_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/g22_ap1_to_lin_rec709_color4 +// +function mtlx_colortransform_g22_ap1_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_g22_ap1_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'g22_ap1_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g22_ap1_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_g22_ap1_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'g22_ap1_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/g22_ap1_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_g22_ap1_to_lin_rec709_color4.nodedef_name = 'ND_g22_ap1_to_lin_rec709_color4'; +mtlx_colortransform_g22_ap1_to_lin_rec709_color4.nodedef_node = 'g22_ap1_to_lin_rec709'; +mtlx_colortransform_g22_ap1_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/g22_ap1_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/g22_ap1_to_lin_rec709_color4',mtlx_colortransform_g22_ap1_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/srgb_texture_to_lin_rec709_color3 +// +function mtlx_colortransform_srgb_texture_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_srgb_texture_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'srgb_texture_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/srgb_texture_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_srgb_texture_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'srgb_texture_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/srgb_texture_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_srgb_texture_to_lin_rec709_color3.nodedef_name = 'ND_srgb_texture_to_lin_rec709_color3'; +mtlx_colortransform_srgb_texture_to_lin_rec709_color3.nodedef_node = 'srgb_texture_to_lin_rec709'; +mtlx_colortransform_srgb_texture_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/srgb_texture_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/srgb_texture_to_lin_rec709_color3',mtlx_colortransform_srgb_texture_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/srgb_texture_to_lin_rec709_color4 +// +function mtlx_colortransform_srgb_texture_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_srgb_texture_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'srgb_texture_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/srgb_texture_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_srgb_texture_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'srgb_texture_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/srgb_texture_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_srgb_texture_to_lin_rec709_color4.nodedef_name = 'ND_srgb_texture_to_lin_rec709_color4'; +mtlx_colortransform_srgb_texture_to_lin_rec709_color4.nodedef_node = 'srgb_texture_to_lin_rec709'; +mtlx_colortransform_srgb_texture_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/srgb_texture_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/srgb_texture_to_lin_rec709_color4',mtlx_colortransform_srgb_texture_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/lin_adobergb_to_lin_rec709_color3 +// +function mtlx_colortransform_lin_adobergb_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lin_adobergb_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'lin_adobergb_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/lin_adobergb_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lin_adobergb_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'lin_adobergb_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/lin_adobergb_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_lin_adobergb_to_lin_rec709_color3.nodedef_name = 'ND_lin_adobergb_to_lin_rec709_color3'; +mtlx_colortransform_lin_adobergb_to_lin_rec709_color3.nodedef_node = 'lin_adobergb_to_lin_rec709'; +mtlx_colortransform_lin_adobergb_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/lin_adobergb_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/lin_adobergb_to_lin_rec709_color3',mtlx_colortransform_lin_adobergb_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/lin_adobergb_to_lin_rec709_color4 +// +function mtlx_colortransform_lin_adobergb_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lin_adobergb_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'lin_adobergb_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/lin_adobergb_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lin_adobergb_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'lin_adobergb_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/lin_adobergb_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_lin_adobergb_to_lin_rec709_color4.nodedef_name = 'ND_lin_adobergb_to_lin_rec709_color4'; +mtlx_colortransform_lin_adobergb_to_lin_rec709_color4.nodedef_node = 'lin_adobergb_to_lin_rec709'; +mtlx_colortransform_lin_adobergb_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/lin_adobergb_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/lin_adobergb_to_lin_rec709_color4',mtlx_colortransform_lin_adobergb_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/adobergb_to_lin_rec709_color3 +// +function mtlx_colortransform_adobergb_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_adobergb_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'adobergb_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/adobergb_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_adobergb_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'adobergb_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/adobergb_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_adobergb_to_lin_rec709_color3.nodedef_name = 'ND_adobergb_to_lin_rec709_color3'; +mtlx_colortransform_adobergb_to_lin_rec709_color3.nodedef_node = 'adobergb_to_lin_rec709'; +mtlx_colortransform_adobergb_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/adobergb_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/adobergb_to_lin_rec709_color3',mtlx_colortransform_adobergb_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/adobergb_to_lin_rec709_color4 +// +function mtlx_colortransform_adobergb_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_adobergb_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'adobergb_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/adobergb_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_adobergb_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'adobergb_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/adobergb_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_adobergb_to_lin_rec709_color4.nodedef_name = 'ND_adobergb_to_lin_rec709_color4'; +mtlx_colortransform_adobergb_to_lin_rec709_color4.nodedef_node = 'adobergb_to_lin_rec709'; +mtlx_colortransform_adobergb_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/adobergb_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/adobergb_to_lin_rec709_color4',mtlx_colortransform_adobergb_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/srgb_displayp3_to_lin_rec709_color3 +// +function mtlx_colortransform_srgb_displayp3_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_srgb_displayp3_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'srgb_displayp3_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/srgb_displayp3_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_srgb_displayp3_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'srgb_displayp3_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/srgb_displayp3_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_srgb_displayp3_to_lin_rec709_color3.nodedef_name = 'ND_srgb_displayp3_to_lin_rec709_color3'; +mtlx_colortransform_srgb_displayp3_to_lin_rec709_color3.nodedef_node = 'srgb_displayp3_to_lin_rec709'; +mtlx_colortransform_srgb_displayp3_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/srgb_displayp3_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/srgb_displayp3_to_lin_rec709_color3',mtlx_colortransform_srgb_displayp3_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/srgb_displayp3_to_lin_rec709_color4 +// +function mtlx_colortransform_srgb_displayp3_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_srgb_displayp3_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'srgb_displayp3_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/srgb_displayp3_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_srgb_displayp3_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'srgb_displayp3_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/srgb_displayp3_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_srgb_displayp3_to_lin_rec709_color4.nodedef_name = 'ND_srgb_displayp3_to_lin_rec709_color4'; +mtlx_colortransform_srgb_displayp3_to_lin_rec709_color4.nodedef_node = 'srgb_displayp3_to_lin_rec709'; +mtlx_colortransform_srgb_displayp3_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/srgb_displayp3_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/srgb_displayp3_to_lin_rec709_color4',mtlx_colortransform_srgb_displayp3_to_lin_rec709_color4); + +// MaterialX node type: mtlx/colortransform/lin_displayp3_to_lin_rec709_color3 +// +function mtlx_colortransform_lin_displayp3_to_lin_rec709_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lin_displayp3_to_lin_rec709_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'lin_displayp3_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/lin_displayp3_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lin_displayp3_to_lin_rec709_color3_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'lin_displayp3_to_lin_rec709_color3'; + this.desc = "MaterialX:mtlx/colortransform/lin_displayp3_to_lin_rec709_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_colortransform_lin_displayp3_to_lin_rec709_color3.nodedef_name = 'ND_lin_displayp3_to_lin_rec709_color3'; +mtlx_colortransform_lin_displayp3_to_lin_rec709_color3.nodedef_node = 'lin_displayp3_to_lin_rec709'; +mtlx_colortransform_lin_displayp3_to_lin_rec709_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/lin_displayp3_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/lin_displayp3_to_lin_rec709_color3',mtlx_colortransform_lin_displayp3_to_lin_rec709_color3); + +// MaterialX node type: mtlx/colortransform/lin_displayp3_to_lin_rec709_color4 +// +function mtlx_colortransform_lin_displayp3_to_lin_rec709_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lin_displayp3_to_lin_rec709_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'lin_displayp3_to_lin_rec709'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/lin_displayp3_to_lin_rec709.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lin_displayp3_to_lin_rec709_color4_out_genglsl.png'; + this.nodedef_group = 'colortransform'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'lin_displayp3_to_lin_rec709_color4'; + this.desc = "MaterialX:mtlx/colortransform/lin_displayp3_to_lin_rec709_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_colortransform_lin_displayp3_to_lin_rec709_color4.nodedef_name = 'ND_lin_displayp3_to_lin_rec709_color4'; +mtlx_colortransform_lin_displayp3_to_lin_rec709_color4.nodedef_node = 'lin_displayp3_to_lin_rec709'; +mtlx_colortransform_lin_displayp3_to_lin_rec709_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/lin_displayp3_to_lin_rec709.html'; +LiteGraph.registerNodeType('mtlx/colortransform/lin_displayp3_to_lin_rec709_color4',mtlx_colortransform_lin_displayp3_to_lin_rec709_color4); + +// MaterialX node type: mtlx/light/point_light +// +function mtlx_light_point_light() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_point_light'; + this.nodedef_type = 'lightshader'; + this.nodedef_node = 'point_light'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/point_light.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_point_light_out_genglsl.png'; + this.nodedef_group = 'light'; + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('color','color3'); + this.addProperty('color', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('intensity','float'); + this.addProperty('intensity', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('decay_rate','float'); + this.addProperty('decay_rate', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','lightshader'); + this.title = 'point_light_lightshader'; + this.desc = "MaterialX:mtlx/light/point_light"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_light_point_light.nodedef_name = 'ND_point_light'; +mtlx_light_point_light.nodedef_node = 'point_light'; +mtlx_light_point_light.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/point_light.html'; +LiteGraph.registerNodeType('mtlx/light/point_light',mtlx_light_point_light); + +// MaterialX node type: mtlx/light/directional_light +// +function mtlx_light_directional_light() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_directional_light'; + this.nodedef_type = 'lightshader'; + this.nodedef_node = 'directional_light'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/directional_light.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_directional_light_out_genglsl.png'; + this.nodedef_group = 'light'; + this.addInput('direction','vector3'); + this.addProperty('direction', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('color','color3'); + this.addProperty('color', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('intensity','float'); + this.addProperty('intensity', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','lightshader'); + this.title = 'directional_light_lightshader'; + this.desc = "MaterialX:mtlx/light/directional_light"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_light_directional_light.nodedef_name = 'ND_directional_light'; +mtlx_light_directional_light.nodedef_node = 'directional_light'; +mtlx_light_directional_light.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/directional_light.html'; +LiteGraph.registerNodeType('mtlx/light/directional_light',mtlx_light_directional_light); + +// MaterialX node type: mtlx/light/spot_light +// +function mtlx_light_spot_light() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_spot_light'; + this.nodedef_type = 'lightshader'; + this.nodedef_node = 'spot_light'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/spot_light.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_spot_light_out_genglsl.png'; + this.nodedef_group = 'light'; + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('direction','vector3'); + this.addProperty('direction', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('color','color3'); + this.addProperty('color', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('intensity','float'); + this.addProperty('intensity', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('decay_rate','float'); + this.addProperty('decay_rate', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inner_angle','float'); + this.addProperty('inner_angle', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outer_angle','float'); + this.addProperty('outer_angle', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','lightshader'); + this.title = 'spot_light_lightshader'; + this.desc = "MaterialX:mtlx/light/spot_light"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_light_spot_light.nodedef_name = 'ND_spot_light'; +mtlx_light_spot_light.nodedef_node = 'spot_light'; +mtlx_light_spot_light.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/spot_light.html'; +LiteGraph.registerNodeType('mtlx/light/spot_light',mtlx_light_spot_light); + +// MaterialX node type: mtlx/npr/viewdirection_vector3 +// +function mtlx_npr_viewdirection_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_viewdirection_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'viewdirection'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/viewdirection.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_viewdirection_vector3_out_genglsl.png'; + this.nodedef_group = 'npr'; + this.addInput('space','string'); + this.addProperty('space', 'world', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'viewdirection_vector3'; + this.desc = "MaterialX:mtlx/npr/viewdirection_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_npr_viewdirection_vector3.nodedef_name = 'ND_viewdirection_vector3'; +mtlx_npr_viewdirection_vector3.nodedef_node = 'viewdirection'; +mtlx_npr_viewdirection_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/viewdirection.html'; +LiteGraph.registerNodeType('mtlx/npr/viewdirection_vector3',mtlx_npr_viewdirection_vector3); + +// MaterialX node type: mtlx/npr/facingratio_float +// +function mtlx_npr_facingratio_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_facingratio_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'facingratio'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/facingratio.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_facingratio_float_out_genglsl.png'; + this.nodedef_group = 'npr'; + this.addInput('viewdirection','vector3'); + this.addProperty('viewdirection', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('faceforward','boolean'); + this.addProperty('faceforward', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('invert','boolean'); + this.addProperty('invert', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'facingratio_float'; + this.desc = "MaterialX:mtlx/npr/facingratio_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_npr_facingratio_float.nodedef_name = 'ND_facingratio_float'; +mtlx_npr_facingratio_float.nodedef_node = 'facingratio'; +mtlx_npr_facingratio_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/facingratio.html'; +LiteGraph.registerNodeType('mtlx/npr/facingratio_float',mtlx_npr_facingratio_float); + +// MaterialX node type: mtlx/npr/gooch_shade +// +function mtlx_npr_gooch_shade() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gooch_shade'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'gooch_shade'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gooch_shade.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gooch_shade_out_genglsl.png'; + this.nodedef_group = 'npr'; + this.addInput('warm_color','color3'); + this.addProperty('warm_color', [0.8, 0.8, 0.7], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Warm Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('cool_color','color3'); + this.addProperty('cool_color', [0.3, 0.3, 0.8], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Cool Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specular_intensity','float'); + this.addProperty('specular_intensity', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Intensity","uimin":"0","uimax":"1","uifolder":""}); + this.addInput('shininess','float'); + this.addProperty('shininess', 64, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Shininess","uimin":"1","uimax":null,"uifolder":""}); + this.addInput('light_direction','vector3'); + this.addProperty('light_direction', [1, -0.5, -0.5], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Light Direction","uimin":[-1,-1,-1],"uimax":[1,1,1],"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'gooch_shade_color3'; + this.desc = "MaterialX:mtlx/npr/gooch_shade"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_npr_gooch_shade.nodedef_name = 'ND_gooch_shade'; +mtlx_npr_gooch_shade.nodedef_node = 'gooch_shade'; +mtlx_npr_gooch_shade.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gooch_shade.html'; +LiteGraph.registerNodeType('mtlx/npr/gooch_shade',mtlx_npr_gooch_shade); + +// MaterialX node type: mtlx/material/surfacematerial +// +function mtlx_material_surfacematerial() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_surfacematerial'; + this.nodedef_type = 'material'; + this.nodedef_node = 'surfacematerial'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/surfacematerial.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_surfacematerial_out_genglsl.png'; + this.nodedef_group = 'material'; + this.addInput('surfaceshader','surfaceshader'); + this.addProperty('surfaceshader', '', 'surfaceshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('displacementshader','displacementshader'); + this.addProperty('displacementshader', '', 'displacementshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','material'); + this.title = 'surfacematerial_material'; + this.desc = "MaterialX:mtlx/material/surfacematerial"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#151'; + this.shape = LiteGraph.BOX_SHAPE; +} +mtlx_material_surfacematerial.nodedef_name = 'ND_surfacematerial'; +mtlx_material_surfacematerial.nodedef_node = 'surfacematerial'; +mtlx_material_surfacematerial.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/surfacematerial.html'; +LiteGraph.registerNodeType('mtlx/material/surfacematerial',mtlx_material_surfacematerial); + +// MaterialX node type: mtlx/material/volumematerial +// +function mtlx_material_volumematerial() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_volumematerial'; + this.nodedef_type = 'material'; + this.nodedef_node = 'volumematerial'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/volumematerial.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_volumematerial_out_genglsl.png'; + this.nodedef_group = 'material'; + this.addInput('volumeshader','volumeshader'); + this.addProperty('volumeshader', '', 'volumeshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','material'); + this.title = 'volumematerial_material'; + this.desc = "MaterialX:mtlx/material/volumematerial"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#151'; + this.shape = LiteGraph.BOX_SHAPE; +} +mtlx_material_volumematerial.nodedef_name = 'ND_volumematerial'; +mtlx_material_volumematerial.nodedef_node = 'volumematerial'; +mtlx_material_volumematerial.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/volumematerial.html'; +LiteGraph.registerNodeType('mtlx/material/volumematerial',mtlx_material_volumematerial); + +// MaterialX node type: mtlx/shader/surface_unlit +// +function mtlx_shader_surface_unlit() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_surface_unlit'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'surface_unlit'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/surface_unlit.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_surface_unlit_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('emission','float'); + this.addProperty('emission', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('emission_color','color3'); + this.addProperty('emission_color', [1,1,1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('transmission','float'); + this.addProperty('transmission', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('transmission_color','color3'); + this.addProperty('transmission_color', [1,1,1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('opacity','float'); + this.addProperty('opacity', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'surface_unlit_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/surface_unlit"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_surface_unlit.nodedef_name = 'ND_surface_unlit'; +mtlx_shader_surface_unlit.nodedef_node = 'surface_unlit'; +mtlx_shader_surface_unlit.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/surface_unlit.html'; +LiteGraph.registerNodeType('mtlx/shader/surface_unlit',mtlx_shader_surface_unlit); + +// MaterialX node type: mtlx/texture2d/image_float +// +function mtlx_texture2d_image_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_image_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_image_float_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"Filename","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layer','string'); + this.addProperty('layer', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Layer","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','float'); + this.addProperty('default', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Default Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Texture Coordinates","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode U","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode V","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Filter Type","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Range","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Offset","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame End Action","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'image_float'; + this.desc = "MaterialX:mtlx/texture2d/image_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_texture2d_image_float.nodedef_name = 'ND_image_float'; +mtlx_texture2d_image_float.nodedef_node = 'image'; +mtlx_texture2d_image_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/image_float',mtlx_texture2d_image_float); + +// MaterialX node type: mtlx/texture2d/image_color3 +// +function mtlx_texture2d_image_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_image_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_image_color3_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"Filename","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layer','string'); + this.addProperty('layer', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Layer","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color3'); + this.addProperty('default', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Default Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Texture Coordinates","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode U","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode V","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Filter Type","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Range","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Offset","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame End Action","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'image_color3'; + this.desc = "MaterialX:mtlx/texture2d/image_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_texture2d_image_color3.nodedef_name = 'ND_image_color3'; +mtlx_texture2d_image_color3.nodedef_node = 'image'; +mtlx_texture2d_image_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/image_color3',mtlx_texture2d_image_color3); + +// MaterialX node type: mtlx/texture2d/image_color4 +// +function mtlx_texture2d_image_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_image_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_image_color4_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"Filename","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layer','string'); + this.addProperty('layer', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Layer","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color4'); + this.addProperty('default', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"Default Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Texture Coordinates","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode U","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode V","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Filter Type","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Range","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Offset","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame End Action","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'image_color4'; + this.desc = "MaterialX:mtlx/texture2d/image_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_texture2d_image_color4.nodedef_name = 'ND_image_color4'; +mtlx_texture2d_image_color4.nodedef_node = 'image'; +mtlx_texture2d_image_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/image_color4',mtlx_texture2d_image_color4); + +// MaterialX node type: mtlx/texture2d/image_vector2 +// +function mtlx_texture2d_image_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_image_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_image_vector2_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"Filename","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layer','string'); + this.addProperty('layer', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Layer","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector2'); + this.addProperty('default', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Default Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Texture Coordinates","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode U","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode V","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Filter Type","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Range","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Offset","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame End Action","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'image_vector2'; + this.desc = "MaterialX:mtlx/texture2d/image_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_texture2d_image_vector2.nodedef_name = 'ND_image_vector2'; +mtlx_texture2d_image_vector2.nodedef_node = 'image'; +mtlx_texture2d_image_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/image_vector2',mtlx_texture2d_image_vector2); + +// MaterialX node type: mtlx/texture2d/image_vector3 +// +function mtlx_texture2d_image_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_image_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_image_vector3_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"Filename","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layer','string'); + this.addProperty('layer', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Layer","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector3'); + this.addProperty('default', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Default Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Texture Coordinates","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode U","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode V","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Filter Type","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Range","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Offset","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame End Action","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'image_vector3'; + this.desc = "MaterialX:mtlx/texture2d/image_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_texture2d_image_vector3.nodedef_name = 'ND_image_vector3'; +mtlx_texture2d_image_vector3.nodedef_node = 'image'; +mtlx_texture2d_image_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/image_vector3',mtlx_texture2d_image_vector3); + +// MaterialX node type: mtlx/texture2d/image_vector4 +// +function mtlx_texture2d_image_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_image_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_image_vector4_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"Filename","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layer','string'); + this.addProperty('layer', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Layer","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector4'); + this.addProperty('default', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"Default Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Texture Coordinates","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode U","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Address Mode V","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Filter Type","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Range","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Frame Offset","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Frame End Action","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'image_vector4'; + this.desc = "MaterialX:mtlx/texture2d/image_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_texture2d_image_vector4.nodedef_name = 'ND_image_vector4'; +mtlx_texture2d_image_vector4.nodedef_node = 'image'; +mtlx_texture2d_image_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/image_vector4',mtlx_texture2d_image_vector4); + +// MaterialX node type: mtlx/texture2d/tiledimage_float +// +function mtlx_texture2d_tiledimage_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledimage_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'tiledimage'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledimage_float_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','float'); + this.addProperty('default', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldimagesize','vector2'); + this.addProperty('realworldimagesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldtilesize','vector2'); + this.addProperty('realworldtilesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'tiledimage_float'; + this.desc = "MaterialX:mtlx/texture2d/tiledimage_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_texture2d_tiledimage_float.nodedef_name = 'ND_tiledimage_float'; +mtlx_texture2d_tiledimage_float.nodedef_node = 'tiledimage'; +mtlx_texture2d_tiledimage_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; +LiteGraph.registerNodeType('mtlx/texture2d/tiledimage_float',mtlx_texture2d_tiledimage_float); + +// MaterialX node type: mtlx/texture2d/tiledimage_color3 +// +function mtlx_texture2d_tiledimage_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledimage_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'tiledimage'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledimage_color3_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color3'); + this.addProperty('default', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldimagesize','vector2'); + this.addProperty('realworldimagesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldtilesize','vector2'); + this.addProperty('realworldtilesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'tiledimage_color3'; + this.desc = "MaterialX:mtlx/texture2d/tiledimage_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_texture2d_tiledimage_color3.nodedef_name = 'ND_tiledimage_color3'; +mtlx_texture2d_tiledimage_color3.nodedef_node = 'tiledimage'; +mtlx_texture2d_tiledimage_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; +LiteGraph.registerNodeType('mtlx/texture2d/tiledimage_color3',mtlx_texture2d_tiledimage_color3); + +// MaterialX node type: mtlx/texture2d/tiledimage_color4 +// +function mtlx_texture2d_tiledimage_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledimage_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'tiledimage'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledimage_color4_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color4'); + this.addProperty('default', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldimagesize','vector2'); + this.addProperty('realworldimagesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldtilesize','vector2'); + this.addProperty('realworldtilesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'tiledimage_color4'; + this.desc = "MaterialX:mtlx/texture2d/tiledimage_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_texture2d_tiledimage_color4.nodedef_name = 'ND_tiledimage_color4'; +mtlx_texture2d_tiledimage_color4.nodedef_node = 'tiledimage'; +mtlx_texture2d_tiledimage_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; +LiteGraph.registerNodeType('mtlx/texture2d/tiledimage_color4',mtlx_texture2d_tiledimage_color4); + +// MaterialX node type: mtlx/texture2d/tiledimage_vector2 +// +function mtlx_texture2d_tiledimage_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledimage_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'tiledimage'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledimage_vector2_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector2'); + this.addProperty('default', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldimagesize','vector2'); + this.addProperty('realworldimagesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldtilesize','vector2'); + this.addProperty('realworldtilesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'tiledimage_vector2'; + this.desc = "MaterialX:mtlx/texture2d/tiledimage_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_texture2d_tiledimage_vector2.nodedef_name = 'ND_tiledimage_vector2'; +mtlx_texture2d_tiledimage_vector2.nodedef_node = 'tiledimage'; +mtlx_texture2d_tiledimage_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; +LiteGraph.registerNodeType('mtlx/texture2d/tiledimage_vector2',mtlx_texture2d_tiledimage_vector2); + +// MaterialX node type: mtlx/texture2d/tiledimage_vector3 +// +function mtlx_texture2d_tiledimage_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledimage_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'tiledimage'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledimage_vector3_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector3'); + this.addProperty('default', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldimagesize','vector2'); + this.addProperty('realworldimagesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldtilesize','vector2'); + this.addProperty('realworldtilesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'tiledimage_vector3'; + this.desc = "MaterialX:mtlx/texture2d/tiledimage_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_texture2d_tiledimage_vector3.nodedef_name = 'ND_tiledimage_vector3'; +mtlx_texture2d_tiledimage_vector3.nodedef_node = 'tiledimage'; +mtlx_texture2d_tiledimage_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; +LiteGraph.registerNodeType('mtlx/texture2d/tiledimage_vector3',mtlx_texture2d_tiledimage_vector3); + +// MaterialX node type: mtlx/texture2d/tiledimage_vector4 +// +function mtlx_texture2d_tiledimage_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledimage_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'tiledimage'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledimage_vector4_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector4'); + this.addProperty('default', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldimagesize','vector2'); + this.addProperty('realworldimagesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('realworldtilesize','vector2'); + this.addProperty('realworldtilesize', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'tiledimage_vector4'; + this.desc = "MaterialX:mtlx/texture2d/tiledimage_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_texture2d_tiledimage_vector4.nodedef_name = 'ND_tiledimage_vector4'; +mtlx_texture2d_tiledimage_vector4.nodedef_node = 'tiledimage'; +mtlx_texture2d_tiledimage_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledimage.html'; +LiteGraph.registerNodeType('mtlx/texture2d/tiledimage_vector4',mtlx_texture2d_tiledimage_vector4); + +// MaterialX node type: mtlx/texture3d/triplanarprojection_float +// +function mtlx_texture3d_triplanarprojection_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_triplanarprojection_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'triplanarprojection'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_triplanarprojection_float_out_genglsl.png'; + this.nodedef_group = 'texture3d'; + this.addInput('filex','filename'); + this.addProperty('filex', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filey','filename'); + this.addProperty('filey', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filez','filename'); + this.addProperty('filez', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerx','string'); + this.addProperty('layerx', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layery','string'); + this.addProperty('layery', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerz','string'); + this.addProperty('layerz', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','float'); + this.addProperty('default', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('upaxis','integer'); + this.addProperty('upaxis', 2, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('blend','float'); + this.addProperty('blend', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'triplanarprojection_float'; + this.desc = "MaterialX:mtlx/texture3d/triplanarprojection_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_texture3d_triplanarprojection_float.nodedef_name = 'ND_triplanarprojection_float'; +mtlx_texture3d_triplanarprojection_float.nodedef_node = 'triplanarprojection'; +mtlx_texture3d_triplanarprojection_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; +LiteGraph.registerNodeType('mtlx/texture3d/triplanarprojection_float',mtlx_texture3d_triplanarprojection_float); + +// MaterialX node type: mtlx/texture3d/triplanarprojection_color3 +// +function mtlx_texture3d_triplanarprojection_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_triplanarprojection_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'triplanarprojection'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_triplanarprojection_color3_out_genglsl.png'; + this.nodedef_group = 'texture3d'; + this.addInput('filex','filename'); + this.addProperty('filex', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filey','filename'); + this.addProperty('filey', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filez','filename'); + this.addProperty('filez', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerx','string'); + this.addProperty('layerx', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layery','string'); + this.addProperty('layery', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerz','string'); + this.addProperty('layerz', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color3'); + this.addProperty('default', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('upaxis','integer'); + this.addProperty('upaxis', 2, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('blend','float'); + this.addProperty('blend', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'triplanarprojection_color3'; + this.desc = "MaterialX:mtlx/texture3d/triplanarprojection_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_texture3d_triplanarprojection_color3.nodedef_name = 'ND_triplanarprojection_color3'; +mtlx_texture3d_triplanarprojection_color3.nodedef_node = 'triplanarprojection'; +mtlx_texture3d_triplanarprojection_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; +LiteGraph.registerNodeType('mtlx/texture3d/triplanarprojection_color3',mtlx_texture3d_triplanarprojection_color3); + +// MaterialX node type: mtlx/texture3d/triplanarprojection_color4 +// +function mtlx_texture3d_triplanarprojection_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_triplanarprojection_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'triplanarprojection'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_triplanarprojection_color4_out_genglsl.png'; + this.nodedef_group = 'texture3d'; + this.addInput('filex','filename'); + this.addProperty('filex', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filey','filename'); + this.addProperty('filey', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filez','filename'); + this.addProperty('filez', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerx','string'); + this.addProperty('layerx', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layery','string'); + this.addProperty('layery', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerz','string'); + this.addProperty('layerz', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color4'); + this.addProperty('default', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('upaxis','integer'); + this.addProperty('upaxis', 2, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('blend','float'); + this.addProperty('blend', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'triplanarprojection_color4'; + this.desc = "MaterialX:mtlx/texture3d/triplanarprojection_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_texture3d_triplanarprojection_color4.nodedef_name = 'ND_triplanarprojection_color4'; +mtlx_texture3d_triplanarprojection_color4.nodedef_node = 'triplanarprojection'; +mtlx_texture3d_triplanarprojection_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; +LiteGraph.registerNodeType('mtlx/texture3d/triplanarprojection_color4',mtlx_texture3d_triplanarprojection_color4); + +// MaterialX node type: mtlx/texture3d/triplanarprojection_vector2 +// +function mtlx_texture3d_triplanarprojection_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_triplanarprojection_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'triplanarprojection'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_triplanarprojection_vector2_out_genglsl.png'; + this.nodedef_group = 'texture3d'; + this.addInput('filex','filename'); + this.addProperty('filex', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filey','filename'); + this.addProperty('filey', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filez','filename'); + this.addProperty('filez', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerx','string'); + this.addProperty('layerx', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layery','string'); + this.addProperty('layery', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerz','string'); + this.addProperty('layerz', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector2'); + this.addProperty('default', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('upaxis','integer'); + this.addProperty('upaxis', 2, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('blend','float'); + this.addProperty('blend', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'triplanarprojection_vector2'; + this.desc = "MaterialX:mtlx/texture3d/triplanarprojection_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_texture3d_triplanarprojection_vector2.nodedef_name = 'ND_triplanarprojection_vector2'; +mtlx_texture3d_triplanarprojection_vector2.nodedef_node = 'triplanarprojection'; +mtlx_texture3d_triplanarprojection_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; +LiteGraph.registerNodeType('mtlx/texture3d/triplanarprojection_vector2',mtlx_texture3d_triplanarprojection_vector2); + +// MaterialX node type: mtlx/texture3d/triplanarprojection_vector3 +// +function mtlx_texture3d_triplanarprojection_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_triplanarprojection_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'triplanarprojection'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_triplanarprojection_vector3_out_genglsl.png'; + this.nodedef_group = 'texture3d'; + this.addInput('filex','filename'); + this.addProperty('filex', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filey','filename'); + this.addProperty('filey', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filez','filename'); + this.addProperty('filez', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerx','string'); + this.addProperty('layerx', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layery','string'); + this.addProperty('layery', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerz','string'); + this.addProperty('layerz', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector3'); + this.addProperty('default', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('upaxis','integer'); + this.addProperty('upaxis', 2, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('blend','float'); + this.addProperty('blend', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'triplanarprojection_vector3'; + this.desc = "MaterialX:mtlx/texture3d/triplanarprojection_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_texture3d_triplanarprojection_vector3.nodedef_name = 'ND_triplanarprojection_vector3'; +mtlx_texture3d_triplanarprojection_vector3.nodedef_node = 'triplanarprojection'; +mtlx_texture3d_triplanarprojection_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; +LiteGraph.registerNodeType('mtlx/texture3d/triplanarprojection_vector3',mtlx_texture3d_triplanarprojection_vector3); + +// MaterialX node type: mtlx/texture3d/triplanarprojection_vector4 +// +function mtlx_texture3d_triplanarprojection_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_triplanarprojection_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'triplanarprojection'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_triplanarprojection_vector4_out_genglsl.png'; + this.nodedef_group = 'texture3d'; + this.addInput('filex','filename'); + this.addProperty('filex', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filey','filename'); + this.addProperty('filey', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filez','filename'); + this.addProperty('filez', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerx','string'); + this.addProperty('layerx', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layery','string'); + this.addProperty('layery', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('layerz','string'); + this.addProperty('layerz', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector4'); + this.addProperty('default', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('upaxis','integer'); + this.addProperty('upaxis', 2, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('blend','float'); + this.addProperty('blend', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('framerange','string'); + this.addProperty('framerange', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameoffset','integer'); + this.addProperty('frameoffset', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('frameendaction','string'); + this.addProperty('frameendaction', 'constant', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'triplanarprojection_vector4'; + this.desc = "MaterialX:mtlx/texture3d/triplanarprojection_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_texture3d_triplanarprojection_vector4.nodedef_name = 'ND_triplanarprojection_vector4'; +mtlx_texture3d_triplanarprojection_vector4.nodedef_node = 'triplanarprojection'; +mtlx_texture3d_triplanarprojection_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/triplanarprojection.html'; +LiteGraph.registerNodeType('mtlx/texture3d/triplanarprojection_vector4',mtlx_texture3d_triplanarprojection_vector4); + +// MaterialX node type: mtlx/procedural/constant_float +// +function mtlx_procedural_constant_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_float_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','float'); + this.addProperty('value', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'constant_float'; + this.desc = "MaterialX:mtlx/procedural/constant_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural_constant_float.nodedef_name = 'ND_constant_float'; +mtlx_procedural_constant_float.nodedef_node = 'constant'; +mtlx_procedural_constant_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_float',mtlx_procedural_constant_float); + +// MaterialX node type: mtlx/procedural/constant_color3 +// +function mtlx_procedural_constant_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_color3_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','color3'); + this.addProperty('value', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'constant_color3'; + this.desc = "MaterialX:mtlx/procedural/constant_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural_constant_color3.nodedef_name = 'ND_constant_color3'; +mtlx_procedural_constant_color3.nodedef_node = 'constant'; +mtlx_procedural_constant_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_color3',mtlx_procedural_constant_color3); + +// MaterialX node type: mtlx/procedural/constant_color4 +// +function mtlx_procedural_constant_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_color4_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','color4'); + this.addProperty('value', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'constant_color4'; + this.desc = "MaterialX:mtlx/procedural/constant_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural_constant_color4.nodedef_name = 'ND_constant_color4'; +mtlx_procedural_constant_color4.nodedef_node = 'constant'; +mtlx_procedural_constant_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_color4',mtlx_procedural_constant_color4); + +// MaterialX node type: mtlx/procedural/constant_vector2 +// +function mtlx_procedural_constant_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','vector2'); + this.addProperty('value', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'constant_vector2'; + this.desc = "MaterialX:mtlx/procedural/constant_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural_constant_vector2.nodedef_name = 'ND_constant_vector2'; +mtlx_procedural_constant_vector2.nodedef_node = 'constant'; +mtlx_procedural_constant_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_vector2',mtlx_procedural_constant_vector2); + +// MaterialX node type: mtlx/procedural/constant_vector3 +// +function mtlx_procedural_constant_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','vector3'); + this.addProperty('value', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'constant_vector3'; + this.desc = "MaterialX:mtlx/procedural/constant_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural_constant_vector3.nodedef_name = 'ND_constant_vector3'; +mtlx_procedural_constant_vector3.nodedef_node = 'constant'; +mtlx_procedural_constant_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_vector3',mtlx_procedural_constant_vector3); + +// MaterialX node type: mtlx/procedural/constant_vector4 +// +function mtlx_procedural_constant_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','vector4'); + this.addProperty('value', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'constant_vector4'; + this.desc = "MaterialX:mtlx/procedural/constant_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural_constant_vector4.nodedef_name = 'ND_constant_vector4'; +mtlx_procedural_constant_vector4.nodedef_node = 'constant'; +mtlx_procedural_constant_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_vector4',mtlx_procedural_constant_vector4); + +// MaterialX node type: mtlx/procedural/constant_boolean +// +function mtlx_procedural_constant_boolean() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_boolean'; + this.nodedef_type = 'boolean'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_boolean_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','boolean'); + this.addProperty('value', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','boolean'); + this.title = 'constant_boolean'; + this.desc = "MaterialX:mtlx/procedural/constant_boolean"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#48A'; +} +mtlx_procedural_constant_boolean.nodedef_name = 'ND_constant_boolean'; +mtlx_procedural_constant_boolean.nodedef_node = 'constant'; +mtlx_procedural_constant_boolean.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_boolean',mtlx_procedural_constant_boolean); + +// MaterialX node type: mtlx/procedural/constant_integer +// +function mtlx_procedural_constant_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_integer_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','integer'); + this.addProperty('value', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'constant_integer'; + this.desc = "MaterialX:mtlx/procedural/constant_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural_constant_integer.nodedef_name = 'ND_constant_integer'; +mtlx_procedural_constant_integer.nodedef_node = 'constant'; +mtlx_procedural_constant_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_integer',mtlx_procedural_constant_integer); + +// MaterialX node type: mtlx/procedural/constant_matrix33 +// +function mtlx_procedural_constant_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_matrix33_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','matrix33'); + this.addProperty('value', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'constant_matrix33'; + this.desc = "MaterialX:mtlx/procedural/constant_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_procedural_constant_matrix33.nodedef_name = 'ND_constant_matrix33'; +mtlx_procedural_constant_matrix33.nodedef_node = 'constant'; +mtlx_procedural_constant_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_matrix33',mtlx_procedural_constant_matrix33); + +// MaterialX node type: mtlx/procedural/constant_matrix44 +// +function mtlx_procedural_constant_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_matrix44_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','matrix44'); + this.addProperty('value', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'constant_matrix44'; + this.desc = "MaterialX:mtlx/procedural/constant_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_procedural_constant_matrix44.nodedef_name = 'ND_constant_matrix44'; +mtlx_procedural_constant_matrix44.nodedef_node = 'constant'; +mtlx_procedural_constant_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_matrix44',mtlx_procedural_constant_matrix44); + +// MaterialX node type: mtlx/procedural/constant_string +// +function mtlx_procedural_constant_string() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_string'; + this.nodedef_type = 'string'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_string_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','string'); + this.addProperty('value', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','string'); + this.title = 'constant_string'; + this.desc = "MaterialX:mtlx/procedural/constant_string"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#888'; +} +mtlx_procedural_constant_string.nodedef_name = 'ND_constant_string'; +mtlx_procedural_constant_string.nodedef_node = 'constant'; +mtlx_procedural_constant_string.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_string',mtlx_procedural_constant_string); + +// MaterialX node type: mtlx/procedural/constant_filename +// +function mtlx_procedural_constant_filename() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_constant_filename'; + this.nodedef_type = 'filename'; + this.nodedef_node = 'constant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_constant_filename_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('value','filename'); + this.addProperty('value', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','filename'); + this.title = 'constant_filename'; + this.desc = "MaterialX:mtlx/procedural/constant_filename"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#58E'; +} +mtlx_procedural_constant_filename.nodedef_name = 'ND_constant_filename'; +mtlx_procedural_constant_filename.nodedef_node = 'constant'; +mtlx_procedural_constant_filename.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/constant.html'; +LiteGraph.registerNodeType('mtlx/procedural/constant_filename',mtlx_procedural_constant_filename); + +// MaterialX node type: mtlx/procedural2d/ramplr_float +// +function mtlx_procedural2d_ramplr_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramplr_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ramplr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramplr_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','float'); + this.addProperty('valuel', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','float'); + this.addProperty('valuer', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ramplr_float'; + this.desc = "MaterialX:mtlx/procedural2d/ramplr_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_ramplr_float.nodedef_name = 'ND_ramplr_float'; +mtlx_procedural2d_ramplr_float.nodedef_node = 'ramplr'; +mtlx_procedural2d_ramplr_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramplr_float',mtlx_procedural2d_ramplr_float); + +// MaterialX node type: mtlx/procedural2d/ramplr_color3 +// +function mtlx_procedural2d_ramplr_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramplr_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ramplr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramplr_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','color3'); + this.addProperty('valuel', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','color3'); + this.addProperty('valuer', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ramplr_color3'; + this.desc = "MaterialX:mtlx/procedural2d/ramplr_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_ramplr_color3.nodedef_name = 'ND_ramplr_color3'; +mtlx_procedural2d_ramplr_color3.nodedef_node = 'ramplr'; +mtlx_procedural2d_ramplr_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramplr_color3',mtlx_procedural2d_ramplr_color3); + +// MaterialX node type: mtlx/procedural2d/ramplr_color4 +// +function mtlx_procedural2d_ramplr_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramplr_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ramplr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramplr_color4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','color4'); + this.addProperty('valuel', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','color4'); + this.addProperty('valuer', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ramplr_color4'; + this.desc = "MaterialX:mtlx/procedural2d/ramplr_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural2d_ramplr_color4.nodedef_name = 'ND_ramplr_color4'; +mtlx_procedural2d_ramplr_color4.nodedef_node = 'ramplr'; +mtlx_procedural2d_ramplr_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramplr_color4',mtlx_procedural2d_ramplr_color4); + +// MaterialX node type: mtlx/procedural2d/ramplr_vector2 +// +function mtlx_procedural2d_ramplr_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramplr_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ramplr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramplr_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','vector2'); + this.addProperty('valuel', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','vector2'); + this.addProperty('valuer', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ramplr_vector2'; + this.desc = "MaterialX:mtlx/procedural2d/ramplr_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural2d_ramplr_vector2.nodedef_name = 'ND_ramplr_vector2'; +mtlx_procedural2d_ramplr_vector2.nodedef_node = 'ramplr'; +mtlx_procedural2d_ramplr_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramplr_vector2',mtlx_procedural2d_ramplr_vector2); + +// MaterialX node type: mtlx/procedural2d/ramplr_vector3 +// +function mtlx_procedural2d_ramplr_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramplr_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ramplr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramplr_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','vector3'); + this.addProperty('valuel', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','vector3'); + this.addProperty('valuer', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ramplr_vector3'; + this.desc = "MaterialX:mtlx/procedural2d/ramplr_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural2d_ramplr_vector3.nodedef_name = 'ND_ramplr_vector3'; +mtlx_procedural2d_ramplr_vector3.nodedef_node = 'ramplr'; +mtlx_procedural2d_ramplr_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramplr_vector3',mtlx_procedural2d_ramplr_vector3); + +// MaterialX node type: mtlx/procedural2d/ramplr_vector4 +// +function mtlx_procedural2d_ramplr_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramplr_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ramplr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramplr_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','vector4'); + this.addProperty('valuel', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','vector4'); + this.addProperty('valuer', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ramplr_vector4'; + this.desc = "MaterialX:mtlx/procedural2d/ramplr_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural2d_ramplr_vector4.nodedef_name = 'ND_ramplr_vector4'; +mtlx_procedural2d_ramplr_vector4.nodedef_node = 'ramplr'; +mtlx_procedural2d_ramplr_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramplr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramplr_vector4',mtlx_procedural2d_ramplr_vector4); + +// MaterialX node type: mtlx/procedural2d/ramptb_float +// +function mtlx_procedural2d_ramptb_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramptb_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ramptb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramptb_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','float'); + this.addProperty('valuet', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','float'); + this.addProperty('valueb', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ramptb_float'; + this.desc = "MaterialX:mtlx/procedural2d/ramptb_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_ramptb_float.nodedef_name = 'ND_ramptb_float'; +mtlx_procedural2d_ramptb_float.nodedef_node = 'ramptb'; +mtlx_procedural2d_ramptb_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramptb_float',mtlx_procedural2d_ramptb_float); + +// MaterialX node type: mtlx/procedural2d/ramptb_color3 +// +function mtlx_procedural2d_ramptb_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramptb_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ramptb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramptb_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','color3'); + this.addProperty('valuet', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','color3'); + this.addProperty('valueb', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ramptb_color3'; + this.desc = "MaterialX:mtlx/procedural2d/ramptb_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_ramptb_color3.nodedef_name = 'ND_ramptb_color3'; +mtlx_procedural2d_ramptb_color3.nodedef_node = 'ramptb'; +mtlx_procedural2d_ramptb_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramptb_color3',mtlx_procedural2d_ramptb_color3); + +// MaterialX node type: mtlx/procedural2d/ramptb_color4 +// +function mtlx_procedural2d_ramptb_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramptb_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ramptb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramptb_color4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','color4'); + this.addProperty('valuet', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','color4'); + this.addProperty('valueb', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ramptb_color4'; + this.desc = "MaterialX:mtlx/procedural2d/ramptb_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural2d_ramptb_color4.nodedef_name = 'ND_ramptb_color4'; +mtlx_procedural2d_ramptb_color4.nodedef_node = 'ramptb'; +mtlx_procedural2d_ramptb_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramptb_color4',mtlx_procedural2d_ramptb_color4); + +// MaterialX node type: mtlx/procedural2d/ramptb_vector2 +// +function mtlx_procedural2d_ramptb_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramptb_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ramptb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramptb_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','vector2'); + this.addProperty('valuet', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','vector2'); + this.addProperty('valueb', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ramptb_vector2'; + this.desc = "MaterialX:mtlx/procedural2d/ramptb_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural2d_ramptb_vector2.nodedef_name = 'ND_ramptb_vector2'; +mtlx_procedural2d_ramptb_vector2.nodedef_node = 'ramptb'; +mtlx_procedural2d_ramptb_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramptb_vector2',mtlx_procedural2d_ramptb_vector2); + +// MaterialX node type: mtlx/procedural2d/ramptb_vector3 +// +function mtlx_procedural2d_ramptb_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramptb_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ramptb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramptb_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','vector3'); + this.addProperty('valuet', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','vector3'); + this.addProperty('valueb', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ramptb_vector3'; + this.desc = "MaterialX:mtlx/procedural2d/ramptb_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural2d_ramptb_vector3.nodedef_name = 'ND_ramptb_vector3'; +mtlx_procedural2d_ramptb_vector3.nodedef_node = 'ramptb'; +mtlx_procedural2d_ramptb_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramptb_vector3',mtlx_procedural2d_ramptb_vector3); + +// MaterialX node type: mtlx/procedural2d/ramptb_vector4 +// +function mtlx_procedural2d_ramptb_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramptb_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ramptb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramptb_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','vector4'); + this.addProperty('valuet', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','vector4'); + this.addProperty('valueb', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ramptb_vector4'; + this.desc = "MaterialX:mtlx/procedural2d/ramptb_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural2d_ramptb_vector4.nodedef_name = 'ND_ramptb_vector4'; +mtlx_procedural2d_ramptb_vector4.nodedef_node = 'ramptb'; +mtlx_procedural2d_ramptb_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramptb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramptb_vector4',mtlx_procedural2d_ramptb_vector4); + +// MaterialX node type: mtlx/procedural2d/ramp4_float +// +function mtlx_procedural2d_ramp4_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramp4_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ramp4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramp4_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuetl','float'); + this.addProperty('valuetl', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuetr','float'); + this.addProperty('valuetr', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebl','float'); + this.addProperty('valuebl', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebr','float'); + this.addProperty('valuebr', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ramp4_float'; + this.desc = "MaterialX:mtlx/procedural2d/ramp4_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_ramp4_float.nodedef_name = 'ND_ramp4_float'; +mtlx_procedural2d_ramp4_float.nodedef_node = 'ramp4'; +mtlx_procedural2d_ramp4_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramp4_float',mtlx_procedural2d_ramp4_float); + +// MaterialX node type: mtlx/procedural2d/ramp4_color3 +// +function mtlx_procedural2d_ramp4_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramp4_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ramp4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramp4_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuetl','color3'); + this.addProperty('valuetl', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuetr','color3'); + this.addProperty('valuetr', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebl','color3'); + this.addProperty('valuebl', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebr','color3'); + this.addProperty('valuebr', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ramp4_color3'; + this.desc = "MaterialX:mtlx/procedural2d/ramp4_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_ramp4_color3.nodedef_name = 'ND_ramp4_color3'; +mtlx_procedural2d_ramp4_color3.nodedef_node = 'ramp4'; +mtlx_procedural2d_ramp4_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramp4_color3',mtlx_procedural2d_ramp4_color3); + +// MaterialX node type: mtlx/procedural2d/ramp4_color4 +// +function mtlx_procedural2d_ramp4_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramp4_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ramp4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramp4_color4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuetl','color4'); + this.addProperty('valuetl', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuetr','color4'); + this.addProperty('valuetr', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebl','color4'); + this.addProperty('valuebl', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebr','color4'); + this.addProperty('valuebr', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ramp4_color4'; + this.desc = "MaterialX:mtlx/procedural2d/ramp4_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural2d_ramp4_color4.nodedef_name = 'ND_ramp4_color4'; +mtlx_procedural2d_ramp4_color4.nodedef_node = 'ramp4'; +mtlx_procedural2d_ramp4_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramp4_color4',mtlx_procedural2d_ramp4_color4); + +// MaterialX node type: mtlx/procedural2d/ramp4_vector2 +// +function mtlx_procedural2d_ramp4_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramp4_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ramp4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramp4_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuetl','vector2'); + this.addProperty('valuetl', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuetr','vector2'); + this.addProperty('valuetr', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebl','vector2'); + this.addProperty('valuebl', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebr','vector2'); + this.addProperty('valuebr', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ramp4_vector2'; + this.desc = "MaterialX:mtlx/procedural2d/ramp4_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural2d_ramp4_vector2.nodedef_name = 'ND_ramp4_vector2'; +mtlx_procedural2d_ramp4_vector2.nodedef_node = 'ramp4'; +mtlx_procedural2d_ramp4_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramp4_vector2',mtlx_procedural2d_ramp4_vector2); + +// MaterialX node type: mtlx/procedural2d/ramp4_vector3 +// +function mtlx_procedural2d_ramp4_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramp4_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ramp4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramp4_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuetl','vector3'); + this.addProperty('valuetl', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuetr','vector3'); + this.addProperty('valuetr', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebl','vector3'); + this.addProperty('valuebl', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebr','vector3'); + this.addProperty('valuebr', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ramp4_vector3'; + this.desc = "MaterialX:mtlx/procedural2d/ramp4_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural2d_ramp4_vector3.nodedef_name = 'ND_ramp4_vector3'; +mtlx_procedural2d_ramp4_vector3.nodedef_node = 'ramp4'; +mtlx_procedural2d_ramp4_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramp4_vector3',mtlx_procedural2d_ramp4_vector3); + +// MaterialX node type: mtlx/procedural2d/ramp4_vector4 +// +function mtlx_procedural2d_ramp4_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ramp4_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ramp4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ramp4_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuetl','vector4'); + this.addProperty('valuetl', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuetr','vector4'); + this.addProperty('valuetr', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebl','vector4'); + this.addProperty('valuebl', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuebr','vector4'); + this.addProperty('valuebr', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ramp4_vector4'; + this.desc = "MaterialX:mtlx/procedural2d/ramp4_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural2d_ramp4_vector4.nodedef_name = 'ND_ramp4_vector4'; +mtlx_procedural2d_ramp4_vector4.nodedef_node = 'ramp4'; +mtlx_procedural2d_ramp4_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ramp4.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/ramp4_vector4',mtlx_procedural2d_ramp4_vector4); + +// MaterialX node type: mtlx/procedural2d/splitlr_float +// +function mtlx_procedural2d_splitlr_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splitlr_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'splitlr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splitlr_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','float'); + this.addProperty('valuel', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Left","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','float'); + this.addProperty('valuer', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Right","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'splitlr_float'; + this.desc = "MaterialX:mtlx/procedural2d/splitlr_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_splitlr_float.nodedef_name = 'ND_splitlr_float'; +mtlx_procedural2d_splitlr_float.nodedef_node = 'splitlr'; +mtlx_procedural2d_splitlr_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splitlr_float',mtlx_procedural2d_splitlr_float); + +// MaterialX node type: mtlx/procedural2d/splitlr_color3 +// +function mtlx_procedural2d_splitlr_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splitlr_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'splitlr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splitlr_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','color3'); + this.addProperty('valuel', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Left","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','color3'); + this.addProperty('valuer', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Right","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'splitlr_color3'; + this.desc = "MaterialX:mtlx/procedural2d/splitlr_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_splitlr_color3.nodedef_name = 'ND_splitlr_color3'; +mtlx_procedural2d_splitlr_color3.nodedef_node = 'splitlr'; +mtlx_procedural2d_splitlr_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splitlr_color3',mtlx_procedural2d_splitlr_color3); + +// MaterialX node type: mtlx/procedural2d/splitlr_color4 +// +function mtlx_procedural2d_splitlr_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splitlr_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'splitlr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splitlr_color4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','color4'); + this.addProperty('valuel', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"Left","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','color4'); + this.addProperty('valuer', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"Right","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'splitlr_color4'; + this.desc = "MaterialX:mtlx/procedural2d/splitlr_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural2d_splitlr_color4.nodedef_name = 'ND_splitlr_color4'; +mtlx_procedural2d_splitlr_color4.nodedef_node = 'splitlr'; +mtlx_procedural2d_splitlr_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splitlr_color4',mtlx_procedural2d_splitlr_color4); + +// MaterialX node type: mtlx/procedural2d/splitlr_vector2 +// +function mtlx_procedural2d_splitlr_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splitlr_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'splitlr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splitlr_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','vector2'); + this.addProperty('valuel', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Left","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','vector2'); + this.addProperty('valuer', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Right","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'splitlr_vector2'; + this.desc = "MaterialX:mtlx/procedural2d/splitlr_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural2d_splitlr_vector2.nodedef_name = 'ND_splitlr_vector2'; +mtlx_procedural2d_splitlr_vector2.nodedef_node = 'splitlr'; +mtlx_procedural2d_splitlr_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splitlr_vector2',mtlx_procedural2d_splitlr_vector2); + +// MaterialX node type: mtlx/procedural2d/splitlr_vector3 +// +function mtlx_procedural2d_splitlr_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splitlr_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'splitlr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splitlr_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','vector3'); + this.addProperty('valuel', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Left","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','vector3'); + this.addProperty('valuer', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Right","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'splitlr_vector3'; + this.desc = "MaterialX:mtlx/procedural2d/splitlr_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural2d_splitlr_vector3.nodedef_name = 'ND_splitlr_vector3'; +mtlx_procedural2d_splitlr_vector3.nodedef_node = 'splitlr'; +mtlx_procedural2d_splitlr_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splitlr_vector3',mtlx_procedural2d_splitlr_vector3); + +// MaterialX node type: mtlx/procedural2d/splitlr_vector4 +// +function mtlx_procedural2d_splitlr_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splitlr_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'splitlr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splitlr_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuel','vector4'); + this.addProperty('valuel', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"Left","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valuer','vector4'); + this.addProperty('valuer', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"Right","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'splitlr_vector4'; + this.desc = "MaterialX:mtlx/procedural2d/splitlr_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural2d_splitlr_vector4.nodedef_name = 'ND_splitlr_vector4'; +mtlx_procedural2d_splitlr_vector4.nodedef_node = 'splitlr'; +mtlx_procedural2d_splitlr_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splitlr.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splitlr_vector4',mtlx_procedural2d_splitlr_vector4); + +// MaterialX node type: mtlx/procedural2d/splittb_float +// +function mtlx_procedural2d_splittb_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splittb_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'splittb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splittb_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','float'); + this.addProperty('valuet', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Top","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','float'); + this.addProperty('valueb', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Bottom","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'splittb_float'; + this.desc = "MaterialX:mtlx/procedural2d/splittb_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_splittb_float.nodedef_name = 'ND_splittb_float'; +mtlx_procedural2d_splittb_float.nodedef_node = 'splittb'; +mtlx_procedural2d_splittb_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splittb_float',mtlx_procedural2d_splittb_float); + +// MaterialX node type: mtlx/procedural2d/splittb_color3 +// +function mtlx_procedural2d_splittb_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splittb_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'splittb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splittb_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','color3'); + this.addProperty('valuet', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Top","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','color3'); + this.addProperty('valueb', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Bottom","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'splittb_color3'; + this.desc = "MaterialX:mtlx/procedural2d/splittb_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_splittb_color3.nodedef_name = 'ND_splittb_color3'; +mtlx_procedural2d_splittb_color3.nodedef_node = 'splittb'; +mtlx_procedural2d_splittb_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splittb_color3',mtlx_procedural2d_splittb_color3); + +// MaterialX node type: mtlx/procedural2d/splittb_color4 +// +function mtlx_procedural2d_splittb_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splittb_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'splittb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splittb_color4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','color4'); + this.addProperty('valuet', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"Top","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','color4'); + this.addProperty('valueb', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"Bottom","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'splittb_color4'; + this.desc = "MaterialX:mtlx/procedural2d/splittb_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural2d_splittb_color4.nodedef_name = 'ND_splittb_color4'; +mtlx_procedural2d_splittb_color4.nodedef_node = 'splittb'; +mtlx_procedural2d_splittb_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splittb_color4',mtlx_procedural2d_splittb_color4); + +// MaterialX node type: mtlx/procedural2d/splittb_vector2 +// +function mtlx_procedural2d_splittb_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splittb_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'splittb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splittb_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','vector2'); + this.addProperty('valuet', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Top","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','vector2'); + this.addProperty('valueb', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Bottom","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'splittb_vector2'; + this.desc = "MaterialX:mtlx/procedural2d/splittb_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural2d_splittb_vector2.nodedef_name = 'ND_splittb_vector2'; +mtlx_procedural2d_splittb_vector2.nodedef_node = 'splittb'; +mtlx_procedural2d_splittb_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splittb_vector2',mtlx_procedural2d_splittb_vector2); + +// MaterialX node type: mtlx/procedural2d/splittb_vector3 +// +function mtlx_procedural2d_splittb_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splittb_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'splittb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splittb_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','vector3'); + this.addProperty('valuet', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Top","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','vector3'); + this.addProperty('valueb', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Bottom","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'splittb_vector3'; + this.desc = "MaterialX:mtlx/procedural2d/splittb_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural2d_splittb_vector3.nodedef_name = 'ND_splittb_vector3'; +mtlx_procedural2d_splittb_vector3.nodedef_node = 'splittb'; +mtlx_procedural2d_splittb_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splittb_vector3',mtlx_procedural2d_splittb_vector3); + +// MaterialX node type: mtlx/procedural2d/splittb_vector4 +// +function mtlx_procedural2d_splittb_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_splittb_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'splittb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_splittb_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('valuet','vector4'); + this.addProperty('valuet', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"Top","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('valueb','vector4'); + this.addProperty('valueb', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"Bottom","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','float'); + this.addProperty('center', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Center","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'splittb_vector4'; + this.desc = "MaterialX:mtlx/procedural2d/splittb_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural2d_splittb_vector4.nodedef_name = 'ND_splittb_vector4'; +mtlx_procedural2d_splittb_vector4.nodedef_node = 'splittb'; +mtlx_procedural2d_splittb_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/splittb.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/splittb_vector4',mtlx_procedural2d_splittb_vector4); + +// MaterialX node type: mtlx/procedural2d/noise2d_float +// +function mtlx_procedural2d_noise2d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'noise2d_float'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_noise2d_float.nodedef_name = 'ND_noise2d_float'; +mtlx_procedural2d_noise2d_float.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_float',mtlx_procedural2d_noise2d_float); + +// MaterialX node type: mtlx/procedural2d/noise2d_color3 +// +function mtlx_procedural2d_noise2d_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','vector3'); + this.addProperty('amplitude', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'noise2d_color3'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_noise2d_color3.nodedef_name = 'ND_noise2d_color3'; +mtlx_procedural2d_noise2d_color3.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_color3',mtlx_procedural2d_noise2d_color3); + +// MaterialX node type: mtlx/procedural2d/noise2d_color4 +// +function mtlx_procedural2d_noise2d_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_color4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','vector4'); + this.addProperty('amplitude', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'noise2d_color4'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural2d_noise2d_color4.nodedef_name = 'ND_noise2d_color4'; +mtlx_procedural2d_noise2d_color4.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_color4',mtlx_procedural2d_noise2d_color4); + +// MaterialX node type: mtlx/procedural2d/noise2d_vector2 +// +function mtlx_procedural2d_noise2d_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','vector2'); + this.addProperty('amplitude', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'noise2d_vector2'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural2d_noise2d_vector2.nodedef_name = 'ND_noise2d_vector2'; +mtlx_procedural2d_noise2d_vector2.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_vector2',mtlx_procedural2d_noise2d_vector2); + +// MaterialX node type: mtlx/procedural2d/noise2d_vector3 +// +function mtlx_procedural2d_noise2d_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','vector3'); + this.addProperty('amplitude', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'noise2d_vector3'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural2d_noise2d_vector3.nodedef_name = 'ND_noise2d_vector3'; +mtlx_procedural2d_noise2d_vector3.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_vector3',mtlx_procedural2d_noise2d_vector3); + +// MaterialX node type: mtlx/procedural2d/noise2d_vector4 +// +function mtlx_procedural2d_noise2d_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','vector4'); + this.addProperty('amplitude', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'noise2d_vector4'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural2d_noise2d_vector4.nodedef_name = 'ND_noise2d_vector4'; +mtlx_procedural2d_noise2d_vector4.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_vector4',mtlx_procedural2d_noise2d_vector4); + +// MaterialX node type: mtlx/procedural2d/noise2d_color3FA +// +function mtlx_procedural2d_noise2d_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_color3FA_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'noise2d_color3'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_noise2d_color3FA.nodedef_name = 'ND_noise2d_color3FA'; +mtlx_procedural2d_noise2d_color3FA.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_color3FA',mtlx_procedural2d_noise2d_color3FA); + +// MaterialX node type: mtlx/procedural2d/noise2d_color4FA +// +function mtlx_procedural2d_noise2d_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_color4FA_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'noise2d_color4'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural2d_noise2d_color4FA.nodedef_name = 'ND_noise2d_color4FA'; +mtlx_procedural2d_noise2d_color4FA.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_color4FA',mtlx_procedural2d_noise2d_color4FA); + +// MaterialX node type: mtlx/procedural2d/noise2d_vector2FA +// +function mtlx_procedural2d_noise2d_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_vector2FA_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'noise2d_vector2'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural2d_noise2d_vector2FA.nodedef_name = 'ND_noise2d_vector2FA'; +mtlx_procedural2d_noise2d_vector2FA.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_vector2FA',mtlx_procedural2d_noise2d_vector2FA); + +// MaterialX node type: mtlx/procedural2d/noise2d_vector3FA +// +function mtlx_procedural2d_noise2d_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_vector3FA_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'noise2d_vector3'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural2d_noise2d_vector3FA.nodedef_name = 'ND_noise2d_vector3FA'; +mtlx_procedural2d_noise2d_vector3FA.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_vector3FA',mtlx_procedural2d_noise2d_vector3FA); + +// MaterialX node type: mtlx/procedural2d/noise2d_vector4FA +// +function mtlx_procedural2d_noise2d_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise2d_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'noise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise2d_vector4FA_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'noise2d_vector4'; + this.desc = "MaterialX:mtlx/procedural2d/noise2d_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural2d_noise2d_vector4FA.nodedef_name = 'ND_noise2d_vector4FA'; +mtlx_procedural2d_noise2d_vector4FA.nodedef_node = 'noise2d'; +mtlx_procedural2d_noise2d_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/noise2d_vector4FA',mtlx_procedural2d_noise2d_vector4FA); + +// MaterialX node type: mtlx/procedural3d/noise3d_float +// +function mtlx_procedural3d_noise3d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_float_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'noise3d_float'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural3d_noise3d_float.nodedef_name = 'ND_noise3d_float'; +mtlx_procedural3d_noise3d_float.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_float',mtlx_procedural3d_noise3d_float); + +// MaterialX node type: mtlx/procedural3d/noise3d_color3 +// +function mtlx_procedural3d_noise3d_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_color3_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector3'); + this.addProperty('amplitude', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'noise3d_color3'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural3d_noise3d_color3.nodedef_name = 'ND_noise3d_color3'; +mtlx_procedural3d_noise3d_color3.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_color3',mtlx_procedural3d_noise3d_color3); + +// MaterialX node type: mtlx/procedural3d/noise3d_color4 +// +function mtlx_procedural3d_noise3d_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_color4_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector4'); + this.addProperty('amplitude', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'noise3d_color4'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural3d_noise3d_color4.nodedef_name = 'ND_noise3d_color4'; +mtlx_procedural3d_noise3d_color4.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_color4',mtlx_procedural3d_noise3d_color4); + +// MaterialX node type: mtlx/procedural3d/noise3d_vector2 +// +function mtlx_procedural3d_noise3d_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector2'); + this.addProperty('amplitude', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'noise3d_vector2'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural3d_noise3d_vector2.nodedef_name = 'ND_noise3d_vector2'; +mtlx_procedural3d_noise3d_vector2.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_vector2',mtlx_procedural3d_noise3d_vector2); + +// MaterialX node type: mtlx/procedural3d/noise3d_vector3 +// +function mtlx_procedural3d_noise3d_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector3'); + this.addProperty('amplitude', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'noise3d_vector3'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural3d_noise3d_vector3.nodedef_name = 'ND_noise3d_vector3'; +mtlx_procedural3d_noise3d_vector3.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_vector3',mtlx_procedural3d_noise3d_vector3); + +// MaterialX node type: mtlx/procedural3d/noise3d_vector4 +// +function mtlx_procedural3d_noise3d_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector4'); + this.addProperty('amplitude', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'noise3d_vector4'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural3d_noise3d_vector4.nodedef_name = 'ND_noise3d_vector4'; +mtlx_procedural3d_noise3d_vector4.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_vector4',mtlx_procedural3d_noise3d_vector4); + +// MaterialX node type: mtlx/procedural3d/noise3d_color3FA +// +function mtlx_procedural3d_noise3d_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_color3FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'noise3d_color3'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural3d_noise3d_color3FA.nodedef_name = 'ND_noise3d_color3FA'; +mtlx_procedural3d_noise3d_color3FA.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_color3FA',mtlx_procedural3d_noise3d_color3FA); + +// MaterialX node type: mtlx/procedural3d/noise3d_color4FA +// +function mtlx_procedural3d_noise3d_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_color4FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'noise3d_color4'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural3d_noise3d_color4FA.nodedef_name = 'ND_noise3d_color4FA'; +mtlx_procedural3d_noise3d_color4FA.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_color4FA',mtlx_procedural3d_noise3d_color4FA); + +// MaterialX node type: mtlx/procedural3d/noise3d_vector2FA +// +function mtlx_procedural3d_noise3d_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_vector2FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'noise3d_vector2'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural3d_noise3d_vector2FA.nodedef_name = 'ND_noise3d_vector2FA'; +mtlx_procedural3d_noise3d_vector2FA.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_vector2FA',mtlx_procedural3d_noise3d_vector2FA); + +// MaterialX node type: mtlx/procedural3d/noise3d_vector3FA +// +function mtlx_procedural3d_noise3d_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_vector3FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'noise3d_vector3'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural3d_noise3d_vector3FA.nodedef_name = 'ND_noise3d_vector3FA'; +mtlx_procedural3d_noise3d_vector3FA.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_vector3FA',mtlx_procedural3d_noise3d_vector3FA); + +// MaterialX node type: mtlx/procedural3d/noise3d_vector4FA +// +function mtlx_procedural3d_noise3d_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_noise3d_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'noise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_noise3d_vector4FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'noise3d_vector4'; + this.desc = "MaterialX:mtlx/procedural3d/noise3d_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural3d_noise3d_vector4FA.nodedef_name = 'ND_noise3d_vector4FA'; +mtlx_procedural3d_noise3d_vector4FA.nodedef_node = 'noise3d'; +mtlx_procedural3d_noise3d_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/noise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/noise3d_vector4FA',mtlx_procedural3d_noise3d_vector4FA); + +// MaterialX node type: mtlx/procedural3d/fractal3d_float +// +function mtlx_procedural3d_fractal3d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_float_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'fractal3d_float'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural3d_fractal3d_float.nodedef_name = 'ND_fractal3d_float'; +mtlx_procedural3d_fractal3d_float.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_float',mtlx_procedural3d_fractal3d_float); + +// MaterialX node type: mtlx/procedural3d/fractal3d_color3 +// +function mtlx_procedural3d_fractal3d_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_color3_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector3'); + this.addProperty('amplitude', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'fractal3d_color3'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural3d_fractal3d_color3.nodedef_name = 'ND_fractal3d_color3'; +mtlx_procedural3d_fractal3d_color3.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_color3',mtlx_procedural3d_fractal3d_color3); + +// MaterialX node type: mtlx/procedural3d/fractal3d_color4 +// +function mtlx_procedural3d_fractal3d_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_color4_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector4'); + this.addProperty('amplitude', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'fractal3d_color4'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural3d_fractal3d_color4.nodedef_name = 'ND_fractal3d_color4'; +mtlx_procedural3d_fractal3d_color4.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_color4',mtlx_procedural3d_fractal3d_color4); + +// MaterialX node type: mtlx/procedural3d/fractal3d_vector2 +// +function mtlx_procedural3d_fractal3d_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector2'); + this.addProperty('amplitude', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'fractal3d_vector2'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural3d_fractal3d_vector2.nodedef_name = 'ND_fractal3d_vector2'; +mtlx_procedural3d_fractal3d_vector2.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_vector2',mtlx_procedural3d_fractal3d_vector2); + +// MaterialX node type: mtlx/procedural3d/fractal3d_vector3 +// +function mtlx_procedural3d_fractal3d_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector3'); + this.addProperty('amplitude', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'fractal3d_vector3'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural3d_fractal3d_vector3.nodedef_name = 'ND_fractal3d_vector3'; +mtlx_procedural3d_fractal3d_vector3.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_vector3',mtlx_procedural3d_fractal3d_vector3); + +// MaterialX node type: mtlx/procedural3d/fractal3d_vector4 +// +function mtlx_procedural3d_fractal3d_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_vector4_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','vector4'); + this.addProperty('amplitude', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'fractal3d_vector4'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural3d_fractal3d_vector4.nodedef_name = 'ND_fractal3d_vector4'; +mtlx_procedural3d_fractal3d_vector4.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_vector4',mtlx_procedural3d_fractal3d_vector4); + +// MaterialX node type: mtlx/procedural3d/fractal3d_color3FA +// +function mtlx_procedural3d_fractal3d_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_color3FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'fractal3d_color3'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural3d_fractal3d_color3FA.nodedef_name = 'ND_fractal3d_color3FA'; +mtlx_procedural3d_fractal3d_color3FA.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_color3FA',mtlx_procedural3d_fractal3d_color3FA); + +// MaterialX node type: mtlx/procedural3d/fractal3d_color4FA +// +function mtlx_procedural3d_fractal3d_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_color4FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'fractal3d_color4'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_procedural3d_fractal3d_color4FA.nodedef_name = 'ND_fractal3d_color4FA'; +mtlx_procedural3d_fractal3d_color4FA.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_color4FA',mtlx_procedural3d_fractal3d_color4FA); + +// MaterialX node type: mtlx/procedural3d/fractal3d_vector2FA +// +function mtlx_procedural3d_fractal3d_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_vector2FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'fractal3d_vector2'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural3d_fractal3d_vector2FA.nodedef_name = 'ND_fractal3d_vector2FA'; +mtlx_procedural3d_fractal3d_vector2FA.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_vector2FA',mtlx_procedural3d_fractal3d_vector2FA); + +// MaterialX node type: mtlx/procedural3d/fractal3d_vector3FA +// +function mtlx_procedural3d_fractal3d_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_vector3FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'fractal3d_vector3'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural3d_fractal3d_vector3FA.nodedef_name = 'ND_fractal3d_vector3FA'; +mtlx_procedural3d_fractal3d_vector3FA.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_vector3FA',mtlx_procedural3d_fractal3d_vector3FA); + +// MaterialX node type: mtlx/procedural3d/fractal3d_vector4FA +// +function mtlx_procedural3d_fractal3d_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_fractal3d_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'fractal3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_fractal3d_vector4FA_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('amplitude','float'); + this.addProperty('amplitude', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'fractal3d_vector4'; + this.desc = "MaterialX:mtlx/procedural3d/fractal3d_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_procedural3d_fractal3d_vector4FA.nodedef_name = 'ND_fractal3d_vector4FA'; +mtlx_procedural3d_fractal3d_vector4FA.nodedef_node = 'fractal3d'; +mtlx_procedural3d_fractal3d_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/fractal3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/fractal3d_vector4FA',mtlx_procedural3d_fractal3d_vector4FA); + +// MaterialX node type: mtlx/procedural2d/cellnoise2d_float +// +function mtlx_procedural2d_cellnoise2d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_cellnoise2d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'cellnoise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cellnoise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_cellnoise2d_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'cellnoise2d_float'; + this.desc = "MaterialX:mtlx/procedural2d/cellnoise2d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_cellnoise2d_float.nodedef_name = 'ND_cellnoise2d_float'; +mtlx_procedural2d_cellnoise2d_float.nodedef_node = 'cellnoise2d'; +mtlx_procedural2d_cellnoise2d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cellnoise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/cellnoise2d_float',mtlx_procedural2d_cellnoise2d_float); + +// MaterialX node type: mtlx/procedural3d/cellnoise3d_float +// +function mtlx_procedural3d_cellnoise3d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_cellnoise3d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'cellnoise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cellnoise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_cellnoise3d_float_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'cellnoise3d_float'; + this.desc = "MaterialX:mtlx/procedural3d/cellnoise3d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural3d_cellnoise3d_float.nodedef_name = 'ND_cellnoise3d_float'; +mtlx_procedural3d_cellnoise3d_float.nodedef_node = 'cellnoise3d'; +mtlx_procedural3d_cellnoise3d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cellnoise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/cellnoise3d_float',mtlx_procedural3d_cellnoise3d_float); + +// MaterialX node type: mtlx/procedural2d/worleynoise2d_float +// +function mtlx_procedural2d_worleynoise2d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_worleynoise2d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'worleynoise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_worleynoise2d_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('jitter','float'); + this.addProperty('jitter', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'worleynoise2d_float'; + this.desc = "MaterialX:mtlx/procedural2d/worleynoise2d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_worleynoise2d_float.nodedef_name = 'ND_worleynoise2d_float'; +mtlx_procedural2d_worleynoise2d_float.nodedef_node = 'worleynoise2d'; +mtlx_procedural2d_worleynoise2d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/worleynoise2d_float',mtlx_procedural2d_worleynoise2d_float); + +// MaterialX node type: mtlx/procedural2d/worleynoise2d_vector2 +// +function mtlx_procedural2d_worleynoise2d_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_worleynoise2d_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'worleynoise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_worleynoise2d_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('jitter','float'); + this.addProperty('jitter', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'worleynoise2d_vector2'; + this.desc = "MaterialX:mtlx/procedural2d/worleynoise2d_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural2d_worleynoise2d_vector2.nodedef_name = 'ND_worleynoise2d_vector2'; +mtlx_procedural2d_worleynoise2d_vector2.nodedef_node = 'worleynoise2d'; +mtlx_procedural2d_worleynoise2d_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/worleynoise2d_vector2',mtlx_procedural2d_worleynoise2d_vector2); + +// MaterialX node type: mtlx/procedural2d/worleynoise2d_vector3 +// +function mtlx_procedural2d_worleynoise2d_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_worleynoise2d_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'worleynoise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_worleynoise2d_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('jitter','float'); + this.addProperty('jitter', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'worleynoise2d_vector3'; + this.desc = "MaterialX:mtlx/procedural2d/worleynoise2d_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural2d_worleynoise2d_vector3.nodedef_name = 'ND_worleynoise2d_vector3'; +mtlx_procedural2d_worleynoise2d_vector3.nodedef_node = 'worleynoise2d'; +mtlx_procedural2d_worleynoise2d_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/worleynoise2d_vector3',mtlx_procedural2d_worleynoise2d_vector3); + +// MaterialX node type: mtlx/procedural3d/worleynoise3d_float +// +function mtlx_procedural3d_worleynoise3d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_worleynoise3d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'worleynoise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_worleynoise3d_float_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('jitter','float'); + this.addProperty('jitter', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'worleynoise3d_float'; + this.desc = "MaterialX:mtlx/procedural3d/worleynoise3d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural3d_worleynoise3d_float.nodedef_name = 'ND_worleynoise3d_float'; +mtlx_procedural3d_worleynoise3d_float.nodedef_node = 'worleynoise3d'; +mtlx_procedural3d_worleynoise3d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/worleynoise3d_float',mtlx_procedural3d_worleynoise3d_float); + +// MaterialX node type: mtlx/procedural3d/worleynoise3d_vector2 +// +function mtlx_procedural3d_worleynoise3d_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_worleynoise3d_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'worleynoise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_worleynoise3d_vector2_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('jitter','float'); + this.addProperty('jitter', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'worleynoise3d_vector2'; + this.desc = "MaterialX:mtlx/procedural3d/worleynoise3d_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_procedural3d_worleynoise3d_vector2.nodedef_name = 'ND_worleynoise3d_vector2'; +mtlx_procedural3d_worleynoise3d_vector2.nodedef_node = 'worleynoise3d'; +mtlx_procedural3d_worleynoise3d_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/worleynoise3d_vector2',mtlx_procedural3d_worleynoise3d_vector2); + +// MaterialX node type: mtlx/procedural3d/worleynoise3d_vector3 +// +function mtlx_procedural3d_worleynoise3d_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_worleynoise3d_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'worleynoise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_worleynoise3d_vector3_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('jitter','float'); + this.addProperty('jitter', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'worleynoise3d_vector3'; + this.desc = "MaterialX:mtlx/procedural3d/worleynoise3d_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_procedural3d_worleynoise3d_vector3.nodedef_name = 'ND_worleynoise3d_vector3'; +mtlx_procedural3d_worleynoise3d_vector3.nodedef_node = 'worleynoise3d'; +mtlx_procedural3d_worleynoise3d_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/worleynoise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/worleynoise3d_vector3',mtlx_procedural3d_worleynoise3d_vector3); + +// MaterialX node type: mtlx/procedural2d/unifiednoise2d_float +// +function mtlx_procedural2d_unifiednoise2d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_unifiednoise2d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'unifiednoise2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/unifiednoise2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_unifiednoise2d_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addInput('freq','vector2'); + this.addProperty('freq', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Frequency","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Offset","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addInput('jitter','float'); + this.addProperty('jitter', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Jitter","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addInput('outmin','float'); + this.addProperty('outmin', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Output Min","uimin":null,"uimax":null,"uifolder":"Post Process"}); + this.addInput('outmax','float'); + this.addProperty('outmax', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Output Max","uimin":null,"uimax":null,"uifolder":"Post Process"}); + this.addInput('clampoutput','boolean'); + this.addProperty('clampoutput', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"Clamp Output","uimin":null,"uimax":null,"uifolder":"Post Process"}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Octaves","uimin":null,"uimax":null,"uifolder":"Fractal"}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Lacunarity","uimin":null,"uimax":null,"uifolder":"Fractal"}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Diminish","uimin":null,"uimax":null,"uifolder":"Fractal"}); + this.addInput('type','integer'); + this.addProperty('type', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Noise Type","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addOutput('out','float'); + this.title = 'unifiednoise2d_float'; + this.desc = "MaterialX:mtlx/procedural2d/unifiednoise2d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_unifiednoise2d_float.nodedef_name = 'ND_unifiednoise2d_float'; +mtlx_procedural2d_unifiednoise2d_float.nodedef_node = 'unifiednoise2d'; +mtlx_procedural2d_unifiednoise2d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/unifiednoise2d.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/unifiednoise2d_float',mtlx_procedural2d_unifiednoise2d_float); + +// MaterialX node type: mtlx/procedural3d/unifiednoise3d_float +// +function mtlx_procedural3d_unifiednoise3d_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_unifiednoise3d_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'unifiednoise3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/unifiednoise3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_unifiednoise3d_float_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('position','vector3'); + this.addProperty('position', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addInput('freq','vector3'); + this.addProperty('freq', [1, 1, 1], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Frequency","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addInput('offset','vector3'); + this.addProperty('offset', [0, 0, 0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Offset","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addInput('jitter','float'); + this.addProperty('jitter', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Jitter","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addInput('outmin','float'); + this.addProperty('outmin', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Output Min","uimin":null,"uimax":null,"uifolder":"Post Process"}); + this.addInput('outmax','float'); + this.addProperty('outmax', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Output Max","uimin":null,"uimax":null,"uifolder":"Post Process"}); + this.addInput('clampoutput','boolean'); + this.addProperty('clampoutput', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"Clamp Output","uimin":null,"uimax":null,"uifolder":"Post Process"}); + this.addInput('octaves','integer'); + this.addProperty('octaves', 3, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Octaves","uimin":null,"uimax":null,"uifolder":"Fractal"}); + this.addInput('lacunarity','float'); + this.addProperty('lacunarity', 2, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Lacunarity","uimin":null,"uimax":null,"uifolder":"Fractal"}); + this.addInput('diminish','float'); + this.addProperty('diminish', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Diminish","uimin":null,"uimax":null,"uifolder":"Fractal"}); + this.addInput('type','integer'); + this.addProperty('type', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Noise Type","uimin":null,"uimax":null,"uifolder":"Common"}); + this.addOutput('out','float'); + this.title = 'unifiednoise3d_float'; + this.desc = "MaterialX:mtlx/procedural3d/unifiednoise3d_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural3d_unifiednoise3d_float.nodedef_name = 'ND_unifiednoise3d_float'; +mtlx_procedural3d_unifiednoise3d_float.nodedef_node = 'unifiednoise3d'; +mtlx_procedural3d_unifiednoise3d_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/unifiednoise3d.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/unifiednoise3d_float',mtlx_procedural3d_unifiednoise3d_float); + +// MaterialX node type: mtlx/procedural/randomfloat_float +// +function mtlx_procedural_randomfloat_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_randomfloat_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'randomfloat'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/randomfloat.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_randomfloat_float_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Input","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('min','float'); + this.addProperty('min', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Minimum","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('max','float'); + this.addProperty('max', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Maximum","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('seed','integer'); + this.addProperty('seed', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Seed","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'randomfloat_float'; + this.desc = "MaterialX:mtlx/procedural/randomfloat_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural_randomfloat_float.nodedef_name = 'ND_randomfloat_float'; +mtlx_procedural_randomfloat_float.nodedef_node = 'randomfloat'; +mtlx_procedural_randomfloat_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/randomfloat.html'; +LiteGraph.registerNodeType('mtlx/procedural/randomfloat_float',mtlx_procedural_randomfloat_float); + +// MaterialX node type: mtlx/procedural/randomfloat_integer +// +function mtlx_procedural_randomfloat_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_randomfloat_integer'; + this.nodedef_type = 'float'; + this.nodedef_node = 'randomfloat'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/randomfloat.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_randomfloat_integer_out_genglsl.png'; + this.nodedef_group = 'procedural'; + this.addInput('in','integer'); + this.addProperty('in', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Input","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('min','float'); + this.addProperty('min', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Minimum","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('max','float'); + this.addProperty('max', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Maximum","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('seed','integer'); + this.addProperty('seed', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Seed","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'randomfloat_float'; + this.desc = "MaterialX:mtlx/procedural/randomfloat_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural_randomfloat_integer.nodedef_name = 'ND_randomfloat_integer'; +mtlx_procedural_randomfloat_integer.nodedef_node = 'randomfloat'; +mtlx_procedural_randomfloat_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/randomfloat.html'; +LiteGraph.registerNodeType('mtlx/procedural/randomfloat_integer',mtlx_procedural_randomfloat_integer); + +// MaterialX node type: mtlx/procedural3d/randomcolor_float +// +function mtlx_procedural3d_randomcolor_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_randomcolor_float'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'randomcolor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/randomcolor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_randomcolor_float_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Input","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('huelow','float'); + this.addProperty('huelow', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Hue Low","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('huehigh','float'); + this.addProperty('huehigh', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Hue High","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('saturationlow','float'); + this.addProperty('saturationlow', 0.825, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Saturation Low","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('saturationhigh','float'); + this.addProperty('saturationhigh', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Saturation High","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('brightnesslow','float'); + this.addProperty('brightnesslow', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Brightness Low","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('brightnesshigh','float'); + this.addProperty('brightnesshigh', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Brightness High","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('seed','integer'); + this.addProperty('seed', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Seed","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'randomcolor_color3'; + this.desc = "MaterialX:mtlx/procedural3d/randomcolor_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural3d_randomcolor_float.nodedef_name = 'ND_randomcolor_float'; +mtlx_procedural3d_randomcolor_float.nodedef_node = 'randomcolor'; +mtlx_procedural3d_randomcolor_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/randomcolor.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/randomcolor_float',mtlx_procedural3d_randomcolor_float); + +// MaterialX node type: mtlx/procedural3d/randomcolor_integer +// +function mtlx_procedural3d_randomcolor_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_randomcolor_integer'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'randomcolor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/randomcolor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_randomcolor_integer_out_genglsl.png'; + this.nodedef_group = 'procedural3d'; + this.addInput('in','integer'); + this.addProperty('in', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Input","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('huelow','float'); + this.addProperty('huelow', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Hue Low","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('huehigh','float'); + this.addProperty('huehigh', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Hue High","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('saturationlow','float'); + this.addProperty('saturationlow', 0.825, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Saturation Low","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('saturationhigh','float'); + this.addProperty('saturationhigh', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Saturation High","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('brightnesslow','float'); + this.addProperty('brightnesslow', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Brightness Low","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('brightnesshigh','float'); + this.addProperty('brightnesshigh', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Brightness High","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('seed','integer'); + this.addProperty('seed', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Seed","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'randomcolor_color3'; + this.desc = "MaterialX:mtlx/procedural3d/randomcolor_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural3d_randomcolor_integer.nodedef_name = 'ND_randomcolor_integer'; +mtlx_procedural3d_randomcolor_integer.nodedef_node = 'randomcolor'; +mtlx_procedural3d_randomcolor_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/randomcolor.html'; +LiteGraph.registerNodeType('mtlx/procedural3d/randomcolor_integer',mtlx_procedural3d_randomcolor_integer); + +// MaterialX node type: mtlx/procedural2d/checkerboard_color3 +// +function mtlx_procedural2d_checkerboard_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_checkerboard_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'checkerboard'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/checkerboard.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_checkerboard_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('color1','color3'); + this.addProperty('color1', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Color 1","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('color2','color3'); + this.addProperty('color2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Color 2","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [8, 8], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"UV Tiling","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"UV Offset","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"Texture Coordinates","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'checkerboard_color3'; + this.desc = "MaterialX:mtlx/procedural2d/checkerboard_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_checkerboard_color3.nodedef_name = 'ND_checkerboard_color3'; +mtlx_procedural2d_checkerboard_color3.nodedef_node = 'checkerboard'; +mtlx_procedural2d_checkerboard_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/checkerboard.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/checkerboard_color3',mtlx_procedural2d_checkerboard_color3); + +// MaterialX node type: mtlx/procedural2d/line_float +// +function mtlx_procedural2d_line_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_line_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'line'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/line.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_line_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','vector2'); + this.addProperty('center', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('radius','float'); + this.addProperty('radius', 0.1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('point1','vector2'); + this.addProperty('point1', [0.25, 0.25], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('point2','vector2'); + this.addProperty('point2', [0.75, 0.75], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'line_float'; + this.desc = "MaterialX:mtlx/procedural2d/line_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_line_float.nodedef_name = 'ND_line_float'; +mtlx_procedural2d_line_float.nodedef_node = 'line'; +mtlx_procedural2d_line_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/line.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/line_float',mtlx_procedural2d_line_float); + +// MaterialX node type: mtlx/procedural2d/circle_float +// +function mtlx_procedural2d_circle_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_circle_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'circle'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/circle.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_circle_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','vector2'); + this.addProperty('center', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('radius','float'); + this.addProperty('radius', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'circle_float'; + this.desc = "MaterialX:mtlx/procedural2d/circle_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_circle_float.nodedef_name = 'ND_circle_float'; +mtlx_procedural2d_circle_float.nodedef_node = 'circle'; +mtlx_procedural2d_circle_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/circle.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/circle_float',mtlx_procedural2d_circle_float); + +// MaterialX node type: mtlx/procedural2d/cloverleaf_float +// +function mtlx_procedural2d_cloverleaf_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_cloverleaf_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'cloverleaf'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cloverleaf.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_cloverleaf_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','vector2'); + this.addProperty('center', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('radius','float'); + this.addProperty('radius', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'cloverleaf_float'; + this.desc = "MaterialX:mtlx/procedural2d/cloverleaf_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_cloverleaf_float.nodedef_name = 'ND_cloverleaf_float'; +mtlx_procedural2d_cloverleaf_float.nodedef_node = 'cloverleaf'; +mtlx_procedural2d_cloverleaf_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cloverleaf.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/cloverleaf_float',mtlx_procedural2d_cloverleaf_float); + +// MaterialX node type: mtlx/procedural2d/hexagon_float +// +function mtlx_procedural2d_hexagon_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_hexagon_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'hexagon'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hexagon.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_hexagon_float_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('center','vector2'); + this.addProperty('center', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('radius','float'); + this.addProperty('radius', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'hexagon_float'; + this.desc = "MaterialX:mtlx/procedural2d/hexagon_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_procedural2d_hexagon_float.nodedef_name = 'ND_hexagon_float'; +mtlx_procedural2d_hexagon_float.nodedef_node = 'hexagon'; +mtlx_procedural2d_hexagon_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hexagon.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/hexagon_float',mtlx_procedural2d_hexagon_float); + +// MaterialX node type: mtlx/procedural2d/grid_color3 +// +function mtlx_procedural2d_grid_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_grid_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'grid'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/grid.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_grid_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thickness','float'); + this.addProperty('thickness', 0.05, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('staggered','boolean'); + this.addProperty('staggered', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'grid_color3'; + this.desc = "MaterialX:mtlx/procedural2d/grid_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_grid_color3.nodedef_name = 'ND_grid_color3'; +mtlx_procedural2d_grid_color3.nodedef_node = 'grid'; +mtlx_procedural2d_grid_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/grid.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/grid_color3',mtlx_procedural2d_grid_color3); + +// MaterialX node type: mtlx/procedural2d/crosshatch_color3 +// +function mtlx_procedural2d_crosshatch_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_crosshatch_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'crosshatch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/crosshatch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_crosshatch_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thickness','float'); + this.addProperty('thickness', 0.05, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('staggered','boolean'); + this.addProperty('staggered', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'crosshatch_color3'; + this.desc = "MaterialX:mtlx/procedural2d/crosshatch_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_crosshatch_color3.nodedef_name = 'ND_crosshatch_color3'; +mtlx_procedural2d_crosshatch_color3.nodedef_node = 'crosshatch'; +mtlx_procedural2d_crosshatch_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/crosshatch.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/crosshatch_color3',mtlx_procedural2d_crosshatch_color3); + +// MaterialX node type: mtlx/procedural2d/tiledcircles_color3 +// +function mtlx_procedural2d_tiledcircles_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledcircles_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'tiledcircles'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledcircles.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledcircles_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('staggered','boolean'); + this.addProperty('staggered', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'tiledcircles_color3'; + this.desc = "MaterialX:mtlx/procedural2d/tiledcircles_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_tiledcircles_color3.nodedef_name = 'ND_tiledcircles_color3'; +mtlx_procedural2d_tiledcircles_color3.nodedef_node = 'tiledcircles'; +mtlx_procedural2d_tiledcircles_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledcircles.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/tiledcircles_color3',mtlx_procedural2d_tiledcircles_color3); + +// MaterialX node type: mtlx/procedural2d/tiledcloverleafs_color3 +// +function mtlx_procedural2d_tiledcloverleafs_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledcloverleafs_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'tiledcloverleafs'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledcloverleafs.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledcloverleafs_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('staggered','boolean'); + this.addProperty('staggered', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'tiledcloverleafs_color3'; + this.desc = "MaterialX:mtlx/procedural2d/tiledcloverleafs_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_tiledcloverleafs_color3.nodedef_name = 'ND_tiledcloverleafs_color3'; +mtlx_procedural2d_tiledcloverleafs_color3.nodedef_node = 'tiledcloverleafs'; +mtlx_procedural2d_tiledcloverleafs_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledcloverleafs.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/tiledcloverleafs_color3',mtlx_procedural2d_tiledcloverleafs_color3); + +// MaterialX node type: mtlx/procedural2d/tiledhexagons_color3 +// +function mtlx_procedural2d_tiledhexagons_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tiledhexagons_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'tiledhexagons'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledhexagons.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tiledhexagons_color3_out_genglsl.png'; + this.nodedef_group = 'procedural2d'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvtiling','vector2'); + this.addProperty('uvtiling', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uvoffset','vector2'); + this.addProperty('uvoffset', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('staggered','boolean'); + this.addProperty('staggered', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'tiledhexagons_color3'; + this.desc = "MaterialX:mtlx/procedural2d/tiledhexagons_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_procedural2d_tiledhexagons_color3.nodedef_name = 'ND_tiledhexagons_color3'; +mtlx_procedural2d_tiledhexagons_color3.nodedef_node = 'tiledhexagons'; +mtlx_procedural2d_tiledhexagons_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tiledhexagons.html'; +LiteGraph.registerNodeType('mtlx/procedural2d/tiledhexagons_color3',mtlx_procedural2d_tiledhexagons_color3); + +// MaterialX node type: mtlx/geometric/position_vector3 +// +function mtlx_geometric_position_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_position_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'position'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/position.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_position_vector3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('space','string'); + this.addProperty('space', 'object', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'position_vector3'; + this.desc = "MaterialX:mtlx/geometric/position_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_geometric_position_vector3.nodedef_name = 'ND_position_vector3'; +mtlx_geometric_position_vector3.nodedef_node = 'position'; +mtlx_geometric_position_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/position.html'; +LiteGraph.registerNodeType('mtlx/geometric/position_vector3',mtlx_geometric_position_vector3); + +// MaterialX node type: mtlx/geometric/normal_vector3 +// +function mtlx_geometric_normal_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_normal_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'normal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_normal_vector3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('space','string'); + this.addProperty('space', 'object', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'normal_vector3'; + this.desc = "MaterialX:mtlx/geometric/normal_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_geometric_normal_vector3.nodedef_name = 'ND_normal_vector3'; +mtlx_geometric_normal_vector3.nodedef_node = 'normal'; +mtlx_geometric_normal_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normal.html'; +LiteGraph.registerNodeType('mtlx/geometric/normal_vector3',mtlx_geometric_normal_vector3); + +// MaterialX node type: mtlx/geometric/tangent_vector3 +// +function mtlx_geometric_tangent_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tangent_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'tangent'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tangent.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tangent_vector3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('space','string'); + this.addProperty('space', 'object', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'tangent_vector3'; + this.desc = "MaterialX:mtlx/geometric/tangent_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_geometric_tangent_vector3.nodedef_name = 'ND_tangent_vector3'; +mtlx_geometric_tangent_vector3.nodedef_node = 'tangent'; +mtlx_geometric_tangent_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tangent.html'; +LiteGraph.registerNodeType('mtlx/geometric/tangent_vector3',mtlx_geometric_tangent_vector3); + +// MaterialX node type: mtlx/geometric/bitangent_vector3 +// +function mtlx_geometric_bitangent_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_bitangent_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'bitangent'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/bitangent.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_bitangent_vector3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('space','string'); + this.addProperty('space', 'object', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'bitangent_vector3'; + this.desc = "MaterialX:mtlx/geometric/bitangent_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_geometric_bitangent_vector3.nodedef_name = 'ND_bitangent_vector3'; +mtlx_geometric_bitangent_vector3.nodedef_node = 'bitangent'; +mtlx_geometric_bitangent_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/bitangent.html'; +LiteGraph.registerNodeType('mtlx/geometric/bitangent_vector3',mtlx_geometric_bitangent_vector3); + +// MaterialX node type: mtlx/geometric/texcoord_vector2 +// +function mtlx_geometric_texcoord_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_texcoord_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'texcoord'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/texcoord.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_texcoord_vector2_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'texcoord_vector2'; + this.desc = "MaterialX:mtlx/geometric/texcoord_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_geometric_texcoord_vector2.nodedef_name = 'ND_texcoord_vector2'; +mtlx_geometric_texcoord_vector2.nodedef_node = 'texcoord'; +mtlx_geometric_texcoord_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/texcoord.html'; +LiteGraph.registerNodeType('mtlx/geometric/texcoord_vector2',mtlx_geometric_texcoord_vector2); + +// MaterialX node type: mtlx/geometric/texcoord_vector3 +// +function mtlx_geometric_texcoord_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_texcoord_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'texcoord'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/texcoord.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_texcoord_vector3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'texcoord_vector3'; + this.desc = "MaterialX:mtlx/geometric/texcoord_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_geometric_texcoord_vector3.nodedef_name = 'ND_texcoord_vector3'; +mtlx_geometric_texcoord_vector3.nodedef_node = 'texcoord'; +mtlx_geometric_texcoord_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/texcoord.html'; +LiteGraph.registerNodeType('mtlx/geometric/texcoord_vector3',mtlx_geometric_texcoord_vector3); + +// MaterialX node type: mtlx/geometric/geomcolor_float +// +function mtlx_geometric_geomcolor_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geomcolor_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'geomcolor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geomcolor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geomcolor_float_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'geomcolor_float'; + this.desc = "MaterialX:mtlx/geometric/geomcolor_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_geometric_geomcolor_float.nodedef_name = 'ND_geomcolor_float'; +mtlx_geometric_geomcolor_float.nodedef_node = 'geomcolor'; +mtlx_geometric_geomcolor_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geomcolor.html'; +LiteGraph.registerNodeType('mtlx/geometric/geomcolor_float',mtlx_geometric_geomcolor_float); + +// MaterialX node type: mtlx/geometric/geomcolor_color3 +// +function mtlx_geometric_geomcolor_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geomcolor_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'geomcolor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geomcolor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geomcolor_color3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'geomcolor_color3'; + this.desc = "MaterialX:mtlx/geometric/geomcolor_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_geometric_geomcolor_color3.nodedef_name = 'ND_geomcolor_color3'; +mtlx_geometric_geomcolor_color3.nodedef_node = 'geomcolor'; +mtlx_geometric_geomcolor_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geomcolor.html'; +LiteGraph.registerNodeType('mtlx/geometric/geomcolor_color3',mtlx_geometric_geomcolor_color3); + +// MaterialX node type: mtlx/geometric/geomcolor_color4 +// +function mtlx_geometric_geomcolor_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geomcolor_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'geomcolor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geomcolor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geomcolor_color4_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'geomcolor_color4'; + this.desc = "MaterialX:mtlx/geometric/geomcolor_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_geometric_geomcolor_color4.nodedef_name = 'ND_geomcolor_color4'; +mtlx_geometric_geomcolor_color4.nodedef_node = 'geomcolor'; +mtlx_geometric_geomcolor_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geomcolor.html'; +LiteGraph.registerNodeType('mtlx/geometric/geomcolor_color4',mtlx_geometric_geomcolor_color4); + +// MaterialX node type: mtlx/geometric/geompropvalue_integer +// +function mtlx_geometric_geompropvalue_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_integer_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','integer'); + this.addProperty('default', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'geompropvalue_integer'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_geometric_geompropvalue_integer.nodedef_name = 'ND_geompropvalue_integer'; +mtlx_geometric_geompropvalue_integer.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_integer',mtlx_geometric_geompropvalue_integer); + +// MaterialX node type: mtlx/geometric/geompropvalue_boolean +// +function mtlx_geometric_geompropvalue_boolean() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_boolean'; + this.nodedef_type = 'boolean'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_boolean_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','boolean'); + this.addProperty('default', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','boolean'); + this.title = 'geompropvalue_boolean'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_boolean"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#48A'; +} +mtlx_geometric_geompropvalue_boolean.nodedef_name = 'ND_geompropvalue_boolean'; +mtlx_geometric_geompropvalue_boolean.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_boolean.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_boolean',mtlx_geometric_geompropvalue_boolean); + +// MaterialX node type: mtlx/geometric/geompropvalue_string +// +function mtlx_geometric_geompropvalue_string() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_string'; + this.nodedef_type = 'string'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_string_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','string'); + this.addProperty('default', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','string'); + this.title = 'geompropvalue_string'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_string"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#888'; +} +mtlx_geometric_geompropvalue_string.nodedef_name = 'ND_geompropvalue_string'; +mtlx_geometric_geompropvalue_string.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_string.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_string',mtlx_geometric_geompropvalue_string); + +// MaterialX node type: mtlx/geometric/geompropvalue_float +// +function mtlx_geometric_geompropvalue_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_float_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','float'); + this.addProperty('default', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'geompropvalue_float'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_geometric_geompropvalue_float.nodedef_name = 'ND_geompropvalue_float'; +mtlx_geometric_geompropvalue_float.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_float',mtlx_geometric_geompropvalue_float); + +// MaterialX node type: mtlx/geometric/geompropvalue_color3 +// +function mtlx_geometric_geompropvalue_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_color3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color3'); + this.addProperty('default', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'geompropvalue_color3'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_geometric_geompropvalue_color3.nodedef_name = 'ND_geompropvalue_color3'; +mtlx_geometric_geompropvalue_color3.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_color3',mtlx_geometric_geompropvalue_color3); + +// MaterialX node type: mtlx/geometric/geompropvalue_color4 +// +function mtlx_geometric_geompropvalue_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_color4_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color4'); + this.addProperty('default', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'geompropvalue_color4'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_geometric_geompropvalue_color4.nodedef_name = 'ND_geompropvalue_color4'; +mtlx_geometric_geompropvalue_color4.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_color4',mtlx_geometric_geompropvalue_color4); + +// MaterialX node type: mtlx/geometric/geompropvalue_vector2 +// +function mtlx_geometric_geompropvalue_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_vector2_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector2'); + this.addProperty('default', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'geompropvalue_vector2'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_geometric_geompropvalue_vector2.nodedef_name = 'ND_geompropvalue_vector2'; +mtlx_geometric_geompropvalue_vector2.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_vector2',mtlx_geometric_geompropvalue_vector2); + +// MaterialX node type: mtlx/geometric/geompropvalue_vector3 +// +function mtlx_geometric_geompropvalue_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_vector3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector3'); + this.addProperty('default', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'geompropvalue_vector3'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_geometric_geompropvalue_vector3.nodedef_name = 'ND_geompropvalue_vector3'; +mtlx_geometric_geompropvalue_vector3.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_vector3',mtlx_geometric_geompropvalue_vector3); + +// MaterialX node type: mtlx/geometric/geompropvalue_vector4 +// +function mtlx_geometric_geompropvalue_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_geompropvalue_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'geompropvalue'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_geompropvalue_vector4_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('geomprop','string'); + this.addProperty('geomprop', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector4'); + this.addProperty('default', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'geompropvalue_vector4'; + this.desc = "MaterialX:mtlx/geometric/geompropvalue_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_geometric_geompropvalue_vector4.nodedef_name = 'ND_geompropvalue_vector4'; +mtlx_geometric_geompropvalue_vector4.nodedef_node = 'geompropvalue'; +mtlx_geometric_geompropvalue_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/geompropvalue.html'; +LiteGraph.registerNodeType('mtlx/geometric/geompropvalue_vector4',mtlx_geometric_geompropvalue_vector4); + +// MaterialX node type: mtlx/geometric/bump_vector3 +// +function mtlx_geometric_bump_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_bump_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'bump'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/bump.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_bump_vector3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('height','float'); + this.addProperty('height', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Height","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','float'); + this.addProperty('scale', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Scale","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Tangent","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'bump_vector3'; + this.desc = "MaterialX:mtlx/geometric/bump_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_geometric_bump_vector3.nodedef_name = 'ND_bump_vector3'; +mtlx_geometric_bump_vector3.nodedef_node = 'bump'; +mtlx_geometric_bump_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/bump.html'; +LiteGraph.registerNodeType('mtlx/geometric/bump_vector3',mtlx_geometric_bump_vector3); + +// MaterialX node type: mtlx/global/ambientocclusion_float +// +function mtlx_global_ambientocclusion_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ambientocclusion_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ambientocclusion'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ambientocclusion.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ambientocclusion_float_out_genglsl.png'; + this.nodedef_group = 'global'; + this.addInput('coneangle','float'); + this.addProperty('coneangle', 90.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('maxdistance','float'); + this.addProperty('maxdistance', 1e38, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ambientocclusion_float'; + this.desc = "MaterialX:mtlx/global/ambientocclusion_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_global_ambientocclusion_float.nodedef_name = 'ND_ambientocclusion_float'; +mtlx_global_ambientocclusion_float.nodedef_node = 'ambientocclusion'; +mtlx_global_ambientocclusion_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ambientocclusion.html'; +LiteGraph.registerNodeType('mtlx/global/ambientocclusion_float',mtlx_global_ambientocclusion_float); + +// MaterialX node type: mtlx/application/frame_float +// +function mtlx_application_frame_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_frame_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'frame'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/frame.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_frame_float_out_genglsl.png'; + this.nodedef_group = 'application'; + this.addOutput('out','float'); + this.title = 'frame_float'; + this.desc = "MaterialX:mtlx/application/frame_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_application_frame_float.nodedef_name = 'ND_frame_float'; +mtlx_application_frame_float.nodedef_node = 'frame'; +mtlx_application_frame_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/frame.html'; +LiteGraph.registerNodeType('mtlx/application/frame_float',mtlx_application_frame_float); + +// MaterialX node type: mtlx/application/time_float +// +function mtlx_application_time_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_time_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'time'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/time.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_time_float_out_genglsl.png'; + this.nodedef_group = 'application'; + this.addInput('fps','float'); + this.addProperty('fps', 24.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'time_float'; + this.desc = "MaterialX:mtlx/application/time_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_application_time_float.nodedef_name = 'ND_time_float'; +mtlx_application_time_float.nodedef_node = 'time'; +mtlx_application_time_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/time.html'; +LiteGraph.registerNodeType('mtlx/application/time_float',mtlx_application_time_float); + +// MaterialX node type: mtlx/math/add_float +// +function mtlx_math_add_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'add_float'; + this.desc = "MaterialX:mtlx/math/add_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_add_float.nodedef_name = 'ND_add_float'; +mtlx_math_add_float.nodedef_node = 'add'; +mtlx_math_add_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_float',mtlx_math_add_float); + +// MaterialX node type: mtlx/math/add_integer +// +function mtlx_math_add_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_integer_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'add_integer'; + this.desc = "MaterialX:mtlx/math/add_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_add_integer.nodedef_name = 'ND_add_integer'; +mtlx_math_add_integer.nodedef_node = 'add'; +mtlx_math_add_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_integer',mtlx_math_add_integer); + +// MaterialX node type: mtlx/math/add_color3 +// +function mtlx_math_add_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'add_color3'; + this.desc = "MaterialX:mtlx/math/add_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_add_color3.nodedef_name = 'ND_add_color3'; +mtlx_math_add_color3.nodedef_node = 'add'; +mtlx_math_add_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_color3',mtlx_math_add_color3); + +// MaterialX node type: mtlx/math/add_color4 +// +function mtlx_math_add_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'add_color4'; + this.desc = "MaterialX:mtlx/math/add_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_add_color4.nodedef_name = 'ND_add_color4'; +mtlx_math_add_color4.nodedef_node = 'add'; +mtlx_math_add_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_color4',mtlx_math_add_color4); + +// MaterialX node type: mtlx/math/add_vector2 +// +function mtlx_math_add_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'add_vector2'; + this.desc = "MaterialX:mtlx/math/add_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_add_vector2.nodedef_name = 'ND_add_vector2'; +mtlx_math_add_vector2.nodedef_node = 'add'; +mtlx_math_add_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_vector2',mtlx_math_add_vector2); + +// MaterialX node type: mtlx/math/add_vector3 +// +function mtlx_math_add_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'add_vector3'; + this.desc = "MaterialX:mtlx/math/add_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_add_vector3.nodedef_name = 'ND_add_vector3'; +mtlx_math_add_vector3.nodedef_node = 'add'; +mtlx_math_add_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_vector3',mtlx_math_add_vector3); + +// MaterialX node type: mtlx/math/add_vector4 +// +function mtlx_math_add_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'add_vector4'; + this.desc = "MaterialX:mtlx/math/add_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_add_vector4.nodedef_name = 'ND_add_vector4'; +mtlx_math_add_vector4.nodedef_node = 'add'; +mtlx_math_add_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_vector4',mtlx_math_add_vector4); + +// MaterialX node type: mtlx/math/add_matrix33 +// +function mtlx_math_add_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_matrix33_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix33'); + this.addProperty('in1', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0,0.0,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'add_matrix33'; + this.desc = "MaterialX:mtlx/math/add_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_add_matrix33.nodedef_name = 'ND_add_matrix33'; +mtlx_math_add_matrix33.nodedef_node = 'add'; +mtlx_math_add_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_matrix33',mtlx_math_add_matrix33); + +// MaterialX node type: mtlx/math/add_matrix44 +// +function mtlx_math_add_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix44'); + this.addProperty('in1', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'add_matrix44'; + this.desc = "MaterialX:mtlx/math/add_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_add_matrix44.nodedef_name = 'ND_add_matrix44'; +mtlx_math_add_matrix44.nodedef_node = 'add'; +mtlx_math_add_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_matrix44',mtlx_math_add_matrix44); + +// MaterialX node type: mtlx/math/add_color3FA +// +function mtlx_math_add_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'add_color3'; + this.desc = "MaterialX:mtlx/math/add_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_add_color3FA.nodedef_name = 'ND_add_color3FA'; +mtlx_math_add_color3FA.nodedef_node = 'add'; +mtlx_math_add_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_color3FA',mtlx_math_add_color3FA); + +// MaterialX node type: mtlx/math/add_color4FA +// +function mtlx_math_add_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'add_color4'; + this.desc = "MaterialX:mtlx/math/add_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_add_color4FA.nodedef_name = 'ND_add_color4FA'; +mtlx_math_add_color4FA.nodedef_node = 'add'; +mtlx_math_add_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_color4FA',mtlx_math_add_color4FA); + +// MaterialX node type: mtlx/math/add_vector2FA +// +function mtlx_math_add_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'add_vector2'; + this.desc = "MaterialX:mtlx/math/add_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_add_vector2FA.nodedef_name = 'ND_add_vector2FA'; +mtlx_math_add_vector2FA.nodedef_node = 'add'; +mtlx_math_add_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_vector2FA',mtlx_math_add_vector2FA); + +// MaterialX node type: mtlx/math/add_vector3FA +// +function mtlx_math_add_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'add_vector3'; + this.desc = "MaterialX:mtlx/math/add_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_add_vector3FA.nodedef_name = 'ND_add_vector3FA'; +mtlx_math_add_vector3FA.nodedef_node = 'add'; +mtlx_math_add_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_vector3FA',mtlx_math_add_vector3FA); + +// MaterialX node type: mtlx/math/add_vector4FA +// +function mtlx_math_add_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'add_vector4'; + this.desc = "MaterialX:mtlx/math/add_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_add_vector4FA.nodedef_name = 'ND_add_vector4FA'; +mtlx_math_add_vector4FA.nodedef_node = 'add'; +mtlx_math_add_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_vector4FA',mtlx_math_add_vector4FA); + +// MaterialX node type: mtlx/math/add_matrix33FA +// +function mtlx_math_add_matrix33FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_matrix33FA'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_matrix33FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix33'); + this.addProperty('in1', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'add_matrix33'; + this.desc = "MaterialX:mtlx/math/add_matrix33FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_add_matrix33FA.nodedef_name = 'ND_add_matrix33FA'; +mtlx_math_add_matrix33FA.nodedef_node = 'add'; +mtlx_math_add_matrix33FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_matrix33FA',mtlx_math_add_matrix33FA); + +// MaterialX node type: mtlx/math/add_matrix44FA +// +function mtlx_math_add_matrix44FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_add_matrix44FA'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'add'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_add_matrix44FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix44'); + this.addProperty('in1', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'add_matrix44'; + this.desc = "MaterialX:mtlx/math/add_matrix44FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_add_matrix44FA.nodedef_name = 'ND_add_matrix44FA'; +mtlx_math_add_matrix44FA.nodedef_node = 'add'; +mtlx_math_add_matrix44FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/add.html'; +LiteGraph.registerNodeType('mtlx/math/add_matrix44FA',mtlx_math_add_matrix44FA); + +// MaterialX node type: mtlx/math/subtract_float +// +function mtlx_math_subtract_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'subtract_float'; + this.desc = "MaterialX:mtlx/math/subtract_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_subtract_float.nodedef_name = 'ND_subtract_float'; +mtlx_math_subtract_float.nodedef_node = 'subtract'; +mtlx_math_subtract_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_float',mtlx_math_subtract_float); + +// MaterialX node type: mtlx/math/subtract_integer +// +function mtlx_math_subtract_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_integer_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'subtract_integer'; + this.desc = "MaterialX:mtlx/math/subtract_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_subtract_integer.nodedef_name = 'ND_subtract_integer'; +mtlx_math_subtract_integer.nodedef_node = 'subtract'; +mtlx_math_subtract_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_integer',mtlx_math_subtract_integer); + +// MaterialX node type: mtlx/math/subtract_color3 +// +function mtlx_math_subtract_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'subtract_color3'; + this.desc = "MaterialX:mtlx/math/subtract_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_subtract_color3.nodedef_name = 'ND_subtract_color3'; +mtlx_math_subtract_color3.nodedef_node = 'subtract'; +mtlx_math_subtract_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_color3',mtlx_math_subtract_color3); + +// MaterialX node type: mtlx/math/subtract_color4 +// +function mtlx_math_subtract_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'subtract_color4'; + this.desc = "MaterialX:mtlx/math/subtract_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_subtract_color4.nodedef_name = 'ND_subtract_color4'; +mtlx_math_subtract_color4.nodedef_node = 'subtract'; +mtlx_math_subtract_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_color4',mtlx_math_subtract_color4); + +// MaterialX node type: mtlx/math/subtract_vector2 +// +function mtlx_math_subtract_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'subtract_vector2'; + this.desc = "MaterialX:mtlx/math/subtract_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_subtract_vector2.nodedef_name = 'ND_subtract_vector2'; +mtlx_math_subtract_vector2.nodedef_node = 'subtract'; +mtlx_math_subtract_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_vector2',mtlx_math_subtract_vector2); + +// MaterialX node type: mtlx/math/subtract_vector3 +// +function mtlx_math_subtract_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'subtract_vector3'; + this.desc = "MaterialX:mtlx/math/subtract_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_subtract_vector3.nodedef_name = 'ND_subtract_vector3'; +mtlx_math_subtract_vector3.nodedef_node = 'subtract'; +mtlx_math_subtract_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_vector3',mtlx_math_subtract_vector3); + +// MaterialX node type: mtlx/math/subtract_vector4 +// +function mtlx_math_subtract_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'subtract_vector4'; + this.desc = "MaterialX:mtlx/math/subtract_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_subtract_vector4.nodedef_name = 'ND_subtract_vector4'; +mtlx_math_subtract_vector4.nodedef_node = 'subtract'; +mtlx_math_subtract_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_vector4',mtlx_math_subtract_vector4); + +// MaterialX node type: mtlx/math/subtract_matrix33 +// +function mtlx_math_subtract_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_matrix33_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix33'); + this.addProperty('in1', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0,0.0,0.0, 0.0,0.0,0.0, 0.0,0.0,0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'subtract_matrix33'; + this.desc = "MaterialX:mtlx/math/subtract_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_subtract_matrix33.nodedef_name = 'ND_subtract_matrix33'; +mtlx_math_subtract_matrix33.nodedef_node = 'subtract'; +mtlx_math_subtract_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_matrix33',mtlx_math_subtract_matrix33); + +// MaterialX node type: mtlx/math/subtract_matrix44 +// +function mtlx_math_subtract_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix44'); + this.addProperty('in1', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0, 0.0,0.0,0.0,0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'subtract_matrix44'; + this.desc = "MaterialX:mtlx/math/subtract_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_subtract_matrix44.nodedef_name = 'ND_subtract_matrix44'; +mtlx_math_subtract_matrix44.nodedef_node = 'subtract'; +mtlx_math_subtract_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_matrix44',mtlx_math_subtract_matrix44); + +// MaterialX node type: mtlx/math/subtract_color3FA +// +function mtlx_math_subtract_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'subtract_color3'; + this.desc = "MaterialX:mtlx/math/subtract_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_subtract_color3FA.nodedef_name = 'ND_subtract_color3FA'; +mtlx_math_subtract_color3FA.nodedef_node = 'subtract'; +mtlx_math_subtract_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_color3FA',mtlx_math_subtract_color3FA); + +// MaterialX node type: mtlx/math/subtract_color4FA +// +function mtlx_math_subtract_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'subtract_color4'; + this.desc = "MaterialX:mtlx/math/subtract_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_subtract_color4FA.nodedef_name = 'ND_subtract_color4FA'; +mtlx_math_subtract_color4FA.nodedef_node = 'subtract'; +mtlx_math_subtract_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_color4FA',mtlx_math_subtract_color4FA); + +// MaterialX node type: mtlx/math/subtract_vector2FA +// +function mtlx_math_subtract_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'subtract_vector2'; + this.desc = "MaterialX:mtlx/math/subtract_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_subtract_vector2FA.nodedef_name = 'ND_subtract_vector2FA'; +mtlx_math_subtract_vector2FA.nodedef_node = 'subtract'; +mtlx_math_subtract_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_vector2FA',mtlx_math_subtract_vector2FA); + +// MaterialX node type: mtlx/math/subtract_vector3FA +// +function mtlx_math_subtract_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'subtract_vector3'; + this.desc = "MaterialX:mtlx/math/subtract_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_subtract_vector3FA.nodedef_name = 'ND_subtract_vector3FA'; +mtlx_math_subtract_vector3FA.nodedef_node = 'subtract'; +mtlx_math_subtract_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_vector3FA',mtlx_math_subtract_vector3FA); + +// MaterialX node type: mtlx/math/subtract_vector4FA +// +function mtlx_math_subtract_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'subtract_vector4'; + this.desc = "MaterialX:mtlx/math/subtract_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_subtract_vector4FA.nodedef_name = 'ND_subtract_vector4FA'; +mtlx_math_subtract_vector4FA.nodedef_node = 'subtract'; +mtlx_math_subtract_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_vector4FA',mtlx_math_subtract_vector4FA); + +// MaterialX node type: mtlx/math/subtract_matrix33FA +// +function mtlx_math_subtract_matrix33FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_matrix33FA'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_matrix33FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix33'); + this.addProperty('in1', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'subtract_matrix33'; + this.desc = "MaterialX:mtlx/math/subtract_matrix33FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_subtract_matrix33FA.nodedef_name = 'ND_subtract_matrix33FA'; +mtlx_math_subtract_matrix33FA.nodedef_node = 'subtract'; +mtlx_math_subtract_matrix33FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_matrix33FA',mtlx_math_subtract_matrix33FA); + +// MaterialX node type: mtlx/math/subtract_matrix44FA +// +function mtlx_math_subtract_matrix44FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_subtract_matrix44FA'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'subtract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_subtract_matrix44FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix44'); + this.addProperty('in1', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'subtract_matrix44'; + this.desc = "MaterialX:mtlx/math/subtract_matrix44FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_subtract_matrix44FA.nodedef_name = 'ND_subtract_matrix44FA'; +mtlx_math_subtract_matrix44FA.nodedef_node = 'subtract'; +mtlx_math_subtract_matrix44FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/subtract.html'; +LiteGraph.registerNodeType('mtlx/math/subtract_matrix44FA',mtlx_math_subtract_matrix44FA); + +// MaterialX node type: mtlx/math/multiply_float +// +function mtlx_math_multiply_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'multiply_float'; + this.desc = "MaterialX:mtlx/math/multiply_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_multiply_float.nodedef_name = 'ND_multiply_float'; +mtlx_math_multiply_float.nodedef_node = 'multiply'; +mtlx_math_multiply_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_float',mtlx_math_multiply_float); + +// MaterialX node type: mtlx/math/multiply_color3 +// +function mtlx_math_multiply_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'multiply_color3'; + this.desc = "MaterialX:mtlx/math/multiply_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_multiply_color3.nodedef_name = 'ND_multiply_color3'; +mtlx_math_multiply_color3.nodedef_node = 'multiply'; +mtlx_math_multiply_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_color3',mtlx_math_multiply_color3); + +// MaterialX node type: mtlx/math/multiply_color4 +// +function mtlx_math_multiply_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'multiply_color4'; + this.desc = "MaterialX:mtlx/math/multiply_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_multiply_color4.nodedef_name = 'ND_multiply_color4'; +mtlx_math_multiply_color4.nodedef_node = 'multiply'; +mtlx_math_multiply_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_color4',mtlx_math_multiply_color4); + +// MaterialX node type: mtlx/math/multiply_vector2 +// +function mtlx_math_multiply_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'multiply_vector2'; + this.desc = "MaterialX:mtlx/math/multiply_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_multiply_vector2.nodedef_name = 'ND_multiply_vector2'; +mtlx_math_multiply_vector2.nodedef_node = 'multiply'; +mtlx_math_multiply_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_vector2',mtlx_math_multiply_vector2); + +// MaterialX node type: mtlx/math/multiply_vector3 +// +function mtlx_math_multiply_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'multiply_vector3'; + this.desc = "MaterialX:mtlx/math/multiply_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_multiply_vector3.nodedef_name = 'ND_multiply_vector3'; +mtlx_math_multiply_vector3.nodedef_node = 'multiply'; +mtlx_math_multiply_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_vector3',mtlx_math_multiply_vector3); + +// MaterialX node type: mtlx/math/multiply_vector4 +// +function mtlx_math_multiply_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'multiply_vector4'; + this.desc = "MaterialX:mtlx/math/multiply_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_multiply_vector4.nodedef_name = 'ND_multiply_vector4'; +mtlx_math_multiply_vector4.nodedef_node = 'multiply'; +mtlx_math_multiply_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_vector4',mtlx_math_multiply_vector4); + +// MaterialX node type: mtlx/math/multiply_matrix33 +// +function mtlx_math_multiply_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_matrix33_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix33'); + this.addProperty('in1', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'multiply_matrix33'; + this.desc = "MaterialX:mtlx/math/multiply_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_multiply_matrix33.nodedef_name = 'ND_multiply_matrix33'; +mtlx_math_multiply_matrix33.nodedef_node = 'multiply'; +mtlx_math_multiply_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_matrix33',mtlx_math_multiply_matrix33); + +// MaterialX node type: mtlx/math/multiply_matrix44 +// +function mtlx_math_multiply_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix44'); + this.addProperty('in1', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'multiply_matrix44'; + this.desc = "MaterialX:mtlx/math/multiply_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_multiply_matrix44.nodedef_name = 'ND_multiply_matrix44'; +mtlx_math_multiply_matrix44.nodedef_node = 'multiply'; +mtlx_math_multiply_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_matrix44',mtlx_math_multiply_matrix44); + +// MaterialX node type: mtlx/math/multiply_color3FA +// +function mtlx_math_multiply_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'multiply_color3'; + this.desc = "MaterialX:mtlx/math/multiply_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_multiply_color3FA.nodedef_name = 'ND_multiply_color3FA'; +mtlx_math_multiply_color3FA.nodedef_node = 'multiply'; +mtlx_math_multiply_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_color3FA',mtlx_math_multiply_color3FA); + +// MaterialX node type: mtlx/math/multiply_color4FA +// +function mtlx_math_multiply_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'multiply_color4'; + this.desc = "MaterialX:mtlx/math/multiply_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_multiply_color4FA.nodedef_name = 'ND_multiply_color4FA'; +mtlx_math_multiply_color4FA.nodedef_node = 'multiply'; +mtlx_math_multiply_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_color4FA',mtlx_math_multiply_color4FA); + +// MaterialX node type: mtlx/math/multiply_vector2FA +// +function mtlx_math_multiply_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'multiply_vector2'; + this.desc = "MaterialX:mtlx/math/multiply_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_multiply_vector2FA.nodedef_name = 'ND_multiply_vector2FA'; +mtlx_math_multiply_vector2FA.nodedef_node = 'multiply'; +mtlx_math_multiply_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_vector2FA',mtlx_math_multiply_vector2FA); + +// MaterialX node type: mtlx/math/multiply_vector3FA +// +function mtlx_math_multiply_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'multiply_vector3'; + this.desc = "MaterialX:mtlx/math/multiply_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_multiply_vector3FA.nodedef_name = 'ND_multiply_vector3FA'; +mtlx_math_multiply_vector3FA.nodedef_node = 'multiply'; +mtlx_math_multiply_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_vector3FA',mtlx_math_multiply_vector3FA); + +// MaterialX node type: mtlx/math/multiply_vector4FA +// +function mtlx_math_multiply_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_multiply_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'multiply'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_multiply_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'multiply_vector4'; + this.desc = "MaterialX:mtlx/math/multiply_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_multiply_vector4FA.nodedef_name = 'ND_multiply_vector4FA'; +mtlx_math_multiply_vector4FA.nodedef_node = 'multiply'; +mtlx_math_multiply_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/multiply.html'; +LiteGraph.registerNodeType('mtlx/math/multiply_vector4FA',mtlx_math_multiply_vector4FA); + +// MaterialX node type: mtlx/math/divide_float +// +function mtlx_math_divide_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'divide_float'; + this.desc = "MaterialX:mtlx/math/divide_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_divide_float.nodedef_name = 'ND_divide_float'; +mtlx_math_divide_float.nodedef_node = 'divide'; +mtlx_math_divide_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_float',mtlx_math_divide_float); + +// MaterialX node type: mtlx/math/divide_color3 +// +function mtlx_math_divide_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'divide_color3'; + this.desc = "MaterialX:mtlx/math/divide_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_divide_color3.nodedef_name = 'ND_divide_color3'; +mtlx_math_divide_color3.nodedef_node = 'divide'; +mtlx_math_divide_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_color3',mtlx_math_divide_color3); + +// MaterialX node type: mtlx/math/divide_color4 +// +function mtlx_math_divide_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'divide_color4'; + this.desc = "MaterialX:mtlx/math/divide_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_divide_color4.nodedef_name = 'ND_divide_color4'; +mtlx_math_divide_color4.nodedef_node = 'divide'; +mtlx_math_divide_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_color4',mtlx_math_divide_color4); + +// MaterialX node type: mtlx/math/divide_vector2 +// +function mtlx_math_divide_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'divide_vector2'; + this.desc = "MaterialX:mtlx/math/divide_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_divide_vector2.nodedef_name = 'ND_divide_vector2'; +mtlx_math_divide_vector2.nodedef_node = 'divide'; +mtlx_math_divide_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_vector2',mtlx_math_divide_vector2); + +// MaterialX node type: mtlx/math/divide_vector3 +// +function mtlx_math_divide_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'divide_vector3'; + this.desc = "MaterialX:mtlx/math/divide_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_divide_vector3.nodedef_name = 'ND_divide_vector3'; +mtlx_math_divide_vector3.nodedef_node = 'divide'; +mtlx_math_divide_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_vector3',mtlx_math_divide_vector3); + +// MaterialX node type: mtlx/math/divide_vector4 +// +function mtlx_math_divide_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'divide_vector4'; + this.desc = "MaterialX:mtlx/math/divide_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_divide_vector4.nodedef_name = 'ND_divide_vector4'; +mtlx_math_divide_vector4.nodedef_node = 'divide'; +mtlx_math_divide_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_vector4',mtlx_math_divide_vector4); + +// MaterialX node type: mtlx/math/divide_matrix33 +// +function mtlx_math_divide_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_matrix33_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix33'); + this.addProperty('in1', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'divide_matrix33'; + this.desc = "MaterialX:mtlx/math/divide_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_divide_matrix33.nodedef_name = 'ND_divide_matrix33'; +mtlx_math_divide_matrix33.nodedef_node = 'divide'; +mtlx_math_divide_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_matrix33',mtlx_math_divide_matrix33); + +// MaterialX node type: mtlx/math/divide_matrix44 +// +function mtlx_math_divide_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','matrix44'); + this.addProperty('in1', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'divide_matrix44'; + this.desc = "MaterialX:mtlx/math/divide_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_divide_matrix44.nodedef_name = 'ND_divide_matrix44'; +mtlx_math_divide_matrix44.nodedef_node = 'divide'; +mtlx_math_divide_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_matrix44',mtlx_math_divide_matrix44); + +// MaterialX node type: mtlx/math/divide_color3FA +// +function mtlx_math_divide_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'divide_color3'; + this.desc = "MaterialX:mtlx/math/divide_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_divide_color3FA.nodedef_name = 'ND_divide_color3FA'; +mtlx_math_divide_color3FA.nodedef_node = 'divide'; +mtlx_math_divide_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_color3FA',mtlx_math_divide_color3FA); + +// MaterialX node type: mtlx/math/divide_color4FA +// +function mtlx_math_divide_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'divide_color4'; + this.desc = "MaterialX:mtlx/math/divide_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_divide_color4FA.nodedef_name = 'ND_divide_color4FA'; +mtlx_math_divide_color4FA.nodedef_node = 'divide'; +mtlx_math_divide_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_color4FA',mtlx_math_divide_color4FA); + +// MaterialX node type: mtlx/math/divide_vector2FA +// +function mtlx_math_divide_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'divide_vector2'; + this.desc = "MaterialX:mtlx/math/divide_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_divide_vector2FA.nodedef_name = 'ND_divide_vector2FA'; +mtlx_math_divide_vector2FA.nodedef_node = 'divide'; +mtlx_math_divide_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_vector2FA',mtlx_math_divide_vector2FA); + +// MaterialX node type: mtlx/math/divide_vector3FA +// +function mtlx_math_divide_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'divide_vector3'; + this.desc = "MaterialX:mtlx/math/divide_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_divide_vector3FA.nodedef_name = 'ND_divide_vector3FA'; +mtlx_math_divide_vector3FA.nodedef_node = 'divide'; +mtlx_math_divide_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_vector3FA',mtlx_math_divide_vector3FA); + +// MaterialX node type: mtlx/math/divide_vector4FA +// +function mtlx_math_divide_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_divide_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'divide'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_divide_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'divide_vector4'; + this.desc = "MaterialX:mtlx/math/divide_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_divide_vector4FA.nodedef_name = 'ND_divide_vector4FA'; +mtlx_math_divide_vector4FA.nodedef_node = 'divide'; +mtlx_math_divide_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/divide.html'; +LiteGraph.registerNodeType('mtlx/math/divide_vector4FA',mtlx_math_divide_vector4FA); + +// MaterialX node type: mtlx/math/modulo_float +// +function mtlx_math_modulo_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'modulo_float'; + this.desc = "MaterialX:mtlx/math/modulo_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_modulo_float.nodedef_name = 'ND_modulo_float'; +mtlx_math_modulo_float.nodedef_node = 'modulo'; +mtlx_math_modulo_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_float',mtlx_math_modulo_float); + +// MaterialX node type: mtlx/math/modulo_color3 +// +function mtlx_math_modulo_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'modulo_color3'; + this.desc = "MaterialX:mtlx/math/modulo_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_modulo_color3.nodedef_name = 'ND_modulo_color3'; +mtlx_math_modulo_color3.nodedef_node = 'modulo'; +mtlx_math_modulo_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_color3',mtlx_math_modulo_color3); + +// MaterialX node type: mtlx/math/modulo_color4 +// +function mtlx_math_modulo_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'modulo_color4'; + this.desc = "MaterialX:mtlx/math/modulo_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_modulo_color4.nodedef_name = 'ND_modulo_color4'; +mtlx_math_modulo_color4.nodedef_node = 'modulo'; +mtlx_math_modulo_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_color4',mtlx_math_modulo_color4); + +// MaterialX node type: mtlx/math/modulo_vector2 +// +function mtlx_math_modulo_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'modulo_vector2'; + this.desc = "MaterialX:mtlx/math/modulo_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_modulo_vector2.nodedef_name = 'ND_modulo_vector2'; +mtlx_math_modulo_vector2.nodedef_node = 'modulo'; +mtlx_math_modulo_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_vector2',mtlx_math_modulo_vector2); + +// MaterialX node type: mtlx/math/modulo_vector3 +// +function mtlx_math_modulo_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'modulo_vector3'; + this.desc = "MaterialX:mtlx/math/modulo_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_modulo_vector3.nodedef_name = 'ND_modulo_vector3'; +mtlx_math_modulo_vector3.nodedef_node = 'modulo'; +mtlx_math_modulo_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_vector3',mtlx_math_modulo_vector3); + +// MaterialX node type: mtlx/math/modulo_vector4 +// +function mtlx_math_modulo_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'modulo_vector4'; + this.desc = "MaterialX:mtlx/math/modulo_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_modulo_vector4.nodedef_name = 'ND_modulo_vector4'; +mtlx_math_modulo_vector4.nodedef_node = 'modulo'; +mtlx_math_modulo_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_vector4',mtlx_math_modulo_vector4); + +// MaterialX node type: mtlx/math/modulo_color3FA +// +function mtlx_math_modulo_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'modulo_color3'; + this.desc = "MaterialX:mtlx/math/modulo_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_modulo_color3FA.nodedef_name = 'ND_modulo_color3FA'; +mtlx_math_modulo_color3FA.nodedef_node = 'modulo'; +mtlx_math_modulo_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_color3FA',mtlx_math_modulo_color3FA); + +// MaterialX node type: mtlx/math/modulo_color4FA +// +function mtlx_math_modulo_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'modulo_color4'; + this.desc = "MaterialX:mtlx/math/modulo_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_modulo_color4FA.nodedef_name = 'ND_modulo_color4FA'; +mtlx_math_modulo_color4FA.nodedef_node = 'modulo'; +mtlx_math_modulo_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_color4FA',mtlx_math_modulo_color4FA); + +// MaterialX node type: mtlx/math/modulo_vector2FA +// +function mtlx_math_modulo_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'modulo_vector2'; + this.desc = "MaterialX:mtlx/math/modulo_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_modulo_vector2FA.nodedef_name = 'ND_modulo_vector2FA'; +mtlx_math_modulo_vector2FA.nodedef_node = 'modulo'; +mtlx_math_modulo_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_vector2FA',mtlx_math_modulo_vector2FA); + +// MaterialX node type: mtlx/math/modulo_vector3FA +// +function mtlx_math_modulo_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'modulo_vector3'; + this.desc = "MaterialX:mtlx/math/modulo_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_modulo_vector3FA.nodedef_name = 'ND_modulo_vector3FA'; +mtlx_math_modulo_vector3FA.nodedef_node = 'modulo'; +mtlx_math_modulo_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_vector3FA',mtlx_math_modulo_vector3FA); + +// MaterialX node type: mtlx/math/modulo_vector4FA +// +function mtlx_math_modulo_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_modulo_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'modulo'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_modulo_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'modulo_vector4'; + this.desc = "MaterialX:mtlx/math/modulo_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_modulo_vector4FA.nodedef_name = 'ND_modulo_vector4FA'; +mtlx_math_modulo_vector4FA.nodedef_node = 'modulo'; +mtlx_math_modulo_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/modulo.html'; +LiteGraph.registerNodeType('mtlx/math/modulo_vector4FA',mtlx_math_modulo_vector4FA); + +// MaterialX node type: mtlx/math/invert_float +// +function mtlx_math_invert_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'invert_float'; + this.desc = "MaterialX:mtlx/math/invert_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_invert_float.nodedef_name = 'ND_invert_float'; +mtlx_math_invert_float.nodedef_node = 'invert'; +mtlx_math_invert_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_float',mtlx_math_invert_float); + +// MaterialX node type: mtlx/math/invert_color3 +// +function mtlx_math_invert_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','color3'); + this.addProperty('amount', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'invert_color3'; + this.desc = "MaterialX:mtlx/math/invert_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_invert_color3.nodedef_name = 'ND_invert_color3'; +mtlx_math_invert_color3.nodedef_node = 'invert'; +mtlx_math_invert_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_color3',mtlx_math_invert_color3); + +// MaterialX node type: mtlx/math/invert_color4 +// +function mtlx_math_invert_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','color4'); + this.addProperty('amount', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'invert_color4'; + this.desc = "MaterialX:mtlx/math/invert_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_invert_color4.nodedef_name = 'ND_invert_color4'; +mtlx_math_invert_color4.nodedef_node = 'invert'; +mtlx_math_invert_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_color4',mtlx_math_invert_color4); + +// MaterialX node type: mtlx/math/invert_vector2 +// +function mtlx_math_invert_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','vector2'); + this.addProperty('amount', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'invert_vector2'; + this.desc = "MaterialX:mtlx/math/invert_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_invert_vector2.nodedef_name = 'ND_invert_vector2'; +mtlx_math_invert_vector2.nodedef_node = 'invert'; +mtlx_math_invert_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_vector2',mtlx_math_invert_vector2); + +// MaterialX node type: mtlx/math/invert_vector3 +// +function mtlx_math_invert_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','vector3'); + this.addProperty('amount', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'invert_vector3'; + this.desc = "MaterialX:mtlx/math/invert_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_invert_vector3.nodedef_name = 'ND_invert_vector3'; +mtlx_math_invert_vector3.nodedef_node = 'invert'; +mtlx_math_invert_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_vector3',mtlx_math_invert_vector3); + +// MaterialX node type: mtlx/math/invert_vector4 +// +function mtlx_math_invert_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','vector4'); + this.addProperty('amount', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'invert_vector4'; + this.desc = "MaterialX:mtlx/math/invert_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_invert_vector4.nodedef_name = 'ND_invert_vector4'; +mtlx_math_invert_vector4.nodedef_node = 'invert'; +mtlx_math_invert_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_vector4',mtlx_math_invert_vector4); + +// MaterialX node type: mtlx/math/invert_color3FA +// +function mtlx_math_invert_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'invert_color3'; + this.desc = "MaterialX:mtlx/math/invert_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_invert_color3FA.nodedef_name = 'ND_invert_color3FA'; +mtlx_math_invert_color3FA.nodedef_node = 'invert'; +mtlx_math_invert_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_color3FA',mtlx_math_invert_color3FA); + +// MaterialX node type: mtlx/math/invert_color4FA +// +function mtlx_math_invert_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'invert_color4'; + this.desc = "MaterialX:mtlx/math/invert_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_invert_color4FA.nodedef_name = 'ND_invert_color4FA'; +mtlx_math_invert_color4FA.nodedef_node = 'invert'; +mtlx_math_invert_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_color4FA',mtlx_math_invert_color4FA); + +// MaterialX node type: mtlx/math/invert_vector2FA +// +function mtlx_math_invert_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'invert_vector2'; + this.desc = "MaterialX:mtlx/math/invert_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_invert_vector2FA.nodedef_name = 'ND_invert_vector2FA'; +mtlx_math_invert_vector2FA.nodedef_node = 'invert'; +mtlx_math_invert_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_vector2FA',mtlx_math_invert_vector2FA); + +// MaterialX node type: mtlx/math/invert_vector3FA +// +function mtlx_math_invert_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'invert_vector3'; + this.desc = "MaterialX:mtlx/math/invert_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_invert_vector3FA.nodedef_name = 'ND_invert_vector3FA'; +mtlx_math_invert_vector3FA.nodedef_node = 'invert'; +mtlx_math_invert_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_vector3FA',mtlx_math_invert_vector3FA); + +// MaterialX node type: mtlx/math/invert_vector4FA +// +function mtlx_math_invert_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invert_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'invert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invert_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'invert_vector4'; + this.desc = "MaterialX:mtlx/math/invert_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_invert_vector4FA.nodedef_name = 'ND_invert_vector4FA'; +mtlx_math_invert_vector4FA.nodedef_node = 'invert'; +mtlx_math_invert_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invert.html'; +LiteGraph.registerNodeType('mtlx/math/invert_vector4FA',mtlx_math_invert_vector4FA); + +// MaterialX node type: mtlx/math/absval_float +// +function mtlx_math_absval_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_absval_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'absval'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_absval_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'absval_float'; + this.desc = "MaterialX:mtlx/math/absval_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_absval_float.nodedef_name = 'ND_absval_float'; +mtlx_math_absval_float.nodedef_node = 'absval'; +mtlx_math_absval_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; +LiteGraph.registerNodeType('mtlx/math/absval_float',mtlx_math_absval_float); + +// MaterialX node type: mtlx/math/absval_color3 +// +function mtlx_math_absval_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_absval_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'absval'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_absval_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'absval_color3'; + this.desc = "MaterialX:mtlx/math/absval_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_absval_color3.nodedef_name = 'ND_absval_color3'; +mtlx_math_absval_color3.nodedef_node = 'absval'; +mtlx_math_absval_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; +LiteGraph.registerNodeType('mtlx/math/absval_color3',mtlx_math_absval_color3); + +// MaterialX node type: mtlx/math/absval_color4 +// +function mtlx_math_absval_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_absval_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'absval'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_absval_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'absval_color4'; + this.desc = "MaterialX:mtlx/math/absval_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_absval_color4.nodedef_name = 'ND_absval_color4'; +mtlx_math_absval_color4.nodedef_node = 'absval'; +mtlx_math_absval_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; +LiteGraph.registerNodeType('mtlx/math/absval_color4',mtlx_math_absval_color4); + +// MaterialX node type: mtlx/math/absval_vector2 +// +function mtlx_math_absval_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_absval_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'absval'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_absval_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'absval_vector2'; + this.desc = "MaterialX:mtlx/math/absval_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_absval_vector2.nodedef_name = 'ND_absval_vector2'; +mtlx_math_absval_vector2.nodedef_node = 'absval'; +mtlx_math_absval_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; +LiteGraph.registerNodeType('mtlx/math/absval_vector2',mtlx_math_absval_vector2); + +// MaterialX node type: mtlx/math/absval_vector3 +// +function mtlx_math_absval_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_absval_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'absval'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_absval_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'absval_vector3'; + this.desc = "MaterialX:mtlx/math/absval_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_absval_vector3.nodedef_name = 'ND_absval_vector3'; +mtlx_math_absval_vector3.nodedef_node = 'absval'; +mtlx_math_absval_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; +LiteGraph.registerNodeType('mtlx/math/absval_vector3',mtlx_math_absval_vector3); + +// MaterialX node type: mtlx/math/absval_vector4 +// +function mtlx_math_absval_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_absval_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'absval'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_absval_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'absval_vector4'; + this.desc = "MaterialX:mtlx/math/absval_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_absval_vector4.nodedef_name = 'ND_absval_vector4'; +mtlx_math_absval_vector4.nodedef_node = 'absval'; +mtlx_math_absval_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/absval.html'; +LiteGraph.registerNodeType('mtlx/math/absval_vector4',mtlx_math_absval_vector4); + +// MaterialX node type: mtlx/math/floor_float +// +function mtlx_math_floor_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_floor_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'floor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_floor_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'floor_float'; + this.desc = "MaterialX:mtlx/math/floor_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_floor_float.nodedef_name = 'ND_floor_float'; +mtlx_math_floor_float.nodedef_node = 'floor'; +mtlx_math_floor_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; +LiteGraph.registerNodeType('mtlx/math/floor_float',mtlx_math_floor_float); + +// MaterialX node type: mtlx/math/floor_color3 +// +function mtlx_math_floor_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_floor_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'floor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_floor_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'floor_color3'; + this.desc = "MaterialX:mtlx/math/floor_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_floor_color3.nodedef_name = 'ND_floor_color3'; +mtlx_math_floor_color3.nodedef_node = 'floor'; +mtlx_math_floor_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; +LiteGraph.registerNodeType('mtlx/math/floor_color3',mtlx_math_floor_color3); + +// MaterialX node type: mtlx/math/floor_color4 +// +function mtlx_math_floor_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_floor_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'floor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_floor_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'floor_color4'; + this.desc = "MaterialX:mtlx/math/floor_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_floor_color4.nodedef_name = 'ND_floor_color4'; +mtlx_math_floor_color4.nodedef_node = 'floor'; +mtlx_math_floor_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; +LiteGraph.registerNodeType('mtlx/math/floor_color4',mtlx_math_floor_color4); + +// MaterialX node type: mtlx/math/floor_vector2 +// +function mtlx_math_floor_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_floor_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'floor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_floor_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'floor_vector2'; + this.desc = "MaterialX:mtlx/math/floor_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_floor_vector2.nodedef_name = 'ND_floor_vector2'; +mtlx_math_floor_vector2.nodedef_node = 'floor'; +mtlx_math_floor_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; +LiteGraph.registerNodeType('mtlx/math/floor_vector2',mtlx_math_floor_vector2); + +// MaterialX node type: mtlx/math/floor_vector3 +// +function mtlx_math_floor_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_floor_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'floor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_floor_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'floor_vector3'; + this.desc = "MaterialX:mtlx/math/floor_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_floor_vector3.nodedef_name = 'ND_floor_vector3'; +mtlx_math_floor_vector3.nodedef_node = 'floor'; +mtlx_math_floor_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; +LiteGraph.registerNodeType('mtlx/math/floor_vector3',mtlx_math_floor_vector3); + +// MaterialX node type: mtlx/math/floor_vector4 +// +function mtlx_math_floor_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_floor_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'floor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_floor_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'floor_vector4'; + this.desc = "MaterialX:mtlx/math/floor_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_floor_vector4.nodedef_name = 'ND_floor_vector4'; +mtlx_math_floor_vector4.nodedef_node = 'floor'; +mtlx_math_floor_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; +LiteGraph.registerNodeType('mtlx/math/floor_vector4',mtlx_math_floor_vector4); + +// MaterialX node type: mtlx/math/floor_integer +// +function mtlx_math_floor_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_floor_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'floor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_floor_integer_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'floor_integer'; + this.desc = "MaterialX:mtlx/math/floor_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_floor_integer.nodedef_name = 'ND_floor_integer'; +mtlx_math_floor_integer.nodedef_node = 'floor'; +mtlx_math_floor_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/floor.html'; +LiteGraph.registerNodeType('mtlx/math/floor_integer',mtlx_math_floor_integer); + +// MaterialX node type: mtlx/math/ceil_float +// +function mtlx_math_ceil_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ceil_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ceil'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ceil_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ceil_float'; + this.desc = "MaterialX:mtlx/math/ceil_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_ceil_float.nodedef_name = 'ND_ceil_float'; +mtlx_math_ceil_float.nodedef_node = 'ceil'; +mtlx_math_ceil_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; +LiteGraph.registerNodeType('mtlx/math/ceil_float',mtlx_math_ceil_float); + +// MaterialX node type: mtlx/math/ceil_color3 +// +function mtlx_math_ceil_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ceil_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ceil'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ceil_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ceil_color3'; + this.desc = "MaterialX:mtlx/math/ceil_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_ceil_color3.nodedef_name = 'ND_ceil_color3'; +mtlx_math_ceil_color3.nodedef_node = 'ceil'; +mtlx_math_ceil_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; +LiteGraph.registerNodeType('mtlx/math/ceil_color3',mtlx_math_ceil_color3); + +// MaterialX node type: mtlx/math/ceil_color4 +// +function mtlx_math_ceil_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ceil_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ceil'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ceil_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ceil_color4'; + this.desc = "MaterialX:mtlx/math/ceil_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_ceil_color4.nodedef_name = 'ND_ceil_color4'; +mtlx_math_ceil_color4.nodedef_node = 'ceil'; +mtlx_math_ceil_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; +LiteGraph.registerNodeType('mtlx/math/ceil_color4',mtlx_math_ceil_color4); + +// MaterialX node type: mtlx/math/ceil_vector2 +// +function mtlx_math_ceil_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ceil_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ceil'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ceil_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ceil_vector2'; + this.desc = "MaterialX:mtlx/math/ceil_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_ceil_vector2.nodedef_name = 'ND_ceil_vector2'; +mtlx_math_ceil_vector2.nodedef_node = 'ceil'; +mtlx_math_ceil_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; +LiteGraph.registerNodeType('mtlx/math/ceil_vector2',mtlx_math_ceil_vector2); + +// MaterialX node type: mtlx/math/ceil_vector3 +// +function mtlx_math_ceil_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ceil_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ceil'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ceil_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ceil_vector3'; + this.desc = "MaterialX:mtlx/math/ceil_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_ceil_vector3.nodedef_name = 'ND_ceil_vector3'; +mtlx_math_ceil_vector3.nodedef_node = 'ceil'; +mtlx_math_ceil_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; +LiteGraph.registerNodeType('mtlx/math/ceil_vector3',mtlx_math_ceil_vector3); + +// MaterialX node type: mtlx/math/ceil_vector4 +// +function mtlx_math_ceil_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ceil_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ceil'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ceil_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ceil_vector4'; + this.desc = "MaterialX:mtlx/math/ceil_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_ceil_vector4.nodedef_name = 'ND_ceil_vector4'; +mtlx_math_ceil_vector4.nodedef_node = 'ceil'; +mtlx_math_ceil_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; +LiteGraph.registerNodeType('mtlx/math/ceil_vector4',mtlx_math_ceil_vector4); + +// MaterialX node type: mtlx/math/ceil_integer +// +function mtlx_math_ceil_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ceil_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'ceil'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ceil_integer_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'ceil_integer'; + this.desc = "MaterialX:mtlx/math/ceil_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_ceil_integer.nodedef_name = 'ND_ceil_integer'; +mtlx_math_ceil_integer.nodedef_node = 'ceil'; +mtlx_math_ceil_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ceil.html'; +LiteGraph.registerNodeType('mtlx/math/ceil_integer',mtlx_math_ceil_integer); + +// MaterialX node type: mtlx/math/round_float +// +function mtlx_math_round_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_round_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'round'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_round_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'round_float'; + this.desc = "MaterialX:mtlx/math/round_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_round_float.nodedef_name = 'ND_round_float'; +mtlx_math_round_float.nodedef_node = 'round'; +mtlx_math_round_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; +LiteGraph.registerNodeType('mtlx/math/round_float',mtlx_math_round_float); + +// MaterialX node type: mtlx/math/round_color3 +// +function mtlx_math_round_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_round_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'round'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_round_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'round_color3'; + this.desc = "MaterialX:mtlx/math/round_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_round_color3.nodedef_name = 'ND_round_color3'; +mtlx_math_round_color3.nodedef_node = 'round'; +mtlx_math_round_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; +LiteGraph.registerNodeType('mtlx/math/round_color3',mtlx_math_round_color3); + +// MaterialX node type: mtlx/math/round_color4 +// +function mtlx_math_round_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_round_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'round'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_round_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'round_color4'; + this.desc = "MaterialX:mtlx/math/round_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_round_color4.nodedef_name = 'ND_round_color4'; +mtlx_math_round_color4.nodedef_node = 'round'; +mtlx_math_round_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; +LiteGraph.registerNodeType('mtlx/math/round_color4',mtlx_math_round_color4); + +// MaterialX node type: mtlx/math/round_vector2 +// +function mtlx_math_round_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_round_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'round'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_round_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'round_vector2'; + this.desc = "MaterialX:mtlx/math/round_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_round_vector2.nodedef_name = 'ND_round_vector2'; +mtlx_math_round_vector2.nodedef_node = 'round'; +mtlx_math_round_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; +LiteGraph.registerNodeType('mtlx/math/round_vector2',mtlx_math_round_vector2); + +// MaterialX node type: mtlx/math/round_vector3 +// +function mtlx_math_round_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_round_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'round'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_round_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'round_vector3'; + this.desc = "MaterialX:mtlx/math/round_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_round_vector3.nodedef_name = 'ND_round_vector3'; +mtlx_math_round_vector3.nodedef_node = 'round'; +mtlx_math_round_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; +LiteGraph.registerNodeType('mtlx/math/round_vector3',mtlx_math_round_vector3); + +// MaterialX node type: mtlx/math/round_vector4 +// +function mtlx_math_round_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_round_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'round'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_round_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'round_vector4'; + this.desc = "MaterialX:mtlx/math/round_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_round_vector4.nodedef_name = 'ND_round_vector4'; +mtlx_math_round_vector4.nodedef_node = 'round'; +mtlx_math_round_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; +LiteGraph.registerNodeType('mtlx/math/round_vector4',mtlx_math_round_vector4); + +// MaterialX node type: mtlx/math/round_integer +// +function mtlx_math_round_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_round_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'round'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_round_integer_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'round_integer'; + this.desc = "MaterialX:mtlx/math/round_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_round_integer.nodedef_name = 'ND_round_integer'; +mtlx_math_round_integer.nodedef_node = 'round'; +mtlx_math_round_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/round.html'; +LiteGraph.registerNodeType('mtlx/math/round_integer',mtlx_math_round_integer); + +// MaterialX node type: mtlx/math/power_float +// +function mtlx_math_power_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'power_float'; + this.desc = "MaterialX:mtlx/math/power_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_power_float.nodedef_name = 'ND_power_float'; +mtlx_math_power_float.nodedef_node = 'power'; +mtlx_math_power_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_float',mtlx_math_power_float); + +// MaterialX node type: mtlx/math/power_color3 +// +function mtlx_math_power_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'power_color3'; + this.desc = "MaterialX:mtlx/math/power_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_power_color3.nodedef_name = 'ND_power_color3'; +mtlx_math_power_color3.nodedef_node = 'power'; +mtlx_math_power_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_color3',mtlx_math_power_color3); + +// MaterialX node type: mtlx/math/power_color4 +// +function mtlx_math_power_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'power_color4'; + this.desc = "MaterialX:mtlx/math/power_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_power_color4.nodedef_name = 'ND_power_color4'; +mtlx_math_power_color4.nodedef_node = 'power'; +mtlx_math_power_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_color4',mtlx_math_power_color4); + +// MaterialX node type: mtlx/math/power_vector2 +// +function mtlx_math_power_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'power_vector2'; + this.desc = "MaterialX:mtlx/math/power_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_power_vector2.nodedef_name = 'ND_power_vector2'; +mtlx_math_power_vector2.nodedef_node = 'power'; +mtlx_math_power_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_vector2',mtlx_math_power_vector2); + +// MaterialX node type: mtlx/math/power_vector3 +// +function mtlx_math_power_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'power_vector3'; + this.desc = "MaterialX:mtlx/math/power_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_power_vector3.nodedef_name = 'ND_power_vector3'; +mtlx_math_power_vector3.nodedef_node = 'power'; +mtlx_math_power_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_vector3',mtlx_math_power_vector3); + +// MaterialX node type: mtlx/math/power_vector4 +// +function mtlx_math_power_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'power_vector4'; + this.desc = "MaterialX:mtlx/math/power_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_power_vector4.nodedef_name = 'ND_power_vector4'; +mtlx_math_power_vector4.nodedef_node = 'power'; +mtlx_math_power_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_vector4',mtlx_math_power_vector4); + +// MaterialX node type: mtlx/math/power_color3FA +// +function mtlx_math_power_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'power_color3'; + this.desc = "MaterialX:mtlx/math/power_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_power_color3FA.nodedef_name = 'ND_power_color3FA'; +mtlx_math_power_color3FA.nodedef_node = 'power'; +mtlx_math_power_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_color3FA',mtlx_math_power_color3FA); + +// MaterialX node type: mtlx/math/power_color4FA +// +function mtlx_math_power_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'power_color4'; + this.desc = "MaterialX:mtlx/math/power_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_power_color4FA.nodedef_name = 'ND_power_color4FA'; +mtlx_math_power_color4FA.nodedef_node = 'power'; +mtlx_math_power_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_color4FA',mtlx_math_power_color4FA); + +// MaterialX node type: mtlx/math/power_vector2FA +// +function mtlx_math_power_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'power_vector2'; + this.desc = "MaterialX:mtlx/math/power_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_power_vector2FA.nodedef_name = 'ND_power_vector2FA'; +mtlx_math_power_vector2FA.nodedef_node = 'power'; +mtlx_math_power_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_vector2FA',mtlx_math_power_vector2FA); + +// MaterialX node type: mtlx/math/power_vector3FA +// +function mtlx_math_power_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'power_vector3'; + this.desc = "MaterialX:mtlx/math/power_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_power_vector3FA.nodedef_name = 'ND_power_vector3FA'; +mtlx_math_power_vector3FA.nodedef_node = 'power'; +mtlx_math_power_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_vector3FA',mtlx_math_power_vector3FA); + +// MaterialX node type: mtlx/math/power_vector4FA +// +function mtlx_math_power_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_power_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'power'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_power_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'power_vector4'; + this.desc = "MaterialX:mtlx/math/power_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_power_vector4FA.nodedef_name = 'ND_power_vector4FA'; +mtlx_math_power_vector4FA.nodedef_node = 'power'; +mtlx_math_power_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/power.html'; +LiteGraph.registerNodeType('mtlx/math/power_vector4FA',mtlx_math_power_vector4FA); + +// MaterialX node type: mtlx/math/safepower_float +// +function mtlx_math_safepower_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'safepower_float'; + this.desc = "MaterialX:mtlx/math/safepower_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_safepower_float.nodedef_name = 'ND_safepower_float'; +mtlx_math_safepower_float.nodedef_node = 'safepower'; +mtlx_math_safepower_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_float',mtlx_math_safepower_float); + +// MaterialX node type: mtlx/math/safepower_color3 +// +function mtlx_math_safepower_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'safepower_color3'; + this.desc = "MaterialX:mtlx/math/safepower_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_safepower_color3.nodedef_name = 'ND_safepower_color3'; +mtlx_math_safepower_color3.nodedef_node = 'safepower'; +mtlx_math_safepower_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_color3',mtlx_math_safepower_color3); + +// MaterialX node type: mtlx/math/safepower_color4 +// +function mtlx_math_safepower_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'safepower_color4'; + this.desc = "MaterialX:mtlx/math/safepower_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_safepower_color4.nodedef_name = 'ND_safepower_color4'; +mtlx_math_safepower_color4.nodedef_node = 'safepower'; +mtlx_math_safepower_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_color4',mtlx_math_safepower_color4); + +// MaterialX node type: mtlx/math/safepower_vector2 +// +function mtlx_math_safepower_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'safepower_vector2'; + this.desc = "MaterialX:mtlx/math/safepower_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_safepower_vector2.nodedef_name = 'ND_safepower_vector2'; +mtlx_math_safepower_vector2.nodedef_node = 'safepower'; +mtlx_math_safepower_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_vector2',mtlx_math_safepower_vector2); + +// MaterialX node type: mtlx/math/safepower_vector3 +// +function mtlx_math_safepower_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'safepower_vector3'; + this.desc = "MaterialX:mtlx/math/safepower_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_safepower_vector3.nodedef_name = 'ND_safepower_vector3'; +mtlx_math_safepower_vector3.nodedef_node = 'safepower'; +mtlx_math_safepower_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_vector3',mtlx_math_safepower_vector3); + +// MaterialX node type: mtlx/math/safepower_vector4 +// +function mtlx_math_safepower_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'safepower_vector4'; + this.desc = "MaterialX:mtlx/math/safepower_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_safepower_vector4.nodedef_name = 'ND_safepower_vector4'; +mtlx_math_safepower_vector4.nodedef_node = 'safepower'; +mtlx_math_safepower_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_vector4',mtlx_math_safepower_vector4); + +// MaterialX node type: mtlx/math/safepower_color3FA +// +function mtlx_math_safepower_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'safepower_color3'; + this.desc = "MaterialX:mtlx/math/safepower_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_safepower_color3FA.nodedef_name = 'ND_safepower_color3FA'; +mtlx_math_safepower_color3FA.nodedef_node = 'safepower'; +mtlx_math_safepower_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_color3FA',mtlx_math_safepower_color3FA); + +// MaterialX node type: mtlx/math/safepower_color4FA +// +function mtlx_math_safepower_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'safepower_color4'; + this.desc = "MaterialX:mtlx/math/safepower_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_safepower_color4FA.nodedef_name = 'ND_safepower_color4FA'; +mtlx_math_safepower_color4FA.nodedef_node = 'safepower'; +mtlx_math_safepower_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_color4FA',mtlx_math_safepower_color4FA); + +// MaterialX node type: mtlx/math/safepower_vector2FA +// +function mtlx_math_safepower_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'safepower_vector2'; + this.desc = "MaterialX:mtlx/math/safepower_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_safepower_vector2FA.nodedef_name = 'ND_safepower_vector2FA'; +mtlx_math_safepower_vector2FA.nodedef_node = 'safepower'; +mtlx_math_safepower_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_vector2FA',mtlx_math_safepower_vector2FA); + +// MaterialX node type: mtlx/math/safepower_vector3FA +// +function mtlx_math_safepower_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'safepower_vector3'; + this.desc = "MaterialX:mtlx/math/safepower_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_safepower_vector3FA.nodedef_name = 'ND_safepower_vector3FA'; +mtlx_math_safepower_vector3FA.nodedef_node = 'safepower'; +mtlx_math_safepower_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_vector3FA',mtlx_math_safepower_vector3FA); + +// MaterialX node type: mtlx/math/safepower_vector4FA +// +function mtlx_math_safepower_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_safepower_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'safepower'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_safepower_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'safepower_vector4'; + this.desc = "MaterialX:mtlx/math/safepower_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_safepower_vector4FA.nodedef_name = 'ND_safepower_vector4FA'; +mtlx_math_safepower_vector4FA.nodedef_node = 'safepower'; +mtlx_math_safepower_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/safepower.html'; +LiteGraph.registerNodeType('mtlx/math/safepower_vector4FA',mtlx_math_safepower_vector4FA); + +// MaterialX node type: mtlx/math/sin_float +// +function mtlx_math_sin_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sin_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'sin'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sin.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sin_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'sin_float'; + this.desc = "MaterialX:mtlx/math/sin_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_sin_float.nodedef_name = 'ND_sin_float'; +mtlx_math_sin_float.nodedef_node = 'sin'; +mtlx_math_sin_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sin.html'; +LiteGraph.registerNodeType('mtlx/math/sin_float',mtlx_math_sin_float); + +// MaterialX node type: mtlx/math/cos_float +// +function mtlx_math_cos_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_cos_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'cos'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cos.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_cos_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'cos_float'; + this.desc = "MaterialX:mtlx/math/cos_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_cos_float.nodedef_name = 'ND_cos_float'; +mtlx_math_cos_float.nodedef_node = 'cos'; +mtlx_math_cos_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cos.html'; +LiteGraph.registerNodeType('mtlx/math/cos_float',mtlx_math_cos_float); + +// MaterialX node type: mtlx/math/tan_float +// +function mtlx_math_tan_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tan_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'tan'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tan.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tan_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'tan_float'; + this.desc = "MaterialX:mtlx/math/tan_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_tan_float.nodedef_name = 'ND_tan_float'; +mtlx_math_tan_float.nodedef_node = 'tan'; +mtlx_math_tan_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tan.html'; +LiteGraph.registerNodeType('mtlx/math/tan_float',mtlx_math_tan_float); + +// MaterialX node type: mtlx/math/asin_float +// +function mtlx_math_asin_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_asin_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'asin'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/asin.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_asin_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'asin_float'; + this.desc = "MaterialX:mtlx/math/asin_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_asin_float.nodedef_name = 'ND_asin_float'; +mtlx_math_asin_float.nodedef_node = 'asin'; +mtlx_math_asin_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/asin.html'; +LiteGraph.registerNodeType('mtlx/math/asin_float',mtlx_math_asin_float); + +// MaterialX node type: mtlx/math/acos_float +// +function mtlx_math_acos_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_acos_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'acos'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acos.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_acos_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'acos_float'; + this.desc = "MaterialX:mtlx/math/acos_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_acos_float.nodedef_name = 'ND_acos_float'; +mtlx_math_acos_float.nodedef_node = 'acos'; +mtlx_math_acos_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acos.html'; +LiteGraph.registerNodeType('mtlx/math/acos_float',mtlx_math_acos_float); + +// MaterialX node type: mtlx/math/atan2_float +// +function mtlx_math_atan2_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_atan2_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'atan2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/atan2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_atan2_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('iny','float'); + this.addProperty('iny', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inx','float'); + this.addProperty('inx', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'atan2_float'; + this.desc = "MaterialX:mtlx/math/atan2_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_atan2_float.nodedef_name = 'ND_atan2_float'; +mtlx_math_atan2_float.nodedef_node = 'atan2'; +mtlx_math_atan2_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/atan2.html'; +LiteGraph.registerNodeType('mtlx/math/atan2_float',mtlx_math_atan2_float); + +// MaterialX node type: mtlx/math/sin_vector2 +// +function mtlx_math_sin_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sin_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'sin'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sin.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sin_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'sin_vector2'; + this.desc = "MaterialX:mtlx/math/sin_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_sin_vector2.nodedef_name = 'ND_sin_vector2'; +mtlx_math_sin_vector2.nodedef_node = 'sin'; +mtlx_math_sin_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sin.html'; +LiteGraph.registerNodeType('mtlx/math/sin_vector2',mtlx_math_sin_vector2); + +// MaterialX node type: mtlx/math/cos_vector2 +// +function mtlx_math_cos_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_cos_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'cos'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cos.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_cos_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'cos_vector2'; + this.desc = "MaterialX:mtlx/math/cos_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_cos_vector2.nodedef_name = 'ND_cos_vector2'; +mtlx_math_cos_vector2.nodedef_node = 'cos'; +mtlx_math_cos_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cos.html'; +LiteGraph.registerNodeType('mtlx/math/cos_vector2',mtlx_math_cos_vector2); + +// MaterialX node type: mtlx/math/tan_vector2 +// +function mtlx_math_tan_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tan_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'tan'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tan.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tan_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'tan_vector2'; + this.desc = "MaterialX:mtlx/math/tan_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_tan_vector2.nodedef_name = 'ND_tan_vector2'; +mtlx_math_tan_vector2.nodedef_node = 'tan'; +mtlx_math_tan_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tan.html'; +LiteGraph.registerNodeType('mtlx/math/tan_vector2',mtlx_math_tan_vector2); + +// MaterialX node type: mtlx/math/asin_vector2 +// +function mtlx_math_asin_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_asin_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'asin'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/asin.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_asin_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'asin_vector2'; + this.desc = "MaterialX:mtlx/math/asin_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_asin_vector2.nodedef_name = 'ND_asin_vector2'; +mtlx_math_asin_vector2.nodedef_node = 'asin'; +mtlx_math_asin_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/asin.html'; +LiteGraph.registerNodeType('mtlx/math/asin_vector2',mtlx_math_asin_vector2); + +// MaterialX node type: mtlx/math/acos_vector2 +// +function mtlx_math_acos_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_acos_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'acos'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acos.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_acos_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'acos_vector2'; + this.desc = "MaterialX:mtlx/math/acos_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_acos_vector2.nodedef_name = 'ND_acos_vector2'; +mtlx_math_acos_vector2.nodedef_node = 'acos'; +mtlx_math_acos_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acos.html'; +LiteGraph.registerNodeType('mtlx/math/acos_vector2',mtlx_math_acos_vector2); + +// MaterialX node type: mtlx/math/atan2_vector2 +// +function mtlx_math_atan2_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_atan2_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'atan2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/atan2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_atan2_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('iny','vector2'); + this.addProperty('iny', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inx','vector2'); + this.addProperty('inx', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'atan2_vector2'; + this.desc = "MaterialX:mtlx/math/atan2_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_atan2_vector2.nodedef_name = 'ND_atan2_vector2'; +mtlx_math_atan2_vector2.nodedef_node = 'atan2'; +mtlx_math_atan2_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/atan2.html'; +LiteGraph.registerNodeType('mtlx/math/atan2_vector2',mtlx_math_atan2_vector2); + +// MaterialX node type: mtlx/math/sin_vector3 +// +function mtlx_math_sin_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sin_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'sin'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sin.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sin_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'sin_vector3'; + this.desc = "MaterialX:mtlx/math/sin_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_sin_vector3.nodedef_name = 'ND_sin_vector3'; +mtlx_math_sin_vector3.nodedef_node = 'sin'; +mtlx_math_sin_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sin.html'; +LiteGraph.registerNodeType('mtlx/math/sin_vector3',mtlx_math_sin_vector3); + +// MaterialX node type: mtlx/math/cos_vector3 +// +function mtlx_math_cos_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_cos_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'cos'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cos.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_cos_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'cos_vector3'; + this.desc = "MaterialX:mtlx/math/cos_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_cos_vector3.nodedef_name = 'ND_cos_vector3'; +mtlx_math_cos_vector3.nodedef_node = 'cos'; +mtlx_math_cos_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cos.html'; +LiteGraph.registerNodeType('mtlx/math/cos_vector3',mtlx_math_cos_vector3); + +// MaterialX node type: mtlx/math/tan_vector3 +// +function mtlx_math_tan_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tan_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'tan'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tan.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tan_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'tan_vector3'; + this.desc = "MaterialX:mtlx/math/tan_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_tan_vector3.nodedef_name = 'ND_tan_vector3'; +mtlx_math_tan_vector3.nodedef_node = 'tan'; +mtlx_math_tan_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tan.html'; +LiteGraph.registerNodeType('mtlx/math/tan_vector3',mtlx_math_tan_vector3); + +// MaterialX node type: mtlx/math/asin_vector3 +// +function mtlx_math_asin_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_asin_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'asin'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/asin.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_asin_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'asin_vector3'; + this.desc = "MaterialX:mtlx/math/asin_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_asin_vector3.nodedef_name = 'ND_asin_vector3'; +mtlx_math_asin_vector3.nodedef_node = 'asin'; +mtlx_math_asin_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/asin.html'; +LiteGraph.registerNodeType('mtlx/math/asin_vector3',mtlx_math_asin_vector3); + +// MaterialX node type: mtlx/math/acos_vector3 +// +function mtlx_math_acos_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_acos_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'acos'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acos.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_acos_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'acos_vector3'; + this.desc = "MaterialX:mtlx/math/acos_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_acos_vector3.nodedef_name = 'ND_acos_vector3'; +mtlx_math_acos_vector3.nodedef_node = 'acos'; +mtlx_math_acos_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acos.html'; +LiteGraph.registerNodeType('mtlx/math/acos_vector3',mtlx_math_acos_vector3); + +// MaterialX node type: mtlx/math/atan2_vector3 +// +function mtlx_math_atan2_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_atan2_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'atan2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/atan2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_atan2_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('iny','vector3'); + this.addProperty('iny', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inx','vector3'); + this.addProperty('inx', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'atan2_vector3'; + this.desc = "MaterialX:mtlx/math/atan2_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_atan2_vector3.nodedef_name = 'ND_atan2_vector3'; +mtlx_math_atan2_vector3.nodedef_node = 'atan2'; +mtlx_math_atan2_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/atan2.html'; +LiteGraph.registerNodeType('mtlx/math/atan2_vector3',mtlx_math_atan2_vector3); + +// MaterialX node type: mtlx/math/sin_vector4 +// +function mtlx_math_sin_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sin_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'sin'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sin.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sin_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'sin_vector4'; + this.desc = "MaterialX:mtlx/math/sin_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_sin_vector4.nodedef_name = 'ND_sin_vector4'; +mtlx_math_sin_vector4.nodedef_node = 'sin'; +mtlx_math_sin_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sin.html'; +LiteGraph.registerNodeType('mtlx/math/sin_vector4',mtlx_math_sin_vector4); + +// MaterialX node type: mtlx/math/cos_vector4 +// +function mtlx_math_cos_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_cos_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'cos'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cos.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_cos_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'cos_vector4'; + this.desc = "MaterialX:mtlx/math/cos_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_cos_vector4.nodedef_name = 'ND_cos_vector4'; +mtlx_math_cos_vector4.nodedef_node = 'cos'; +mtlx_math_cos_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/cos.html'; +LiteGraph.registerNodeType('mtlx/math/cos_vector4',mtlx_math_cos_vector4); + +// MaterialX node type: mtlx/math/tan_vector4 +// +function mtlx_math_tan_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_tan_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'tan'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tan.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_tan_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'tan_vector4'; + this.desc = "MaterialX:mtlx/math/tan_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_tan_vector4.nodedef_name = 'ND_tan_vector4'; +mtlx_math_tan_vector4.nodedef_node = 'tan'; +mtlx_math_tan_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/tan.html'; +LiteGraph.registerNodeType('mtlx/math/tan_vector4',mtlx_math_tan_vector4); + +// MaterialX node type: mtlx/math/asin_vector4 +// +function mtlx_math_asin_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_asin_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'asin'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/asin.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_asin_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'asin_vector4'; + this.desc = "MaterialX:mtlx/math/asin_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_asin_vector4.nodedef_name = 'ND_asin_vector4'; +mtlx_math_asin_vector4.nodedef_node = 'asin'; +mtlx_math_asin_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/asin.html'; +LiteGraph.registerNodeType('mtlx/math/asin_vector4',mtlx_math_asin_vector4); + +// MaterialX node type: mtlx/math/acos_vector4 +// +function mtlx_math_acos_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_acos_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'acos'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acos.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_acos_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'acos_vector4'; + this.desc = "MaterialX:mtlx/math/acos_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_acos_vector4.nodedef_name = 'ND_acos_vector4'; +mtlx_math_acos_vector4.nodedef_node = 'acos'; +mtlx_math_acos_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/acos.html'; +LiteGraph.registerNodeType('mtlx/math/acos_vector4',mtlx_math_acos_vector4); + +// MaterialX node type: mtlx/math/atan2_vector4 +// +function mtlx_math_atan2_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_atan2_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'atan2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/atan2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_atan2_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('iny','vector4'); + this.addProperty('iny', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inx','vector4'); + this.addProperty('inx', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'atan2_vector4'; + this.desc = "MaterialX:mtlx/math/atan2_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_atan2_vector4.nodedef_name = 'ND_atan2_vector4'; +mtlx_math_atan2_vector4.nodedef_node = 'atan2'; +mtlx_math_atan2_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/atan2.html'; +LiteGraph.registerNodeType('mtlx/math/atan2_vector4',mtlx_math_atan2_vector4); + +// MaterialX node type: mtlx/math/sqrt_float +// +function mtlx_math_sqrt_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sqrt_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'sqrt'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sqrt.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sqrt_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'sqrt_float'; + this.desc = "MaterialX:mtlx/math/sqrt_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_sqrt_float.nodedef_name = 'ND_sqrt_float'; +mtlx_math_sqrt_float.nodedef_node = 'sqrt'; +mtlx_math_sqrt_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sqrt.html'; +LiteGraph.registerNodeType('mtlx/math/sqrt_float',mtlx_math_sqrt_float); + +// MaterialX node type: mtlx/math/ln_float +// +function mtlx_math_ln_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ln_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ln'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ln.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ln_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ln_float'; + this.desc = "MaterialX:mtlx/math/ln_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_ln_float.nodedef_name = 'ND_ln_float'; +mtlx_math_ln_float.nodedef_node = 'ln'; +mtlx_math_ln_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ln.html'; +LiteGraph.registerNodeType('mtlx/math/ln_float',mtlx_math_ln_float); + +// MaterialX node type: mtlx/math/exp_float +// +function mtlx_math_exp_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_exp_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'exp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/exp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_exp_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'exp_float'; + this.desc = "MaterialX:mtlx/math/exp_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_exp_float.nodedef_name = 'ND_exp_float'; +mtlx_math_exp_float.nodedef_node = 'exp'; +mtlx_math_exp_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/exp.html'; +LiteGraph.registerNodeType('mtlx/math/exp_float',mtlx_math_exp_float); + +// MaterialX node type: mtlx/math/sqrt_vector2 +// +function mtlx_math_sqrt_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sqrt_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'sqrt'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sqrt.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sqrt_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'sqrt_vector2'; + this.desc = "MaterialX:mtlx/math/sqrt_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_sqrt_vector2.nodedef_name = 'ND_sqrt_vector2'; +mtlx_math_sqrt_vector2.nodedef_node = 'sqrt'; +mtlx_math_sqrt_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sqrt.html'; +LiteGraph.registerNodeType('mtlx/math/sqrt_vector2',mtlx_math_sqrt_vector2); + +// MaterialX node type: mtlx/math/ln_vector2 +// +function mtlx_math_ln_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ln_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ln'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ln.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ln_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ln_vector2'; + this.desc = "MaterialX:mtlx/math/ln_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_ln_vector2.nodedef_name = 'ND_ln_vector2'; +mtlx_math_ln_vector2.nodedef_node = 'ln'; +mtlx_math_ln_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ln.html'; +LiteGraph.registerNodeType('mtlx/math/ln_vector2',mtlx_math_ln_vector2); + +// MaterialX node type: mtlx/math/exp_vector2 +// +function mtlx_math_exp_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_exp_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'exp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/exp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_exp_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'exp_vector2'; + this.desc = "MaterialX:mtlx/math/exp_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_exp_vector2.nodedef_name = 'ND_exp_vector2'; +mtlx_math_exp_vector2.nodedef_node = 'exp'; +mtlx_math_exp_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/exp.html'; +LiteGraph.registerNodeType('mtlx/math/exp_vector2',mtlx_math_exp_vector2); + +// MaterialX node type: mtlx/math/sqrt_vector3 +// +function mtlx_math_sqrt_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sqrt_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'sqrt'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sqrt.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sqrt_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'sqrt_vector3'; + this.desc = "MaterialX:mtlx/math/sqrt_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_sqrt_vector3.nodedef_name = 'ND_sqrt_vector3'; +mtlx_math_sqrt_vector3.nodedef_node = 'sqrt'; +mtlx_math_sqrt_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sqrt.html'; +LiteGraph.registerNodeType('mtlx/math/sqrt_vector3',mtlx_math_sqrt_vector3); + +// MaterialX node type: mtlx/math/ln_vector3 +// +function mtlx_math_ln_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ln_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ln'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ln.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ln_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ln_vector3'; + this.desc = "MaterialX:mtlx/math/ln_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_ln_vector3.nodedef_name = 'ND_ln_vector3'; +mtlx_math_ln_vector3.nodedef_node = 'ln'; +mtlx_math_ln_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ln.html'; +LiteGraph.registerNodeType('mtlx/math/ln_vector3',mtlx_math_ln_vector3); + +// MaterialX node type: mtlx/math/exp_vector3 +// +function mtlx_math_exp_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_exp_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'exp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/exp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_exp_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'exp_vector3'; + this.desc = "MaterialX:mtlx/math/exp_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_exp_vector3.nodedef_name = 'ND_exp_vector3'; +mtlx_math_exp_vector3.nodedef_node = 'exp'; +mtlx_math_exp_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/exp.html'; +LiteGraph.registerNodeType('mtlx/math/exp_vector3',mtlx_math_exp_vector3); + +// MaterialX node type: mtlx/math/sqrt_vector4 +// +function mtlx_math_sqrt_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sqrt_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'sqrt'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sqrt.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sqrt_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'sqrt_vector4'; + this.desc = "MaterialX:mtlx/math/sqrt_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_sqrt_vector4.nodedef_name = 'ND_sqrt_vector4'; +mtlx_math_sqrt_vector4.nodedef_node = 'sqrt'; +mtlx_math_sqrt_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sqrt.html'; +LiteGraph.registerNodeType('mtlx/math/sqrt_vector4',mtlx_math_sqrt_vector4); + +// MaterialX node type: mtlx/math/ln_vector4 +// +function mtlx_math_ln_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ln_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ln'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ln.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ln_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ln_vector4'; + this.desc = "MaterialX:mtlx/math/ln_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_ln_vector4.nodedef_name = 'ND_ln_vector4'; +mtlx_math_ln_vector4.nodedef_node = 'ln'; +mtlx_math_ln_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ln.html'; +LiteGraph.registerNodeType('mtlx/math/ln_vector4',mtlx_math_ln_vector4); + +// MaterialX node type: mtlx/math/exp_vector4 +// +function mtlx_math_exp_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_exp_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'exp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/exp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_exp_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'exp_vector4'; + this.desc = "MaterialX:mtlx/math/exp_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_exp_vector4.nodedef_name = 'ND_exp_vector4'; +mtlx_math_exp_vector4.nodedef_node = 'exp'; +mtlx_math_exp_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/exp.html'; +LiteGraph.registerNodeType('mtlx/math/exp_vector4',mtlx_math_exp_vector4); + +// MaterialX node type: mtlx/math/sign_float +// +function mtlx_math_sign_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sign_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'sign'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sign_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'sign_float'; + this.desc = "MaterialX:mtlx/math/sign_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_sign_float.nodedef_name = 'ND_sign_float'; +mtlx_math_sign_float.nodedef_node = 'sign'; +mtlx_math_sign_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; +LiteGraph.registerNodeType('mtlx/math/sign_float',mtlx_math_sign_float); + +// MaterialX node type: mtlx/math/sign_color3 +// +function mtlx_math_sign_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sign_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'sign'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sign_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'sign_color3'; + this.desc = "MaterialX:mtlx/math/sign_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_sign_color3.nodedef_name = 'ND_sign_color3'; +mtlx_math_sign_color3.nodedef_node = 'sign'; +mtlx_math_sign_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; +LiteGraph.registerNodeType('mtlx/math/sign_color3',mtlx_math_sign_color3); + +// MaterialX node type: mtlx/math/sign_color4 +// +function mtlx_math_sign_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sign_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'sign'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sign_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'sign_color4'; + this.desc = "MaterialX:mtlx/math/sign_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_sign_color4.nodedef_name = 'ND_sign_color4'; +mtlx_math_sign_color4.nodedef_node = 'sign'; +mtlx_math_sign_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; +LiteGraph.registerNodeType('mtlx/math/sign_color4',mtlx_math_sign_color4); + +// MaterialX node type: mtlx/math/sign_vector2 +// +function mtlx_math_sign_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sign_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'sign'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sign_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'sign_vector2'; + this.desc = "MaterialX:mtlx/math/sign_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_sign_vector2.nodedef_name = 'ND_sign_vector2'; +mtlx_math_sign_vector2.nodedef_node = 'sign'; +mtlx_math_sign_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; +LiteGraph.registerNodeType('mtlx/math/sign_vector2',mtlx_math_sign_vector2); + +// MaterialX node type: mtlx/math/sign_vector3 +// +function mtlx_math_sign_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sign_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'sign'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sign_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'sign_vector3'; + this.desc = "MaterialX:mtlx/math/sign_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_sign_vector3.nodedef_name = 'ND_sign_vector3'; +mtlx_math_sign_vector3.nodedef_node = 'sign'; +mtlx_math_sign_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; +LiteGraph.registerNodeType('mtlx/math/sign_vector3',mtlx_math_sign_vector3); + +// MaterialX node type: mtlx/math/sign_vector4 +// +function mtlx_math_sign_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_sign_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'sign'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_sign_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'sign_vector4'; + this.desc = "MaterialX:mtlx/math/sign_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_sign_vector4.nodedef_name = 'ND_sign_vector4'; +mtlx_math_sign_vector4.nodedef_node = 'sign'; +mtlx_math_sign_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/sign.html'; +LiteGraph.registerNodeType('mtlx/math/sign_vector4',mtlx_math_sign_vector4); + +// MaterialX node type: mtlx/math/clamp_float +// +function mtlx_math_clamp_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'clamp_float'; + this.desc = "MaterialX:mtlx/math/clamp_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_clamp_float.nodedef_name = 'ND_clamp_float'; +mtlx_math_clamp_float.nodedef_node = 'clamp'; +mtlx_math_clamp_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_float',mtlx_math_clamp_float); + +// MaterialX node type: mtlx/math/clamp_color3 +// +function mtlx_math_clamp_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','color3'); + this.addProperty('low', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','color3'); + this.addProperty('high', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'clamp_color3'; + this.desc = "MaterialX:mtlx/math/clamp_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_clamp_color3.nodedef_name = 'ND_clamp_color3'; +mtlx_math_clamp_color3.nodedef_node = 'clamp'; +mtlx_math_clamp_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_color3',mtlx_math_clamp_color3); + +// MaterialX node type: mtlx/math/clamp_color4 +// +function mtlx_math_clamp_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','color4'); + this.addProperty('low', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','color4'); + this.addProperty('high', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'clamp_color4'; + this.desc = "MaterialX:mtlx/math/clamp_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_clamp_color4.nodedef_name = 'ND_clamp_color4'; +mtlx_math_clamp_color4.nodedef_node = 'clamp'; +mtlx_math_clamp_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_color4',mtlx_math_clamp_color4); + +// MaterialX node type: mtlx/math/clamp_vector2 +// +function mtlx_math_clamp_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','vector2'); + this.addProperty('low', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','vector2'); + this.addProperty('high', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'clamp_vector2'; + this.desc = "MaterialX:mtlx/math/clamp_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_clamp_vector2.nodedef_name = 'ND_clamp_vector2'; +mtlx_math_clamp_vector2.nodedef_node = 'clamp'; +mtlx_math_clamp_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_vector2',mtlx_math_clamp_vector2); + +// MaterialX node type: mtlx/math/clamp_vector3 +// +function mtlx_math_clamp_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','vector3'); + this.addProperty('low', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','vector3'); + this.addProperty('high', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'clamp_vector3'; + this.desc = "MaterialX:mtlx/math/clamp_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_clamp_vector3.nodedef_name = 'ND_clamp_vector3'; +mtlx_math_clamp_vector3.nodedef_node = 'clamp'; +mtlx_math_clamp_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_vector3',mtlx_math_clamp_vector3); + +// MaterialX node type: mtlx/math/clamp_vector4 +// +function mtlx_math_clamp_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','vector4'); + this.addProperty('low', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','vector4'); + this.addProperty('high', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'clamp_vector4'; + this.desc = "MaterialX:mtlx/math/clamp_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_clamp_vector4.nodedef_name = 'ND_clamp_vector4'; +mtlx_math_clamp_vector4.nodedef_node = 'clamp'; +mtlx_math_clamp_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_vector4',mtlx_math_clamp_vector4); + +// MaterialX node type: mtlx/math/clamp_color3FA +// +function mtlx_math_clamp_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'clamp_color3'; + this.desc = "MaterialX:mtlx/math/clamp_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_clamp_color3FA.nodedef_name = 'ND_clamp_color3FA'; +mtlx_math_clamp_color3FA.nodedef_node = 'clamp'; +mtlx_math_clamp_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_color3FA',mtlx_math_clamp_color3FA); + +// MaterialX node type: mtlx/math/clamp_color4FA +// +function mtlx_math_clamp_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'clamp_color4'; + this.desc = "MaterialX:mtlx/math/clamp_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_clamp_color4FA.nodedef_name = 'ND_clamp_color4FA'; +mtlx_math_clamp_color4FA.nodedef_node = 'clamp'; +mtlx_math_clamp_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_color4FA',mtlx_math_clamp_color4FA); + +// MaterialX node type: mtlx/math/clamp_vector2FA +// +function mtlx_math_clamp_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'clamp_vector2'; + this.desc = "MaterialX:mtlx/math/clamp_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_clamp_vector2FA.nodedef_name = 'ND_clamp_vector2FA'; +mtlx_math_clamp_vector2FA.nodedef_node = 'clamp'; +mtlx_math_clamp_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_vector2FA',mtlx_math_clamp_vector2FA); + +// MaterialX node type: mtlx/math/clamp_vector3FA +// +function mtlx_math_clamp_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'clamp_vector3'; + this.desc = "MaterialX:mtlx/math/clamp_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_clamp_vector3FA.nodedef_name = 'ND_clamp_vector3FA'; +mtlx_math_clamp_vector3FA.nodedef_node = 'clamp'; +mtlx_math_clamp_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_vector3FA',mtlx_math_clamp_vector3FA); + +// MaterialX node type: mtlx/math/clamp_vector4FA +// +function mtlx_math_clamp_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_clamp_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'clamp'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_clamp_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'clamp_vector4'; + this.desc = "MaterialX:mtlx/math/clamp_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_clamp_vector4FA.nodedef_name = 'ND_clamp_vector4FA'; +mtlx_math_clamp_vector4FA.nodedef_node = 'clamp'; +mtlx_math_clamp_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/clamp.html'; +LiteGraph.registerNodeType('mtlx/math/clamp_vector4FA',mtlx_math_clamp_vector4FA); + +// MaterialX node type: mtlx/math/min_float +// +function mtlx_math_min_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'min_float'; + this.desc = "MaterialX:mtlx/math/min_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_min_float.nodedef_name = 'ND_min_float'; +mtlx_math_min_float.nodedef_node = 'min'; +mtlx_math_min_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_float',mtlx_math_min_float); + +// MaterialX node type: mtlx/math/min_color3 +// +function mtlx_math_min_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'min_color3'; + this.desc = "MaterialX:mtlx/math/min_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_min_color3.nodedef_name = 'ND_min_color3'; +mtlx_math_min_color3.nodedef_node = 'min'; +mtlx_math_min_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_color3',mtlx_math_min_color3); + +// MaterialX node type: mtlx/math/min_color4 +// +function mtlx_math_min_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'min_color4'; + this.desc = "MaterialX:mtlx/math/min_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_min_color4.nodedef_name = 'ND_min_color4'; +mtlx_math_min_color4.nodedef_node = 'min'; +mtlx_math_min_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_color4',mtlx_math_min_color4); + +// MaterialX node type: mtlx/math/min_vector2 +// +function mtlx_math_min_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'min_vector2'; + this.desc = "MaterialX:mtlx/math/min_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_min_vector2.nodedef_name = 'ND_min_vector2'; +mtlx_math_min_vector2.nodedef_node = 'min'; +mtlx_math_min_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_vector2',mtlx_math_min_vector2); + +// MaterialX node type: mtlx/math/min_vector3 +// +function mtlx_math_min_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'min_vector3'; + this.desc = "MaterialX:mtlx/math/min_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_min_vector3.nodedef_name = 'ND_min_vector3'; +mtlx_math_min_vector3.nodedef_node = 'min'; +mtlx_math_min_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_vector3',mtlx_math_min_vector3); + +// MaterialX node type: mtlx/math/min_vector4 +// +function mtlx_math_min_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'min_vector4'; + this.desc = "MaterialX:mtlx/math/min_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_min_vector4.nodedef_name = 'ND_min_vector4'; +mtlx_math_min_vector4.nodedef_node = 'min'; +mtlx_math_min_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_vector4',mtlx_math_min_vector4); + +// MaterialX node type: mtlx/math/min_color3FA +// +function mtlx_math_min_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'min_color3'; + this.desc = "MaterialX:mtlx/math/min_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_min_color3FA.nodedef_name = 'ND_min_color3FA'; +mtlx_math_min_color3FA.nodedef_node = 'min'; +mtlx_math_min_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_color3FA',mtlx_math_min_color3FA); + +// MaterialX node type: mtlx/math/min_color4FA +// +function mtlx_math_min_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'min_color4'; + this.desc = "MaterialX:mtlx/math/min_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_min_color4FA.nodedef_name = 'ND_min_color4FA'; +mtlx_math_min_color4FA.nodedef_node = 'min'; +mtlx_math_min_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_color4FA',mtlx_math_min_color4FA); + +// MaterialX node type: mtlx/math/min_vector2FA +// +function mtlx_math_min_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'min_vector2'; + this.desc = "MaterialX:mtlx/math/min_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_min_vector2FA.nodedef_name = 'ND_min_vector2FA'; +mtlx_math_min_vector2FA.nodedef_node = 'min'; +mtlx_math_min_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_vector2FA',mtlx_math_min_vector2FA); + +// MaterialX node type: mtlx/math/min_vector3FA +// +function mtlx_math_min_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'min_vector3'; + this.desc = "MaterialX:mtlx/math/min_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_min_vector3FA.nodedef_name = 'ND_min_vector3FA'; +mtlx_math_min_vector3FA.nodedef_node = 'min'; +mtlx_math_min_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_vector3FA',mtlx_math_min_vector3FA); + +// MaterialX node type: mtlx/math/min_vector4FA +// +function mtlx_math_min_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_min_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'min'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_min_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'min_vector4'; + this.desc = "MaterialX:mtlx/math/min_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_min_vector4FA.nodedef_name = 'ND_min_vector4FA'; +mtlx_math_min_vector4FA.nodedef_node = 'min'; +mtlx_math_min_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/min.html'; +LiteGraph.registerNodeType('mtlx/math/min_vector4FA',mtlx_math_min_vector4FA); + +// MaterialX node type: mtlx/math/max_float +// +function mtlx_math_max_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'max_float'; + this.desc = "MaterialX:mtlx/math/max_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_max_float.nodedef_name = 'ND_max_float'; +mtlx_math_max_float.nodedef_node = 'max'; +mtlx_math_max_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_float',mtlx_math_max_float); + +// MaterialX node type: mtlx/math/max_color3 +// +function mtlx_math_max_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_color3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'max_color3'; + this.desc = "MaterialX:mtlx/math/max_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_max_color3.nodedef_name = 'ND_max_color3'; +mtlx_math_max_color3.nodedef_node = 'max'; +mtlx_math_max_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_color3',mtlx_math_max_color3); + +// MaterialX node type: mtlx/math/max_color4 +// +function mtlx_math_max_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_color4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'max_color4'; + this.desc = "MaterialX:mtlx/math/max_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_max_color4.nodedef_name = 'ND_max_color4'; +mtlx_math_max_color4.nodedef_node = 'max'; +mtlx_math_max_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_color4',mtlx_math_max_color4); + +// MaterialX node type: mtlx/math/max_vector2 +// +function mtlx_math_max_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'max_vector2'; + this.desc = "MaterialX:mtlx/math/max_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_max_vector2.nodedef_name = 'ND_max_vector2'; +mtlx_math_max_vector2.nodedef_node = 'max'; +mtlx_math_max_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_vector2',mtlx_math_max_vector2); + +// MaterialX node type: mtlx/math/max_vector3 +// +function mtlx_math_max_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'max_vector3'; + this.desc = "MaterialX:mtlx/math/max_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_max_vector3.nodedef_name = 'ND_max_vector3'; +mtlx_math_max_vector3.nodedef_node = 'max'; +mtlx_math_max_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_vector3',mtlx_math_max_vector3); + +// MaterialX node type: mtlx/math/max_vector4 +// +function mtlx_math_max_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'max_vector4'; + this.desc = "MaterialX:mtlx/math/max_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_max_vector4.nodedef_name = 'ND_max_vector4'; +mtlx_math_max_vector4.nodedef_node = 'max'; +mtlx_math_max_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_vector4',mtlx_math_max_vector4); + +// MaterialX node type: mtlx/math/max_color3FA +// +function mtlx_math_max_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_color3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'max_color3'; + this.desc = "MaterialX:mtlx/math/max_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_math_max_color3FA.nodedef_name = 'ND_max_color3FA'; +mtlx_math_max_color3FA.nodedef_node = 'max'; +mtlx_math_max_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_color3FA',mtlx_math_max_color3FA); + +// MaterialX node type: mtlx/math/max_color4FA +// +function mtlx_math_max_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_color4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'max_color4'; + this.desc = "MaterialX:mtlx/math/max_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_math_max_color4FA.nodedef_name = 'ND_max_color4FA'; +mtlx_math_max_color4FA.nodedef_node = 'max'; +mtlx_math_max_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_color4FA',mtlx_math_max_color4FA); + +// MaterialX node type: mtlx/math/max_vector2FA +// +function mtlx_math_max_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_vector2FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'max_vector2'; + this.desc = "MaterialX:mtlx/math/max_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_max_vector2FA.nodedef_name = 'ND_max_vector2FA'; +mtlx_math_max_vector2FA.nodedef_node = 'max'; +mtlx_math_max_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_vector2FA',mtlx_math_max_vector2FA); + +// MaterialX node type: mtlx/math/max_vector3FA +// +function mtlx_math_max_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_vector3FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'max_vector3'; + this.desc = "MaterialX:mtlx/math/max_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_max_vector3FA.nodedef_name = 'ND_max_vector3FA'; +mtlx_math_max_vector3FA.nodedef_node = 'max'; +mtlx_math_max_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_vector3FA',mtlx_math_max_vector3FA); + +// MaterialX node type: mtlx/math/max_vector4FA +// +function mtlx_math_max_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_max_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'max'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_max_vector4FA_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'max_vector4'; + this.desc = "MaterialX:mtlx/math/max_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_max_vector4FA.nodedef_name = 'ND_max_vector4FA'; +mtlx_math_max_vector4FA.nodedef_node = 'max'; +mtlx_math_max_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/max.html'; +LiteGraph.registerNodeType('mtlx/math/max_vector4FA',mtlx_math_max_vector4FA); + +// MaterialX node type: mtlx/math/normalize_vector2 +// +function mtlx_math_normalize_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_normalize_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'normalize'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalize.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_normalize_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'normalize_vector2'; + this.desc = "MaterialX:mtlx/math/normalize_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_normalize_vector2.nodedef_name = 'ND_normalize_vector2'; +mtlx_math_normalize_vector2.nodedef_node = 'normalize'; +mtlx_math_normalize_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalize.html'; +LiteGraph.registerNodeType('mtlx/math/normalize_vector2',mtlx_math_normalize_vector2); + +// MaterialX node type: mtlx/math/normalize_vector3 +// +function mtlx_math_normalize_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_normalize_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'normalize'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalize.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_normalize_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'normalize_vector3'; + this.desc = "MaterialX:mtlx/math/normalize_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_normalize_vector3.nodedef_name = 'ND_normalize_vector3'; +mtlx_math_normalize_vector3.nodedef_node = 'normalize'; +mtlx_math_normalize_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalize.html'; +LiteGraph.registerNodeType('mtlx/math/normalize_vector3',mtlx_math_normalize_vector3); + +// MaterialX node type: mtlx/math/normalize_vector4 +// +function mtlx_math_normalize_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_normalize_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'normalize'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalize.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_normalize_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'normalize_vector4'; + this.desc = "MaterialX:mtlx/math/normalize_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_normalize_vector4.nodedef_name = 'ND_normalize_vector4'; +mtlx_math_normalize_vector4.nodedef_node = 'normalize'; +mtlx_math_normalize_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalize.html'; +LiteGraph.registerNodeType('mtlx/math/normalize_vector4',mtlx_math_normalize_vector4); + +// MaterialX node type: mtlx/math/magnitude_vector2 +// +function mtlx_math_magnitude_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_magnitude_vector2'; + this.nodedef_type = 'float'; + this.nodedef_node = 'magnitude'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/magnitude.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_magnitude_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'magnitude_float'; + this.desc = "MaterialX:mtlx/math/magnitude_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_magnitude_vector2.nodedef_name = 'ND_magnitude_vector2'; +mtlx_math_magnitude_vector2.nodedef_node = 'magnitude'; +mtlx_math_magnitude_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/magnitude.html'; +LiteGraph.registerNodeType('mtlx/math/magnitude_vector2',mtlx_math_magnitude_vector2); + +// MaterialX node type: mtlx/math/magnitude_vector3 +// +function mtlx_math_magnitude_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_magnitude_vector3'; + this.nodedef_type = 'float'; + this.nodedef_node = 'magnitude'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/magnitude.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_magnitude_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'magnitude_float'; + this.desc = "MaterialX:mtlx/math/magnitude_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_magnitude_vector3.nodedef_name = 'ND_magnitude_vector3'; +mtlx_math_magnitude_vector3.nodedef_node = 'magnitude'; +mtlx_math_magnitude_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/magnitude.html'; +LiteGraph.registerNodeType('mtlx/math/magnitude_vector3',mtlx_math_magnitude_vector3); + +// MaterialX node type: mtlx/math/magnitude_vector4 +// +function mtlx_math_magnitude_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_magnitude_vector4'; + this.nodedef_type = 'float'; + this.nodedef_node = 'magnitude'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/magnitude.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_magnitude_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'magnitude_float'; + this.desc = "MaterialX:mtlx/math/magnitude_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_magnitude_vector4.nodedef_name = 'ND_magnitude_vector4'; +mtlx_math_magnitude_vector4.nodedef_node = 'magnitude'; +mtlx_math_magnitude_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/magnitude.html'; +LiteGraph.registerNodeType('mtlx/math/magnitude_vector4',mtlx_math_magnitude_vector4); + +// MaterialX node type: mtlx/math/distance_vector2 +// +function mtlx_math_distance_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_distance_vector2'; + this.nodedef_type = 'float'; + this.nodedef_node = 'distance'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/distance.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_distance_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"in1","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"in2","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'distance_float'; + this.desc = "MaterialX:mtlx/math/distance_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_distance_vector2.nodedef_name = 'ND_distance_vector2'; +mtlx_math_distance_vector2.nodedef_node = 'distance'; +mtlx_math_distance_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/distance.html'; +LiteGraph.registerNodeType('mtlx/math/distance_vector2',mtlx_math_distance_vector2); + +// MaterialX node type: mtlx/math/distance_vector3 +// +function mtlx_math_distance_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_distance_vector3'; + this.nodedef_type = 'float'; + this.nodedef_node = 'distance'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/distance.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_distance_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"in1","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"in2","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'distance_float'; + this.desc = "MaterialX:mtlx/math/distance_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_distance_vector3.nodedef_name = 'ND_distance_vector3'; +mtlx_math_distance_vector3.nodedef_node = 'distance'; +mtlx_math_distance_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/distance.html'; +LiteGraph.registerNodeType('mtlx/math/distance_vector3',mtlx_math_distance_vector3); + +// MaterialX node type: mtlx/math/distance_vector4 +// +function mtlx_math_distance_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_distance_vector4'; + this.nodedef_type = 'float'; + this.nodedef_node = 'distance'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/distance.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_distance_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"in1","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"in2","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'distance_float'; + this.desc = "MaterialX:mtlx/math/distance_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_distance_vector4.nodedef_name = 'ND_distance_vector4'; +mtlx_math_distance_vector4.nodedef_node = 'distance'; +mtlx_math_distance_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/distance.html'; +LiteGraph.registerNodeType('mtlx/math/distance_vector4',mtlx_math_distance_vector4); + +// MaterialX node type: mtlx/math/dotproduct_vector2 +// +function mtlx_math_dotproduct_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dotproduct_vector2'; + this.nodedef_type = 'float'; + this.nodedef_node = 'dotproduct'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dotproduct.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dotproduct_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'dotproduct_float'; + this.desc = "MaterialX:mtlx/math/dotproduct_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_dotproduct_vector2.nodedef_name = 'ND_dotproduct_vector2'; +mtlx_math_dotproduct_vector2.nodedef_node = 'dotproduct'; +mtlx_math_dotproduct_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dotproduct.html'; +LiteGraph.registerNodeType('mtlx/math/dotproduct_vector2',mtlx_math_dotproduct_vector2); + +// MaterialX node type: mtlx/math/dotproduct_vector3 +// +function mtlx_math_dotproduct_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dotproduct_vector3'; + this.nodedef_type = 'float'; + this.nodedef_node = 'dotproduct'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dotproduct.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dotproduct_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'dotproduct_float'; + this.desc = "MaterialX:mtlx/math/dotproduct_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_dotproduct_vector3.nodedef_name = 'ND_dotproduct_vector3'; +mtlx_math_dotproduct_vector3.nodedef_node = 'dotproduct'; +mtlx_math_dotproduct_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dotproduct.html'; +LiteGraph.registerNodeType('mtlx/math/dotproduct_vector3',mtlx_math_dotproduct_vector3); + +// MaterialX node type: mtlx/math/dotproduct_vector4 +// +function mtlx_math_dotproduct_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dotproduct_vector4'; + this.nodedef_type = 'float'; + this.nodedef_node = 'dotproduct'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dotproduct.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dotproduct_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'dotproduct_float'; + this.desc = "MaterialX:mtlx/math/dotproduct_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_dotproduct_vector4.nodedef_name = 'ND_dotproduct_vector4'; +mtlx_math_dotproduct_vector4.nodedef_node = 'dotproduct'; +mtlx_math_dotproduct_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dotproduct.html'; +LiteGraph.registerNodeType('mtlx/math/dotproduct_vector4',mtlx_math_dotproduct_vector4); + +// MaterialX node type: mtlx/math/crossproduct_vector3 +// +function mtlx_math_crossproduct_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_crossproduct_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'crossproduct'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/crossproduct.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_crossproduct_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'crossproduct_vector3'; + this.desc = "MaterialX:mtlx/math/crossproduct_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_crossproduct_vector3.nodedef_name = 'ND_crossproduct_vector3'; +mtlx_math_crossproduct_vector3.nodedef_node = 'crossproduct'; +mtlx_math_crossproduct_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/crossproduct.html'; +LiteGraph.registerNodeType('mtlx/math/crossproduct_vector3',mtlx_math_crossproduct_vector3); + +// MaterialX node type: mtlx/math/transformpoint_vector3 +// +function mtlx_math_transformpoint_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transformpoint_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'transformpoint'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformpoint.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transformpoint_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fromspace','string'); + this.addProperty('fromspace', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tospace','string'); + this.addProperty('tospace', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'transformpoint_vector3'; + this.desc = "MaterialX:mtlx/math/transformpoint_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_transformpoint_vector3.nodedef_name = 'ND_transformpoint_vector3'; +mtlx_math_transformpoint_vector3.nodedef_node = 'transformpoint'; +mtlx_math_transformpoint_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformpoint.html'; +LiteGraph.registerNodeType('mtlx/math/transformpoint_vector3',mtlx_math_transformpoint_vector3); + +// MaterialX node type: mtlx/math/transformvector_vector3 +// +function mtlx_math_transformvector_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transformvector_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'transformvector'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformvector.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transformvector_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fromspace','string'); + this.addProperty('fromspace', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tospace','string'); + this.addProperty('tospace', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'transformvector_vector3'; + this.desc = "MaterialX:mtlx/math/transformvector_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_transformvector_vector3.nodedef_name = 'ND_transformvector_vector3'; +mtlx_math_transformvector_vector3.nodedef_node = 'transformvector'; +mtlx_math_transformvector_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformvector.html'; +LiteGraph.registerNodeType('mtlx/math/transformvector_vector3',mtlx_math_transformvector_vector3); + +// MaterialX node type: mtlx/math/transformnormal_vector3 +// +function mtlx_math_transformnormal_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transformnormal_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'transformnormal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformnormal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transformnormal_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fromspace','string'); + this.addProperty('fromspace', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tospace','string'); + this.addProperty('tospace', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'transformnormal_vector3'; + this.desc = "MaterialX:mtlx/math/transformnormal_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_transformnormal_vector3.nodedef_name = 'ND_transformnormal_vector3'; +mtlx_math_transformnormal_vector3.nodedef_node = 'transformnormal'; +mtlx_math_transformnormal_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformnormal.html'; +LiteGraph.registerNodeType('mtlx/math/transformnormal_vector3',mtlx_math_transformnormal_vector3); + +// MaterialX node type: mtlx/math/transformmatrix_vector2M3 +// +function mtlx_math_transformmatrix_vector2M3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transformmatrix_vector2M3'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'transformmatrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformmatrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transformmatrix_vector2M3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mat','matrix33'); + this.addProperty('mat', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'transformmatrix_vector2'; + this.desc = "MaterialX:mtlx/math/transformmatrix_vector2M3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_transformmatrix_vector2M3.nodedef_name = 'ND_transformmatrix_vector2M3'; +mtlx_math_transformmatrix_vector2M3.nodedef_node = 'transformmatrix'; +mtlx_math_transformmatrix_vector2M3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformmatrix.html'; +LiteGraph.registerNodeType('mtlx/math/transformmatrix_vector2M3',mtlx_math_transformmatrix_vector2M3); + +// MaterialX node type: mtlx/math/transformmatrix_vector3 +// +function mtlx_math_transformmatrix_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transformmatrix_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'transformmatrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformmatrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transformmatrix_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mat','matrix33'); + this.addProperty('mat', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'transformmatrix_vector3'; + this.desc = "MaterialX:mtlx/math/transformmatrix_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_transformmatrix_vector3.nodedef_name = 'ND_transformmatrix_vector3'; +mtlx_math_transformmatrix_vector3.nodedef_node = 'transformmatrix'; +mtlx_math_transformmatrix_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformmatrix.html'; +LiteGraph.registerNodeType('mtlx/math/transformmatrix_vector3',mtlx_math_transformmatrix_vector3); + +// MaterialX node type: mtlx/math/transformmatrix_vector3M4 +// +function mtlx_math_transformmatrix_vector3M4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transformmatrix_vector3M4'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'transformmatrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformmatrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transformmatrix_vector3M4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mat','matrix44'); + this.addProperty('mat', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'transformmatrix_vector3'; + this.desc = "MaterialX:mtlx/math/transformmatrix_vector3M4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_transformmatrix_vector3M4.nodedef_name = 'ND_transformmatrix_vector3M4'; +mtlx_math_transformmatrix_vector3M4.nodedef_node = 'transformmatrix'; +mtlx_math_transformmatrix_vector3M4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformmatrix.html'; +LiteGraph.registerNodeType('mtlx/math/transformmatrix_vector3M4',mtlx_math_transformmatrix_vector3M4); + +// MaterialX node type: mtlx/math/transformmatrix_vector4 +// +function mtlx_math_transformmatrix_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transformmatrix_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'transformmatrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformmatrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transformmatrix_vector4_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mat','matrix44'); + this.addProperty('mat', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'transformmatrix_vector4'; + this.desc = "MaterialX:mtlx/math/transformmatrix_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_math_transformmatrix_vector4.nodedef_name = 'ND_transformmatrix_vector4'; +mtlx_math_transformmatrix_vector4.nodedef_node = 'transformmatrix'; +mtlx_math_transformmatrix_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transformmatrix.html'; +LiteGraph.registerNodeType('mtlx/math/transformmatrix_vector4',mtlx_math_transformmatrix_vector4); + +// MaterialX node type: mtlx/math/normalmap_float +// +function mtlx_math_normalmap_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_normalmap_float'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'normalmap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalmap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_normalmap_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.5, 0.5, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('space','string'); + this.addProperty('space', 'tangent', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','float'); + this.addProperty('scale', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'normalmap_vector3'; + this.desc = "MaterialX:mtlx/math/normalmap_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_normalmap_float.nodedef_name = 'ND_normalmap_float'; +mtlx_math_normalmap_float.nodedef_node = 'normalmap'; +mtlx_math_normalmap_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalmap.html'; +LiteGraph.registerNodeType('mtlx/math/normalmap_float',mtlx_math_normalmap_float); + +// MaterialX node type: mtlx/math/normalmap_vector2 +// +function mtlx_math_normalmap_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_normalmap_vector2'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'normalmap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalmap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_normalmap_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.5, 0.5, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('space','string'); + this.addProperty('space', 'tangent', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'normalmap_vector3'; + this.desc = "MaterialX:mtlx/math/normalmap_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_normalmap_vector2.nodedef_name = 'ND_normalmap_vector2'; +mtlx_math_normalmap_vector2.nodedef_node = 'normalmap'; +mtlx_math_normalmap_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/normalmap.html'; +LiteGraph.registerNodeType('mtlx/math/normalmap_vector2',mtlx_math_normalmap_vector2); + +// MaterialX node type: mtlx/math/transpose_matrix33 +// +function mtlx_math_transpose_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transpose_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'transpose'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transpose.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transpose_matrix33_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','matrix33'); + this.addProperty('in', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'transpose_matrix33'; + this.desc = "MaterialX:mtlx/math/transpose_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_transpose_matrix33.nodedef_name = 'ND_transpose_matrix33'; +mtlx_math_transpose_matrix33.nodedef_node = 'transpose'; +mtlx_math_transpose_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transpose.html'; +LiteGraph.registerNodeType('mtlx/math/transpose_matrix33',mtlx_math_transpose_matrix33); + +// MaterialX node type: mtlx/math/transpose_matrix44 +// +function mtlx_math_transpose_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_transpose_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'transpose'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transpose.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_transpose_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','matrix44'); + this.addProperty('in', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'transpose_matrix44'; + this.desc = "MaterialX:mtlx/math/transpose_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_transpose_matrix44.nodedef_name = 'ND_transpose_matrix44'; +mtlx_math_transpose_matrix44.nodedef_node = 'transpose'; +mtlx_math_transpose_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/transpose.html'; +LiteGraph.registerNodeType('mtlx/math/transpose_matrix44',mtlx_math_transpose_matrix44); + +// MaterialX node type: mtlx/math/determinant_matrix33 +// +function mtlx_math_determinant_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_determinant_matrix33'; + this.nodedef_type = 'float'; + this.nodedef_node = 'determinant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/determinant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_determinant_matrix33_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','matrix33'); + this.addProperty('in', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'determinant_float'; + this.desc = "MaterialX:mtlx/math/determinant_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_determinant_matrix33.nodedef_name = 'ND_determinant_matrix33'; +mtlx_math_determinant_matrix33.nodedef_node = 'determinant'; +mtlx_math_determinant_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/determinant.html'; +LiteGraph.registerNodeType('mtlx/math/determinant_matrix33',mtlx_math_determinant_matrix33); + +// MaterialX node type: mtlx/math/determinant_matrix44 +// +function mtlx_math_determinant_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_determinant_matrix44'; + this.nodedef_type = 'float'; + this.nodedef_node = 'determinant'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/determinant.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_determinant_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','matrix44'); + this.addProperty('in', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'determinant_float'; + this.desc = "MaterialX:mtlx/math/determinant_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_determinant_matrix44.nodedef_name = 'ND_determinant_matrix44'; +mtlx_math_determinant_matrix44.nodedef_node = 'determinant'; +mtlx_math_determinant_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/determinant.html'; +LiteGraph.registerNodeType('mtlx/math/determinant_matrix44',mtlx_math_determinant_matrix44); + +// MaterialX node type: mtlx/math/invertmatrix_matrix33 +// +function mtlx_math_invertmatrix_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invertmatrix_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'invertmatrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invertmatrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invertmatrix_matrix33_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','matrix33'); + this.addProperty('in', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'invertmatrix_matrix33'; + this.desc = "MaterialX:mtlx/math/invertmatrix_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_invertmatrix_matrix33.nodedef_name = 'ND_invertmatrix_matrix33'; +mtlx_math_invertmatrix_matrix33.nodedef_node = 'invertmatrix'; +mtlx_math_invertmatrix_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invertmatrix.html'; +LiteGraph.registerNodeType('mtlx/math/invertmatrix_matrix33',mtlx_math_invertmatrix_matrix33); + +// MaterialX node type: mtlx/math/invertmatrix_matrix44 +// +function mtlx_math_invertmatrix_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_invertmatrix_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'invertmatrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invertmatrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_invertmatrix_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','matrix44'); + this.addProperty('in', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'invertmatrix_matrix44'; + this.desc = "MaterialX:mtlx/math/invertmatrix_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_invertmatrix_matrix44.nodedef_name = 'ND_invertmatrix_matrix44'; +mtlx_math_invertmatrix_matrix44.nodedef_node = 'invertmatrix'; +mtlx_math_invertmatrix_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/invertmatrix.html'; +LiteGraph.registerNodeType('mtlx/math/invertmatrix_matrix44',mtlx_math_invertmatrix_matrix44); + +// MaterialX node type: mtlx/math/rotate2d_vector2 +// +function mtlx_math_rotate2d_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_rotate2d_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'rotate2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rotate2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_rotate2d_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'rotate2d_vector2'; + this.desc = "MaterialX:mtlx/math/rotate2d_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_rotate2d_vector2.nodedef_name = 'ND_rotate2d_vector2'; +mtlx_math_rotate2d_vector2.nodedef_node = 'rotate2d'; +mtlx_math_rotate2d_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rotate2d.html'; +LiteGraph.registerNodeType('mtlx/math/rotate2d_vector2',mtlx_math_rotate2d_vector2); + +// MaterialX node type: mtlx/math/rotate3d_vector3 +// +function mtlx_math_rotate3d_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_rotate3d_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'rotate3d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rotate3d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_rotate3d_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('axis','vector3'); + this.addProperty('axis', [0.0, 1.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'rotate3d_vector3'; + this.desc = "MaterialX:mtlx/math/rotate3d_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_rotate3d_vector3.nodedef_name = 'ND_rotate3d_vector3'; +mtlx_math_rotate3d_vector3.nodedef_node = 'rotate3d'; +mtlx_math_rotate3d_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rotate3d.html'; +LiteGraph.registerNodeType('mtlx/math/rotate3d_vector3',mtlx_math_rotate3d_vector3); + +// MaterialX node type: mtlx/math/place2d_vector2 +// +function mtlx_math_place2d_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_place2d_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'place2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/place2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_place2d_vector2_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0.0,0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1.0,1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('rotate','float'); + this.addProperty('rotate', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0.0,0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('operationorder','integer'); + this.addProperty('operationorder', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'place2d_vector2'; + this.desc = "MaterialX:mtlx/math/place2d_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_place2d_vector2.nodedef_name = 'ND_place2d_vector2'; +mtlx_math_place2d_vector2.nodedef_node = 'place2d'; +mtlx_math_place2d_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/place2d.html'; +LiteGraph.registerNodeType('mtlx/math/place2d_vector2',mtlx_math_place2d_vector2); + +// MaterialX node type: mtlx/math/trianglewave_float +// +function mtlx_math_trianglewave_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_trianglewave_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'trianglewave'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/trianglewave.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_trianglewave_float_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','float'); + this.addProperty('in', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'trianglewave_float'; + this.desc = "MaterialX:mtlx/math/trianglewave_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_math_trianglewave_float.nodedef_name = 'ND_trianglewave_float'; +mtlx_math_trianglewave_float.nodedef_node = 'trianglewave'; +mtlx_math_trianglewave_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/trianglewave.html'; +LiteGraph.registerNodeType('mtlx/math/trianglewave_float',mtlx_math_trianglewave_float); + +// MaterialX node type: mtlx/math/reflect_vector3 +// +function mtlx_math_reflect_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_reflect_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'reflect'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/reflect.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_reflect_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [1.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'reflect_vector3'; + this.desc = "MaterialX:mtlx/math/reflect_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_reflect_vector3.nodedef_name = 'ND_reflect_vector3'; +mtlx_math_reflect_vector3.nodedef_node = 'reflect'; +mtlx_math_reflect_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/reflect.html'; +LiteGraph.registerNodeType('mtlx/math/reflect_vector3',mtlx_math_reflect_vector3); + +// MaterialX node type: mtlx/math/refract_vector3 +// +function mtlx_math_refract_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_refract_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'refract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/refract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_refract_vector3_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector3'); + this.addProperty('in', [1.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('ior','float'); + this.addProperty('ior', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'refract_vector3'; + this.desc = "MaterialX:mtlx/math/refract_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_math_refract_vector3.nodedef_name = 'ND_refract_vector3'; +mtlx_math_refract_vector3.nodedef_node = 'refract'; +mtlx_math_refract_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/refract.html'; +LiteGraph.registerNodeType('mtlx/math/refract_vector3',mtlx_math_refract_vector3); + +// MaterialX node type: mtlx/adjustment/remap_float +// +function mtlx_adjustment_remap_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_float_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'remap_float'; + this.desc = "MaterialX:mtlx/adjustment/remap_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_adjustment_remap_float.nodedef_name = 'ND_remap_float'; +mtlx_adjustment_remap_float.nodedef_node = 'remap'; +mtlx_adjustment_remap_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_float',mtlx_adjustment_remap_float); + +// MaterialX node type: mtlx/adjustment/remap_color3 +// +function mtlx_adjustment_remap_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','color3'); + this.addProperty('inlow', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','color3'); + this.addProperty('inhigh', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','color3'); + this.addProperty('outlow', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','color3'); + this.addProperty('outhigh', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'remap_color3'; + this.desc = "MaterialX:mtlx/adjustment/remap_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_remap_color3.nodedef_name = 'ND_remap_color3'; +mtlx_adjustment_remap_color3.nodedef_node = 'remap'; +mtlx_adjustment_remap_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_color3',mtlx_adjustment_remap_color3); + +// MaterialX node type: mtlx/adjustment/remap_color4 +// +function mtlx_adjustment_remap_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','color4'); + this.addProperty('inlow', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','color4'); + this.addProperty('inhigh', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','color4'); + this.addProperty('outlow', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','color4'); + this.addProperty('outhigh', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'remap_color4'; + this.desc = "MaterialX:mtlx/adjustment/remap_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_remap_color4.nodedef_name = 'ND_remap_color4'; +mtlx_adjustment_remap_color4.nodedef_node = 'remap'; +mtlx_adjustment_remap_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_color4',mtlx_adjustment_remap_color4); + +// MaterialX node type: mtlx/adjustment/remap_vector2 +// +function mtlx_adjustment_remap_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_vector2_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','vector2'); + this.addProperty('inlow', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','vector2'); + this.addProperty('inhigh', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','vector2'); + this.addProperty('outlow', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','vector2'); + this.addProperty('outhigh', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'remap_vector2'; + this.desc = "MaterialX:mtlx/adjustment/remap_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_remap_vector2.nodedef_name = 'ND_remap_vector2'; +mtlx_adjustment_remap_vector2.nodedef_node = 'remap'; +mtlx_adjustment_remap_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_vector2',mtlx_adjustment_remap_vector2); + +// MaterialX node type: mtlx/adjustment/remap_vector3 +// +function mtlx_adjustment_remap_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_vector3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','vector3'); + this.addProperty('inlow', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','vector3'); + this.addProperty('inhigh', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','vector3'); + this.addProperty('outlow', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','vector3'); + this.addProperty('outhigh', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'remap_vector3'; + this.desc = "MaterialX:mtlx/adjustment/remap_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_remap_vector3.nodedef_name = 'ND_remap_vector3'; +mtlx_adjustment_remap_vector3.nodedef_node = 'remap'; +mtlx_adjustment_remap_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_vector3',mtlx_adjustment_remap_vector3); + +// MaterialX node type: mtlx/adjustment/remap_vector4 +// +function mtlx_adjustment_remap_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_vector4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','vector4'); + this.addProperty('inlow', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','vector4'); + this.addProperty('inhigh', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','vector4'); + this.addProperty('outlow', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','vector4'); + this.addProperty('outhigh', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'remap_vector4'; + this.desc = "MaterialX:mtlx/adjustment/remap_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_remap_vector4.nodedef_name = 'ND_remap_vector4'; +mtlx_adjustment_remap_vector4.nodedef_node = 'remap'; +mtlx_adjustment_remap_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_vector4',mtlx_adjustment_remap_vector4); + +// MaterialX node type: mtlx/adjustment/remap_color3FA +// +function mtlx_adjustment_remap_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_color3FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'remap_color3'; + this.desc = "MaterialX:mtlx/adjustment/remap_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_remap_color3FA.nodedef_name = 'ND_remap_color3FA'; +mtlx_adjustment_remap_color3FA.nodedef_node = 'remap'; +mtlx_adjustment_remap_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_color3FA',mtlx_adjustment_remap_color3FA); + +// MaterialX node type: mtlx/adjustment/remap_color4FA +// +function mtlx_adjustment_remap_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_color4FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'remap_color4'; + this.desc = "MaterialX:mtlx/adjustment/remap_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_remap_color4FA.nodedef_name = 'ND_remap_color4FA'; +mtlx_adjustment_remap_color4FA.nodedef_node = 'remap'; +mtlx_adjustment_remap_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_color4FA',mtlx_adjustment_remap_color4FA); + +// MaterialX node type: mtlx/adjustment/remap_vector2FA +// +function mtlx_adjustment_remap_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_vector2FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'remap_vector2'; + this.desc = "MaterialX:mtlx/adjustment/remap_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_remap_vector2FA.nodedef_name = 'ND_remap_vector2FA'; +mtlx_adjustment_remap_vector2FA.nodedef_node = 'remap'; +mtlx_adjustment_remap_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_vector2FA',mtlx_adjustment_remap_vector2FA); + +// MaterialX node type: mtlx/adjustment/remap_vector3FA +// +function mtlx_adjustment_remap_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_vector3FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'remap_vector3'; + this.desc = "MaterialX:mtlx/adjustment/remap_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_remap_vector3FA.nodedef_name = 'ND_remap_vector3FA'; +mtlx_adjustment_remap_vector3FA.nodedef_node = 'remap'; +mtlx_adjustment_remap_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_vector3FA',mtlx_adjustment_remap_vector3FA); + +// MaterialX node type: mtlx/adjustment/remap_vector4FA +// +function mtlx_adjustment_remap_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_remap_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'remap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_remap_vector4FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'remap_vector4'; + this.desc = "MaterialX:mtlx/adjustment/remap_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_remap_vector4FA.nodedef_name = 'ND_remap_vector4FA'; +mtlx_adjustment_remap_vector4FA.nodedef_node = 'remap'; +mtlx_adjustment_remap_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/remap.html'; +LiteGraph.registerNodeType('mtlx/adjustment/remap_vector4FA',mtlx_adjustment_remap_vector4FA); + +// MaterialX node type: mtlx/adjustment/smoothstep_float +// +function mtlx_adjustment_smoothstep_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_float_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'smoothstep_float'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_adjustment_smoothstep_float.nodedef_name = 'ND_smoothstep_float'; +mtlx_adjustment_smoothstep_float.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_float',mtlx_adjustment_smoothstep_float); + +// MaterialX node type: mtlx/adjustment/smoothstep_color3 +// +function mtlx_adjustment_smoothstep_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','color3'); + this.addProperty('low', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','color3'); + this.addProperty('high', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'smoothstep_color3'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_smoothstep_color3.nodedef_name = 'ND_smoothstep_color3'; +mtlx_adjustment_smoothstep_color3.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_color3',mtlx_adjustment_smoothstep_color3); + +// MaterialX node type: mtlx/adjustment/smoothstep_color4 +// +function mtlx_adjustment_smoothstep_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','color4'); + this.addProperty('low', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','color4'); + this.addProperty('high', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'smoothstep_color4'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_smoothstep_color4.nodedef_name = 'ND_smoothstep_color4'; +mtlx_adjustment_smoothstep_color4.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_color4',mtlx_adjustment_smoothstep_color4); + +// MaterialX node type: mtlx/adjustment/smoothstep_vector2 +// +function mtlx_adjustment_smoothstep_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_vector2_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','vector2'); + this.addProperty('low', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','vector2'); + this.addProperty('high', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'smoothstep_vector2'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_smoothstep_vector2.nodedef_name = 'ND_smoothstep_vector2'; +mtlx_adjustment_smoothstep_vector2.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_vector2',mtlx_adjustment_smoothstep_vector2); + +// MaterialX node type: mtlx/adjustment/smoothstep_vector3 +// +function mtlx_adjustment_smoothstep_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_vector3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','vector3'); + this.addProperty('low', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','vector3'); + this.addProperty('high', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'smoothstep_vector3'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_smoothstep_vector3.nodedef_name = 'ND_smoothstep_vector3'; +mtlx_adjustment_smoothstep_vector3.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_vector3',mtlx_adjustment_smoothstep_vector3); + +// MaterialX node type: mtlx/adjustment/smoothstep_vector4 +// +function mtlx_adjustment_smoothstep_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_vector4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','vector4'); + this.addProperty('low', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','vector4'); + this.addProperty('high', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'smoothstep_vector4'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_smoothstep_vector4.nodedef_name = 'ND_smoothstep_vector4'; +mtlx_adjustment_smoothstep_vector4.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_vector4',mtlx_adjustment_smoothstep_vector4); + +// MaterialX node type: mtlx/adjustment/smoothstep_color3FA +// +function mtlx_adjustment_smoothstep_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_color3FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'smoothstep_color3'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_smoothstep_color3FA.nodedef_name = 'ND_smoothstep_color3FA'; +mtlx_adjustment_smoothstep_color3FA.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_color3FA',mtlx_adjustment_smoothstep_color3FA); + +// MaterialX node type: mtlx/adjustment/smoothstep_color4FA +// +function mtlx_adjustment_smoothstep_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_color4FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'smoothstep_color4'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_smoothstep_color4FA.nodedef_name = 'ND_smoothstep_color4FA'; +mtlx_adjustment_smoothstep_color4FA.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_color4FA',mtlx_adjustment_smoothstep_color4FA); + +// MaterialX node type: mtlx/adjustment/smoothstep_vector2FA +// +function mtlx_adjustment_smoothstep_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_vector2FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'smoothstep_vector2'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_smoothstep_vector2FA.nodedef_name = 'ND_smoothstep_vector2FA'; +mtlx_adjustment_smoothstep_vector2FA.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_vector2FA',mtlx_adjustment_smoothstep_vector2FA); + +// MaterialX node type: mtlx/adjustment/smoothstep_vector3FA +// +function mtlx_adjustment_smoothstep_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_vector3FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'smoothstep_vector3'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_smoothstep_vector3FA.nodedef_name = 'ND_smoothstep_vector3FA'; +mtlx_adjustment_smoothstep_vector3FA.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_vector3FA',mtlx_adjustment_smoothstep_vector3FA); + +// MaterialX node type: mtlx/adjustment/smoothstep_vector4FA +// +function mtlx_adjustment_smoothstep_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_smoothstep_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'smoothstep'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_smoothstep_vector4FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('low','float'); + this.addProperty('low', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('high','float'); + this.addProperty('high', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'smoothstep_vector4'; + this.desc = "MaterialX:mtlx/adjustment/smoothstep_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_smoothstep_vector4FA.nodedef_name = 'ND_smoothstep_vector4FA'; +mtlx_adjustment_smoothstep_vector4FA.nodedef_node = 'smoothstep'; +mtlx_adjustment_smoothstep_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/smoothstep.html'; +LiteGraph.registerNodeType('mtlx/adjustment/smoothstep_vector4FA',mtlx_adjustment_smoothstep_vector4FA); + +// MaterialX node type: mtlx/adjustment/curveadjust_float +// +function mtlx_adjustment_curveadjust_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_curveadjust_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'curveadjust'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_curveadjust_float_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('knots','vector2array'); + this.addProperty('knots', '', 'vector2array',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'curveadjust_float'; + this.desc = "MaterialX:mtlx/adjustment/curveadjust_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_adjustment_curveadjust_float.nodedef_name = 'ND_curveadjust_float'; +mtlx_adjustment_curveadjust_float.nodedef_node = 'curveadjust'; +mtlx_adjustment_curveadjust_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; +LiteGraph.registerNodeType('mtlx/adjustment/curveadjust_float',mtlx_adjustment_curveadjust_float); + +// MaterialX node type: mtlx/adjustment/curveadjust_color3 +// +function mtlx_adjustment_curveadjust_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_curveadjust_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'curveadjust'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_curveadjust_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('knots','vector2array'); + this.addProperty('knots', '', 'vector2array',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'curveadjust_color3'; + this.desc = "MaterialX:mtlx/adjustment/curveadjust_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_curveadjust_color3.nodedef_name = 'ND_curveadjust_color3'; +mtlx_adjustment_curveadjust_color3.nodedef_node = 'curveadjust'; +mtlx_adjustment_curveadjust_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; +LiteGraph.registerNodeType('mtlx/adjustment/curveadjust_color3',mtlx_adjustment_curveadjust_color3); + +// MaterialX node type: mtlx/adjustment/curveadjust_color4 +// +function mtlx_adjustment_curveadjust_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_curveadjust_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'curveadjust'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_curveadjust_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('knots','vector2array'); + this.addProperty('knots', '', 'vector2array',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'curveadjust_color4'; + this.desc = "MaterialX:mtlx/adjustment/curveadjust_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_curveadjust_color4.nodedef_name = 'ND_curveadjust_color4'; +mtlx_adjustment_curveadjust_color4.nodedef_node = 'curveadjust'; +mtlx_adjustment_curveadjust_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; +LiteGraph.registerNodeType('mtlx/adjustment/curveadjust_color4',mtlx_adjustment_curveadjust_color4); + +// MaterialX node type: mtlx/adjustment/curveadjust_vector2 +// +function mtlx_adjustment_curveadjust_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_curveadjust_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'curveadjust'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_curveadjust_vector2_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('knots','vector2array'); + this.addProperty('knots', '', 'vector2array',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'curveadjust_vector2'; + this.desc = "MaterialX:mtlx/adjustment/curveadjust_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_curveadjust_vector2.nodedef_name = 'ND_curveadjust_vector2'; +mtlx_adjustment_curveadjust_vector2.nodedef_node = 'curveadjust'; +mtlx_adjustment_curveadjust_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; +LiteGraph.registerNodeType('mtlx/adjustment/curveadjust_vector2',mtlx_adjustment_curveadjust_vector2); + +// MaterialX node type: mtlx/adjustment/curveadjust_vector3 +// +function mtlx_adjustment_curveadjust_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_curveadjust_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'curveadjust'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_curveadjust_vector3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('knots','vector2array'); + this.addProperty('knots', '', 'vector2array',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'curveadjust_vector3'; + this.desc = "MaterialX:mtlx/adjustment/curveadjust_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_curveadjust_vector3.nodedef_name = 'ND_curveadjust_vector3'; +mtlx_adjustment_curveadjust_vector3.nodedef_node = 'curveadjust'; +mtlx_adjustment_curveadjust_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; +LiteGraph.registerNodeType('mtlx/adjustment/curveadjust_vector3',mtlx_adjustment_curveadjust_vector3); + +// MaterialX node type: mtlx/adjustment/curveadjust_vector4 +// +function mtlx_adjustment_curveadjust_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_curveadjust_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'curveadjust'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_curveadjust_vector4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('knots','vector2array'); + this.addProperty('knots', '', 'vector2array',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'curveadjust_vector4'; + this.desc = "MaterialX:mtlx/adjustment/curveadjust_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_curveadjust_vector4.nodedef_name = 'ND_curveadjust_vector4'; +mtlx_adjustment_curveadjust_vector4.nodedef_node = 'curveadjust'; +mtlx_adjustment_curveadjust_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/curveadjust.html'; +LiteGraph.registerNodeType('mtlx/adjustment/curveadjust_vector4',mtlx_adjustment_curveadjust_vector4); + +// MaterialX node type: mtlx/adjustment/luminance_color3 +// +function mtlx_adjustment_luminance_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_luminance_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'luminance'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/luminance.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_luminance_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lumacoeffs','color3'); + this.addProperty('lumacoeffs', [0.2722287, 0.6740818, 0.0536895], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'luminance_color3'; + this.desc = "MaterialX:mtlx/adjustment/luminance_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_luminance_color3.nodedef_name = 'ND_luminance_color3'; +mtlx_adjustment_luminance_color3.nodedef_node = 'luminance'; +mtlx_adjustment_luminance_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/luminance.html'; +LiteGraph.registerNodeType('mtlx/adjustment/luminance_color3',mtlx_adjustment_luminance_color3); + +// MaterialX node type: mtlx/adjustment/luminance_color4 +// +function mtlx_adjustment_luminance_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_luminance_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'luminance'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/luminance.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_luminance_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lumacoeffs','color3'); + this.addProperty('lumacoeffs', [0.2722287, 0.6740818, 0.0536895], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'luminance_color4'; + this.desc = "MaterialX:mtlx/adjustment/luminance_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_luminance_color4.nodedef_name = 'ND_luminance_color4'; +mtlx_adjustment_luminance_color4.nodedef_node = 'luminance'; +mtlx_adjustment_luminance_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/luminance.html'; +LiteGraph.registerNodeType('mtlx/adjustment/luminance_color4',mtlx_adjustment_luminance_color4); + +// MaterialX node type: mtlx/adjustment/rgbtohsv_color3 +// +function mtlx_adjustment_rgbtohsv_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_rgbtohsv_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'rgbtohsv'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rgbtohsv.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_rgbtohsv_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'rgbtohsv_color3'; + this.desc = "MaterialX:mtlx/adjustment/rgbtohsv_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_rgbtohsv_color3.nodedef_name = 'ND_rgbtohsv_color3'; +mtlx_adjustment_rgbtohsv_color3.nodedef_node = 'rgbtohsv'; +mtlx_adjustment_rgbtohsv_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rgbtohsv.html'; +LiteGraph.registerNodeType('mtlx/adjustment/rgbtohsv_color3',mtlx_adjustment_rgbtohsv_color3); + +// MaterialX node type: mtlx/adjustment/rgbtohsv_color4 +// +function mtlx_adjustment_rgbtohsv_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_rgbtohsv_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'rgbtohsv'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rgbtohsv.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_rgbtohsv_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'rgbtohsv_color4'; + this.desc = "MaterialX:mtlx/adjustment/rgbtohsv_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_rgbtohsv_color4.nodedef_name = 'ND_rgbtohsv_color4'; +mtlx_adjustment_rgbtohsv_color4.nodedef_node = 'rgbtohsv'; +mtlx_adjustment_rgbtohsv_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/rgbtohsv.html'; +LiteGraph.registerNodeType('mtlx/adjustment/rgbtohsv_color4',mtlx_adjustment_rgbtohsv_color4); + +// MaterialX node type: mtlx/adjustment/hsvtorgb_color3 +// +function mtlx_adjustment_hsvtorgb_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_hsvtorgb_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'hsvtorgb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hsvtorgb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_hsvtorgb_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'hsvtorgb_color3'; + this.desc = "MaterialX:mtlx/adjustment/hsvtorgb_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_hsvtorgb_color3.nodedef_name = 'ND_hsvtorgb_color3'; +mtlx_adjustment_hsvtorgb_color3.nodedef_node = 'hsvtorgb'; +mtlx_adjustment_hsvtorgb_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hsvtorgb.html'; +LiteGraph.registerNodeType('mtlx/adjustment/hsvtorgb_color3',mtlx_adjustment_hsvtorgb_color3); + +// MaterialX node type: mtlx/adjustment/hsvtorgb_color4 +// +function mtlx_adjustment_hsvtorgb_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_hsvtorgb_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'hsvtorgb'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hsvtorgb.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_hsvtorgb_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'hsvtorgb_color4'; + this.desc = "MaterialX:mtlx/adjustment/hsvtorgb_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_hsvtorgb_color4.nodedef_name = 'ND_hsvtorgb_color4'; +mtlx_adjustment_hsvtorgb_color4.nodedef_node = 'hsvtorgb'; +mtlx_adjustment_hsvtorgb_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hsvtorgb.html'; +LiteGraph.registerNodeType('mtlx/adjustment/hsvtorgb_color4',mtlx_adjustment_hsvtorgb_color4); + +// MaterialX node type: mtlx/adjustment/contrast_float +// +function mtlx_adjustment_contrast_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_float_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'contrast_float'; + this.desc = "MaterialX:mtlx/adjustment/contrast_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_adjustment_contrast_float.nodedef_name = 'ND_contrast_float'; +mtlx_adjustment_contrast_float.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_float',mtlx_adjustment_contrast_float); + +// MaterialX node type: mtlx/adjustment/contrast_color3 +// +function mtlx_adjustment_contrast_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','color3'); + this.addProperty('amount', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','color3'); + this.addProperty('pivot', [0.5, 0.5, 0.5], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'contrast_color3'; + this.desc = "MaterialX:mtlx/adjustment/contrast_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_contrast_color3.nodedef_name = 'ND_contrast_color3'; +mtlx_adjustment_contrast_color3.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_color3',mtlx_adjustment_contrast_color3); + +// MaterialX node type: mtlx/adjustment/contrast_color4 +// +function mtlx_adjustment_contrast_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','color4'); + this.addProperty('amount', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','color4'); + this.addProperty('pivot', [0.5, 0.5, 0.5, 0.5], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'contrast_color4'; + this.desc = "MaterialX:mtlx/adjustment/contrast_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_contrast_color4.nodedef_name = 'ND_contrast_color4'; +mtlx_adjustment_contrast_color4.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_color4',mtlx_adjustment_contrast_color4); + +// MaterialX node type: mtlx/adjustment/contrast_vector2 +// +function mtlx_adjustment_contrast_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_vector2_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','vector2'); + this.addProperty('amount', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0.5, 0.5], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'contrast_vector2'; + this.desc = "MaterialX:mtlx/adjustment/contrast_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_contrast_vector2.nodedef_name = 'ND_contrast_vector2'; +mtlx_adjustment_contrast_vector2.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_vector2',mtlx_adjustment_contrast_vector2); + +// MaterialX node type: mtlx/adjustment/contrast_vector3 +// +function mtlx_adjustment_contrast_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_vector3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','vector3'); + this.addProperty('amount', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector3'); + this.addProperty('pivot', [0.5, 0.5, 0.5], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'contrast_vector3'; + this.desc = "MaterialX:mtlx/adjustment/contrast_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_contrast_vector3.nodedef_name = 'ND_contrast_vector3'; +mtlx_adjustment_contrast_vector3.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_vector3',mtlx_adjustment_contrast_vector3); + +// MaterialX node type: mtlx/adjustment/contrast_vector4 +// +function mtlx_adjustment_contrast_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_vector4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','vector4'); + this.addProperty('amount', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector4'); + this.addProperty('pivot', [0.5, 0.5, 0.5, 0.5], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'contrast_vector4'; + this.desc = "MaterialX:mtlx/adjustment/contrast_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_contrast_vector4.nodedef_name = 'ND_contrast_vector4'; +mtlx_adjustment_contrast_vector4.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_vector4',mtlx_adjustment_contrast_vector4); + +// MaterialX node type: mtlx/adjustment/contrast_color3FA +// +function mtlx_adjustment_contrast_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_color3FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'contrast_color3'; + this.desc = "MaterialX:mtlx/adjustment/contrast_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_contrast_color3FA.nodedef_name = 'ND_contrast_color3FA'; +mtlx_adjustment_contrast_color3FA.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_color3FA',mtlx_adjustment_contrast_color3FA); + +// MaterialX node type: mtlx/adjustment/contrast_color4FA +// +function mtlx_adjustment_contrast_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_color4FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'contrast_color4'; + this.desc = "MaterialX:mtlx/adjustment/contrast_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_contrast_color4FA.nodedef_name = 'ND_contrast_color4FA'; +mtlx_adjustment_contrast_color4FA.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_color4FA',mtlx_adjustment_contrast_color4FA); + +// MaterialX node type: mtlx/adjustment/contrast_vector2FA +// +function mtlx_adjustment_contrast_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_vector2FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'contrast_vector2'; + this.desc = "MaterialX:mtlx/adjustment/contrast_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_contrast_vector2FA.nodedef_name = 'ND_contrast_vector2FA'; +mtlx_adjustment_contrast_vector2FA.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_vector2FA',mtlx_adjustment_contrast_vector2FA); + +// MaterialX node type: mtlx/adjustment/contrast_vector3FA +// +function mtlx_adjustment_contrast_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_vector3FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'contrast_vector3'; + this.desc = "MaterialX:mtlx/adjustment/contrast_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_contrast_vector3FA.nodedef_name = 'ND_contrast_vector3FA'; +mtlx_adjustment_contrast_vector3FA.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_vector3FA',mtlx_adjustment_contrast_vector3FA); + +// MaterialX node type: mtlx/adjustment/contrast_vector4FA +// +function mtlx_adjustment_contrast_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_contrast_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'contrast'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_contrast_vector4FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','float'); + this.addProperty('pivot', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'contrast_vector4'; + this.desc = "MaterialX:mtlx/adjustment/contrast_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_contrast_vector4FA.nodedef_name = 'ND_contrast_vector4FA'; +mtlx_adjustment_contrast_vector4FA.nodedef_node = 'contrast'; +mtlx_adjustment_contrast_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/contrast.html'; +LiteGraph.registerNodeType('mtlx/adjustment/contrast_vector4FA',mtlx_adjustment_contrast_vector4FA); + +// MaterialX node type: mtlx/adjustment/range_float +// +function mtlx_adjustment_range_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_float_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','float'); + this.addProperty('gamma', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'range_float'; + this.desc = "MaterialX:mtlx/adjustment/range_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_adjustment_range_float.nodedef_name = 'ND_range_float'; +mtlx_adjustment_range_float.nodedef_node = 'range'; +mtlx_adjustment_range_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_float',mtlx_adjustment_range_float); + +// MaterialX node type: mtlx/adjustment/range_color3 +// +function mtlx_adjustment_range_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','color3'); + this.addProperty('inlow', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','color3'); + this.addProperty('inhigh', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','color3'); + this.addProperty('gamma', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','color3'); + this.addProperty('outlow', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','color3'); + this.addProperty('outhigh', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'range_color3'; + this.desc = "MaterialX:mtlx/adjustment/range_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_range_color3.nodedef_name = 'ND_range_color3'; +mtlx_adjustment_range_color3.nodedef_node = 'range'; +mtlx_adjustment_range_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_color3',mtlx_adjustment_range_color3); + +// MaterialX node type: mtlx/adjustment/range_color4 +// +function mtlx_adjustment_range_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','color4'); + this.addProperty('inlow', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','color4'); + this.addProperty('inhigh', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','color4'); + this.addProperty('gamma', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','color4'); + this.addProperty('outlow', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','color4'); + this.addProperty('outhigh', [1.0, 1.0, 1.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'range_color4'; + this.desc = "MaterialX:mtlx/adjustment/range_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_range_color4.nodedef_name = 'ND_range_color4'; +mtlx_adjustment_range_color4.nodedef_node = 'range'; +mtlx_adjustment_range_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_color4',mtlx_adjustment_range_color4); + +// MaterialX node type: mtlx/adjustment/range_vector2 +// +function mtlx_adjustment_range_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_vector2_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','vector2'); + this.addProperty('inlow', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','vector2'); + this.addProperty('inhigh', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','vector2'); + this.addProperty('gamma', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','vector2'); + this.addProperty('outlow', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','vector2'); + this.addProperty('outhigh', [1.0, 1.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'range_vector2'; + this.desc = "MaterialX:mtlx/adjustment/range_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_range_vector2.nodedef_name = 'ND_range_vector2'; +mtlx_adjustment_range_vector2.nodedef_node = 'range'; +mtlx_adjustment_range_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_vector2',mtlx_adjustment_range_vector2); + +// MaterialX node type: mtlx/adjustment/range_vector3 +// +function mtlx_adjustment_range_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_vector3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','vector3'); + this.addProperty('inlow', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','vector3'); + this.addProperty('inhigh', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','vector3'); + this.addProperty('gamma', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','vector3'); + this.addProperty('outlow', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','vector3'); + this.addProperty('outhigh', [1.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'range_vector3'; + this.desc = "MaterialX:mtlx/adjustment/range_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_range_vector3.nodedef_name = 'ND_range_vector3'; +mtlx_adjustment_range_vector3.nodedef_node = 'range'; +mtlx_adjustment_range_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_vector3',mtlx_adjustment_range_vector3); + +// MaterialX node type: mtlx/adjustment/range_vector4 +// +function mtlx_adjustment_range_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_vector4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','vector4'); + this.addProperty('inlow', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','vector4'); + this.addProperty('inhigh', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','vector4'); + this.addProperty('gamma', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','vector4'); + this.addProperty('outlow', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','vector4'); + this.addProperty('outhigh', [1.0, 1.0, 1.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'range_vector4'; + this.desc = "MaterialX:mtlx/adjustment/range_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_range_vector4.nodedef_name = 'ND_range_vector4'; +mtlx_adjustment_range_vector4.nodedef_node = 'range'; +mtlx_adjustment_range_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_vector4',mtlx_adjustment_range_vector4); + +// MaterialX node type: mtlx/adjustment/range_color3FA +// +function mtlx_adjustment_range_color3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_color3FA'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_color3FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','float'); + this.addProperty('gamma', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'range_color3'; + this.desc = "MaterialX:mtlx/adjustment/range_color3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_range_color3FA.nodedef_name = 'ND_range_color3FA'; +mtlx_adjustment_range_color3FA.nodedef_node = 'range'; +mtlx_adjustment_range_color3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_color3FA',mtlx_adjustment_range_color3FA); + +// MaterialX node type: mtlx/adjustment/range_color4FA +// +function mtlx_adjustment_range_color4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_color4FA'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_color4FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','float'); + this.addProperty('gamma', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'range_color4'; + this.desc = "MaterialX:mtlx/adjustment/range_color4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_range_color4FA.nodedef_name = 'ND_range_color4FA'; +mtlx_adjustment_range_color4FA.nodedef_node = 'range'; +mtlx_adjustment_range_color4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_color4FA',mtlx_adjustment_range_color4FA); + +// MaterialX node type: mtlx/adjustment/range_vector2FA +// +function mtlx_adjustment_range_vector2FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_vector2FA'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_vector2FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','float'); + this.addProperty('gamma', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'range_vector2'; + this.desc = "MaterialX:mtlx/adjustment/range_vector2FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_adjustment_range_vector2FA.nodedef_name = 'ND_range_vector2FA'; +mtlx_adjustment_range_vector2FA.nodedef_node = 'range'; +mtlx_adjustment_range_vector2FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_vector2FA',mtlx_adjustment_range_vector2FA); + +// MaterialX node type: mtlx/adjustment/range_vector3FA +// +function mtlx_adjustment_range_vector3FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_vector3FA'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_vector3FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','float'); + this.addProperty('gamma', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'range_vector3'; + this.desc = "MaterialX:mtlx/adjustment/range_vector3FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_adjustment_range_vector3FA.nodedef_name = 'ND_range_vector3FA'; +mtlx_adjustment_range_vector3FA.nodedef_node = 'range'; +mtlx_adjustment_range_vector3FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_vector3FA',mtlx_adjustment_range_vector3FA); + +// MaterialX node type: mtlx/adjustment/range_vector4FA +// +function mtlx_adjustment_range_vector4FA() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_range_vector4FA'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'range'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_range_vector4FA_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inlow','float'); + this.addProperty('inlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('inhigh','float'); + this.addProperty('inhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','float'); + this.addProperty('gamma', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outlow','float'); + this.addProperty('outlow', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('outhigh','float'); + this.addProperty('outhigh', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('doclamp','boolean'); + this.addProperty('doclamp', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'range_vector4'; + this.desc = "MaterialX:mtlx/adjustment/range_vector4FA"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_adjustment_range_vector4FA.nodedef_name = 'ND_range_vector4FA'; +mtlx_adjustment_range_vector4FA.nodedef_node = 'range'; +mtlx_adjustment_range_vector4FA.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/range.html'; +LiteGraph.registerNodeType('mtlx/adjustment/range_vector4FA',mtlx_adjustment_range_vector4FA); + +// MaterialX node type: mtlx/adjustment/hsvadjust_color3 +// +function mtlx_adjustment_hsvadjust_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_hsvadjust_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'hsvadjust'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hsvadjust.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_hsvadjust_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','vector3'); + this.addProperty('amount', [0.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'hsvadjust_color3'; + this.desc = "MaterialX:mtlx/adjustment/hsvadjust_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_hsvadjust_color3.nodedef_name = 'ND_hsvadjust_color3'; +mtlx_adjustment_hsvadjust_color3.nodedef_node = 'hsvadjust'; +mtlx_adjustment_hsvadjust_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hsvadjust.html'; +LiteGraph.registerNodeType('mtlx/adjustment/hsvadjust_color3',mtlx_adjustment_hsvadjust_color3); + +// MaterialX node type: mtlx/adjustment/hsvadjust_color4 +// +function mtlx_adjustment_hsvadjust_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_hsvadjust_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'hsvadjust'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hsvadjust.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_hsvadjust_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','vector3'); + this.addProperty('amount', [0.0, 1.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'hsvadjust_color4'; + this.desc = "MaterialX:mtlx/adjustment/hsvadjust_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_hsvadjust_color4.nodedef_name = 'ND_hsvadjust_color4'; +mtlx_adjustment_hsvadjust_color4.nodedef_node = 'hsvadjust'; +mtlx_adjustment_hsvadjust_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/hsvadjust.html'; +LiteGraph.registerNodeType('mtlx/adjustment/hsvadjust_color4',mtlx_adjustment_hsvadjust_color4); + +// MaterialX node type: mtlx/adjustment/saturate_color3 +// +function mtlx_adjustment_saturate_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_saturate_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'saturate'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/saturate.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_saturate_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lumacoeffs','color3'); + this.addProperty('lumacoeffs', [0.2722287, 0.6740818, 0.0536895], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'saturate_color3'; + this.desc = "MaterialX:mtlx/adjustment/saturate_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_saturate_color3.nodedef_name = 'ND_saturate_color3'; +mtlx_adjustment_saturate_color3.nodedef_node = 'saturate'; +mtlx_adjustment_saturate_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/saturate.html'; +LiteGraph.registerNodeType('mtlx/adjustment/saturate_color3',mtlx_adjustment_saturate_color3); + +// MaterialX node type: mtlx/adjustment/saturate_color4 +// +function mtlx_adjustment_saturate_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_saturate_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'saturate'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/saturate.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_saturate_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('amount','float'); + this.addProperty('amount', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lumacoeffs','color3'); + this.addProperty('lumacoeffs', [0.2722287, 0.6740818, 0.0536895], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'saturate_color4'; + this.desc = "MaterialX:mtlx/adjustment/saturate_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_saturate_color4.nodedef_name = 'ND_saturate_color4'; +mtlx_adjustment_saturate_color4.nodedef_node = 'saturate'; +mtlx_adjustment_saturate_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/saturate.html'; +LiteGraph.registerNodeType('mtlx/adjustment/saturate_color4',mtlx_adjustment_saturate_color4); + +// MaterialX node type: mtlx/adjustment/colorcorrect_color3 +// +function mtlx_adjustment_colorcorrect_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_colorcorrect_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'colorcorrect'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/colorcorrect.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_colorcorrect_color3_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color3'); + this.addProperty('in', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Input Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('hue','float'); + this.addProperty('hue', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Hue","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('saturation','float'); + this.addProperty('saturation', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Saturation","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','float'); + this.addProperty('gamma', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Gamma","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lift','float'); + this.addProperty('lift', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Lift","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gain','float'); + this.addProperty('gain', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Gain","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('contrast','float'); + this.addProperty('contrast', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Contrast","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('contrastpivot','float'); + this.addProperty('contrastpivot', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Contrast Pivot","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('exposure','float'); + this.addProperty('exposure', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Exposure","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'colorcorrect_color3'; + this.desc = "MaterialX:mtlx/adjustment/colorcorrect_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_adjustment_colorcorrect_color3.nodedef_name = 'ND_colorcorrect_color3'; +mtlx_adjustment_colorcorrect_color3.nodedef_node = 'colorcorrect'; +mtlx_adjustment_colorcorrect_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/colorcorrect.html'; +LiteGraph.registerNodeType('mtlx/adjustment/colorcorrect_color3',mtlx_adjustment_colorcorrect_color3); + +// MaterialX node type: mtlx/adjustment/colorcorrect_color4 +// +function mtlx_adjustment_colorcorrect_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_colorcorrect_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'colorcorrect'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/colorcorrect.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_colorcorrect_color4_out_genglsl.png'; + this.nodedef_group = 'adjustment'; + this.addInput('in','color4'); + this.addProperty('in', [1, 1, 1, 0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"Input Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('hue','float'); + this.addProperty('hue', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Hue","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('saturation','float'); + this.addProperty('saturation', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Saturation","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gamma','float'); + this.addProperty('gamma', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Gamma","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('lift','float'); + this.addProperty('lift', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Lift","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('gain','float'); + this.addProperty('gain', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Gain","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('contrast','float'); + this.addProperty('contrast', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Contrast","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('contrastpivot','float'); + this.addProperty('contrastpivot', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Contrast Pivot","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('exposure','float'); + this.addProperty('exposure', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Exposure","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'colorcorrect_color4'; + this.desc = "MaterialX:mtlx/adjustment/colorcorrect_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_adjustment_colorcorrect_color4.nodedef_name = 'ND_colorcorrect_color4'; +mtlx_adjustment_colorcorrect_color4.nodedef_node = 'colorcorrect'; +mtlx_adjustment_colorcorrect_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/colorcorrect.html'; +LiteGraph.registerNodeType('mtlx/adjustment/colorcorrect_color4',mtlx_adjustment_colorcorrect_color4); + +// MaterialX node type: mtlx/compositing/premult_color4 +// +function mtlx_compositing_premult_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_premult_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'premult'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/premult.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_premult_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'premult_color4'; + this.desc = "MaterialX:mtlx/compositing/premult_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_premult_color4.nodedef_name = 'ND_premult_color4'; +mtlx_compositing_premult_color4.nodedef_node = 'premult'; +mtlx_compositing_premult_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/premult.html'; +LiteGraph.registerNodeType('mtlx/compositing/premult_color4',mtlx_compositing_premult_color4); + +// MaterialX node type: mtlx/compositing/unpremult_color4 +// +function mtlx_compositing_unpremult_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_unpremult_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'unpremult'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/unpremult.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_unpremult_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 1.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'unpremult_color4'; + this.desc = "MaterialX:mtlx/compositing/unpremult_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_unpremult_color4.nodedef_name = 'ND_unpremult_color4'; +mtlx_compositing_unpremult_color4.nodedef_node = 'unpremult'; +mtlx_compositing_unpremult_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/unpremult.html'; +LiteGraph.registerNodeType('mtlx/compositing/unpremult_color4',mtlx_compositing_unpremult_color4); + +// MaterialX node type: mtlx/compositing/plus_float +// +function mtlx_compositing_plus_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_plus_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'plus'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/plus.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_plus_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','float'); + this.addProperty('fg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','float'); + this.addProperty('bg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'plus_float'; + this.desc = "MaterialX:mtlx/compositing/plus_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_plus_float.nodedef_name = 'ND_plus_float'; +mtlx_compositing_plus_float.nodedef_node = 'plus'; +mtlx_compositing_plus_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/plus.html'; +LiteGraph.registerNodeType('mtlx/compositing/plus_float',mtlx_compositing_plus_float); + +// MaterialX node type: mtlx/compositing/plus_color3 +// +function mtlx_compositing_plus_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_plus_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'plus'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/plus.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_plus_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'plus_color3'; + this.desc = "MaterialX:mtlx/compositing/plus_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_plus_color3.nodedef_name = 'ND_plus_color3'; +mtlx_compositing_plus_color3.nodedef_node = 'plus'; +mtlx_compositing_plus_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/plus.html'; +LiteGraph.registerNodeType('mtlx/compositing/plus_color3',mtlx_compositing_plus_color3); + +// MaterialX node type: mtlx/compositing/plus_color4 +// +function mtlx_compositing_plus_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_plus_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'plus'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/plus.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_plus_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'plus_color4'; + this.desc = "MaterialX:mtlx/compositing/plus_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_plus_color4.nodedef_name = 'ND_plus_color4'; +mtlx_compositing_plus_color4.nodedef_node = 'plus'; +mtlx_compositing_plus_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/plus.html'; +LiteGraph.registerNodeType('mtlx/compositing/plus_color4',mtlx_compositing_plus_color4); + +// MaterialX node type: mtlx/compositing/minus_float +// +function mtlx_compositing_minus_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_minus_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'minus'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/minus.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_minus_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','float'); + this.addProperty('fg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','float'); + this.addProperty('bg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'minus_float'; + this.desc = "MaterialX:mtlx/compositing/minus_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_minus_float.nodedef_name = 'ND_minus_float'; +mtlx_compositing_minus_float.nodedef_node = 'minus'; +mtlx_compositing_minus_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/minus.html'; +LiteGraph.registerNodeType('mtlx/compositing/minus_float',mtlx_compositing_minus_float); + +// MaterialX node type: mtlx/compositing/minus_color3 +// +function mtlx_compositing_minus_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_minus_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'minus'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/minus.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_minus_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'minus_color3'; + this.desc = "MaterialX:mtlx/compositing/minus_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_minus_color3.nodedef_name = 'ND_minus_color3'; +mtlx_compositing_minus_color3.nodedef_node = 'minus'; +mtlx_compositing_minus_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/minus.html'; +LiteGraph.registerNodeType('mtlx/compositing/minus_color3',mtlx_compositing_minus_color3); + +// MaterialX node type: mtlx/compositing/minus_color4 +// +function mtlx_compositing_minus_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_minus_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'minus'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/minus.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_minus_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'minus_color4'; + this.desc = "MaterialX:mtlx/compositing/minus_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_minus_color4.nodedef_name = 'ND_minus_color4'; +mtlx_compositing_minus_color4.nodedef_node = 'minus'; +mtlx_compositing_minus_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/minus.html'; +LiteGraph.registerNodeType('mtlx/compositing/minus_color4',mtlx_compositing_minus_color4); + +// MaterialX node type: mtlx/compositing/difference_float +// +function mtlx_compositing_difference_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_difference_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'difference'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/difference.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_difference_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','float'); + this.addProperty('fg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','float'); + this.addProperty('bg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'difference_float'; + this.desc = "MaterialX:mtlx/compositing/difference_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_difference_float.nodedef_name = 'ND_difference_float'; +mtlx_compositing_difference_float.nodedef_node = 'difference'; +mtlx_compositing_difference_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/difference.html'; +LiteGraph.registerNodeType('mtlx/compositing/difference_float',mtlx_compositing_difference_float); + +// MaterialX node type: mtlx/compositing/difference_color3 +// +function mtlx_compositing_difference_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_difference_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'difference'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/difference.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_difference_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'difference_color3'; + this.desc = "MaterialX:mtlx/compositing/difference_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_difference_color3.nodedef_name = 'ND_difference_color3'; +mtlx_compositing_difference_color3.nodedef_node = 'difference'; +mtlx_compositing_difference_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/difference.html'; +LiteGraph.registerNodeType('mtlx/compositing/difference_color3',mtlx_compositing_difference_color3); + +// MaterialX node type: mtlx/compositing/difference_color4 +// +function mtlx_compositing_difference_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_difference_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'difference'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/difference.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_difference_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'difference_color4'; + this.desc = "MaterialX:mtlx/compositing/difference_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_difference_color4.nodedef_name = 'ND_difference_color4'; +mtlx_compositing_difference_color4.nodedef_node = 'difference'; +mtlx_compositing_difference_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/difference.html'; +LiteGraph.registerNodeType('mtlx/compositing/difference_color4',mtlx_compositing_difference_color4); + +// MaterialX node type: mtlx/compositing/burn_float +// +function mtlx_compositing_burn_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_burn_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'burn'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/burn.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_burn_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','float'); + this.addProperty('fg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','float'); + this.addProperty('bg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'burn_float'; + this.desc = "MaterialX:mtlx/compositing/burn_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_burn_float.nodedef_name = 'ND_burn_float'; +mtlx_compositing_burn_float.nodedef_node = 'burn'; +mtlx_compositing_burn_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/burn.html'; +LiteGraph.registerNodeType('mtlx/compositing/burn_float',mtlx_compositing_burn_float); + +// MaterialX node type: mtlx/compositing/burn_color3 +// +function mtlx_compositing_burn_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_burn_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'burn'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/burn.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_burn_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'burn_color3'; + this.desc = "MaterialX:mtlx/compositing/burn_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_burn_color3.nodedef_name = 'ND_burn_color3'; +mtlx_compositing_burn_color3.nodedef_node = 'burn'; +mtlx_compositing_burn_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/burn.html'; +LiteGraph.registerNodeType('mtlx/compositing/burn_color3',mtlx_compositing_burn_color3); + +// MaterialX node type: mtlx/compositing/burn_color4 +// +function mtlx_compositing_burn_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_burn_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'burn'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/burn.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_burn_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'burn_color4'; + this.desc = "MaterialX:mtlx/compositing/burn_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_burn_color4.nodedef_name = 'ND_burn_color4'; +mtlx_compositing_burn_color4.nodedef_node = 'burn'; +mtlx_compositing_burn_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/burn.html'; +LiteGraph.registerNodeType('mtlx/compositing/burn_color4',mtlx_compositing_burn_color4); + +// MaterialX node type: mtlx/compositing/dodge_float +// +function mtlx_compositing_dodge_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dodge_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'dodge'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dodge.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dodge_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','float'); + this.addProperty('fg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','float'); + this.addProperty('bg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'dodge_float'; + this.desc = "MaterialX:mtlx/compositing/dodge_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_dodge_float.nodedef_name = 'ND_dodge_float'; +mtlx_compositing_dodge_float.nodedef_node = 'dodge'; +mtlx_compositing_dodge_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dodge.html'; +LiteGraph.registerNodeType('mtlx/compositing/dodge_float',mtlx_compositing_dodge_float); + +// MaterialX node type: mtlx/compositing/dodge_color3 +// +function mtlx_compositing_dodge_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dodge_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'dodge'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dodge.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dodge_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'dodge_color3'; + this.desc = "MaterialX:mtlx/compositing/dodge_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_dodge_color3.nodedef_name = 'ND_dodge_color3'; +mtlx_compositing_dodge_color3.nodedef_node = 'dodge'; +mtlx_compositing_dodge_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dodge.html'; +LiteGraph.registerNodeType('mtlx/compositing/dodge_color3',mtlx_compositing_dodge_color3); + +// MaterialX node type: mtlx/compositing/dodge_color4 +// +function mtlx_compositing_dodge_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dodge_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'dodge'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dodge.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dodge_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'dodge_color4'; + this.desc = "MaterialX:mtlx/compositing/dodge_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_dodge_color4.nodedef_name = 'ND_dodge_color4'; +mtlx_compositing_dodge_color4.nodedef_node = 'dodge'; +mtlx_compositing_dodge_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dodge.html'; +LiteGraph.registerNodeType('mtlx/compositing/dodge_color4',mtlx_compositing_dodge_color4); + +// MaterialX node type: mtlx/compositing/screen_float +// +function mtlx_compositing_screen_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_screen_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'screen'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/screen.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_screen_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','float'); + this.addProperty('fg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','float'); + this.addProperty('bg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'screen_float'; + this.desc = "MaterialX:mtlx/compositing/screen_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_screen_float.nodedef_name = 'ND_screen_float'; +mtlx_compositing_screen_float.nodedef_node = 'screen'; +mtlx_compositing_screen_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/screen.html'; +LiteGraph.registerNodeType('mtlx/compositing/screen_float',mtlx_compositing_screen_float); + +// MaterialX node type: mtlx/compositing/screen_color3 +// +function mtlx_compositing_screen_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_screen_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'screen'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/screen.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_screen_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'screen_color3'; + this.desc = "MaterialX:mtlx/compositing/screen_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_screen_color3.nodedef_name = 'ND_screen_color3'; +mtlx_compositing_screen_color3.nodedef_node = 'screen'; +mtlx_compositing_screen_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/screen.html'; +LiteGraph.registerNodeType('mtlx/compositing/screen_color3',mtlx_compositing_screen_color3); + +// MaterialX node type: mtlx/compositing/screen_color4 +// +function mtlx_compositing_screen_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_screen_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'screen'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/screen.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_screen_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'screen_color4'; + this.desc = "MaterialX:mtlx/compositing/screen_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_screen_color4.nodedef_name = 'ND_screen_color4'; +mtlx_compositing_screen_color4.nodedef_node = 'screen'; +mtlx_compositing_screen_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/screen.html'; +LiteGraph.registerNodeType('mtlx/compositing/screen_color4',mtlx_compositing_screen_color4); + +// MaterialX node type: mtlx/compositing/overlay_float +// +function mtlx_compositing_overlay_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_overlay_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'overlay'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/overlay.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_overlay_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','float'); + this.addProperty('fg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','float'); + this.addProperty('bg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'overlay_float'; + this.desc = "MaterialX:mtlx/compositing/overlay_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_overlay_float.nodedef_name = 'ND_overlay_float'; +mtlx_compositing_overlay_float.nodedef_node = 'overlay'; +mtlx_compositing_overlay_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/overlay.html'; +LiteGraph.registerNodeType('mtlx/compositing/overlay_float',mtlx_compositing_overlay_float); + +// MaterialX node type: mtlx/compositing/overlay_color3 +// +function mtlx_compositing_overlay_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_overlay_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'overlay'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/overlay.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_overlay_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'overlay_color3'; + this.desc = "MaterialX:mtlx/compositing/overlay_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_overlay_color3.nodedef_name = 'ND_overlay_color3'; +mtlx_compositing_overlay_color3.nodedef_node = 'overlay'; +mtlx_compositing_overlay_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/overlay.html'; +LiteGraph.registerNodeType('mtlx/compositing/overlay_color3',mtlx_compositing_overlay_color3); + +// MaterialX node type: mtlx/compositing/overlay_color4 +// +function mtlx_compositing_overlay_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_overlay_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'overlay'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/overlay.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_overlay_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'overlay_color4'; + this.desc = "MaterialX:mtlx/compositing/overlay_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_overlay_color4.nodedef_name = 'ND_overlay_color4'; +mtlx_compositing_overlay_color4.nodedef_node = 'overlay'; +mtlx_compositing_overlay_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/overlay.html'; +LiteGraph.registerNodeType('mtlx/compositing/overlay_color4',mtlx_compositing_overlay_color4); + +// MaterialX node type: mtlx/compositing/disjointover_color4 +// +function mtlx_compositing_disjointover_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_disjointover_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'disjointover'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/disjointover.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_disjointover_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'disjointover_color4'; + this.desc = "MaterialX:mtlx/compositing/disjointover_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_disjointover_color4.nodedef_name = 'ND_disjointover_color4'; +mtlx_compositing_disjointover_color4.nodedef_node = 'disjointover'; +mtlx_compositing_disjointover_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/disjointover.html'; +LiteGraph.registerNodeType('mtlx/compositing/disjointover_color4',mtlx_compositing_disjointover_color4); + +// MaterialX node type: mtlx/compositing/in_color4 +// +function mtlx_compositing_in_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_in_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'in'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/in.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_in_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'in_color4'; + this.desc = "MaterialX:mtlx/compositing/in_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_in_color4.nodedef_name = 'ND_in_color4'; +mtlx_compositing_in_color4.nodedef_node = 'in'; +mtlx_compositing_in_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/in.html'; +LiteGraph.registerNodeType('mtlx/compositing/in_color4',mtlx_compositing_in_color4); + +// MaterialX node type: mtlx/compositing/mask_color4 +// +function mtlx_compositing_mask_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mask_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'mask'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mask.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mask_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'mask_color4'; + this.desc = "MaterialX:mtlx/compositing/mask_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_mask_color4.nodedef_name = 'ND_mask_color4'; +mtlx_compositing_mask_color4.nodedef_node = 'mask'; +mtlx_compositing_mask_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mask.html'; +LiteGraph.registerNodeType('mtlx/compositing/mask_color4',mtlx_compositing_mask_color4); + +// MaterialX node type: mtlx/compositing/matte_color4 +// +function mtlx_compositing_matte_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_matte_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'matte'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/matte.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_matte_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'matte_color4'; + this.desc = "MaterialX:mtlx/compositing/matte_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_matte_color4.nodedef_name = 'ND_matte_color4'; +mtlx_compositing_matte_color4.nodedef_node = 'matte'; +mtlx_compositing_matte_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/matte.html'; +LiteGraph.registerNodeType('mtlx/compositing/matte_color4',mtlx_compositing_matte_color4); + +// MaterialX node type: mtlx/compositing/out_color4 +// +function mtlx_compositing_out_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_out_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'out'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/out.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_out_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'out_color4'; + this.desc = "MaterialX:mtlx/compositing/out_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_out_color4.nodedef_name = 'ND_out_color4'; +mtlx_compositing_out_color4.nodedef_node = 'out'; +mtlx_compositing_out_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/out.html'; +LiteGraph.registerNodeType('mtlx/compositing/out_color4',mtlx_compositing_out_color4); + +// MaterialX node type: mtlx/compositing/over_color4 +// +function mtlx_compositing_over_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_over_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'over'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/over.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_over_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'over_color4'; + this.desc = "MaterialX:mtlx/compositing/over_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_over_color4.nodedef_name = 'ND_over_color4'; +mtlx_compositing_over_color4.nodedef_node = 'over'; +mtlx_compositing_over_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/over.html'; +LiteGraph.registerNodeType('mtlx/compositing/over_color4',mtlx_compositing_over_color4); + +// MaterialX node type: mtlx/compositing/inside_float +// +function mtlx_compositing_inside_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_inside_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'inside'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/inside.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_inside_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mask','float'); + this.addProperty('mask', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'inside_float'; + this.desc = "MaterialX:mtlx/compositing/inside_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_inside_float.nodedef_name = 'ND_inside_float'; +mtlx_compositing_inside_float.nodedef_node = 'inside'; +mtlx_compositing_inside_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/inside.html'; +LiteGraph.registerNodeType('mtlx/compositing/inside_float',mtlx_compositing_inside_float); + +// MaterialX node type: mtlx/compositing/inside_color3 +// +function mtlx_compositing_inside_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_inside_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'inside'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/inside.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_inside_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mask','float'); + this.addProperty('mask', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'inside_color3'; + this.desc = "MaterialX:mtlx/compositing/inside_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_inside_color3.nodedef_name = 'ND_inside_color3'; +mtlx_compositing_inside_color3.nodedef_node = 'inside'; +mtlx_compositing_inside_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/inside.html'; +LiteGraph.registerNodeType('mtlx/compositing/inside_color3',mtlx_compositing_inside_color3); + +// MaterialX node type: mtlx/compositing/inside_color4 +// +function mtlx_compositing_inside_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_inside_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'inside'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/inside.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_inside_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mask','float'); + this.addProperty('mask', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'inside_color4'; + this.desc = "MaterialX:mtlx/compositing/inside_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_inside_color4.nodedef_name = 'ND_inside_color4'; +mtlx_compositing_inside_color4.nodedef_node = 'inside'; +mtlx_compositing_inside_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/inside.html'; +LiteGraph.registerNodeType('mtlx/compositing/inside_color4',mtlx_compositing_inside_color4); + +// MaterialX node type: mtlx/compositing/outside_float +// +function mtlx_compositing_outside_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_outside_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'outside'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/outside.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_outside_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mask','float'); + this.addProperty('mask', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'outside_float'; + this.desc = "MaterialX:mtlx/compositing/outside_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_outside_float.nodedef_name = 'ND_outside_float'; +mtlx_compositing_outside_float.nodedef_node = 'outside'; +mtlx_compositing_outside_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/outside.html'; +LiteGraph.registerNodeType('mtlx/compositing/outside_float',mtlx_compositing_outside_float); + +// MaterialX node type: mtlx/compositing/outside_color3 +// +function mtlx_compositing_outside_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_outside_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'outside'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/outside.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_outside_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mask','float'); + this.addProperty('mask', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'outside_color3'; + this.desc = "MaterialX:mtlx/compositing/outside_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_outside_color3.nodedef_name = 'ND_outside_color3'; +mtlx_compositing_outside_color3.nodedef_node = 'outside'; +mtlx_compositing_outside_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/outside.html'; +LiteGraph.registerNodeType('mtlx/compositing/outside_color3',mtlx_compositing_outside_color3); + +// MaterialX node type: mtlx/compositing/outside_color4 +// +function mtlx_compositing_outside_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_outside_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'outside'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/outside.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_outside_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mask','float'); + this.addProperty('mask', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'outside_color4'; + this.desc = "MaterialX:mtlx/compositing/outside_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_outside_color4.nodedef_name = 'ND_outside_color4'; +mtlx_compositing_outside_color4.nodedef_node = 'outside'; +mtlx_compositing_outside_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/outside.html'; +LiteGraph.registerNodeType('mtlx/compositing/outside_color4',mtlx_compositing_outside_color4); + +// MaterialX node type: mtlx/compositing/mix_float +// +function mtlx_compositing_mix_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_float_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','float'); + this.addProperty('fg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','float'); + this.addProperty('bg', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'mix_float'; + this.desc = "MaterialX:mtlx/compositing/mix_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_compositing_mix_float.nodedef_name = 'ND_mix_float'; +mtlx_compositing_mix_float.nodedef_node = 'mix'; +mtlx_compositing_mix_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_float',mtlx_compositing_mix_float); + +// MaterialX node type: mtlx/compositing/mix_color3 +// +function mtlx_compositing_mix_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'mix_color3'; + this.desc = "MaterialX:mtlx/compositing/mix_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_mix_color3.nodedef_name = 'ND_mix_color3'; +mtlx_compositing_mix_color3.nodedef_node = 'mix'; +mtlx_compositing_mix_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_color3',mtlx_compositing_mix_color3); + +// MaterialX node type: mtlx/compositing/mix_color3_color3 +// +function mtlx_compositing_mix_color3_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_color3_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_color3_color3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','color3'); + this.addProperty('mix', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'mix_color3'; + this.desc = "MaterialX:mtlx/compositing/mix_color3_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_compositing_mix_color3_color3.nodedef_name = 'ND_mix_color3_color3'; +mtlx_compositing_mix_color3_color3.nodedef_node = 'mix'; +mtlx_compositing_mix_color3_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_color3_color3',mtlx_compositing_mix_color3_color3); + +// MaterialX node type: mtlx/compositing/mix_color4 +// +function mtlx_compositing_mix_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'mix_color4'; + this.desc = "MaterialX:mtlx/compositing/mix_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_mix_color4.nodedef_name = 'ND_mix_color4'; +mtlx_compositing_mix_color4.nodedef_node = 'mix'; +mtlx_compositing_mix_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_color4',mtlx_compositing_mix_color4); + +// MaterialX node type: mtlx/compositing/mix_color4_color4 +// +function mtlx_compositing_mix_color4_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_color4_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_color4_color4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','color4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','color4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','color4'); + this.addProperty('mix', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'mix_color4'; + this.desc = "MaterialX:mtlx/compositing/mix_color4_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_compositing_mix_color4_color4.nodedef_name = 'ND_mix_color4_color4'; +mtlx_compositing_mix_color4_color4.nodedef_node = 'mix'; +mtlx_compositing_mix_color4_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_color4_color4',mtlx_compositing_mix_color4_color4); + +// MaterialX node type: mtlx/compositing/mix_vector2 +// +function mtlx_compositing_mix_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_vector2_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','vector2'); + this.addProperty('fg', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','vector2'); + this.addProperty('bg', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'mix_vector2'; + this.desc = "MaterialX:mtlx/compositing/mix_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_compositing_mix_vector2.nodedef_name = 'ND_mix_vector2'; +mtlx_compositing_mix_vector2.nodedef_node = 'mix'; +mtlx_compositing_mix_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_vector2',mtlx_compositing_mix_vector2); + +// MaterialX node type: mtlx/compositing/mix_vector2_vector2 +// +function mtlx_compositing_mix_vector2_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_vector2_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_vector2_vector2_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','vector2'); + this.addProperty('fg', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','vector2'); + this.addProperty('bg', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','vector2'); + this.addProperty('mix', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'mix_vector2'; + this.desc = "MaterialX:mtlx/compositing/mix_vector2_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_compositing_mix_vector2_vector2.nodedef_name = 'ND_mix_vector2_vector2'; +mtlx_compositing_mix_vector2_vector2.nodedef_node = 'mix'; +mtlx_compositing_mix_vector2_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_vector2_vector2',mtlx_compositing_mix_vector2_vector2); + +// MaterialX node type: mtlx/compositing/mix_vector3 +// +function mtlx_compositing_mix_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_vector3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','vector3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','vector3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'mix_vector3'; + this.desc = "MaterialX:mtlx/compositing/mix_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_compositing_mix_vector3.nodedef_name = 'ND_mix_vector3'; +mtlx_compositing_mix_vector3.nodedef_node = 'mix'; +mtlx_compositing_mix_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_vector3',mtlx_compositing_mix_vector3); + +// MaterialX node type: mtlx/compositing/mix_vector3_vector3 +// +function mtlx_compositing_mix_vector3_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_vector3_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_vector3_vector3_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','vector3'); + this.addProperty('fg', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','vector3'); + this.addProperty('bg', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','vector3'); + this.addProperty('mix', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'mix_vector3'; + this.desc = "MaterialX:mtlx/compositing/mix_vector3_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_compositing_mix_vector3_vector3.nodedef_name = 'ND_mix_vector3_vector3'; +mtlx_compositing_mix_vector3_vector3.nodedef_node = 'mix'; +mtlx_compositing_mix_vector3_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_vector3_vector3',mtlx_compositing_mix_vector3_vector3); + +// MaterialX node type: mtlx/compositing/mix_vector4 +// +function mtlx_compositing_mix_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_vector4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','vector4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','vector4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'mix_vector4'; + this.desc = "MaterialX:mtlx/compositing/mix_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_compositing_mix_vector4.nodedef_name = 'ND_mix_vector4'; +mtlx_compositing_mix_vector4.nodedef_node = 'mix'; +mtlx_compositing_mix_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_vector4',mtlx_compositing_mix_vector4); + +// MaterialX node type: mtlx/compositing/mix_vector4_vector4 +// +function mtlx_compositing_mix_vector4_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_vector4_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_vector4_vector4_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','vector4'); + this.addProperty('fg', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','vector4'); + this.addProperty('bg', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','vector4'); + this.addProperty('mix', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'mix_vector4'; + this.desc = "MaterialX:mtlx/compositing/mix_vector4_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_compositing_mix_vector4_vector4.nodedef_name = 'ND_mix_vector4_vector4'; +mtlx_compositing_mix_vector4_vector4.nodedef_node = 'mix'; +mtlx_compositing_mix_vector4_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_vector4_vector4',mtlx_compositing_mix_vector4_vector4); + +// MaterialX node type: mtlx/compositing/mix_surfaceshader +// +function mtlx_compositing_mix_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','surfaceshader'); + this.addProperty('fg', '', 'surfaceshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','surfaceshader'); + this.addProperty('bg', '', 'surfaceshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'mix_surfaceshader'; + this.desc = "MaterialX:mtlx/compositing/mix_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_compositing_mix_surfaceshader.nodedef_name = 'ND_mix_surfaceshader'; +mtlx_compositing_mix_surfaceshader.nodedef_node = 'mix'; +mtlx_compositing_mix_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_surfaceshader',mtlx_compositing_mix_surfaceshader); + +// MaterialX node type: mtlx/compositing/mix_displacementshader +// +function mtlx_compositing_mix_displacementshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_displacementshader'; + this.nodedef_type = 'displacementshader'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_displacementshader_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','displacementshader'); + this.addProperty('fg', '', 'displacementshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','displacementshader'); + this.addProperty('bg', '', 'displacementshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','displacementshader'); + this.title = 'mix_displacementshader'; + this.desc = "MaterialX:mtlx/compositing/mix_displacementshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_compositing_mix_displacementshader.nodedef_name = 'ND_mix_displacementshader'; +mtlx_compositing_mix_displacementshader.nodedef_node = 'mix'; +mtlx_compositing_mix_displacementshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_displacementshader',mtlx_compositing_mix_displacementshader); + +// MaterialX node type: mtlx/compositing/mix_volumeshader +// +function mtlx_compositing_mix_volumeshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_mix_volumeshader'; + this.nodedef_type = 'volumeshader'; + this.nodedef_node = 'mix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_mix_volumeshader_out_genglsl.png'; + this.nodedef_group = 'compositing'; + this.addInput('fg','volumeshader'); + this.addProperty('fg', '', 'volumeshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bg','volumeshader'); + this.addProperty('bg', '', 'volumeshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','volumeshader'); + this.title = 'mix_volumeshader'; + this.desc = "MaterialX:mtlx/compositing/mix_volumeshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_compositing_mix_volumeshader.nodedef_name = 'ND_mix_volumeshader'; +mtlx_compositing_mix_volumeshader.nodedef_node = 'mix'; +mtlx_compositing_mix_volumeshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/mix.html'; +LiteGraph.registerNodeType('mtlx/compositing/mix_volumeshader',mtlx_compositing_mix_volumeshader); + +// MaterialX node type: mtlx/conditional/ifgreater_float +// +function mtlx_conditional_ifgreater_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_float_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ifgreater_float'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_ifgreater_float.nodedef_name = 'ND_ifgreater_float'; +mtlx_conditional_ifgreater_float.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_float',mtlx_conditional_ifgreater_float); + +// MaterialX node type: mtlx/conditional/ifgreater_integer +// +function mtlx_conditional_ifgreater_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_integer_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'ifgreater_integer'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifgreater_integer.nodedef_name = 'ND_ifgreater_integer'; +mtlx_conditional_ifgreater_integer.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_integer',mtlx_conditional_ifgreater_integer); + +// MaterialX node type: mtlx/conditional/ifgreater_color3 +// +function mtlx_conditional_ifgreater_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_color3_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ifgreater_color3'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_ifgreater_color3.nodedef_name = 'ND_ifgreater_color3'; +mtlx_conditional_ifgreater_color3.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_color3',mtlx_conditional_ifgreater_color3); + +// MaterialX node type: mtlx/conditional/ifgreater_color4 +// +function mtlx_conditional_ifgreater_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_color4_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ifgreater_color4'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_ifgreater_color4.nodedef_name = 'ND_ifgreater_color4'; +mtlx_conditional_ifgreater_color4.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_color4',mtlx_conditional_ifgreater_color4); + +// MaterialX node type: mtlx/conditional/ifgreater_vector2 +// +function mtlx_conditional_ifgreater_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_vector2_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ifgreater_vector2'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifgreater_vector2.nodedef_name = 'ND_ifgreater_vector2'; +mtlx_conditional_ifgreater_vector2.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_vector2',mtlx_conditional_ifgreater_vector2); + +// MaterialX node type: mtlx/conditional/ifgreater_vector3 +// +function mtlx_conditional_ifgreater_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_vector3_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ifgreater_vector3'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_ifgreater_vector3.nodedef_name = 'ND_ifgreater_vector3'; +mtlx_conditional_ifgreater_vector3.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_vector3',mtlx_conditional_ifgreater_vector3); + +// MaterialX node type: mtlx/conditional/ifgreater_vector4 +// +function mtlx_conditional_ifgreater_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_vector4_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ifgreater_vector4'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_ifgreater_vector4.nodedef_name = 'ND_ifgreater_vector4'; +mtlx_conditional_ifgreater_vector4.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_vector4',mtlx_conditional_ifgreater_vector4); + +// MaterialX node type: mtlx/conditional/ifgreater_matrix33 +// +function mtlx_conditional_ifgreater_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_matrix33_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'ifgreater_matrix33'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_ifgreater_matrix33.nodedef_name = 'ND_ifgreater_matrix33'; +mtlx_conditional_ifgreater_matrix33.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_matrix33',mtlx_conditional_ifgreater_matrix33); + +// MaterialX node type: mtlx/conditional/ifgreater_matrix44 +// +function mtlx_conditional_ifgreater_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_matrix44_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'ifgreater_matrix44'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_ifgreater_matrix44.nodedef_name = 'ND_ifgreater_matrix44'; +mtlx_conditional_ifgreater_matrix44.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_matrix44',mtlx_conditional_ifgreater_matrix44); + +// MaterialX node type: mtlx/conditional/ifgreater_floatI +// +function mtlx_conditional_ifgreater_floatI() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_floatI'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_floatI_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ifgreater_float'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_floatI"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_ifgreater_floatI.nodedef_name = 'ND_ifgreater_floatI'; +mtlx_conditional_ifgreater_floatI.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_floatI.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_floatI',mtlx_conditional_ifgreater_floatI); + +// MaterialX node type: mtlx/conditional/ifgreater_integerI +// +function mtlx_conditional_ifgreater_integerI() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_integerI'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_integerI_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'ifgreater_integer'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_integerI"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifgreater_integerI.nodedef_name = 'ND_ifgreater_integerI'; +mtlx_conditional_ifgreater_integerI.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_integerI.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_integerI',mtlx_conditional_ifgreater_integerI); + +// MaterialX node type: mtlx/conditional/ifgreater_color3I +// +function mtlx_conditional_ifgreater_color3I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_color3I'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_color3I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ifgreater_color3'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_color3I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_ifgreater_color3I.nodedef_name = 'ND_ifgreater_color3I'; +mtlx_conditional_ifgreater_color3I.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_color3I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_color3I',mtlx_conditional_ifgreater_color3I); + +// MaterialX node type: mtlx/conditional/ifgreater_color4I +// +function mtlx_conditional_ifgreater_color4I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_color4I'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_color4I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ifgreater_color4'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_color4I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_ifgreater_color4I.nodedef_name = 'ND_ifgreater_color4I'; +mtlx_conditional_ifgreater_color4I.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_color4I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_color4I',mtlx_conditional_ifgreater_color4I); + +// MaterialX node type: mtlx/conditional/ifgreater_vector2I +// +function mtlx_conditional_ifgreater_vector2I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_vector2I'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_vector2I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ifgreater_vector2'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_vector2I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifgreater_vector2I.nodedef_name = 'ND_ifgreater_vector2I'; +mtlx_conditional_ifgreater_vector2I.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_vector2I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_vector2I',mtlx_conditional_ifgreater_vector2I); + +// MaterialX node type: mtlx/conditional/ifgreater_vector3I +// +function mtlx_conditional_ifgreater_vector3I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_vector3I'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_vector3I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ifgreater_vector3'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_vector3I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_ifgreater_vector3I.nodedef_name = 'ND_ifgreater_vector3I'; +mtlx_conditional_ifgreater_vector3I.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_vector3I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_vector3I',mtlx_conditional_ifgreater_vector3I); + +// MaterialX node type: mtlx/conditional/ifgreater_vector4I +// +function mtlx_conditional_ifgreater_vector4I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_vector4I'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_vector4I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ifgreater_vector4'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_vector4I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_ifgreater_vector4I.nodedef_name = 'ND_ifgreater_vector4I'; +mtlx_conditional_ifgreater_vector4I.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_vector4I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_vector4I',mtlx_conditional_ifgreater_vector4I); + +// MaterialX node type: mtlx/conditional/ifgreater_matrix33I +// +function mtlx_conditional_ifgreater_matrix33I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_matrix33I'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_matrix33I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'ifgreater_matrix33'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_matrix33I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_ifgreater_matrix33I.nodedef_name = 'ND_ifgreater_matrix33I'; +mtlx_conditional_ifgreater_matrix33I.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_matrix33I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_matrix33I',mtlx_conditional_ifgreater_matrix33I); + +// MaterialX node type: mtlx/conditional/ifgreater_matrix44I +// +function mtlx_conditional_ifgreater_matrix44I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreater_matrix44I'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'ifgreater'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreater_matrix44I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'ifgreater_matrix44'; + this.desc = "MaterialX:mtlx/conditional/ifgreater_matrix44I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_ifgreater_matrix44I.nodedef_name = 'ND_ifgreater_matrix44I'; +mtlx_conditional_ifgreater_matrix44I.nodedef_node = 'ifgreater'; +mtlx_conditional_ifgreater_matrix44I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreater.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreater_matrix44I',mtlx_conditional_ifgreater_matrix44I); + +// MaterialX node type: mtlx/conditional/ifgreatereq_float +// +function mtlx_conditional_ifgreatereq_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_float_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ifgreatereq_float'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_ifgreatereq_float.nodedef_name = 'ND_ifgreatereq_float'; +mtlx_conditional_ifgreatereq_float.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_float',mtlx_conditional_ifgreatereq_float); + +// MaterialX node type: mtlx/conditional/ifgreatereq_integer +// +function mtlx_conditional_ifgreatereq_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_integer_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'ifgreatereq_integer'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifgreatereq_integer.nodedef_name = 'ND_ifgreatereq_integer'; +mtlx_conditional_ifgreatereq_integer.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_integer',mtlx_conditional_ifgreatereq_integer); + +// MaterialX node type: mtlx/conditional/ifgreatereq_color3 +// +function mtlx_conditional_ifgreatereq_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_color3_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ifgreatereq_color3'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_ifgreatereq_color3.nodedef_name = 'ND_ifgreatereq_color3'; +mtlx_conditional_ifgreatereq_color3.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_color3',mtlx_conditional_ifgreatereq_color3); + +// MaterialX node type: mtlx/conditional/ifgreatereq_color4 +// +function mtlx_conditional_ifgreatereq_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_color4_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ifgreatereq_color4'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_ifgreatereq_color4.nodedef_name = 'ND_ifgreatereq_color4'; +mtlx_conditional_ifgreatereq_color4.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_color4',mtlx_conditional_ifgreatereq_color4); + +// MaterialX node type: mtlx/conditional/ifgreatereq_vector2 +// +function mtlx_conditional_ifgreatereq_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_vector2_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ifgreatereq_vector2'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifgreatereq_vector2.nodedef_name = 'ND_ifgreatereq_vector2'; +mtlx_conditional_ifgreatereq_vector2.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_vector2',mtlx_conditional_ifgreatereq_vector2); + +// MaterialX node type: mtlx/conditional/ifgreatereq_vector3 +// +function mtlx_conditional_ifgreatereq_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_vector3_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ifgreatereq_vector3'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_ifgreatereq_vector3.nodedef_name = 'ND_ifgreatereq_vector3'; +mtlx_conditional_ifgreatereq_vector3.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_vector3',mtlx_conditional_ifgreatereq_vector3); + +// MaterialX node type: mtlx/conditional/ifgreatereq_vector4 +// +function mtlx_conditional_ifgreatereq_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ifgreatereq_vector4'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_ifgreatereq_vector4.nodedef_name = 'ND_ifgreatereq_vector4'; +mtlx_conditional_ifgreatereq_vector4.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_vector4',mtlx_conditional_ifgreatereq_vector4); + +// MaterialX node type: mtlx/conditional/ifgreatereq_matrix33 +// +function mtlx_conditional_ifgreatereq_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_matrix33_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'ifgreatereq_matrix33'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_ifgreatereq_matrix33.nodedef_name = 'ND_ifgreatereq_matrix33'; +mtlx_conditional_ifgreatereq_matrix33.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_matrix33',mtlx_conditional_ifgreatereq_matrix33); + +// MaterialX node type: mtlx/conditional/ifgreatereq_matrix44 +// +function mtlx_conditional_ifgreatereq_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_matrix44_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'ifgreatereq_matrix44'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_ifgreatereq_matrix44.nodedef_name = 'ND_ifgreatereq_matrix44'; +mtlx_conditional_ifgreatereq_matrix44.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_matrix44',mtlx_conditional_ifgreatereq_matrix44); + +// MaterialX node type: mtlx/conditional/ifgreatereq_floatI +// +function mtlx_conditional_ifgreatereq_floatI() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_floatI'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_floatI_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ifgreatereq_float'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_floatI"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_ifgreatereq_floatI.nodedef_name = 'ND_ifgreatereq_floatI'; +mtlx_conditional_ifgreatereq_floatI.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_floatI.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_floatI',mtlx_conditional_ifgreatereq_floatI); + +// MaterialX node type: mtlx/conditional/ifgreatereq_integerI +// +function mtlx_conditional_ifgreatereq_integerI() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_integerI'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_integerI_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'ifgreatereq_integer'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_integerI"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifgreatereq_integerI.nodedef_name = 'ND_ifgreatereq_integerI'; +mtlx_conditional_ifgreatereq_integerI.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_integerI.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_integerI',mtlx_conditional_ifgreatereq_integerI); + +// MaterialX node type: mtlx/conditional/ifgreatereq_color3I +// +function mtlx_conditional_ifgreatereq_color3I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_color3I'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_color3I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ifgreatereq_color3'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_color3I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_ifgreatereq_color3I.nodedef_name = 'ND_ifgreatereq_color3I'; +mtlx_conditional_ifgreatereq_color3I.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_color3I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_color3I',mtlx_conditional_ifgreatereq_color3I); + +// MaterialX node type: mtlx/conditional/ifgreatereq_color4I +// +function mtlx_conditional_ifgreatereq_color4I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_color4I'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_color4I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ifgreatereq_color4'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_color4I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_ifgreatereq_color4I.nodedef_name = 'ND_ifgreatereq_color4I'; +mtlx_conditional_ifgreatereq_color4I.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_color4I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_color4I',mtlx_conditional_ifgreatereq_color4I); + +// MaterialX node type: mtlx/conditional/ifgreatereq_vector2I +// +function mtlx_conditional_ifgreatereq_vector2I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_vector2I'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_vector2I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ifgreatereq_vector2'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_vector2I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifgreatereq_vector2I.nodedef_name = 'ND_ifgreatereq_vector2I'; +mtlx_conditional_ifgreatereq_vector2I.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_vector2I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_vector2I',mtlx_conditional_ifgreatereq_vector2I); + +// MaterialX node type: mtlx/conditional/ifgreatereq_vector3I +// +function mtlx_conditional_ifgreatereq_vector3I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_vector3I'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_vector3I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ifgreatereq_vector3'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_vector3I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_ifgreatereq_vector3I.nodedef_name = 'ND_ifgreatereq_vector3I'; +mtlx_conditional_ifgreatereq_vector3I.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_vector3I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_vector3I',mtlx_conditional_ifgreatereq_vector3I); + +// MaterialX node type: mtlx/conditional/ifgreatereq_vector4I +// +function mtlx_conditional_ifgreatereq_vector4I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_vector4I'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ifgreatereq_vector4'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_vector4I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_ifgreatereq_vector4I.nodedef_name = 'ND_ifgreatereq_vector4I'; +mtlx_conditional_ifgreatereq_vector4I.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_vector4I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_vector4I',mtlx_conditional_ifgreatereq_vector4I); + +// MaterialX node type: mtlx/conditional/ifgreatereq_matrix33I +// +function mtlx_conditional_ifgreatereq_matrix33I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_matrix33I'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_matrix33I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'ifgreatereq_matrix33'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_matrix33I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_ifgreatereq_matrix33I.nodedef_name = 'ND_ifgreatereq_matrix33I'; +mtlx_conditional_ifgreatereq_matrix33I.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_matrix33I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_matrix33I',mtlx_conditional_ifgreatereq_matrix33I); + +// MaterialX node type: mtlx/conditional/ifgreatereq_matrix44I +// +function mtlx_conditional_ifgreatereq_matrix44I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifgreatereq_matrix44I'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'ifgreatereq'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifgreatereq_matrix44I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'ifgreatereq_matrix44'; + this.desc = "MaterialX:mtlx/conditional/ifgreatereq_matrix44I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_ifgreatereq_matrix44I.nodedef_name = 'ND_ifgreatereq_matrix44I'; +mtlx_conditional_ifgreatereq_matrix44I.nodedef_node = 'ifgreatereq'; +mtlx_conditional_ifgreatereq_matrix44I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifgreatereq.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifgreatereq_matrix44I',mtlx_conditional_ifgreatereq_matrix44I); + +// MaterialX node type: mtlx/conditional/ifequal_float +// +function mtlx_conditional_ifequal_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_float_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ifequal_float'; + this.desc = "MaterialX:mtlx/conditional/ifequal_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_ifequal_float.nodedef_name = 'ND_ifequal_float'; +mtlx_conditional_ifequal_float.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_float',mtlx_conditional_ifequal_float); + +// MaterialX node type: mtlx/conditional/ifequal_integer +// +function mtlx_conditional_ifequal_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_integer_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'ifequal_integer'; + this.desc = "MaterialX:mtlx/conditional/ifequal_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifequal_integer.nodedef_name = 'ND_ifequal_integer'; +mtlx_conditional_ifequal_integer.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_integer',mtlx_conditional_ifequal_integer); + +// MaterialX node type: mtlx/conditional/ifequal_color3 +// +function mtlx_conditional_ifequal_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_color3_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ifequal_color3'; + this.desc = "MaterialX:mtlx/conditional/ifequal_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_ifequal_color3.nodedef_name = 'ND_ifequal_color3'; +mtlx_conditional_ifequal_color3.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_color3',mtlx_conditional_ifequal_color3); + +// MaterialX node type: mtlx/conditional/ifequal_color4 +// +function mtlx_conditional_ifequal_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_color4_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ifequal_color4'; + this.desc = "MaterialX:mtlx/conditional/ifequal_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_ifequal_color4.nodedef_name = 'ND_ifequal_color4'; +mtlx_conditional_ifequal_color4.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_color4',mtlx_conditional_ifequal_color4); + +// MaterialX node type: mtlx/conditional/ifequal_vector2 +// +function mtlx_conditional_ifequal_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector2_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ifequal_vector2'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifequal_vector2.nodedef_name = 'ND_ifequal_vector2'; +mtlx_conditional_ifequal_vector2.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector2',mtlx_conditional_ifequal_vector2); + +// MaterialX node type: mtlx/conditional/ifequal_vector3 +// +function mtlx_conditional_ifequal_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector3_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ifequal_vector3'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_ifequal_vector3.nodedef_name = 'ND_ifequal_vector3'; +mtlx_conditional_ifequal_vector3.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector3',mtlx_conditional_ifequal_vector3); + +// MaterialX node type: mtlx/conditional/ifequal_vector4 +// +function mtlx_conditional_ifequal_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector4_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ifequal_vector4'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_ifequal_vector4.nodedef_name = 'ND_ifequal_vector4'; +mtlx_conditional_ifequal_vector4.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector4',mtlx_conditional_ifequal_vector4); + +// MaterialX node type: mtlx/conditional/ifequal_matrix33 +// +function mtlx_conditional_ifequal_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_matrix33_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'ifequal_matrix33'; + this.desc = "MaterialX:mtlx/conditional/ifequal_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_ifequal_matrix33.nodedef_name = 'ND_ifequal_matrix33'; +mtlx_conditional_ifequal_matrix33.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_matrix33',mtlx_conditional_ifequal_matrix33); + +// MaterialX node type: mtlx/conditional/ifequal_matrix44 +// +function mtlx_conditional_ifequal_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_matrix44_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','float'); + this.addProperty('value1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','float'); + this.addProperty('value2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'ifequal_matrix44'; + this.desc = "MaterialX:mtlx/conditional/ifequal_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_ifequal_matrix44.nodedef_name = 'ND_ifequal_matrix44'; +mtlx_conditional_ifequal_matrix44.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_matrix44',mtlx_conditional_ifequal_matrix44); + +// MaterialX node type: mtlx/conditional/ifequal_floatI +// +function mtlx_conditional_ifequal_floatI() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_floatI'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_floatI_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ifequal_float'; + this.desc = "MaterialX:mtlx/conditional/ifequal_floatI"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_ifequal_floatI.nodedef_name = 'ND_ifequal_floatI'; +mtlx_conditional_ifequal_floatI.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_floatI.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_floatI',mtlx_conditional_ifequal_floatI); + +// MaterialX node type: mtlx/conditional/ifequal_integerI +// +function mtlx_conditional_ifequal_integerI() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_integerI'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_integerI_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'ifequal_integer'; + this.desc = "MaterialX:mtlx/conditional/ifequal_integerI"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifequal_integerI.nodedef_name = 'ND_ifequal_integerI'; +mtlx_conditional_ifequal_integerI.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_integerI.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_integerI',mtlx_conditional_ifequal_integerI); + +// MaterialX node type: mtlx/conditional/ifequal_color3I +// +function mtlx_conditional_ifequal_color3I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_color3I'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_color3I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ifequal_color3'; + this.desc = "MaterialX:mtlx/conditional/ifequal_color3I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_ifequal_color3I.nodedef_name = 'ND_ifequal_color3I'; +mtlx_conditional_ifequal_color3I.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_color3I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_color3I',mtlx_conditional_ifequal_color3I); + +// MaterialX node type: mtlx/conditional/ifequal_color4I +// +function mtlx_conditional_ifequal_color4I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_color4I'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_color4I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ifequal_color4'; + this.desc = "MaterialX:mtlx/conditional/ifequal_color4I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_ifequal_color4I.nodedef_name = 'ND_ifequal_color4I'; +mtlx_conditional_ifequal_color4I.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_color4I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_color4I',mtlx_conditional_ifequal_color4I); + +// MaterialX node type: mtlx/conditional/ifequal_vector2I +// +function mtlx_conditional_ifequal_vector2I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector2I'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector2I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ifequal_vector2'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector2I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifequal_vector2I.nodedef_name = 'ND_ifequal_vector2I'; +mtlx_conditional_ifequal_vector2I.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector2I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector2I',mtlx_conditional_ifequal_vector2I); + +// MaterialX node type: mtlx/conditional/ifequal_vector3I +// +function mtlx_conditional_ifequal_vector3I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector3I'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector3I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ifequal_vector3'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector3I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_ifequal_vector3I.nodedef_name = 'ND_ifequal_vector3I'; +mtlx_conditional_ifequal_vector3I.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector3I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector3I',mtlx_conditional_ifequal_vector3I); + +// MaterialX node type: mtlx/conditional/ifequal_vector4I +// +function mtlx_conditional_ifequal_vector4I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector4I'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector4I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ifequal_vector4'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector4I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_ifequal_vector4I.nodedef_name = 'ND_ifequal_vector4I'; +mtlx_conditional_ifequal_vector4I.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector4I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector4I',mtlx_conditional_ifequal_vector4I); + +// MaterialX node type: mtlx/conditional/ifequal_matrix33I +// +function mtlx_conditional_ifequal_matrix33I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_matrix33I'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_matrix33I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'ifequal_matrix33'; + this.desc = "MaterialX:mtlx/conditional/ifequal_matrix33I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_ifequal_matrix33I.nodedef_name = 'ND_ifequal_matrix33I'; +mtlx_conditional_ifequal_matrix33I.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_matrix33I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_matrix33I',mtlx_conditional_ifequal_matrix33I); + +// MaterialX node type: mtlx/conditional/ifequal_matrix44I +// +function mtlx_conditional_ifequal_matrix44I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_matrix44I'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_matrix44I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','integer'); + this.addProperty('value1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','integer'); + this.addProperty('value2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'ifequal_matrix44'; + this.desc = "MaterialX:mtlx/conditional/ifequal_matrix44I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_ifequal_matrix44I.nodedef_name = 'ND_ifequal_matrix44I'; +mtlx_conditional_ifequal_matrix44I.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_matrix44I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_matrix44I',mtlx_conditional_ifequal_matrix44I); + +// MaterialX node type: mtlx/conditional/ifequal_floatB +// +function mtlx_conditional_ifequal_floatB() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_floatB'; + this.nodedef_type = 'float'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_floatB_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'ifequal_float'; + this.desc = "MaterialX:mtlx/conditional/ifequal_floatB"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_ifequal_floatB.nodedef_name = 'ND_ifequal_floatB'; +mtlx_conditional_ifequal_floatB.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_floatB.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_floatB',mtlx_conditional_ifequal_floatB); + +// MaterialX node type: mtlx/conditional/ifequal_integerB +// +function mtlx_conditional_ifequal_integerB() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_integerB'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_integerB_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','integer'); + this.addProperty('in1', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','integer'); + this.addProperty('in2', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'ifequal_integer'; + this.desc = "MaterialX:mtlx/conditional/ifequal_integerB"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifequal_integerB.nodedef_name = 'ND_ifequal_integerB'; +mtlx_conditional_ifequal_integerB.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_integerB.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_integerB',mtlx_conditional_ifequal_integerB); + +// MaterialX node type: mtlx/conditional/ifequal_color3B +// +function mtlx_conditional_ifequal_color3B() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_color3B'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_color3B_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'ifequal_color3'; + this.desc = "MaterialX:mtlx/conditional/ifequal_color3B"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_ifequal_color3B.nodedef_name = 'ND_ifequal_color3B'; +mtlx_conditional_ifequal_color3B.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_color3B.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_color3B',mtlx_conditional_ifequal_color3B); + +// MaterialX node type: mtlx/conditional/ifequal_color4B +// +function mtlx_conditional_ifequal_color4B() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_color4B'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_color4B_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'ifequal_color4'; + this.desc = "MaterialX:mtlx/conditional/ifequal_color4B"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_ifequal_color4B.nodedef_name = 'ND_ifequal_color4B'; +mtlx_conditional_ifequal_color4B.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_color4B.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_color4B',mtlx_conditional_ifequal_color4B); + +// MaterialX node type: mtlx/conditional/ifequal_vector2B +// +function mtlx_conditional_ifequal_vector2B() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector2B'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector2B_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'ifequal_vector2'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector2B"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_ifequal_vector2B.nodedef_name = 'ND_ifequal_vector2B'; +mtlx_conditional_ifequal_vector2B.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector2B.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector2B',mtlx_conditional_ifequal_vector2B); + +// MaterialX node type: mtlx/conditional/ifequal_vector3B +// +function mtlx_conditional_ifequal_vector3B() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector3B'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector3B_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'ifequal_vector3'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector3B"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_ifequal_vector3B.nodedef_name = 'ND_ifequal_vector3B'; +mtlx_conditional_ifequal_vector3B.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector3B.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector3B',mtlx_conditional_ifequal_vector3B); + +// MaterialX node type: mtlx/conditional/ifequal_vector4B +// +function mtlx_conditional_ifequal_vector4B() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_vector4B'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_vector4B_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'ifequal_vector4'; + this.desc = "MaterialX:mtlx/conditional/ifequal_vector4B"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_ifequal_vector4B.nodedef_name = 'ND_ifequal_vector4B'; +mtlx_conditional_ifequal_vector4B.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_vector4B.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_vector4B',mtlx_conditional_ifequal_vector4B); + +// MaterialX node type: mtlx/conditional/ifequal_matrix33B +// +function mtlx_conditional_ifequal_matrix33B() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_matrix33B'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_matrix33B_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'ifequal_matrix33'; + this.desc = "MaterialX:mtlx/conditional/ifequal_matrix33B"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_ifequal_matrix33B.nodedef_name = 'ND_ifequal_matrix33B'; +mtlx_conditional_ifequal_matrix33B.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_matrix33B.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_matrix33B',mtlx_conditional_ifequal_matrix33B); + +// MaterialX node type: mtlx/conditional/ifequal_matrix44B +// +function mtlx_conditional_ifequal_matrix44B() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_ifequal_matrix44B'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'ifequal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_ifequal_matrix44B_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('value1','boolean'); + this.addProperty('value1', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('value2','boolean'); + this.addProperty('value2', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'ifequal_matrix44'; + this.desc = "MaterialX:mtlx/conditional/ifequal_matrix44B"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_ifequal_matrix44B.nodedef_name = 'ND_ifequal_matrix44B'; +mtlx_conditional_ifequal_matrix44B.nodedef_node = 'ifequal'; +mtlx_conditional_ifequal_matrix44B.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/ifequal.html'; +LiteGraph.registerNodeType('mtlx/conditional/ifequal_matrix44B',mtlx_conditional_ifequal_matrix44B); + +// MaterialX node type: mtlx/conditional/switch_float +// +function mtlx_conditional_switch_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_float_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','float'); + this.addProperty('in3', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','float'); + this.addProperty('in4', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','float'); + this.addProperty('in5', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','float'); + this.addProperty('in6', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','float'); + this.addProperty('in7', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','float'); + this.addProperty('in8', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','float'); + this.addProperty('in9', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','float'); + this.addProperty('in10', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','float'); + this.addProperty('which', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'switch_float'; + this.desc = "MaterialX:mtlx/conditional/switch_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_switch_float.nodedef_name = 'ND_switch_float'; +mtlx_conditional_switch_float.nodedef_node = 'switch'; +mtlx_conditional_switch_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_float',mtlx_conditional_switch_float); + +// MaterialX node type: mtlx/conditional/switch_color3 +// +function mtlx_conditional_switch_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_color3_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','color3'); + this.addProperty('in3', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','color3'); + this.addProperty('in4', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','color3'); + this.addProperty('in5', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','color3'); + this.addProperty('in6', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','color3'); + this.addProperty('in7', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','color3'); + this.addProperty('in8', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','color3'); + this.addProperty('in9', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','color3'); + this.addProperty('in10', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','float'); + this.addProperty('which', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'switch_color3'; + this.desc = "MaterialX:mtlx/conditional/switch_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_switch_color3.nodedef_name = 'ND_switch_color3'; +mtlx_conditional_switch_color3.nodedef_node = 'switch'; +mtlx_conditional_switch_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_color3',mtlx_conditional_switch_color3); + +// MaterialX node type: mtlx/conditional/switch_color4 +// +function mtlx_conditional_switch_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_color4_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','color4'); + this.addProperty('in3', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','color4'); + this.addProperty('in4', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','color4'); + this.addProperty('in5', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','color4'); + this.addProperty('in6', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','color4'); + this.addProperty('in7', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','color4'); + this.addProperty('in8', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','color4'); + this.addProperty('in9', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','color4'); + this.addProperty('in10', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','float'); + this.addProperty('which', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'switch_color4'; + this.desc = "MaterialX:mtlx/conditional/switch_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_switch_color4.nodedef_name = 'ND_switch_color4'; +mtlx_conditional_switch_color4.nodedef_node = 'switch'; +mtlx_conditional_switch_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_color4',mtlx_conditional_switch_color4); + +// MaterialX node type: mtlx/conditional/switch_vector2 +// +function mtlx_conditional_switch_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_vector2_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector2'); + this.addProperty('in3', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','vector2'); + this.addProperty('in4', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','vector2'); + this.addProperty('in5', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','vector2'); + this.addProperty('in6', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','vector2'); + this.addProperty('in7', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','vector2'); + this.addProperty('in8', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','vector2'); + this.addProperty('in9', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','vector2'); + this.addProperty('in10', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','float'); + this.addProperty('which', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'switch_vector2'; + this.desc = "MaterialX:mtlx/conditional/switch_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_switch_vector2.nodedef_name = 'ND_switch_vector2'; +mtlx_conditional_switch_vector2.nodedef_node = 'switch'; +mtlx_conditional_switch_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_vector2',mtlx_conditional_switch_vector2); + +// MaterialX node type: mtlx/conditional/switch_vector3 +// +function mtlx_conditional_switch_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_vector3_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector3'); + this.addProperty('in3', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','vector3'); + this.addProperty('in4', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','vector3'); + this.addProperty('in5', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','vector3'); + this.addProperty('in6', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','vector3'); + this.addProperty('in7', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','vector3'); + this.addProperty('in8', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','vector3'); + this.addProperty('in9', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','vector3'); + this.addProperty('in10', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','float'); + this.addProperty('which', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'switch_vector3'; + this.desc = "MaterialX:mtlx/conditional/switch_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_switch_vector3.nodedef_name = 'ND_switch_vector3'; +mtlx_conditional_switch_vector3.nodedef_node = 'switch'; +mtlx_conditional_switch_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_vector3',mtlx_conditional_switch_vector3); + +// MaterialX node type: mtlx/conditional/switch_vector4 +// +function mtlx_conditional_switch_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_vector4_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector4'); + this.addProperty('in3', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','vector4'); + this.addProperty('in4', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','vector4'); + this.addProperty('in5', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','vector4'); + this.addProperty('in6', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','vector4'); + this.addProperty('in7', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','vector4'); + this.addProperty('in8', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','vector4'); + this.addProperty('in9', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','vector4'); + this.addProperty('in10', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','float'); + this.addProperty('which', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'switch_vector4'; + this.desc = "MaterialX:mtlx/conditional/switch_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_switch_vector4.nodedef_name = 'ND_switch_vector4'; +mtlx_conditional_switch_vector4.nodedef_node = 'switch'; +mtlx_conditional_switch_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_vector4',mtlx_conditional_switch_vector4); + +// MaterialX node type: mtlx/conditional/switch_matrix33 +// +function mtlx_conditional_switch_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_matrix33_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','matrix33'); + this.addProperty('in3', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','matrix33'); + this.addProperty('in4', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','matrix33'); + this.addProperty('in5', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','matrix33'); + this.addProperty('in6', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','matrix33'); + this.addProperty('in7', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','matrix33'); + this.addProperty('in8', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','matrix33'); + this.addProperty('in9', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','matrix33'); + this.addProperty('in10', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','float'); + this.addProperty('which', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'switch_matrix33'; + this.desc = "MaterialX:mtlx/conditional/switch_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_switch_matrix33.nodedef_name = 'ND_switch_matrix33'; +mtlx_conditional_switch_matrix33.nodedef_node = 'switch'; +mtlx_conditional_switch_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_matrix33',mtlx_conditional_switch_matrix33); + +// MaterialX node type: mtlx/conditional/switch_matrix44 +// +function mtlx_conditional_switch_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_matrix44_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','matrix44'); + this.addProperty('in3', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','matrix44'); + this.addProperty('in4', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','matrix44'); + this.addProperty('in5', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','matrix44'); + this.addProperty('in6', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','matrix44'); + this.addProperty('in7', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','matrix44'); + this.addProperty('in8', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','matrix44'); + this.addProperty('in9', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','matrix44'); + this.addProperty('in10', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','float'); + this.addProperty('which', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'switch_matrix44'; + this.desc = "MaterialX:mtlx/conditional/switch_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_switch_matrix44.nodedef_name = 'ND_switch_matrix44'; +mtlx_conditional_switch_matrix44.nodedef_node = 'switch'; +mtlx_conditional_switch_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_matrix44',mtlx_conditional_switch_matrix44); + +// MaterialX node type: mtlx/conditional/switch_floatI +// +function mtlx_conditional_switch_floatI() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_floatI'; + this.nodedef_type = 'float'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_floatI_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','float'); + this.addProperty('in3', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','float'); + this.addProperty('in4', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','float'); + this.addProperty('in5', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','float'); + this.addProperty('in6', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','float'); + this.addProperty('in7', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','float'); + this.addProperty('in8', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','float'); + this.addProperty('in9', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','float'); + this.addProperty('in10', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','integer'); + this.addProperty('which', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'switch_float'; + this.desc = "MaterialX:mtlx/conditional/switch_floatI"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#753'; +} +mtlx_conditional_switch_floatI.nodedef_name = 'ND_switch_floatI'; +mtlx_conditional_switch_floatI.nodedef_node = 'switch'; +mtlx_conditional_switch_floatI.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_floatI',mtlx_conditional_switch_floatI); + +// MaterialX node type: mtlx/conditional/switch_color3I +// +function mtlx_conditional_switch_color3I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_color3I'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_color3I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','color3'); + this.addProperty('in3', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','color3'); + this.addProperty('in4', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','color3'); + this.addProperty('in5', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','color3'); + this.addProperty('in6', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','color3'); + this.addProperty('in7', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','color3'); + this.addProperty('in8', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','color3'); + this.addProperty('in9', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','color3'); + this.addProperty('in10', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','integer'); + this.addProperty('which', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'switch_color3'; + this.desc = "MaterialX:mtlx/conditional/switch_color3I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#679'; +} +mtlx_conditional_switch_color3I.nodedef_name = 'ND_switch_color3I'; +mtlx_conditional_switch_color3I.nodedef_node = 'switch'; +mtlx_conditional_switch_color3I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_color3I',mtlx_conditional_switch_color3I); + +// MaterialX node type: mtlx/conditional/switch_color4I +// +function mtlx_conditional_switch_color4I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_color4I'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_color4I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','color4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','color4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','color4'); + this.addProperty('in3', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','color4'); + this.addProperty('in4', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','color4'); + this.addProperty('in5', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','color4'); + this.addProperty('in6', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','color4'); + this.addProperty('in7', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','color4'); + this.addProperty('in8', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','color4'); + this.addProperty('in9', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','color4'); + this.addProperty('in10', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','integer'); + this.addProperty('which', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'switch_color4'; + this.desc = "MaterialX:mtlx/conditional/switch_color4I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#899'; +} +mtlx_conditional_switch_color4I.nodedef_name = 'ND_switch_color4I'; +mtlx_conditional_switch_color4I.nodedef_node = 'switch'; +mtlx_conditional_switch_color4I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_color4I',mtlx_conditional_switch_color4I); + +// MaterialX node type: mtlx/conditional/switch_vector2I +// +function mtlx_conditional_switch_vector2I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_vector2I'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_vector2I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector2'); + this.addProperty('in3', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','vector2'); + this.addProperty('in4', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','vector2'); + this.addProperty('in5', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','vector2'); + this.addProperty('in6', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','vector2'); + this.addProperty('in7', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','vector2'); + this.addProperty('in8', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','vector2'); + this.addProperty('in9', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','vector2'); + this.addProperty('in10', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','integer'); + this.addProperty('which', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'switch_vector2'; + this.desc = "MaterialX:mtlx/conditional/switch_vector2I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_conditional_switch_vector2I.nodedef_name = 'ND_switch_vector2I'; +mtlx_conditional_switch_vector2I.nodedef_node = 'switch'; +mtlx_conditional_switch_vector2I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_vector2I',mtlx_conditional_switch_vector2I); + +// MaterialX node type: mtlx/conditional/switch_vector3I +// +function mtlx_conditional_switch_vector3I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_vector3I'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_vector3I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector3'); + this.addProperty('in3', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','vector3'); + this.addProperty('in4', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','vector3'); + this.addProperty('in5', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','vector3'); + this.addProperty('in6', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','vector3'); + this.addProperty('in7', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','vector3'); + this.addProperty('in8', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','vector3'); + this.addProperty('in9', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','vector3'); + this.addProperty('in10', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','integer'); + this.addProperty('which', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'switch_vector3'; + this.desc = "MaterialX:mtlx/conditional/switch_vector3I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_conditional_switch_vector3I.nodedef_name = 'ND_switch_vector3I'; +mtlx_conditional_switch_vector3I.nodedef_node = 'switch'; +mtlx_conditional_switch_vector3I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_vector3I',mtlx_conditional_switch_vector3I); + +// MaterialX node type: mtlx/conditional/switch_vector4I +// +function mtlx_conditional_switch_vector4I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_vector4I'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_vector4I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','vector4'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector4'); + this.addProperty('in3', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','vector4'); + this.addProperty('in4', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','vector4'); + this.addProperty('in5', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','vector4'); + this.addProperty('in6', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','vector4'); + this.addProperty('in7', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','vector4'); + this.addProperty('in8', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','vector4'); + this.addProperty('in9', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','vector4'); + this.addProperty('in10', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','integer'); + this.addProperty('which', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'switch_vector4'; + this.desc = "MaterialX:mtlx/conditional/switch_vector4I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_conditional_switch_vector4I.nodedef_name = 'ND_switch_vector4I'; +mtlx_conditional_switch_vector4I.nodedef_node = 'switch'; +mtlx_conditional_switch_vector4I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_vector4I',mtlx_conditional_switch_vector4I); + +// MaterialX node type: mtlx/conditional/switch_matrix33I +// +function mtlx_conditional_switch_matrix33I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_matrix33I'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_matrix33I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','matrix33'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix33'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','matrix33'); + this.addProperty('in3', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','matrix33'); + this.addProperty('in4', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','matrix33'); + this.addProperty('in5', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','matrix33'); + this.addProperty('in6', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','matrix33'); + this.addProperty('in7', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','matrix33'); + this.addProperty('in8', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','matrix33'); + this.addProperty('in9', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','matrix33'); + this.addProperty('in10', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','integer'); + this.addProperty('which', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'switch_matrix33'; + this.desc = "MaterialX:mtlx/conditional/switch_matrix33I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#333'; +} +mtlx_conditional_switch_matrix33I.nodedef_name = 'ND_switch_matrix33I'; +mtlx_conditional_switch_matrix33I.nodedef_node = 'switch'; +mtlx_conditional_switch_matrix33I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_matrix33I',mtlx_conditional_switch_matrix33I); + +// MaterialX node type: mtlx/conditional/switch_matrix44I +// +function mtlx_conditional_switch_matrix44I() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_switch_matrix44I'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'switch'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_switch_matrix44I_out_genglsl.png'; + this.nodedef_group = 'conditional'; + this.addInput('in1','matrix44'); + this.addProperty('in1', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','matrix44'); + this.addProperty('in2', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','matrix44'); + this.addProperty('in3', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','matrix44'); + this.addProperty('in4', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in5','matrix44'); + this.addProperty('in5', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in6','matrix44'); + this.addProperty('in6', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in7','matrix44'); + this.addProperty('in7', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in8','matrix44'); + this.addProperty('in8', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in9','matrix44'); + this.addProperty('in9', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in10','matrix44'); + this.addProperty('in10', [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('which','integer'); + this.addProperty('which', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'switch_matrix44'; + this.desc = "MaterialX:mtlx/conditional/switch_matrix44I"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#532200'; + this.title_text_color = '#000'; + this.shape = LiteGraph.CARD_SHAPE; + this.boxcolor = '#444'; +} +mtlx_conditional_switch_matrix44I.nodedef_name = 'ND_switch_matrix44I'; +mtlx_conditional_switch_matrix44I.nodedef_node = 'switch'; +mtlx_conditional_switch_matrix44I.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/switch.html'; +LiteGraph.registerNodeType('mtlx/conditional/switch_matrix44I',mtlx_conditional_switch_matrix44I); + +// MaterialX node type: mtlx/channel/convert_float_color3 +// +function mtlx_channel_convert_float_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_float_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_float_color3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'convert_color3'; + this.desc = "MaterialX:mtlx/channel/convert_float_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_channel_convert_float_color3.nodedef_name = 'ND_convert_float_color3'; +mtlx_channel_convert_float_color3.nodedef_node = 'convert'; +mtlx_channel_convert_float_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_float_color3',mtlx_channel_convert_float_color3); + +// MaterialX node type: mtlx/channel/convert_float_color4 +// +function mtlx_channel_convert_float_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_float_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_float_color4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'convert_color4'; + this.desc = "MaterialX:mtlx/channel/convert_float_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_channel_convert_float_color4.nodedef_name = 'ND_convert_float_color4'; +mtlx_channel_convert_float_color4.nodedef_node = 'convert'; +mtlx_channel_convert_float_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_float_color4',mtlx_channel_convert_float_color4); + +// MaterialX node type: mtlx/channel/convert_float_vector2 +// +function mtlx_channel_convert_float_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_float_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_float_vector2_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'convert_vector2'; + this.desc = "MaterialX:mtlx/channel/convert_float_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_channel_convert_float_vector2.nodedef_name = 'ND_convert_float_vector2'; +mtlx_channel_convert_float_vector2.nodedef_node = 'convert'; +mtlx_channel_convert_float_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_float_vector2',mtlx_channel_convert_float_vector2); + +// MaterialX node type: mtlx/channel/convert_float_vector3 +// +function mtlx_channel_convert_float_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_float_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_float_vector3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'convert_vector3'; + this.desc = "MaterialX:mtlx/channel/convert_float_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_channel_convert_float_vector3.nodedef_name = 'ND_convert_float_vector3'; +mtlx_channel_convert_float_vector3.nodedef_node = 'convert'; +mtlx_channel_convert_float_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_float_vector3',mtlx_channel_convert_float_vector3); + +// MaterialX node type: mtlx/channel/convert_float_vector4 +// +function mtlx_channel_convert_float_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_float_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_float_vector4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'convert_vector4'; + this.desc = "MaterialX:mtlx/channel/convert_float_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_channel_convert_float_vector4.nodedef_name = 'ND_convert_float_vector4'; +mtlx_channel_convert_float_vector4.nodedef_node = 'convert'; +mtlx_channel_convert_float_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_float_vector4',mtlx_channel_convert_float_vector4); + +// MaterialX node type: mtlx/channel/convert_vector2_vector3 +// +function mtlx_channel_convert_vector2_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector2_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector2_vector3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'convert_vector3'; + this.desc = "MaterialX:mtlx/channel/convert_vector2_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_channel_convert_vector2_vector3.nodedef_name = 'ND_convert_vector2_vector3'; +mtlx_channel_convert_vector2_vector3.nodedef_node = 'convert'; +mtlx_channel_convert_vector2_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_vector2_vector3',mtlx_channel_convert_vector2_vector3); + +// MaterialX node type: mtlx/channel/convert_vector3_color3 +// +function mtlx_channel_convert_vector3_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector3_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector3_color3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'convert_color3'; + this.desc = "MaterialX:mtlx/channel/convert_vector3_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_channel_convert_vector3_color3.nodedef_name = 'ND_convert_vector3_color3'; +mtlx_channel_convert_vector3_color3.nodedef_node = 'convert'; +mtlx_channel_convert_vector3_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_vector3_color3',mtlx_channel_convert_vector3_color3); + +// MaterialX node type: mtlx/channel/convert_vector3_vector2 +// +function mtlx_channel_convert_vector3_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector3_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector3_vector2_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'convert_vector2'; + this.desc = "MaterialX:mtlx/channel/convert_vector3_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_channel_convert_vector3_vector2.nodedef_name = 'ND_convert_vector3_vector2'; +mtlx_channel_convert_vector3_vector2.nodedef_node = 'convert'; +mtlx_channel_convert_vector3_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_vector3_vector2',mtlx_channel_convert_vector3_vector2); + +// MaterialX node type: mtlx/channel/convert_vector3_vector4 +// +function mtlx_channel_convert_vector3_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector3_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector3_vector4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'convert_vector4'; + this.desc = "MaterialX:mtlx/channel/convert_vector3_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_channel_convert_vector3_vector4.nodedef_name = 'ND_convert_vector3_vector4'; +mtlx_channel_convert_vector3_vector4.nodedef_node = 'convert'; +mtlx_channel_convert_vector3_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_vector3_vector4',mtlx_channel_convert_vector3_vector4); + +// MaterialX node type: mtlx/channel/convert_vector4_color4 +// +function mtlx_channel_convert_vector4_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector4_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector4_color4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'convert_color4'; + this.desc = "MaterialX:mtlx/channel/convert_vector4_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_channel_convert_vector4_color4.nodedef_name = 'ND_convert_vector4_color4'; +mtlx_channel_convert_vector4_color4.nodedef_node = 'convert'; +mtlx_channel_convert_vector4_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_vector4_color4',mtlx_channel_convert_vector4_color4); + +// MaterialX node type: mtlx/channel/convert_vector4_vector3 +// +function mtlx_channel_convert_vector4_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector4_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector4_vector3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'convert_vector3'; + this.desc = "MaterialX:mtlx/channel/convert_vector4_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_channel_convert_vector4_vector3.nodedef_name = 'ND_convert_vector4_vector3'; +mtlx_channel_convert_vector4_vector3.nodedef_node = 'convert'; +mtlx_channel_convert_vector4_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_vector4_vector3',mtlx_channel_convert_vector4_vector3); + +// MaterialX node type: mtlx/channel/convert_color3_vector3 +// +function mtlx_channel_convert_color3_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_color3_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_color3_vector3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'convert_vector3'; + this.desc = "MaterialX:mtlx/channel/convert_color3_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_channel_convert_color3_vector3.nodedef_name = 'ND_convert_color3_vector3'; +mtlx_channel_convert_color3_vector3.nodedef_node = 'convert'; +mtlx_channel_convert_color3_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_color3_vector3',mtlx_channel_convert_color3_vector3); + +// MaterialX node type: mtlx/channel/convert_color4_vector4 +// +function mtlx_channel_convert_color4_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_color4_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_color4_vector4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'convert_vector4'; + this.desc = "MaterialX:mtlx/channel/convert_color4_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_channel_convert_color4_vector4.nodedef_name = 'ND_convert_color4_vector4'; +mtlx_channel_convert_color4_vector4.nodedef_node = 'convert'; +mtlx_channel_convert_color4_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_color4_vector4',mtlx_channel_convert_color4_vector4); + +// MaterialX node type: mtlx/channel/convert_color3_color4 +// +function mtlx_channel_convert_color3_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_color3_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_color3_color4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'convert_color4'; + this.desc = "MaterialX:mtlx/channel/convert_color3_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_channel_convert_color3_color4.nodedef_name = 'ND_convert_color3_color4'; +mtlx_channel_convert_color3_color4.nodedef_node = 'convert'; +mtlx_channel_convert_color3_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_color3_color4',mtlx_channel_convert_color3_color4); + +// MaterialX node type: mtlx/channel/convert_color4_color3 +// +function mtlx_channel_convert_color4_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_color4_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_color4_color3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'convert_color3'; + this.desc = "MaterialX:mtlx/channel/convert_color4_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_channel_convert_color4_color3.nodedef_name = 'ND_convert_color4_color3'; +mtlx_channel_convert_color4_color3.nodedef_node = 'convert'; +mtlx_channel_convert_color4_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_color4_color3',mtlx_channel_convert_color4_color3); + +// MaterialX node type: mtlx/channel/convert_boolean_float +// +function mtlx_channel_convert_boolean_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_boolean_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_boolean_float_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','boolean'); + this.addProperty('in', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'convert_float'; + this.desc = "MaterialX:mtlx/channel/convert_boolean_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_channel_convert_boolean_float.nodedef_name = 'ND_convert_boolean_float'; +mtlx_channel_convert_boolean_float.nodedef_node = 'convert'; +mtlx_channel_convert_boolean_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_boolean_float',mtlx_channel_convert_boolean_float); + +// MaterialX node type: mtlx/channel/convert_integer_float +// +function mtlx_channel_convert_integer_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_integer_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_integer_float_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','integer'); + this.addProperty('in', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'convert_float'; + this.desc = "MaterialX:mtlx/channel/convert_integer_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_channel_convert_integer_float.nodedef_name = 'ND_convert_integer_float'; +mtlx_channel_convert_integer_float.nodedef_node = 'convert'; +mtlx_channel_convert_integer_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/channel/convert_integer_float',mtlx_channel_convert_integer_float); + +// MaterialX node type: mtlx/shader/convert_color3_surfaceshader +// +function mtlx_shader_convert_color3_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_color3_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_color3_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('in','color3'); + this.addProperty('in', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'convert_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/convert_color3_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_convert_color3_surfaceshader.nodedef_name = 'ND_convert_color3_surfaceshader'; +mtlx_shader_convert_color3_surfaceshader.nodedef_node = 'convert'; +mtlx_shader_convert_color3_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/shader/convert_color3_surfaceshader',mtlx_shader_convert_color3_surfaceshader); + +// MaterialX node type: mtlx/shader/convert_color4_surfaceshader +// +function mtlx_shader_convert_color4_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_color4_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_color4_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('in','color4'); + this.addProperty('in', [0, 0, 0, 0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'convert_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/convert_color4_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_convert_color4_surfaceshader.nodedef_name = 'ND_convert_color4_surfaceshader'; +mtlx_shader_convert_color4_surfaceshader.nodedef_node = 'convert'; +mtlx_shader_convert_color4_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/shader/convert_color4_surfaceshader',mtlx_shader_convert_color4_surfaceshader); + +// MaterialX node type: mtlx/shader/convert_float_surfaceshader +// +function mtlx_shader_convert_float_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_float_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_float_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('in','float'); + this.addProperty('in', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'convert_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/convert_float_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_convert_float_surfaceshader.nodedef_name = 'ND_convert_float_surfaceshader'; +mtlx_shader_convert_float_surfaceshader.nodedef_node = 'convert'; +mtlx_shader_convert_float_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/shader/convert_float_surfaceshader',mtlx_shader_convert_float_surfaceshader); + +// MaterialX node type: mtlx/shader/convert_vector2_surfaceshader +// +function mtlx_shader_convert_vector2_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector2_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector2_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('in','vector2'); + this.addProperty('in', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'convert_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/convert_vector2_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_convert_vector2_surfaceshader.nodedef_name = 'ND_convert_vector2_surfaceshader'; +mtlx_shader_convert_vector2_surfaceshader.nodedef_node = 'convert'; +mtlx_shader_convert_vector2_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/shader/convert_vector2_surfaceshader',mtlx_shader_convert_vector2_surfaceshader); + +// MaterialX node type: mtlx/shader/convert_vector3_surfaceshader +// +function mtlx_shader_convert_vector3_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector3_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector3_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('in','vector3'); + this.addProperty('in', [0, 0, 0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'convert_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/convert_vector3_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_convert_vector3_surfaceshader.nodedef_name = 'ND_convert_vector3_surfaceshader'; +mtlx_shader_convert_vector3_surfaceshader.nodedef_node = 'convert'; +mtlx_shader_convert_vector3_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/shader/convert_vector3_surfaceshader',mtlx_shader_convert_vector3_surfaceshader); + +// MaterialX node type: mtlx/shader/convert_vector4_surfaceshader +// +function mtlx_shader_convert_vector4_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_vector4_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_vector4_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('in','vector4'); + this.addProperty('in', [0, 0, 0, 0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'convert_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/convert_vector4_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_convert_vector4_surfaceshader.nodedef_name = 'ND_convert_vector4_surfaceshader'; +mtlx_shader_convert_vector4_surfaceshader.nodedef_node = 'convert'; +mtlx_shader_convert_vector4_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/shader/convert_vector4_surfaceshader',mtlx_shader_convert_vector4_surfaceshader); + +// MaterialX node type: mtlx/shader/convert_integer_surfaceshader +// +function mtlx_shader_convert_integer_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_integer_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_integer_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('in','integer'); + this.addProperty('in', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'convert_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/convert_integer_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_convert_integer_surfaceshader.nodedef_name = 'ND_convert_integer_surfaceshader'; +mtlx_shader_convert_integer_surfaceshader.nodedef_node = 'convert'; +mtlx_shader_convert_integer_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/shader/convert_integer_surfaceshader',mtlx_shader_convert_integer_surfaceshader); + +// MaterialX node type: mtlx/shader/convert_boolean_surfaceshader +// +function mtlx_shader_convert_boolean_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_convert_boolean_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'convert'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_convert_boolean_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'shader'; + this.addInput('in','boolean'); + this.addProperty('in', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'convert_surfaceshader'; + this.desc = "MaterialX:mtlx/shader/convert_boolean_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_shader_convert_boolean_surfaceshader.nodedef_name = 'ND_convert_boolean_surfaceshader'; +mtlx_shader_convert_boolean_surfaceshader.nodedef_node = 'convert'; +mtlx_shader_convert_boolean_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/convert.html'; +LiteGraph.registerNodeType('mtlx/shader/convert_boolean_surfaceshader',mtlx_shader_convert_boolean_surfaceshader); + +// MaterialX node type: mtlx/channel/combine2_vector2 +// +function mtlx_channel_combine2_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_combine2_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'combine2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_combine2_vector2_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'combine2_vector2'; + this.desc = "MaterialX:mtlx/channel/combine2_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_channel_combine2_vector2.nodedef_name = 'ND_combine2_vector2'; +mtlx_channel_combine2_vector2.nodedef_node = 'combine2'; +mtlx_channel_combine2_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine2.html'; +LiteGraph.registerNodeType('mtlx/channel/combine2_vector2',mtlx_channel_combine2_vector2); + +// MaterialX node type: mtlx/channel/combine2_color4CF +// +function mtlx_channel_combine2_color4CF() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_combine2_color4CF'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'combine2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_combine2_color4CF_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in1','color3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'combine2_color4'; + this.desc = "MaterialX:mtlx/channel/combine2_color4CF"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_channel_combine2_color4CF.nodedef_name = 'ND_combine2_color4CF'; +mtlx_channel_combine2_color4CF.nodedef_node = 'combine2'; +mtlx_channel_combine2_color4CF.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine2.html'; +LiteGraph.registerNodeType('mtlx/channel/combine2_color4CF',mtlx_channel_combine2_color4CF); + +// MaterialX node type: mtlx/channel/combine2_vector4VF +// +function mtlx_channel_combine2_vector4VF() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_combine2_vector4VF'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'combine2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_combine2_vector4VF_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in1','vector3'); + this.addProperty('in1', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'combine2_vector4'; + this.desc = "MaterialX:mtlx/channel/combine2_vector4VF"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_channel_combine2_vector4VF.nodedef_name = 'ND_combine2_vector4VF'; +mtlx_channel_combine2_vector4VF.nodedef_node = 'combine2'; +mtlx_channel_combine2_vector4VF.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine2.html'; +LiteGraph.registerNodeType('mtlx/channel/combine2_vector4VF',mtlx_channel_combine2_vector4VF); + +// MaterialX node type: mtlx/channel/combine2_vector4VV +// +function mtlx_channel_combine2_vector4VV() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_combine2_vector4VV'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'combine2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_combine2_vector4VV_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in1','vector2'); + this.addProperty('in1', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector2'); + this.addProperty('in2', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'combine2_vector4'; + this.desc = "MaterialX:mtlx/channel/combine2_vector4VV"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_channel_combine2_vector4VV.nodedef_name = 'ND_combine2_vector4VV'; +mtlx_channel_combine2_vector4VV.nodedef_node = 'combine2'; +mtlx_channel_combine2_vector4VV.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine2.html'; +LiteGraph.registerNodeType('mtlx/channel/combine2_vector4VV',mtlx_channel_combine2_vector4VV); + +// MaterialX node type: mtlx/channel/combine3_color3 +// +function mtlx_channel_combine3_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_combine3_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'combine3'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine3.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_combine3_color3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','float'); + this.addProperty('in3', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'combine3_color3'; + this.desc = "MaterialX:mtlx/channel/combine3_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_channel_combine3_color3.nodedef_name = 'ND_combine3_color3'; +mtlx_channel_combine3_color3.nodedef_node = 'combine3'; +mtlx_channel_combine3_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine3.html'; +LiteGraph.registerNodeType('mtlx/channel/combine3_color3',mtlx_channel_combine3_color3); + +// MaterialX node type: mtlx/channel/combine3_vector3 +// +function mtlx_channel_combine3_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_combine3_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'combine3'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine3.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_combine3_vector3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','float'); + this.addProperty('in3', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'combine3_vector3'; + this.desc = "MaterialX:mtlx/channel/combine3_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_channel_combine3_vector3.nodedef_name = 'ND_combine3_vector3'; +mtlx_channel_combine3_vector3.nodedef_node = 'combine3'; +mtlx_channel_combine3_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine3.html'; +LiteGraph.registerNodeType('mtlx/channel/combine3_vector3',mtlx_channel_combine3_vector3); + +// MaterialX node type: mtlx/channel/combine4_color4 +// +function mtlx_channel_combine4_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_combine4_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'combine4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_combine4_color4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','float'); + this.addProperty('in3', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','float'); + this.addProperty('in4', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'combine4_color4'; + this.desc = "MaterialX:mtlx/channel/combine4_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_channel_combine4_color4.nodedef_name = 'ND_combine4_color4'; +mtlx_channel_combine4_color4.nodedef_node = 'combine4'; +mtlx_channel_combine4_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine4.html'; +LiteGraph.registerNodeType('mtlx/channel/combine4_color4',mtlx_channel_combine4_color4); + +// MaterialX node type: mtlx/channel/combine4_vector4 +// +function mtlx_channel_combine4_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_combine4_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'combine4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_combine4_vector4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in1','float'); + this.addProperty('in1', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','float'); + this.addProperty('in2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','float'); + this.addProperty('in3', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','float'); + this.addProperty('in4', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'combine4_vector4'; + this.desc = "MaterialX:mtlx/channel/combine4_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_channel_combine4_vector4.nodedef_name = 'ND_combine4_vector4'; +mtlx_channel_combine4_vector4.nodedef_node = 'combine4'; +mtlx_channel_combine4_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/combine4.html'; +LiteGraph.registerNodeType('mtlx/channel/combine4_vector4',mtlx_channel_combine4_vector4); + +// MaterialX node type: mtlx/math/creatematrix_vector3_matrix33 +// +function mtlx_math_creatematrix_vector3_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_creatematrix_vector3_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'creatematrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/creatematrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_creatematrix_vector3_matrix33_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [1.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 1.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector3'); + this.addProperty('in3', [0.0, 0.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'creatematrix_matrix33'; + this.desc = "MaterialX:mtlx/math/creatematrix_vector3_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_math_creatematrix_vector3_matrix33.nodedef_name = 'ND_creatematrix_vector3_matrix33'; +mtlx_math_creatematrix_vector3_matrix33.nodedef_node = 'creatematrix'; +mtlx_math_creatematrix_vector3_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/creatematrix.html'; +LiteGraph.registerNodeType('mtlx/math/creatematrix_vector3_matrix33',mtlx_math_creatematrix_vector3_matrix33); + +// MaterialX node type: mtlx/math/creatematrix_vector3_matrix44 +// +function mtlx_math_creatematrix_vector3_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_creatematrix_vector3_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'creatematrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/creatematrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_creatematrix_vector3_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector3'); + this.addProperty('in1', [1.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector3'); + this.addProperty('in2', [0.0, 1.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector3'); + this.addProperty('in3', [0.0, 0.0, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','vector3'); + this.addProperty('in4', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'creatematrix_matrix44'; + this.desc = "MaterialX:mtlx/math/creatematrix_vector3_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_creatematrix_vector3_matrix44.nodedef_name = 'ND_creatematrix_vector3_matrix44'; +mtlx_math_creatematrix_vector3_matrix44.nodedef_node = 'creatematrix'; +mtlx_math_creatematrix_vector3_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/creatematrix.html'; +LiteGraph.registerNodeType('mtlx/math/creatematrix_vector3_matrix44',mtlx_math_creatematrix_vector3_matrix44); + +// MaterialX node type: mtlx/math/creatematrix_vector4_matrix44 +// +function mtlx_math_creatematrix_vector4_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_creatematrix_vector4_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'creatematrix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/creatematrix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_creatematrix_vector4_matrix44_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in1','vector4'); + this.addProperty('in1', [1.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in2','vector4'); + this.addProperty('in2', [0.0, 1.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in3','vector4'); + this.addProperty('in3', [0.0, 0.0, 1.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('in4','vector4'); + this.addProperty('in4', [0.0, 0.0, 0.0, 1.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'creatematrix_matrix44'; + this.desc = "MaterialX:mtlx/math/creatematrix_vector4_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_math_creatematrix_vector4_matrix44.nodedef_name = 'ND_creatematrix_vector4_matrix44'; +mtlx_math_creatematrix_vector4_matrix44.nodedef_node = 'creatematrix'; +mtlx_math_creatematrix_vector4_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/creatematrix.html'; +LiteGraph.registerNodeType('mtlx/math/creatematrix_vector4_matrix44',mtlx_math_creatematrix_vector4_matrix44); + +// MaterialX node type: mtlx/channel/extract_color3 +// +function mtlx_channel_extract_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_extract_color3'; + this.nodedef_type = 'float'; + this.nodedef_node = 'extract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_extract_color3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"2","uifolder":""}); + this.addOutput('out','float'); + this.title = 'extract_float'; + this.desc = "MaterialX:mtlx/channel/extract_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_channel_extract_color3.nodedef_name = 'ND_extract_color3'; +mtlx_channel_extract_color3.nodedef_node = 'extract'; +mtlx_channel_extract_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; +LiteGraph.registerNodeType('mtlx/channel/extract_color3',mtlx_channel_extract_color3); + +// MaterialX node type: mtlx/channel/extract_color4 +// +function mtlx_channel_extract_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_extract_color4'; + this.nodedef_type = 'float'; + this.nodedef_node = 'extract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_extract_color4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"3","uifolder":""}); + this.addOutput('out','float'); + this.title = 'extract_float'; + this.desc = "MaterialX:mtlx/channel/extract_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_channel_extract_color4.nodedef_name = 'ND_extract_color4'; +mtlx_channel_extract_color4.nodedef_node = 'extract'; +mtlx_channel_extract_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; +LiteGraph.registerNodeType('mtlx/channel/extract_color4',mtlx_channel_extract_color4); + +// MaterialX node type: mtlx/channel/extract_vector2 +// +function mtlx_channel_extract_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_extract_vector2'; + this.nodedef_type = 'float'; + this.nodedef_node = 'extract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_extract_vector2_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"1","uifolder":""}); + this.addOutput('out','float'); + this.title = 'extract_float'; + this.desc = "MaterialX:mtlx/channel/extract_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_channel_extract_vector2.nodedef_name = 'ND_extract_vector2'; +mtlx_channel_extract_vector2.nodedef_node = 'extract'; +mtlx_channel_extract_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; +LiteGraph.registerNodeType('mtlx/channel/extract_vector2',mtlx_channel_extract_vector2); + +// MaterialX node type: mtlx/channel/extract_vector3 +// +function mtlx_channel_extract_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_extract_vector3'; + this.nodedef_type = 'float'; + this.nodedef_node = 'extract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_extract_vector3_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"2","uifolder":""}); + this.addOutput('out','float'); + this.title = 'extract_float'; + this.desc = "MaterialX:mtlx/channel/extract_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_channel_extract_vector3.nodedef_name = 'ND_extract_vector3'; +mtlx_channel_extract_vector3.nodedef_node = 'extract'; +mtlx_channel_extract_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; +LiteGraph.registerNodeType('mtlx/channel/extract_vector3',mtlx_channel_extract_vector3); + +// MaterialX node type: mtlx/channel/extract_vector4 +// +function mtlx_channel_extract_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_extract_vector4'; + this.nodedef_type = 'float'; + this.nodedef_node = 'extract'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_extract_vector4_out_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('index','integer'); + this.addProperty('index', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"3","uifolder":""}); + this.addOutput('out','float'); + this.title = 'extract_float'; + this.desc = "MaterialX:mtlx/channel/extract_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_channel_extract_vector4.nodedef_name = 'ND_extract_vector4'; +mtlx_channel_extract_vector4.nodedef_node = 'extract'; +mtlx_channel_extract_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/extract.html'; +LiteGraph.registerNodeType('mtlx/channel/extract_vector4',mtlx_channel_extract_vector4); + +// MaterialX node type: mtlx/channel/separate2_vector2 +// +function mtlx_channel_separate2_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_separate2_vector2'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'separate2'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate2.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_separate2_vector2_outx_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('outx','float'); + this.addOutput('outy','float'); + this.title = 'separate2_multioutput'; + this.desc = "MaterialX:mtlx/channel/separate2_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_channel_separate2_vector2.nodedef_name = 'ND_separate2_vector2'; +mtlx_channel_separate2_vector2.nodedef_node = 'separate2'; +mtlx_channel_separate2_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate2.html'; +LiteGraph.registerNodeType('mtlx/channel/separate2_vector2',mtlx_channel_separate2_vector2); + +// MaterialX node type: mtlx/channel/separate3_color3 +// +function mtlx_channel_separate3_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_separate3_color3'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'separate3'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate3.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_separate3_color3_outr_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('outr','float'); + this.addOutput('outg','float'); + this.addOutput('outb','float'); + this.title = 'separate3_multioutput'; + this.desc = "MaterialX:mtlx/channel/separate3_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_channel_separate3_color3.nodedef_name = 'ND_separate3_color3'; +mtlx_channel_separate3_color3.nodedef_node = 'separate3'; +mtlx_channel_separate3_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate3.html'; +LiteGraph.registerNodeType('mtlx/channel/separate3_color3',mtlx_channel_separate3_color3); + +// MaterialX node type: mtlx/channel/separate3_vector3 +// +function mtlx_channel_separate3_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_separate3_vector3'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'separate3'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate3.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_separate3_vector3_outx_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('outx','float'); + this.addOutput('outy','float'); + this.addOutput('outz','float'); + this.title = 'separate3_multioutput'; + this.desc = "MaterialX:mtlx/channel/separate3_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_channel_separate3_vector3.nodedef_name = 'ND_separate3_vector3'; +mtlx_channel_separate3_vector3.nodedef_node = 'separate3'; +mtlx_channel_separate3_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate3.html'; +LiteGraph.registerNodeType('mtlx/channel/separate3_vector3',mtlx_channel_separate3_vector3); + +// MaterialX node type: mtlx/channel/separate4_color4 +// +function mtlx_channel_separate4_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_separate4_color4'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'separate4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_separate4_color4_outr_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('outr','float'); + this.addOutput('outg','float'); + this.addOutput('outb','float'); + this.addOutput('outa','float'); + this.title = 'separate4_multioutput'; + this.desc = "MaterialX:mtlx/channel/separate4_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_channel_separate4_color4.nodedef_name = 'ND_separate4_color4'; +mtlx_channel_separate4_color4.nodedef_node = 'separate4'; +mtlx_channel_separate4_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate4.html'; +LiteGraph.registerNodeType('mtlx/channel/separate4_color4',mtlx_channel_separate4_color4); + +// MaterialX node type: mtlx/channel/separate4_vector4 +// +function mtlx_channel_separate4_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_separate4_vector4'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'separate4'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate4.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_separate4_vector4_outx_genglsl.png'; + this.nodedef_group = 'channel'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('outx','float'); + this.addOutput('outy','float'); + this.addOutput('outz','float'); + this.addOutput('outw','float'); + this.title = 'separate4_multioutput'; + this.desc = "MaterialX:mtlx/channel/separate4_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_channel_separate4_vector4.nodedef_name = 'ND_separate4_vector4'; +mtlx_channel_separate4_vector4.nodedef_node = 'separate4'; +mtlx_channel_separate4_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/separate4.html'; +LiteGraph.registerNodeType('mtlx/channel/separate4_vector4',mtlx_channel_separate4_vector4); + +// MaterialX node type: mtlx/convolution2d/blur_float +// +function mtlx_convolution2d_blur_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_blur_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'blur'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_blur_float_out_genglsl.png'; + this.nodedef_group = 'convolution2d'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'box', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'blur_float'; + this.desc = "MaterialX:mtlx/convolution2d/blur_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_convolution2d_blur_float.nodedef_name = 'ND_blur_float'; +mtlx_convolution2d_blur_float.nodedef_node = 'blur'; +mtlx_convolution2d_blur_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; +LiteGraph.registerNodeType('mtlx/convolution2d/blur_float',mtlx_convolution2d_blur_float); + +// MaterialX node type: mtlx/convolution2d/blur_color3 +// +function mtlx_convolution2d_blur_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_blur_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'blur'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_blur_color3_out_genglsl.png'; + this.nodedef_group = 'convolution2d'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'box', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'blur_color3'; + this.desc = "MaterialX:mtlx/convolution2d/blur_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_convolution2d_blur_color3.nodedef_name = 'ND_blur_color3'; +mtlx_convolution2d_blur_color3.nodedef_node = 'blur'; +mtlx_convolution2d_blur_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; +LiteGraph.registerNodeType('mtlx/convolution2d/blur_color3',mtlx_convolution2d_blur_color3); + +// MaterialX node type: mtlx/convolution2d/blur_color4 +// +function mtlx_convolution2d_blur_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_blur_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'blur'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_blur_color4_out_genglsl.png'; + this.nodedef_group = 'convolution2d'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'box', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'blur_color4'; + this.desc = "MaterialX:mtlx/convolution2d/blur_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_convolution2d_blur_color4.nodedef_name = 'ND_blur_color4'; +mtlx_convolution2d_blur_color4.nodedef_node = 'blur'; +mtlx_convolution2d_blur_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; +LiteGraph.registerNodeType('mtlx/convolution2d/blur_color4',mtlx_convolution2d_blur_color4); + +// MaterialX node type: mtlx/convolution2d/blur_vector2 +// +function mtlx_convolution2d_blur_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_blur_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'blur'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_blur_vector2_out_genglsl.png'; + this.nodedef_group = 'convolution2d'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'box', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'blur_vector2'; + this.desc = "MaterialX:mtlx/convolution2d/blur_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_convolution2d_blur_vector2.nodedef_name = 'ND_blur_vector2'; +mtlx_convolution2d_blur_vector2.nodedef_node = 'blur'; +mtlx_convolution2d_blur_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; +LiteGraph.registerNodeType('mtlx/convolution2d/blur_vector2',mtlx_convolution2d_blur_vector2); + +// MaterialX node type: mtlx/convolution2d/blur_vector3 +// +function mtlx_convolution2d_blur_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_blur_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'blur'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_blur_vector3_out_genglsl.png'; + this.nodedef_group = 'convolution2d'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'box', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'blur_vector3'; + this.desc = "MaterialX:mtlx/convolution2d/blur_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_convolution2d_blur_vector3.nodedef_name = 'ND_blur_vector3'; +mtlx_convolution2d_blur_vector3.nodedef_node = 'blur'; +mtlx_convolution2d_blur_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; +LiteGraph.registerNodeType('mtlx/convolution2d/blur_vector3',mtlx_convolution2d_blur_vector3); + +// MaterialX node type: mtlx/convolution2d/blur_vector4 +// +function mtlx_convolution2d_blur_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_blur_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'blur'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_blur_vector4_out_genglsl.png'; + this.nodedef_group = 'convolution2d'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('size','float'); + this.addProperty('size', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'box', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'blur_vector4'; + this.desc = "MaterialX:mtlx/convolution2d/blur_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_convolution2d_blur_vector4.nodedef_name = 'ND_blur_vector4'; +mtlx_convolution2d_blur_vector4.nodedef_node = 'blur'; +mtlx_convolution2d_blur_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/blur.html'; +LiteGraph.registerNodeType('mtlx/convolution2d/blur_vector4',mtlx_convolution2d_blur_vector4); + +// MaterialX node type: mtlx/convolution2d/heighttonormal_vector3 +// +function mtlx_convolution2d_heighttonormal_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_heighttonormal_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'heighttonormal'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/heighttonormal.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_heighttonormal_vector3_out_genglsl.png'; + this.nodedef_group = 'convolution2d'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','float'); + this.addProperty('scale', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'heighttonormal_vector3'; + this.desc = "MaterialX:mtlx/convolution2d/heighttonormal_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_convolution2d_heighttonormal_vector3.nodedef_name = 'ND_heighttonormal_vector3'; +mtlx_convolution2d_heighttonormal_vector3.nodedef_node = 'heighttonormal'; +mtlx_convolution2d_heighttonormal_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/heighttonormal.html'; +LiteGraph.registerNodeType('mtlx/convolution2d/heighttonormal_vector3',mtlx_convolution2d_heighttonormal_vector3); + +// MaterialX node type: mtlx/organization/dot_float +// +function mtlx_organization_dot_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_float_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','float'); + this.addProperty('in', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'dot_float'; + this.desc = "MaterialX:mtlx/organization/dot_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_organization_dot_float.nodedef_name = 'ND_dot_float'; +mtlx_organization_dot_float.nodedef_node = 'dot'; +mtlx_organization_dot_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_float',mtlx_organization_dot_float); + +// MaterialX node type: mtlx/organization/dot_color3 +// +function mtlx_organization_dot_color3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_color3'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_color3_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','color3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'dot_color3'; + this.desc = "MaterialX:mtlx/organization/dot_color3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_organization_dot_color3.nodedef_name = 'ND_dot_color3'; +mtlx_organization_dot_color3.nodedef_node = 'dot'; +mtlx_organization_dot_color3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_color3',mtlx_organization_dot_color3); + +// MaterialX node type: mtlx/organization/dot_color4 +// +function mtlx_organization_dot_color4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_color4'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_color4_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','color4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'dot_color4'; + this.desc = "MaterialX:mtlx/organization/dot_color4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_organization_dot_color4.nodedef_name = 'ND_dot_color4'; +mtlx_organization_dot_color4.nodedef_node = 'dot'; +mtlx_organization_dot_color4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_color4',mtlx_organization_dot_color4); + +// MaterialX node type: mtlx/organization/dot_vector2 +// +function mtlx_organization_dot_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_vector2_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','vector2'); + this.addProperty('in', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'dot_vector2'; + this.desc = "MaterialX:mtlx/organization/dot_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_organization_dot_vector2.nodedef_name = 'ND_dot_vector2'; +mtlx_organization_dot_vector2.nodedef_node = 'dot'; +mtlx_organization_dot_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_vector2',mtlx_organization_dot_vector2); + +// MaterialX node type: mtlx/organization/dot_vector3 +// +function mtlx_organization_dot_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_vector3_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','vector3'); + this.addProperty('in', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'dot_vector3'; + this.desc = "MaterialX:mtlx/organization/dot_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_organization_dot_vector3.nodedef_name = 'ND_dot_vector3'; +mtlx_organization_dot_vector3.nodedef_node = 'dot'; +mtlx_organization_dot_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_vector3',mtlx_organization_dot_vector3); + +// MaterialX node type: mtlx/organization/dot_vector4 +// +function mtlx_organization_dot_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_vector4_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','vector4'); + this.addProperty('in', [0.0, 0.0, 0.0, 0.0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'dot_vector4'; + this.desc = "MaterialX:mtlx/organization/dot_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_organization_dot_vector4.nodedef_name = 'ND_dot_vector4'; +mtlx_organization_dot_vector4.nodedef_node = 'dot'; +mtlx_organization_dot_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_vector4',mtlx_organization_dot_vector4); + +// MaterialX node type: mtlx/organization/dot_boolean +// +function mtlx_organization_dot_boolean() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_boolean'; + this.nodedef_type = 'boolean'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_boolean_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','boolean'); + this.addProperty('in', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','boolean'); + this.title = 'dot_boolean'; + this.desc = "MaterialX:mtlx/organization/dot_boolean"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#48A'; +} +mtlx_organization_dot_boolean.nodedef_name = 'ND_dot_boolean'; +mtlx_organization_dot_boolean.nodedef_node = 'dot'; +mtlx_organization_dot_boolean.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_boolean',mtlx_organization_dot_boolean); + +// MaterialX node type: mtlx/organization/dot_integer +// +function mtlx_organization_dot_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_integer_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','integer'); + this.addProperty('in', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'dot_integer'; + this.desc = "MaterialX:mtlx/organization/dot_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_organization_dot_integer.nodedef_name = 'ND_dot_integer'; +mtlx_organization_dot_integer.nodedef_node = 'dot'; +mtlx_organization_dot_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_integer',mtlx_organization_dot_integer); + +// MaterialX node type: mtlx/organization/dot_matrix33 +// +function mtlx_organization_dot_matrix33() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_matrix33'; + this.nodedef_type = 'matrix33'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_matrix33_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','matrix33'); + this.addProperty('in', [1.0,0.0,0.0, 0.0,1.0,0.0, 0.0,0.0,1.0], 'matrix33',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix33'); + this.title = 'dot_matrix33'; + this.desc = "MaterialX:mtlx/organization/dot_matrix33"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#333'; +} +mtlx_organization_dot_matrix33.nodedef_name = 'ND_dot_matrix33'; +mtlx_organization_dot_matrix33.nodedef_node = 'dot'; +mtlx_organization_dot_matrix33.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_matrix33',mtlx_organization_dot_matrix33); + +// MaterialX node type: mtlx/organization/dot_matrix44 +// +function mtlx_organization_dot_matrix44() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_matrix44'; + this.nodedef_type = 'matrix44'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_matrix44_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','matrix44'); + this.addProperty('in', [1.0,0.0,0.0,0.0, 0.0,1.0,0.0,0.0, 0.0,0.0,1.0,0.0, 0.0,0.0,0.0,1.0], 'matrix44',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','matrix44'); + this.title = 'dot_matrix44'; + this.desc = "MaterialX:mtlx/organization/dot_matrix44"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#444'; +} +mtlx_organization_dot_matrix44.nodedef_name = 'ND_dot_matrix44'; +mtlx_organization_dot_matrix44.nodedef_node = 'dot'; +mtlx_organization_dot_matrix44.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_matrix44',mtlx_organization_dot_matrix44); + +// MaterialX node type: mtlx/organization/dot_string +// +function mtlx_organization_dot_string() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_string'; + this.nodedef_type = 'string'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_string_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','string'); + this.addProperty('in', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','string'); + this.title = 'dot_string'; + this.desc = "MaterialX:mtlx/organization/dot_string"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#888'; +} +mtlx_organization_dot_string.nodedef_name = 'ND_dot_string'; +mtlx_organization_dot_string.nodedef_node = 'dot'; +mtlx_organization_dot_string.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_string',mtlx_organization_dot_string); + +// MaterialX node type: mtlx/organization/dot_filename +// +function mtlx_organization_dot_filename() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_filename'; + this.nodedef_type = 'filename'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_filename_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','filename'); + this.addProperty('in', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','filename'); + this.title = 'dot_filename'; + this.desc = "MaterialX:mtlx/organization/dot_filename"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#58E'; +} +mtlx_organization_dot_filename.nodedef_name = 'ND_dot_filename'; +mtlx_organization_dot_filename.nodedef_node = 'dot'; +mtlx_organization_dot_filename.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_filename',mtlx_organization_dot_filename); + +// MaterialX node type: mtlx/organization/dot_surfaceshader +// +function mtlx_organization_dot_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','surfaceshader'); + this.addProperty('in', '', 'surfaceshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'dot_surfaceshader'; + this.desc = "MaterialX:mtlx/organization/dot_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_organization_dot_surfaceshader.nodedef_name = 'ND_dot_surfaceshader'; +mtlx_organization_dot_surfaceshader.nodedef_node = 'dot'; +mtlx_organization_dot_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_surfaceshader',mtlx_organization_dot_surfaceshader); + +// MaterialX node type: mtlx/organization/dot_displacementshader +// +function mtlx_organization_dot_displacementshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_displacementshader'; + this.nodedef_type = 'displacementshader'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_displacementshader_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','displacementshader'); + this.addProperty('in', '', 'displacementshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','displacementshader'); + this.title = 'dot_displacementshader'; + this.desc = "MaterialX:mtlx/organization/dot_displacementshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_organization_dot_displacementshader.nodedef_name = 'ND_dot_displacementshader'; +mtlx_organization_dot_displacementshader.nodedef_node = 'dot'; +mtlx_organization_dot_displacementshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_displacementshader',mtlx_organization_dot_displacementshader); + +// MaterialX node type: mtlx/organization/dot_volumeshader +// +function mtlx_organization_dot_volumeshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_volumeshader'; + this.nodedef_type = 'volumeshader'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_volumeshader_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','volumeshader'); + this.addProperty('in', '', 'volumeshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','volumeshader'); + this.title = 'dot_volumeshader'; + this.desc = "MaterialX:mtlx/organization/dot_volumeshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_organization_dot_volumeshader.nodedef_name = 'ND_dot_volumeshader'; +mtlx_organization_dot_volumeshader.nodedef_node = 'dot'; +mtlx_organization_dot_volumeshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_volumeshader',mtlx_organization_dot_volumeshader); + +// MaterialX node type: mtlx/organization/dot_lightshader +// +function mtlx_organization_dot_lightshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_dot_lightshader'; + this.nodedef_type = 'lightshader'; + this.nodedef_node = 'dot'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_dot_lightshader_out_genglsl.png'; + this.nodedef_group = 'organization'; + this.addInput('in','lightshader'); + this.addProperty('in', '', 'lightshader',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('note','string'); + this.addProperty('note', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','lightshader'); + this.title = 'dot_lightshader'; + this.desc = "MaterialX:mtlx/organization/dot_lightshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_organization_dot_lightshader.nodedef_name = 'ND_dot_lightshader'; +mtlx_organization_dot_lightshader.nodedef_node = 'dot'; +mtlx_organization_dot_lightshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/dot.html'; +LiteGraph.registerNodeType('mtlx/organization/dot_lightshader',mtlx_organization_dot_lightshader); + +// MaterialX node type: mtlx/pbr/gltf_pbr_surfaceshader +// +function mtlx_pbr_gltf_pbr_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gltf_pbr_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'gltf_pbr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_pbr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gltf_pbr_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('base_color','color3'); + this.addProperty('base_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Base Color","uimin":"0, 0, 0","uimax":"1, 1, 1","uifolder":"Base"}); + this.addInput('metallic','float'); + this.addProperty('metallic', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Metallic","uimin":"0","uimax":"1","uifolder":"Base"}); + this.addInput('roughness','float'); + this.addProperty('roughness', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Roughness","uimin":"0","uimax":"1","uifolder":"Base"}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":"Base"}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Tangent","uimin":null,"uimax":null,"uifolder":"Base"}); + this.addInput('occlusion','float'); + this.addProperty('occlusion', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Occlusion","uimin":"0","uimax":"1","uifolder":"Base"}); + this.addInput('transmission','float'); + this.addProperty('transmission', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission","uimin":"0","uimax":"1","uifolder":"Base"}); + this.addInput('specular','float'); + this.addProperty('specular', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular","uimin":"0","uimax":"1","uifolder":"Base"}); + this.addInput('specular_color','color3'); + this.addProperty('specular_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Color","uimin":"0, 0, 0","uimax":null,"uifolder":"Base"}); + this.addInput('ior','float'); + this.addProperty('ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Index of Refraction","uimin":"1","uimax":null,"uifolder":"Base"}); + this.addInput('alpha','float'); + this.addProperty('alpha', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Alpha","uimin":"0","uimax":"1","uifolder":"Alpha"}); + this.addInput('alpha_mode','integer'); + this.addProperty('alpha_mode', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Alpha Mode","uimin":null,"uimax":null,"uifolder":"Alpha"}); + this.addInput('alpha_cutoff','float'); + this.addProperty('alpha_cutoff', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Alpha Cutoff","uimin":"0","uimax":"1","uifolder":"Alpha"}); + this.addInput('iridescence','float'); + this.addProperty('iridescence', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Iridescence","uimin":"0","uimax":"1","uifolder":"Iridescence"}); + this.addInput('iridescence_ior','float'); + this.addProperty('iridescence_ior', 1.3, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Iridescence Index of Refraction","uimin":"1","uimax":null,"uifolder":"Iridescence"}); + this.addInput('iridescence_thickness','float'); + this.addProperty('iridescence_thickness', 100, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Iridescence Thickness","uimin":"0","uimax":null,"uifolder":"Iridescence"}); + this.addInput('sheen_color','color3'); + this.addProperty('sheen_color', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Sheen Color","uimin":"0, 0, 0","uimax":"1, 1, 1","uifolder":"Sheen"}); + this.addInput('sheen_roughness','float'); + this.addProperty('sheen_roughness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Sheen Roughness","uimin":"0","uimax":"1","uifolder":"Sheen"}); + this.addInput('clearcoat','float'); + this.addProperty('clearcoat', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Clearcoat","uimin":"0","uimax":"1","uifolder":"Clearcoat"}); + this.addInput('clearcoat_roughness','float'); + this.addProperty('clearcoat_roughness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Clearcoat Roughness","uimin":"0","uimax":"1","uifolder":"Clearcoat"}); + this.addInput('clearcoat_normal','vector3'); + this.addProperty('clearcoat_normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Clearcoat Normal","uimin":null,"uimax":null,"uifolder":"Clearcoat"}); + this.addInput('emissive','color3'); + this.addProperty('emissive', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Emissive","uimin":"0, 0, 0","uimax":"1, 1, 1","uifolder":"Emission"}); + this.addInput('emissive_strength','float'); + this.addProperty('emissive_strength', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Emissive Strength","uimin":"0","uimax":null,"uifolder":"Emission"}); + this.addInput('thickness','float'); + this.addProperty('thickness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thickness","uimin":"0","uimax":null,"uifolder":"Volume"}); + this.addInput('attenuation_distance','float'); + this.addProperty('attenuation_distance', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Attenuation Distance","uimin":"0","uimax":null,"uifolder":"Volume"}); + this.addInput('attenuation_color','color3'); + this.addProperty('attenuation_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Attenuation Color","uimin":"0, 0, 0","uimax":"1, 1, 1","uifolder":"Volume"}); + this.addOutput('out','surfaceshader'); + this.title = 'gltf_pbr_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/gltf_pbr_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_gltf_pbr_surfaceshader.nodedef_name = 'ND_gltf_pbr_surfaceshader'; +mtlx_pbr_gltf_pbr_surfaceshader.nodedef_node = 'gltf_pbr'; +mtlx_pbr_gltf_pbr_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_pbr.html'; +LiteGraph.registerNodeType('mtlx/pbr/gltf_pbr_surfaceshader',mtlx_pbr_gltf_pbr_surfaceshader); + +// MaterialX node type: mtlx/texture2d/gltf_colorimage +// +function mtlx_texture2d_gltf_colorimage() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gltf_colorimage'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'gltf_colorimage'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_colorimage.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gltf_colorimage_outcolor_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('default','color4'); + this.addProperty('default', [0, 0, 0, 0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('rotate','float'); + this.addProperty('rotate', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"360","uifolder":"Image"}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('operationorder','integer'); + this.addProperty('operationorder', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('color','color4'); + this.addProperty('color', [1, 1, 1, 1], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Color"}); + this.addInput('geomcolor','color4'); + this.addProperty('geomcolor', [1, 1, 1, 1], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"Geometry Color","uimin":null,"uimax":null,"uifolder":"Color"}); + this.addOutput('outcolor','color3'); + this.addOutput('outa','float'); + this.title = 'gltf_colorimage_multioutput'; + this.desc = "MaterialX:mtlx/texture2d/gltf_colorimage"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_texture2d_gltf_colorimage.nodedef_name = 'ND_gltf_colorimage'; +mtlx_texture2d_gltf_colorimage.nodedef_node = 'gltf_colorimage'; +mtlx_texture2d_gltf_colorimage.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_colorimage.html'; +LiteGraph.registerNodeType('mtlx/texture2d/gltf_colorimage',mtlx_texture2d_gltf_colorimage); + +// MaterialX node type: mtlx/texture2d/gltf_image_color3_color3_1_0 +// +function mtlx_texture2d_gltf_image_color3_color3_1_0() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gltf_image_color3_color3_1_0'; + this.nodedef_type = 'color3'; + this.nodedef_node = 'gltf_image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gltf_image_color3_color3_1_0_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('factor','color3'); + this.addProperty('factor', [1,1,1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color3'); + this.addProperty('default', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('rotate','float'); + this.addProperty('rotate', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"360","uifolder":""}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('operationorder','integer'); + this.addProperty('operationorder', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color3'); + this.title = 'gltf_image_color3'; + this.desc = "MaterialX:mtlx/texture2d/gltf_image_color3_color3_1_0"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#679'; +} +mtlx_texture2d_gltf_image_color3_color3_1_0.nodedef_name = 'ND_gltf_image_color3_color3_1_0'; +mtlx_texture2d_gltf_image_color3_color3_1_0.nodedef_node = 'gltf_image'; +mtlx_texture2d_gltf_image_color3_color3_1_0.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/gltf_image_color3_color3_1_0',mtlx_texture2d_gltf_image_color3_color3_1_0); + +// MaterialX node type: mtlx/texture2d/gltf_image_color4_color4_1_0 +// +function mtlx_texture2d_gltf_image_color4_color4_1_0() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gltf_image_color4_color4_1_0'; + this.nodedef_type = 'color4'; + this.nodedef_node = 'gltf_image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gltf_image_color4_color4_1_0_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('factor','color4'); + this.addProperty('factor', [1,1,1,1], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','color4'); + this.addProperty('default', [0, 0, 0, 0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('rotate','float'); + this.addProperty('rotate', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"360","uifolder":""}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('operationorder','integer'); + this.addProperty('operationorder', 1, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','color4'); + this.title = 'gltf_image_color4'; + this.desc = "MaterialX:mtlx/texture2d/gltf_image_color4_color4_1_0"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#899'; +} +mtlx_texture2d_gltf_image_color4_color4_1_0.nodedef_name = 'ND_gltf_image_color4_color4_1_0'; +mtlx_texture2d_gltf_image_color4_color4_1_0.nodedef_node = 'gltf_image'; +mtlx_texture2d_gltf_image_color4_color4_1_0.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/gltf_image_color4_color4_1_0',mtlx_texture2d_gltf_image_color4_color4_1_0); + +// MaterialX node type: mtlx/texture2d/gltf_image_float_float_1_0 +// +function mtlx_texture2d_gltf_image_float_float_1_0() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gltf_image_float_float_1_0'; + this.nodedef_type = 'float'; + this.nodedef_node = 'gltf_image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gltf_image_float_float_1_0_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('factor','float'); + this.addProperty('factor', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','float'); + this.addProperty('default', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('rotate','float'); + this.addProperty('rotate', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"360","uifolder":""}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('operationorder','integer'); + this.addProperty('operationorder', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'gltf_image_float'; + this.desc = "MaterialX:mtlx/texture2d/gltf_image_float_float_1_0"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_texture2d_gltf_image_float_float_1_0.nodedef_name = 'ND_gltf_image_float_float_1_0'; +mtlx_texture2d_gltf_image_float_float_1_0.nodedef_node = 'gltf_image'; +mtlx_texture2d_gltf_image_float_float_1_0.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/gltf_image_float_float_1_0',mtlx_texture2d_gltf_image_float_float_1_0); + +// MaterialX node type: mtlx/texture2d/gltf_image_vector3_vector3_1_0 +// +function mtlx_texture2d_gltf_image_vector3_vector3_1_0() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gltf_image_vector3_vector3_1_0'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'gltf_image'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_image.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gltf_image_vector3_vector3_1_0_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector3'); + this.addProperty('default', [0, 0, 0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('rotate','float'); + this.addProperty('rotate', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"360","uifolder":""}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('operationorder','integer'); + this.addProperty('operationorder', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'gltf_image_vector3'; + this.desc = "MaterialX:mtlx/texture2d/gltf_image_vector3_vector3_1_0"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_texture2d_gltf_image_vector3_vector3_1_0.nodedef_name = 'ND_gltf_image_vector3_vector3_1_0'; +mtlx_texture2d_gltf_image_vector3_vector3_1_0.nodedef_node = 'gltf_image'; +mtlx_texture2d_gltf_image_vector3_vector3_1_0.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_image.html'; +LiteGraph.registerNodeType('mtlx/texture2d/gltf_image_vector3_vector3_1_0',mtlx_texture2d_gltf_image_vector3_vector3_1_0); + +// MaterialX node type: mtlx/texture2d/gltf_normalmap_vector3_1_0 +// +function mtlx_texture2d_gltf_normalmap_vector3_1_0() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gltf_normalmap_vector3_1_0'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'gltf_normalmap'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_normalmap.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gltf_normalmap_vector3_1_0_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('default','vector3'); + this.addProperty('default', [0.5, 0.5, 1], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('rotate','float'); + this.addProperty('rotate', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"360","uifolder":""}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('operationorder','integer'); + this.addProperty('operationorder', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'gltf_normalmap_vector3'; + this.desc = "MaterialX:mtlx/texture2d/gltf_normalmap_vector3_1_0"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_texture2d_gltf_normalmap_vector3_1_0.nodedef_name = 'ND_gltf_normalmap_vector3_1_0'; +mtlx_texture2d_gltf_normalmap_vector3_1_0.nodedef_node = 'gltf_normalmap'; +mtlx_texture2d_gltf_normalmap_vector3_1_0.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_normalmap.html'; +LiteGraph.registerNodeType('mtlx/texture2d/gltf_normalmap_vector3_1_0',mtlx_texture2d_gltf_normalmap_vector3_1_0); + +// MaterialX node type: mtlx/texture2d/gltf_iridescence_thickness_float_1_0 +// +function mtlx_texture2d_gltf_iridescence_thickness_float_1_0() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_gltf_iridescence_thickness_float_1_0'; + this.nodedef_type = 'float'; + this.nodedef_node = 'gltf_iridescence_thickness'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_iridescence_thickness.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_gltf_iridescence_thickness_float_1_0_out_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('default','vector3'); + this.addProperty('default', [0, 0, 0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('texcoord','vector2'); + this.addProperty('texcoord', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('pivot','vector2'); + this.addProperty('pivot', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('rotate','float'); + this.addProperty('rotate', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('offset','vector2'); + this.addProperty('offset', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('uaddressmode','string'); + this.addProperty('uaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('vaddressmode','string'); + this.addProperty('vaddressmode', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('filtertype','string'); + this.addProperty('filtertype', 'linear', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Image"}); + this.addInput('thicknessMin','float'); + this.addProperty('thicknessMin', 100, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Thickness"}); + this.addInput('thicknessMax','float'); + this.addProperty('thicknessMax', 400, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":"Thickness"}); + this.addOutput('out','float'); + this.title = 'gltf_iridescence_thickness_float'; + this.desc = "MaterialX:mtlx/texture2d/gltf_iridescence_thickness_float_1_0"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_texture2d_gltf_iridescence_thickness_float_1_0.nodedef_name = 'ND_gltf_iridescence_thickness_float_1_0'; +mtlx_texture2d_gltf_iridescence_thickness_float_1_0.nodedef_node = 'gltf_iridescence_thickness'; +mtlx_texture2d_gltf_iridescence_thickness_float_1_0.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/gltf_iridescence_thickness.html'; +LiteGraph.registerNodeType('mtlx/texture2d/gltf_iridescence_thickness_float_1_0',mtlx_texture2d_gltf_iridescence_thickness_float_1_0); + +// MaterialX node type: mtlx/pbr/UsdPreviewSurface_surfaceshader +// +function mtlx_pbr_UsdPreviewSurface_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdPreviewSurface_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'UsdPreviewSurface'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPreviewSurface.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdPreviewSurface_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('diffuseColor','color3'); + this.addProperty('diffuseColor', [0.18, 0.18, 0.18], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0,0,0","uimax":"1,1,1","uifolder":""}); + this.addInput('emissiveColor','color3'); + this.addProperty('emissiveColor', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0,0,0","uimax":null,"uifolder":""}); + this.addInput('useSpecularWorkflow','integer'); + this.addProperty('useSpecularWorkflow', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0","uimax":"1","uifolder":""}); + this.addInput('specularColor','color3'); + this.addProperty('specularColor', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0,0,0","uimax":"1,1,1","uifolder":""}); + this.addInput('metallic','float'); + this.addProperty('metallic', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('clearcoat','float'); + this.addProperty('clearcoat', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('clearcoatRoughness','float'); + this.addProperty('clearcoatRoughness', 0.01, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('opacity','float'); + this.addProperty('opacity', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('opacityThreshold','float'); + this.addProperty('opacityThreshold', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('ior','float'); + this.addProperty('ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0, 0, 1], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":[-1,-1,-1],"uimax":[1,1,1],"uifolder":""}); + this.addInput('displacement','float'); + this.addProperty('displacement', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('occlusion','float'); + this.addProperty('occlusion', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'UsdPreviewSurface_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/UsdPreviewSurface_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_UsdPreviewSurface_surfaceshader.nodedef_name = 'ND_UsdPreviewSurface_surfaceshader'; +mtlx_pbr_UsdPreviewSurface_surfaceshader.nodedef_node = 'UsdPreviewSurface'; +mtlx_pbr_UsdPreviewSurface_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPreviewSurface.html'; +LiteGraph.registerNodeType('mtlx/pbr/UsdPreviewSurface_surfaceshader',mtlx_pbr_UsdPreviewSurface_surfaceshader); + +// MaterialX node type: mtlx/texture2d/UsdUVTexture +// +function mtlx_texture2d_UsdUVTexture() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdUVTexture'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'UsdUVTexture'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdUVTexture.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdUVTexture_r_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('st','vector2'); + this.addProperty('st', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('wrapS','string'); + this.addProperty('wrapS', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('wrapT','string'); + this.addProperty('wrapT', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','color4'); + this.addProperty('fallback', [0, 0, 0, 1], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','color4'); + this.addProperty('scale', [1, 1, 1, 1], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bias','color4'); + this.addProperty('bias', [0, 0, 0, 0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('r','float'); + this.addOutput('g','float'); + this.addOutput('b','float'); + this.addOutput('a','float'); + this.addOutput('rgb','color3'); + this.addOutput('rgba','color4'); + this.title = 'UsdUVTexture_multioutput'; + this.desc = "MaterialX:mtlx/texture2d/UsdUVTexture"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_texture2d_UsdUVTexture.nodedef_name = 'ND_UsdUVTexture'; +mtlx_texture2d_UsdUVTexture.nodedef_node = 'UsdUVTexture'; +mtlx_texture2d_UsdUVTexture.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdUVTexture.html'; +LiteGraph.registerNodeType('mtlx/texture2d/UsdUVTexture',mtlx_texture2d_UsdUVTexture); + +// MaterialX node type: mtlx/texture2d/UsdUVTexture_23 +// +function mtlx_texture2d_UsdUVTexture_23() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdUVTexture_23'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'UsdUVTexture'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdUVTexture.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdUVTexture_23_r_genglsl.png'; + this.nodedef_group = 'texture2d'; + this.addInput('file','filename'); + this.addProperty('file', '', 'filename',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('st','vector2'); + this.addProperty('st', [0.0, 0.0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('wrapS','string'); + this.addProperty('wrapS', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('wrapT','string'); + this.addProperty('wrapT', 'periodic', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','color4'); + this.addProperty('fallback', [0, 0, 0, 1], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','color4'); + this.addProperty('scale', [1, 1, 1, 1], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('bias','color4'); + this.addProperty('bias', [0, 0, 0, 0], 'color4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('r','float'); + this.addOutput('g','float'); + this.addOutput('b','float'); + this.addOutput('a','float'); + this.addOutput('rgb','color3'); + this.title = 'UsdUVTexture_multioutput'; + this.desc = "MaterialX:mtlx/texture2d/UsdUVTexture_23"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_texture2d_UsdUVTexture_23.nodedef_name = 'ND_UsdUVTexture_23'; +mtlx_texture2d_UsdUVTexture_23.nodedef_node = 'UsdUVTexture'; +mtlx_texture2d_UsdUVTexture_23.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdUVTexture.html'; +LiteGraph.registerNodeType('mtlx/texture2d/UsdUVTexture_23',mtlx_texture2d_UsdUVTexture_23); + +// MaterialX node type: mtlx/geometric/UsdPrimvarReader_integer +// +function mtlx_geometric_UsdPrimvarReader_integer() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdPrimvarReader_integer'; + this.nodedef_type = 'integer'; + this.nodedef_node = 'UsdPrimvarReader'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdPrimvarReader_integer_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('varname','string'); + this.addProperty('varname', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','integer'); + this.addProperty('fallback', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','integer'); + this.title = 'UsdPrimvarReader_integer'; + this.desc = "MaterialX:mtlx/geometric/UsdPrimvarReader_integer"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_geometric_UsdPrimvarReader_integer.nodedef_name = 'ND_UsdPrimvarReader_integer'; +mtlx_geometric_UsdPrimvarReader_integer.nodedef_node = 'UsdPrimvarReader'; +mtlx_geometric_UsdPrimvarReader_integer.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; +LiteGraph.registerNodeType('mtlx/geometric/UsdPrimvarReader_integer',mtlx_geometric_UsdPrimvarReader_integer); + +// MaterialX node type: mtlx/geometric/UsdPrimvarReader_boolean +// +function mtlx_geometric_UsdPrimvarReader_boolean() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdPrimvarReader_boolean'; + this.nodedef_type = 'boolean'; + this.nodedef_node = 'UsdPrimvarReader'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdPrimvarReader_boolean_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('varname','string'); + this.addProperty('varname', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','boolean'); + this.addProperty('fallback', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','boolean'); + this.title = 'UsdPrimvarReader_boolean'; + this.desc = "MaterialX:mtlx/geometric/UsdPrimvarReader_boolean"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#48A'; +} +mtlx_geometric_UsdPrimvarReader_boolean.nodedef_name = 'ND_UsdPrimvarReader_boolean'; +mtlx_geometric_UsdPrimvarReader_boolean.nodedef_node = 'UsdPrimvarReader'; +mtlx_geometric_UsdPrimvarReader_boolean.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; +LiteGraph.registerNodeType('mtlx/geometric/UsdPrimvarReader_boolean',mtlx_geometric_UsdPrimvarReader_boolean); + +// MaterialX node type: mtlx/geometric/UsdPrimvarReader_string +// +function mtlx_geometric_UsdPrimvarReader_string() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdPrimvarReader_string'; + this.nodedef_type = 'string'; + this.nodedef_node = 'UsdPrimvarReader'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdPrimvarReader_string_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('varname','string'); + this.addProperty('varname', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','string'); + this.addProperty('fallback', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','string'); + this.title = 'UsdPrimvarReader_string'; + this.desc = "MaterialX:mtlx/geometric/UsdPrimvarReader_string"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#888'; +} +mtlx_geometric_UsdPrimvarReader_string.nodedef_name = 'ND_UsdPrimvarReader_string'; +mtlx_geometric_UsdPrimvarReader_string.nodedef_node = 'UsdPrimvarReader'; +mtlx_geometric_UsdPrimvarReader_string.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; +LiteGraph.registerNodeType('mtlx/geometric/UsdPrimvarReader_string',mtlx_geometric_UsdPrimvarReader_string); + +// MaterialX node type: mtlx/geometric/UsdPrimvarReader_float +// +function mtlx_geometric_UsdPrimvarReader_float() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdPrimvarReader_float'; + this.nodedef_type = 'float'; + this.nodedef_node = 'UsdPrimvarReader'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdPrimvarReader_float_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('varname','string'); + this.addProperty('varname', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','float'); + this.addProperty('fallback', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','float'); + this.title = 'UsdPrimvarReader_float'; + this.desc = "MaterialX:mtlx/geometric/UsdPrimvarReader_float"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#753'; +} +mtlx_geometric_UsdPrimvarReader_float.nodedef_name = 'ND_UsdPrimvarReader_float'; +mtlx_geometric_UsdPrimvarReader_float.nodedef_node = 'UsdPrimvarReader'; +mtlx_geometric_UsdPrimvarReader_float.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; +LiteGraph.registerNodeType('mtlx/geometric/UsdPrimvarReader_float',mtlx_geometric_UsdPrimvarReader_float); + +// MaterialX node type: mtlx/geometric/UsdPrimvarReader_vector2 +// +function mtlx_geometric_UsdPrimvarReader_vector2() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdPrimvarReader_vector2'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'UsdPrimvarReader'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdPrimvarReader_vector2_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('varname','string'); + this.addProperty('varname', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','vector2'); + this.addProperty('fallback', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'UsdPrimvarReader_vector2'; + this.desc = "MaterialX:mtlx/geometric/UsdPrimvarReader_vector2"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_geometric_UsdPrimvarReader_vector2.nodedef_name = 'ND_UsdPrimvarReader_vector2'; +mtlx_geometric_UsdPrimvarReader_vector2.nodedef_node = 'UsdPrimvarReader'; +mtlx_geometric_UsdPrimvarReader_vector2.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; +LiteGraph.registerNodeType('mtlx/geometric/UsdPrimvarReader_vector2',mtlx_geometric_UsdPrimvarReader_vector2); + +// MaterialX node type: mtlx/geometric/UsdPrimvarReader_vector3 +// +function mtlx_geometric_UsdPrimvarReader_vector3() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdPrimvarReader_vector3'; + this.nodedef_type = 'vector3'; + this.nodedef_node = 'UsdPrimvarReader'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdPrimvarReader_vector3_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('varname','string'); + this.addProperty('varname', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','vector3'); + this.addProperty('fallback', [0, 0, 0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector3'); + this.title = 'UsdPrimvarReader_vector3'; + this.desc = "MaterialX:mtlx/geometric/UsdPrimvarReader_vector3"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A76'; +} +mtlx_geometric_UsdPrimvarReader_vector3.nodedef_name = 'ND_UsdPrimvarReader_vector3'; +mtlx_geometric_UsdPrimvarReader_vector3.nodedef_node = 'UsdPrimvarReader'; +mtlx_geometric_UsdPrimvarReader_vector3.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; +LiteGraph.registerNodeType('mtlx/geometric/UsdPrimvarReader_vector3',mtlx_geometric_UsdPrimvarReader_vector3); + +// MaterialX node type: mtlx/geometric/UsdPrimvarReader_vector4 +// +function mtlx_geometric_UsdPrimvarReader_vector4() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdPrimvarReader_vector4'; + this.nodedef_type = 'vector4'; + this.nodedef_node = 'UsdPrimvarReader'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdPrimvarReader_vector4_out_genglsl.png'; + this.nodedef_group = 'geometric'; + this.addInput('varname','string'); + this.addProperty('varname', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('fallback','vector4'); + this.addProperty('fallback', [0, 0, 0, 0], 'vector4',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector4'); + this.title = 'UsdPrimvarReader_vector4'; + this.desc = "MaterialX:mtlx/geometric/UsdPrimvarReader_vector4"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A98'; +} +mtlx_geometric_UsdPrimvarReader_vector4.nodedef_name = 'ND_UsdPrimvarReader_vector4'; +mtlx_geometric_UsdPrimvarReader_vector4.nodedef_node = 'UsdPrimvarReader'; +mtlx_geometric_UsdPrimvarReader_vector4.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdPrimvarReader.html'; +LiteGraph.registerNodeType('mtlx/geometric/UsdPrimvarReader_vector4',mtlx_geometric_UsdPrimvarReader_vector4); + +// MaterialX node type: mtlx/math/UsdTransform2d +// +function mtlx_math_UsdTransform2d() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_UsdTransform2d'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'UsdTransform2d'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdTransform2d.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_UsdTransform2d_out_genglsl.png'; + this.nodedef_group = 'math'; + this.addInput('in','vector2'); + this.addProperty('in', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('rotation','float'); + this.addProperty('rotation', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scale','vector2'); + this.addProperty('scale', [1, 1], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('translation','vector2'); + this.addProperty('translation', [0, 0], 'vector2',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'UsdTransform2d_vector2'; + this.desc = "MaterialX:mtlx/math/UsdTransform2d"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_math_UsdTransform2d.nodedef_name = 'ND_UsdTransform2d'; +mtlx_math_UsdTransform2d.nodedef_node = 'UsdTransform2d'; +mtlx_math_UsdTransform2d.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/UsdTransform2d.html'; +LiteGraph.registerNodeType('mtlx/math/UsdTransform2d',mtlx_math_UsdTransform2d); + +// MaterialX node type: mtlx/pbr/standard_surface_surfaceshader +// +function mtlx_pbr_standard_surface_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_standard_surface_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'standard_surface'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/standard_surface.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_standard_surface_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('base','float'); + this.addProperty('base', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Base","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('base_color','color3'); + this.addProperty('base_color', [0.8, 0.8, 0.8], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Base Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Base"}); + this.addInput('diffuse_roughness','float'); + this.addProperty('diffuse_roughness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Diffuse Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('metalness','float'); + this.addProperty('metalness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Metalness","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('specular','float'); + this.addProperty('specular', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('specular_color','color3'); + this.addProperty('specular_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Specular"}); + this.addInput('specular_roughness','float'); + this.addProperty('specular_roughness', 0.2, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('specular_IOR','float'); + this.addProperty('specular_IOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Specular"}); + this.addInput('specular_anisotropy','float'); + this.addProperty('specular_anisotropy', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Anisotropy","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('specular_rotation','float'); + this.addProperty('specular_rotation', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Rotation","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('transmission','float'); + this.addProperty('transmission', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission","uimin":"0.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('transmission_color','color3'); + this.addProperty('transmission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Transmission"}); + this.addInput('transmission_depth','float'); + this.addProperty('transmission_depth', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Depth","uimin":"0.0","uimax":null,"uifolder":"Transmission"}); + this.addInput('transmission_scatter','color3'); + this.addProperty('transmission_scatter', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Scatter","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Transmission"}); + this.addInput('transmission_scatter_anisotropy','float'); + this.addProperty('transmission_scatter_anisotropy', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Anisotropy","uimin":"0.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('transmission_dispersion','float'); + this.addProperty('transmission_dispersion', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Dispersion","uimin":"0.0","uimax":null,"uifolder":"Transmission"}); + this.addInput('transmission_extra_roughness','float'); + this.addProperty('transmission_extra_roughness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Roughness","uimin":"-1.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('subsurface','float'); + this.addProperty('subsurface', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface","uimin":"0.0","uimax":"1.0","uifolder":"Subsurface"}); + this.addInput('subsurface_color','color3'); + this.addProperty('subsurface_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Subsurface"}); + this.addInput('subsurface_radius','color3'); + this.addProperty('subsurface_radius', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Radius","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Subsurface"}); + this.addInput('subsurface_scale','float'); + this.addProperty('subsurface_scale', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Scale","uimin":"0.0","uimax":null,"uifolder":"Subsurface"}); + this.addInput('subsurface_anisotropy','float'); + this.addProperty('subsurface_anisotropy', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Anisotropy","uimin":"-1.0","uimax":"1.0","uifolder":"Subsurface"}); + this.addInput('sheen','float'); + this.addProperty('sheen', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Sheen","uimin":"0.0","uimax":"1.0","uifolder":"Sheen"}); + this.addInput('sheen_color','color3'); + this.addProperty('sheen_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Sheen Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Sheen"}); + this.addInput('sheen_roughness','float'); + this.addProperty('sheen_roughness', 0.3, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Sheen Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Sheen"}); + this.addInput('coat','float'); + this.addProperty('coat', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_color','color3'); + this.addProperty('coat_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Coat"}); + this.addInput('coat_roughness','float'); + this.addProperty('coat_roughness', 0.1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_anisotropy','float'); + this.addProperty('coat_anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Anisotropy","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_rotation','float'); + this.addProperty('coat_rotation', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Rotation","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_IOR','float'); + this.addProperty('coat_IOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Coat"}); + this.addInput('coat_normal','vector3'); + this.addProperty('coat_normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Coat normal","uimin":null,"uimax":null,"uifolder":"Coat"}); + this.addInput('coat_affect_color','float'); + this.addProperty('coat_affect_color', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Affect Color","uimin":"0","uimax":"1","uifolder":"Coat"}); + this.addInput('coat_affect_roughness','float'); + this.addProperty('coat_affect_roughness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Affect Roughness","uimin":"0","uimax":"1","uifolder":"Coat"}); + this.addInput('thin_film_thickness','float'); + this.addProperty('thin_film_thickness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Film Thickness","uimin":"0.0","uimax":null,"uifolder":"Thin Film"}); + this.addInput('thin_film_IOR','float'); + this.addProperty('thin_film_IOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Film Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Thin Film"}); + this.addInput('emission','float'); + this.addProperty('emission', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Emission","uimin":"0.0","uimax":null,"uifolder":"Emission"}); + this.addInput('emission_color','color3'); + this.addProperty('emission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Emission Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Emission"}); + this.addInput('opacity','color3'); + this.addProperty('opacity', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Opacity","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Geometry"}); + this.addInput('thin_walled','boolean'); + this.addProperty('thin_walled', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Walled","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Tangent Input","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addOutput('out','surfaceshader'); + this.title = 'standard_surface_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/standard_surface_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_standard_surface_surfaceshader.nodedef_name = 'ND_standard_surface_surfaceshader'; +mtlx_pbr_standard_surface_surfaceshader.nodedef_node = 'standard_surface'; +mtlx_pbr_standard_surface_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/standard_surface.html'; +LiteGraph.registerNodeType('mtlx/pbr/standard_surface_surfaceshader',mtlx_pbr_standard_surface_surfaceshader); + +// MaterialX node type: mtlx/pbr/standard_surface_surfaceshader_100 +// +function mtlx_pbr_standard_surface_surfaceshader_100() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_standard_surface_surfaceshader_100'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'standard_surface'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/standard_surface.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_standard_surface_surfaceshader_100_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('base','float'); + this.addProperty('base', 0.8, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Base","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('base_color','color3'); + this.addProperty('base_color', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Base Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Base"}); + this.addInput('diffuse_roughness','float'); + this.addProperty('diffuse_roughness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Diffuse Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('metalness','float'); + this.addProperty('metalness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Metalness","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('specular','float'); + this.addProperty('specular', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('specular_color','color3'); + this.addProperty('specular_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Specular"}); + this.addInput('specular_roughness','float'); + this.addProperty('specular_roughness', 0.2, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('specular_IOR','float'); + this.addProperty('specular_IOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Specular"}); + this.addInput('specular_anisotropy','float'); + this.addProperty('specular_anisotropy', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Anisotropy","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('specular_rotation','float'); + this.addProperty('specular_rotation', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Rotation","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('transmission','float'); + this.addProperty('transmission', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission","uimin":"0.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('transmission_color','color3'); + this.addProperty('transmission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Transmission"}); + this.addInput('transmission_depth','float'); + this.addProperty('transmission_depth', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Depth","uimin":"0.0","uimax":null,"uifolder":"Transmission"}); + this.addInput('transmission_scatter','color3'); + this.addProperty('transmission_scatter', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Scatter","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Transmission"}); + this.addInput('transmission_scatter_anisotropy','float'); + this.addProperty('transmission_scatter_anisotropy', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Anisotropy","uimin":"0.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('transmission_dispersion','float'); + this.addProperty('transmission_dispersion', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Dispersion","uimin":"0.0","uimax":null,"uifolder":"Transmission"}); + this.addInput('transmission_extra_roughness','float'); + this.addProperty('transmission_extra_roughness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Roughness","uimin":"-1.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('subsurface','float'); + this.addProperty('subsurface', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface","uimin":"0.0","uimax":"1.0","uifolder":"Subsurface"}); + this.addInput('subsurface_color','color3'); + this.addProperty('subsurface_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Subsurface"}); + this.addInput('subsurface_radius','color3'); + this.addProperty('subsurface_radius', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Radius","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Subsurface"}); + this.addInput('subsurface_scale','float'); + this.addProperty('subsurface_scale', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Scale","uimin":"0.0","uimax":null,"uifolder":"Subsurface"}); + this.addInput('subsurface_anisotropy','float'); + this.addProperty('subsurface_anisotropy', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Anisotropy","uimin":"-1.0","uimax":"1.0","uifolder":"Subsurface"}); + this.addInput('sheen','float'); + this.addProperty('sheen', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Sheen","uimin":"0.0","uimax":"1.0","uifolder":"Sheen"}); + this.addInput('sheen_color','color3'); + this.addProperty('sheen_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Sheen Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Sheen"}); + this.addInput('sheen_roughness','float'); + this.addProperty('sheen_roughness', 0.3, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Sheen Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Sheen"}); + this.addInput('coat','float'); + this.addProperty('coat', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_color','color3'); + this.addProperty('coat_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Coat"}); + this.addInput('coat_roughness','float'); + this.addProperty('coat_roughness', 0.1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_anisotropy','float'); + this.addProperty('coat_anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Anisotropy","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_rotation','float'); + this.addProperty('coat_rotation', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Rotation","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_IOR','float'); + this.addProperty('coat_IOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Coat"}); + this.addInput('coat_normal','vector3'); + this.addProperty('coat_normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Coat normal","uimin":null,"uimax":null,"uifolder":"Coat"}); + this.addInput('coat_affect_color','float'); + this.addProperty('coat_affect_color', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Affect Color","uimin":"0","uimax":"1","uifolder":"Coat"}); + this.addInput('coat_affect_roughness','float'); + this.addProperty('coat_affect_roughness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Affect Roughness","uimin":"0","uimax":"1","uifolder":"Coat"}); + this.addInput('thin_film_thickness','float'); + this.addProperty('thin_film_thickness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Film Thickness","uimin":"0.0","uimax":null,"uifolder":"Thin Film"}); + this.addInput('thin_film_IOR','float'); + this.addProperty('thin_film_IOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Film Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Thin Film"}); + this.addInput('emission','float'); + this.addProperty('emission', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Emission","uimin":"0.0","uimax":null,"uifolder":"Emission"}); + this.addInput('emission_color','color3'); + this.addProperty('emission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Emission Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Emission"}); + this.addInput('opacity','color3'); + this.addProperty('opacity', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Opacity","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Geometry"}); + this.addInput('thin_walled','boolean'); + this.addProperty('thin_walled', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Walled","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addInput('tangent','vector3'); + this.addProperty('tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Tangent Input","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addOutput('out','surfaceshader'); + this.title = 'standard_surface_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/standard_surface_surfaceshader_100"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_standard_surface_surfaceshader_100.nodedef_name = 'ND_standard_surface_surfaceshader_100'; +mtlx_pbr_standard_surface_surfaceshader_100.nodedef_node = 'standard_surface'; +mtlx_pbr_standard_surface_surfaceshader_100.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/standard_surface.html'; +LiteGraph.registerNodeType('mtlx/pbr/standard_surface_surfaceshader_100',mtlx_pbr_standard_surface_surfaceshader_100); + +// MaterialX node type: mtlx/pbr/disney_brdf_2012_surface +// +function mtlx_pbr_disney_brdf_2012_surface() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_disney_brdf_2012_surface'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'disney_brdf_2012'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/disney_brdf_2012.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_disney_brdf_2012_surface_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('baseColor','color3'); + this.addProperty('baseColor', [0.16, 0.16, 0.16], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('metallic','float'); + this.addProperty('metallic', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('subsurface','float'); + this.addProperty('subsurface', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specular','float'); + this.addProperty('specular', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specularTint','float'); + this.addProperty('specularTint', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('anisotropic','float'); + this.addProperty('anisotropic', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('sheen','float'); + this.addProperty('sheen', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('sheenTint','float'); + this.addProperty('sheenTint', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('clearcoat','float'); + this.addProperty('clearcoat', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('clearcoatGloss','float'); + this.addProperty('clearcoatGloss', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'disney_brdf_2012_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/disney_brdf_2012_surface"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_disney_brdf_2012_surface.nodedef_name = 'ND_disney_brdf_2012_surface'; +mtlx_pbr_disney_brdf_2012_surface.nodedef_node = 'disney_brdf_2012'; +mtlx_pbr_disney_brdf_2012_surface.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/disney_brdf_2012.html'; +LiteGraph.registerNodeType('mtlx/pbr/disney_brdf_2012_surface',mtlx_pbr_disney_brdf_2012_surface); + +// MaterialX node type: mtlx/pbr/disney_bsdf_2015_surface +// +function mtlx_pbr_disney_bsdf_2015_surface() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_disney_bsdf_2015_surface'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'disney_bsdf_2015'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/disney_bsdf_2015.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_disney_bsdf_2015_surface_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('baseColor','color3'); + this.addProperty('baseColor', [0.16, 0.16, 0.16], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('metallic','float'); + this.addProperty('metallic', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('anisotropic','float'); + this.addProperty('anisotropic', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specularTint','float'); + this.addProperty('specularTint', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('sheen','float'); + this.addProperty('sheen', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('sheenTint','float'); + this.addProperty('sheenTint', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('clearcoat','float'); + this.addProperty('clearcoat', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('clearcoatGloss','float'); + this.addProperty('clearcoatGloss', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specTrans','float'); + this.addProperty('specTrans', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('ior','float'); + this.addProperty('ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('scatterDistance','vector3'); + this.addProperty('scatterDistance', [0, 0, 0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('flatness','float'); + this.addProperty('flatness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('diffTrans','float'); + this.addProperty('diffTrans', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('thin','boolean'); + this.addProperty('thin', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','surfaceshader'); + this.title = 'disney_bsdf_2015_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/disney_bsdf_2015_surface"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_disney_bsdf_2015_surface.nodedef_name = 'ND_disney_bsdf_2015_surface'; +mtlx_pbr_disney_bsdf_2015_surface.nodedef_node = 'disney_bsdf_2015'; +mtlx_pbr_disney_bsdf_2015_surface.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/disney_bsdf_2015.html'; +LiteGraph.registerNodeType('mtlx/pbr/disney_bsdf_2015_surface',mtlx_pbr_disney_bsdf_2015_surface); + +// MaterialX node type: mtlx/pbr/open_pbr_surface_surfaceshader +// +function mtlx_pbr_open_pbr_surface_surfaceshader() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_open_pbr_surface_surfaceshader'; + this.nodedef_type = 'surfaceshader'; + this.nodedef_node = 'open_pbr_surface'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/open_pbr_surface.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_open_pbr_surface_surfaceshader_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('base_weight','float'); + this.addProperty('base_weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Base Weight","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('base_color','color3'); + this.addProperty('base_color', [0.8, 0.8, 0.8], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Base Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Base"}); + this.addInput('base_diffuse_roughness','float'); + this.addProperty('base_diffuse_roughness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Base Diffuse Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('base_metalness','float'); + this.addProperty('base_metalness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Base Metalness","uimin":"0.0","uimax":"1.0","uifolder":"Base"}); + this.addInput('specular_weight','float'); + this.addProperty('specular_weight', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Weight","uimin":"0.0","uimax":null,"uifolder":"Specular"}); + this.addInput('specular_color','color3'); + this.addProperty('specular_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Specular"}); + this.addInput('specular_roughness','float'); + this.addProperty('specular_roughness', 0.3, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('specular_ior','float'); + this.addProperty('specular_ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Specular"}); + this.addInput('specular_roughness_anisotropy','float'); + this.addProperty('specular_roughness_anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Specular Anisotropy","uimin":"0.0","uimax":"1.0","uifolder":"Specular"}); + this.addInput('transmission_weight','float'); + this.addProperty('transmission_weight', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Weight","uimin":"0.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('transmission_color','color3'); + this.addProperty('transmission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Transmission"}); + this.addInput('transmission_depth','float'); + this.addProperty('transmission_depth', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Depth","uimin":"0.0","uimax":null,"uifolder":"Transmission"}); + this.addInput('transmission_scatter','color3'); + this.addProperty('transmission_scatter', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Scatter","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Transmission"}); + this.addInput('transmission_scatter_anisotropy','float'); + this.addProperty('transmission_scatter_anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Anisotropy","uimin":"-1.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('transmission_dispersion_scale','float'); + this.addProperty('transmission_dispersion_scale', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Dispersion Scale","uimin":"0.0","uimax":"1.0","uifolder":"Transmission"}); + this.addInput('transmission_dispersion_abbe_number','float'); + this.addProperty('transmission_dispersion_abbe_number', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Dispersion Abbe Number","uimin":"0.0","uimax":null,"uifolder":"Transmission"}); + this.addInput('subsurface_weight','float'); + this.addProperty('subsurface_weight', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Weight","uimin":"0.0","uimax":"1.0","uifolder":"Subsurface"}); + this.addInput('subsurface_color','color3'); + this.addProperty('subsurface_color', [0.8, 0.8, 0.8], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Subsurface"}); + this.addInput('subsurface_radius','float'); + this.addProperty('subsurface_radius', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Radius","uimin":"0.0","uimax":null,"uifolder":"Subsurface"}); + this.addInput('subsurface_radius_scale','color3'); + this.addProperty('subsurface_radius_scale', [1.0, 0.5, 0.25], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Radius Scale","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Subsurface"}); + this.addInput('subsurface_scatter_anisotropy','float'); + this.addProperty('subsurface_scatter_anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Subsurface Anisotropy","uimin":"-1.0","uimax":"1.0","uifolder":"Subsurface"}); + this.addInput('fuzz_weight','float'); + this.addProperty('fuzz_weight', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Fuzz Weight","uimin":"0.0","uimax":"1.0","uifolder":"Fuzz"}); + this.addInput('fuzz_color','color3'); + this.addProperty('fuzz_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Fuzz Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Fuzz"}); + this.addInput('fuzz_roughness','float'); + this.addProperty('fuzz_roughness', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Fuzz Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Fuzz"}); + this.addInput('coat_weight','float'); + this.addProperty('coat_weight', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Weight","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_color','color3'); + this.addProperty('coat_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Coat"}); + this.addInput('coat_roughness','float'); + this.addProperty('coat_roughness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_roughness_anisotropy','float'); + this.addProperty('coat_roughness_anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Anisotropy","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('coat_ior','float'); + this.addProperty('coat_ior', 1.6, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Coat"}); + this.addInput('coat_darkening','float'); + this.addProperty('coat_darkening', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Darkening","uimin":"0.0","uimax":"1.0","uifolder":"Coat"}); + this.addInput('thin_film_weight','float'); + this.addProperty('thin_film_weight', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Film Weight","uimin":"0.0","uimax":"1.0","uifolder":"Thin Film"}); + this.addInput('thin_film_thickness','float'); + this.addProperty('thin_film_thickness', 0.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Film Thickness","uimin":"0.0","uimax":null,"uifolder":"Thin Film"}); + this.addInput('thin_film_ior','float'); + this.addProperty('thin_film_ior', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Film Index of Refraction","uimin":"0.0","uimax":null,"uifolder":"Thin Film"}); + this.addInput('emission_luminance','float'); + this.addProperty('emission_luminance', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Emission Luminance","uimin":"0.0","uimax":null,"uifolder":"Emission"}); + this.addInput('emission_color','color3'); + this.addProperty('emission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Emission Color","uimin":"0,0,0","uimax":"1,1,1","uifolder":"Emission"}); + this.addInput('geometry_opacity','float'); + this.addProperty('geometry_opacity', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Opacity","uimin":"0","uimax":"1","uifolder":"Geometry"}); + this.addInput('geometry_thin_walled','boolean'); + this.addProperty('geometry_thin_walled', true, 'boolean',{"colorspace":"","unit":"","unittype":"","uiname":"Thin Walled","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addInput('geometry_normal','vector3'); + this.addProperty('geometry_normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addInput('geometry_coat_normal','vector3'); + this.addProperty('geometry_coat_normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Normal","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addInput('geometry_tangent','vector3'); + this.addProperty('geometry_tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Tangent","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addInput('geometry_coat_tangent','vector3'); + this.addProperty('geometry_coat_tangent', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Coat Tangent","uimin":null,"uimax":null,"uifolder":"Geometry"}); + this.addOutput('out','surfaceshader'); + this.title = 'open_pbr_surface_surfaceshader'; + this.desc = "MaterialX:mtlx/pbr/open_pbr_surface_surfaceshader"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#232'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_open_pbr_surface_surfaceshader.nodedef_name = 'ND_open_pbr_surface_surfaceshader'; +mtlx_pbr_open_pbr_surface_surfaceshader.nodedef_node = 'open_pbr_surface'; +mtlx_pbr_open_pbr_surface_surfaceshader.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/open_pbr_surface.html'; +LiteGraph.registerNodeType('mtlx/pbr/open_pbr_surface_surfaceshader',mtlx_pbr_open_pbr_surface_surfaceshader); + +// MaterialX node type: mtlx/pbr/open_pbr_anisotropy +// +function mtlx_pbr_open_pbr_anisotropy() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_open_pbr_anisotropy'; + this.nodedef_type = 'vector2'; + this.nodedef_node = 'open_pbr_anisotropy'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/open_pbr_anisotropy.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_open_pbr_anisotropy_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('roughness','float'); + this.addProperty('roughness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('anisotropy','float'); + this.addProperty('anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('out','vector2'); + this.title = 'open_pbr_anisotropy_vector2'; + this.desc = "MaterialX:mtlx/pbr/open_pbr_anisotropy"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; + this.boxcolor = '#A32'; +} +mtlx_pbr_open_pbr_anisotropy.nodedef_name = 'ND_open_pbr_anisotropy'; +mtlx_pbr_open_pbr_anisotropy.nodedef_node = 'open_pbr_anisotropy'; +mtlx_pbr_open_pbr_anisotropy.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/open_pbr_anisotropy.html'; +LiteGraph.registerNodeType('mtlx/pbr/open_pbr_anisotropy',mtlx_pbr_open_pbr_anisotropy); + +// MaterialX node type: mtlx/pbr/lama_sheen +// +function mtlx_pbr_lama_sheen() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_sheen'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaSheen'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaSheen.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_sheen_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color','color3'); + this.addProperty('color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Color","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Main"}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addOutput('out','BSDF'); + this.title = 'LamaSheen_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_sheen"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_sheen.nodedef_name = 'ND_lama_sheen'; +mtlx_pbr_lama_sheen.nodedef_node = 'LamaSheen'; +mtlx_pbr_lama_sheen.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaSheen.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_sheen',mtlx_pbr_lama_sheen); + +// MaterialX node type: mtlx/pbr/lama_sss +// +function mtlx_pbr_lama_sss() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_sss'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaSSS'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaSSS.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_sss_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color','color3'); + this.addProperty('color', [0.18, 0.18, 0.18], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Color","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('sssRadius','color3'); + this.addProperty('sssRadius', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Radius","uimin":null,"uimax":null,"uifolder":"SSS"}); + this.addInput('sssScale','float'); + this.addProperty('sssScale', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Scale","uimin":null,"uimax":null,"uifolder":"SSS"}); + this.addInput('sssMode','integer'); + this.addProperty('sssMode', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Mode","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('sssIOR','float'); + this.addProperty('sssIOR', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"IOR","uimin":"1.0","uimax":"2.0","uifolder":"SSS"}); + this.addInput('sssAnisotropy','float'); + this.addProperty('sssAnisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Anisotropy","uimin":"-1.0","uimax":"1.0","uifolder":"SSS"}); + this.addInput('sssBleed','float'); + this.addProperty('sssBleed', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Bleed","uimin":"0.0","uimax":"1.0","uifolder":"SSS"}); + this.addInput('sssFollowTopology','float'); + this.addProperty('sssFollowTopology', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Follow Topology","uimin":"0.0","uimax":"1.0","uifolder":"SSS"}); + this.addInput('sssSubset','string'); + this.addProperty('sssSubset', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Subset","uimin":null,"uimax":null,"uifolder":"SSS"}); + this.addInput('sssContinuationRays','integer'); + this.addProperty('sssContinuationRays', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Continuation Rays","uimin":null,"uimax":null,"uifolder":"SSS"}); + this.addInput('sssUnitLength','float'); + this.addProperty('sssUnitLength', 0.00328, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Unit Length","uimin":null,"uimax":null,"uifolder":"SSS"}); + this.addInput('mode','integer'); + this.addProperty('mode', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Mode","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addInput('albedoInversionMethod','integer'); + this.addProperty('albedoInversionMethod', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Albedo Inversion Method","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addInput('diffuseLobeName','string'); + this.addProperty('diffuseLobeName', 'diffuse', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Diffuse Lobe Name","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addInput('sssEntryLobeName','string'); + this.addProperty('sssEntryLobeName', 'irradiance', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"SSS Entry Lobe Name","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addInput('sssExitLobeName','string'); + this.addProperty('sssExitLobeName', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"SSS Exit Lobe Name","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addInput('sssId','integer'); + this.addProperty('sssId', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"SSS Id","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addInput('matte','string'); + this.addProperty('matte', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Matte","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addOutput('out','BSDF'); + this.title = 'LamaSSS_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_sss"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_sss.nodedef_name = 'ND_lama_sss'; +mtlx_pbr_lama_sss.nodedef_node = 'LamaSSS'; +mtlx_pbr_lama_sss.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaSSS.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_sss',mtlx_pbr_lama_sss); + +// MaterialX node type: mtlx/pbr/lama_translucent +// +function mtlx_pbr_lama_translucent() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_translucent'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaTranslucent'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaTranslucent.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_translucent_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color','color3'); + this.addProperty('color', [0.18, 0.18, 0.18], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Roughness","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('energyCompensation','float'); + this.addProperty('energyCompensation', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Energy Compensation","uimin":"0.0","uimax":"1.0","uifolder":"Advanced"}); + this.addInput('lobeName','string'); + this.addProperty('lobeName', 'diffuse', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Lobe Name","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addInput('matte','string'); + this.addProperty('matte', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Matte","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addOutput('out','BSDF'); + this.title = 'LamaTranslucent_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_translucent"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_translucent.nodedef_name = 'ND_lama_translucent'; +mtlx_pbr_lama_translucent.nodedef_node = 'LamaTranslucent'; +mtlx_pbr_lama_translucent.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaTranslucent.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_translucent',mtlx_pbr_lama_translucent); + +// MaterialX node type: mtlx/pbr/lama_conductor +// +function mtlx_pbr_lama_conductor() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_conductor'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaConductor'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaConductor.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_conductor_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('tint','color3'); + this.addProperty('tint', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Tint","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('fresnelMode','integer'); + this.addProperty('fresnelMode', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Fresnel Mode","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('IOR','vector3'); + this.addProperty('IOR', [0.180000007153,0.419999986887,1.37000000477], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"IOR","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('extinction','vector3'); + this.addProperty('extinction', [3.42000007629,2.34999990463,1.76999998093], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Extinction","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('reflectivity','color3'); + this.addProperty('reflectivity', [0.9450, 0.7772, 0.3737], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Reflectivity","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('edgeColor','color3'); + this.addProperty('edgeColor', [0.9979, 0.9813, 0.7523], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Edge Color","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Main"}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('anisotropy','float'); + this.addProperty('anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Anisotropy","uimin":"-1.0","uimax":"1.0","uifolder":"Anisotropy"}); + this.addInput('anisotropyDirection','vector3'); + this.addProperty('anisotropyDirection', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Direction","uimin":null,"uimax":null,"uifolder":"Anisotropy"}); + this.addInput('anisotropyRotation','float'); + this.addProperty('anisotropyRotation', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Rotation","uimin":null,"uimax":null,"uifolder":"Anisotropy"}); + this.addInput('iridescenceThickness','float'); + this.addProperty('iridescenceThickness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Thickness","uimin":"0.0","uimax":null,"uifolder":"Iridescence"}); + this.addInput('iridescenceIOR','float'); + this.addProperty('iridescenceIOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"IOR","uimin":"1.0","uimax":"3.0","uifolder":"Iridescence"}); + this.addInput('exteriorIOR','float'); + this.addProperty('exteriorIOR', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Exterior IOR","uimin":"1.0","uimax":"3.0","uifolder":"Advanced"}); + this.addOutput('out','BSDF'); + this.title = 'LamaConductor_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_conductor"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_conductor.nodedef_name = 'ND_lama_conductor'; +mtlx_pbr_lama_conductor.nodedef_node = 'LamaConductor'; +mtlx_pbr_lama_conductor.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaConductor.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_conductor',mtlx_pbr_lama_conductor); + +// MaterialX node type: mtlx/pbr/lama_dielectric +// +function mtlx_pbr_lama_dielectric() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_dielectric'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaDielectric'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaDielectric.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_dielectric_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('reflectionTint','color3'); + this.addProperty('reflectionTint', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Reflection Tint","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('transmissionTint','color3'); + this.addProperty('transmissionTint', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Transmission Tint","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('fresnelMode','integer'); + this.addProperty('fresnelMode', 0, 'integer',{"colorspace":"","unit":"","unittype":"","uiname":"Fresnel Mode","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('IOR','float'); + this.addProperty('IOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"IOR","uimin":"1.0","uimax":"3.0","uifolder":"Main"}); + this.addInput('reflectivity','float'); + this.addProperty('reflectivity', 0.04, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Reflectivity","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Roughness","uimin":"0.0","uimax":"1.0","uifolder":"Main"}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addInput('anisotropy','float'); + this.addProperty('anisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Anisotropy","uimin":"-1.0","uimax":"1.0","uifolder":"Anisotropy"}); + this.addInput('direction','vector3'); + this.addProperty('direction', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Direction","uimin":null,"uimax":null,"uifolder":"Anisotropy"}); + this.addInput('rotation','float'); + this.addProperty('rotation', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Rotation","uimin":null,"uimax":null,"uifolder":"Anisotropy"}); + this.addInput('exteriorIOR','float'); + this.addProperty('exteriorIOR', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Exterior IOR","uimin":"1.0","uimax":"3.0","uifolder":"Advanced"}); + this.addInput('absorptionColor','color3'); + this.addProperty('absorptionColor', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Absorption Color","uimin":null,"uimax":null,"uifolder":"Interior"}); + this.addInput('absorptionRadius','float'); + this.addProperty('absorptionRadius', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Absorption Radius","uimin":null,"uimax":null,"uifolder":"Interior"}); + this.addInput('scatterColor','color3'); + this.addProperty('scatterColor', [0.0, 0.0, 0.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Scatter Color","uimin":null,"uimax":null,"uifolder":"Interior"}); + this.addInput('scatterAnisotropy','float'); + this.addProperty('scatterAnisotropy', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Scatter Anisotropy","uimin":"-1.0","uimax":"1.0","uifolder":"Interior"}); + this.addOutput('out','BSDF'); + this.title = 'LamaDielectric_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_dielectric"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_dielectric.nodedef_name = 'ND_lama_dielectric'; +mtlx_pbr_lama_dielectric.nodedef_node = 'LamaDielectric'; +mtlx_pbr_lama_dielectric.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaDielectric.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_dielectric',mtlx_pbr_lama_dielectric); + +// MaterialX node type: mtlx/pbr/lama_add_bsdf +// +function mtlx_pbr_lama_add_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_add_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaAdd'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaAdd.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_add_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('material1','BSDF'); + this.addProperty('material1', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material 1","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('material2','BSDF'); + this.addProperty('material2', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material 2","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('weight1','float'); + this.addProperty('weight1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Weight 1","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('weight2','float'); + this.addProperty('weight2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Weight 2","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'LamaAdd_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_add_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_add_bsdf.nodedef_name = 'ND_lama_add_bsdf'; +mtlx_pbr_lama_add_bsdf.nodedef_node = 'LamaAdd'; +mtlx_pbr_lama_add_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaAdd.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_add_bsdf',mtlx_pbr_lama_add_bsdf); + +// MaterialX node type: mtlx/pbr/lama_add_edf +// +function mtlx_pbr_lama_add_edf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_add_edf'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'LamaAdd'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaAdd.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_add_edf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('material1','EDF'); + this.addProperty('material1', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material 1","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('material2','EDF'); + this.addProperty('material2', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material 2","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('weight1','float'); + this.addProperty('weight1', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Weight 1","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('weight2','float'); + this.addProperty('weight2', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Weight 2","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'LamaAdd_EDF'; + this.desc = "MaterialX:mtlx/pbr/lama_add_edf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_add_edf.nodedef_name = 'ND_lama_add_edf'; +mtlx_pbr_lama_add_edf.nodedef_node = 'LamaAdd'; +mtlx_pbr_lama_add_edf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaAdd.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_add_edf',mtlx_pbr_lama_add_edf); + +// MaterialX node type: mtlx/pbr/lama_diffuse +// +function mtlx_pbr_lama_diffuse() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_diffuse'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaDiffuse'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaDiffuse.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_diffuse_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color','color3'); + this.addProperty('color', [0.18, 0.18, 0.18], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Color","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('roughness','float'); + this.addProperty('roughness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Roughness","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.0, 0.0, 0.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"Normal","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('energyCompensation','float'); + this.addProperty('energyCompensation', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Energy Compensation","uimin":"0.0","uimax":"1.0","uifolder":"Advanced"}); + this.addInput('lobeName','string'); + this.addProperty('lobeName', 'diffuse', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Lobe Name","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addInput('matte','string'); + this.addProperty('matte', '', 'string',{"colorspace":"","unit":"","unittype":"","uiname":"Matte","uimin":null,"uimax":null,"uifolder":"Advanced"}); + this.addOutput('out','BSDF'); + this.title = 'LamaDiffuse_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_diffuse"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_diffuse.nodedef_name = 'ND_lama_diffuse'; +mtlx_pbr_lama_diffuse.nodedef_node = 'LamaDiffuse'; +mtlx_pbr_lama_diffuse.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaDiffuse.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_diffuse',mtlx_pbr_lama_diffuse); + +// MaterialX node type: mtlx/pbr/lama_mix_bsdf +// +function mtlx_pbr_lama_mix_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_mix_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaMix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaMix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_mix_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('material1','BSDF'); + this.addProperty('material1', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material 1","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('material2','BSDF'); + this.addProperty('material2', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material 2","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'LamaMix_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_mix_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_mix_bsdf.nodedef_name = 'ND_lama_mix_bsdf'; +mtlx_pbr_lama_mix_bsdf.nodedef_node = 'LamaMix'; +mtlx_pbr_lama_mix_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaMix.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_mix_bsdf',mtlx_pbr_lama_mix_bsdf); + +// MaterialX node type: mtlx/pbr/lama_mix_edf +// +function mtlx_pbr_lama_mix_edf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_mix_edf'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'LamaMix'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaMix.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_mix_edf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('material1','EDF'); + this.addProperty('material1', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material 1","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('material2','EDF'); + this.addProperty('material2', '', 'EDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material 2","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('mix','float'); + this.addProperty('mix', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addOutput('out','EDF'); + this.title = 'LamaMix_EDF'; + this.desc = "MaterialX:mtlx/pbr/lama_mix_edf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_mix_edf.nodedef_name = 'ND_lama_mix_edf'; +mtlx_pbr_lama_mix_edf.nodedef_node = 'LamaMix'; +mtlx_pbr_lama_mix_edf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaMix.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_mix_edf',mtlx_pbr_lama_mix_edf); + +// MaterialX node type: mtlx/pbr/lama_emission +// +function mtlx_pbr_lama_emission() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_emission'; + this.nodedef_type = 'EDF'; + this.nodedef_node = 'LamaEmission'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaEmission.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_emission_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('color','color3'); + this.addProperty('color', [1.0, 1.0, 1.0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"Color","uimin":null,"uimax":null,"uifolder":"Main"}); + this.addOutput('out','EDF'); + this.title = 'LamaEmission_EDF'; + this.desc = "MaterialX:mtlx/pbr/lama_emission"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_emission.nodedef_name = 'ND_lama_emission'; +mtlx_pbr_lama_emission.nodedef_node = 'LamaEmission'; +mtlx_pbr_lama_emission.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaEmission.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_emission',mtlx_pbr_lama_emission); + +// MaterialX node type: mtlx/pbr/lama_layer_bsdf +// +function mtlx_pbr_lama_layer_bsdf() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_lama_layer_bsdf'; + this.nodedef_type = 'BSDF'; + this.nodedef_node = 'LamaLayer'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaLayer.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_lama_layer_bsdf_out_genglsl.png'; + this.nodedef_group = 'pbr'; + this.addInput('materialTop','BSDF'); + this.addProperty('materialTop', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material Top","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('materialBase','BSDF'); + this.addProperty('materialBase', '', 'BSDF',{"colorspace":"","unit":"","unittype":"","uiname":"Material Base","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('topMix','float'); + this.addProperty('topMix', 1.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Top Mix","uimin":"0.0","uimax":"1.0","uifolder":""}); + this.addInput('topThickness','float'); + this.addProperty('topThickness', 0.0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"Top Thickness","uimin":"0.0","uimax":null,"uifolder":""}); + this.addOutput('out','BSDF'); + this.title = 'LamaLayer_BSDF'; + this.desc = "MaterialX:mtlx/pbr/lama_layer_bsdf"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_pbr_lama_layer_bsdf.nodedef_name = 'ND_lama_layer_bsdf'; +mtlx_pbr_lama_layer_bsdf.nodedef_node = 'LamaLayer'; +mtlx_pbr_lama_layer_bsdf.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/LamaLayer.html'; +LiteGraph.registerNodeType('mtlx/pbr/lama_layer_bsdf',mtlx_pbr_lama_layer_bsdf); + +// MaterialX node type: mtlx/translation/standard_surface_to_gltf_pbr +// +function mtlx_translation_standard_surface_to_gltf_pbr() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_standard_surface_to_gltf_pbr'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'standard_surface_to_gltf_pbr'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/standard_surface_to_gltf_pbr.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_standard_surface_to_gltf_pbr_base_color_out_genglsl.png'; + this.nodedef_group = 'translation'; + this.addInput('base','float'); + this.addProperty('base', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('base_color','color3'); + this.addProperty('base_color', [0.8, 0.8, 0.8], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('metalness','float'); + this.addProperty('metalness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specular_roughness','float'); + this.addProperty('specular_roughness', 0.2, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('transmission','float'); + this.addProperty('transmission', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('transmission_color','color3'); + this.addProperty('transmission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('transmission_depth','float'); + this.addProperty('transmission_depth', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('sheen','float'); + this.addProperty('sheen', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('sheen_color','color3'); + this.addProperty('sheen_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('sheen_roughness','float'); + this.addProperty('sheen_roughness', 0.3, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('coat','float'); + this.addProperty('coat', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('coat_color','color3'); + this.addProperty('coat_color', [0, 0, 0], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('coat_roughness','float'); + this.addProperty('coat_roughness', 0.1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('emission','float'); + this.addProperty('emission', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('emission_color','color3'); + this.addProperty('emission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('base_color_out','color3'); + this.addOutput('metallic_out','float'); + this.addOutput('roughness_out','float'); + this.addOutput('transmission_out','float'); + this.addOutput('thickness_out','float'); + this.addOutput('attenuation_color_out','color3'); + this.addOutput('sheen_color_out','color3'); + this.addOutput('sheen_roughness_out','float'); + this.addOutput('clearcoat_out','float'); + this.addOutput('clearcoat_roughness_out','float'); + this.addOutput('emissive_out','color3'); + this.title = 'standard_surface_to_gltf_pbr_multioutput'; + this.desc = "MaterialX:mtlx/translation/standard_surface_to_gltf_pbr"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_translation_standard_surface_to_gltf_pbr.nodedef_name = 'ND_standard_surface_to_gltf_pbr'; +mtlx_translation_standard_surface_to_gltf_pbr.nodedef_node = 'standard_surface_to_gltf_pbr'; +mtlx_translation_standard_surface_to_gltf_pbr.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/standard_surface_to_gltf_pbr.html'; +LiteGraph.registerNodeType('mtlx/translation/standard_surface_to_gltf_pbr',mtlx_translation_standard_surface_to_gltf_pbr); + +// MaterialX node type: mtlx/translation/standard_surface_to_UsdPreviewSurface +// +function mtlx_translation_standard_surface_to_UsdPreviewSurface() { + this.nodedef_icon = './Images/materialx_logo.webp'; + this.nodedef_name = 'ND_standard_surface_to_UsdPreviewSurface'; + this.nodedef_type = 'multioutput'; + this.nodedef_node = 'standard_surface_to_UsdPreviewSurface'; + this.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/standard_surface_to_UsdPreviewSurface.html'; + this.nodedef_swatch = 'https://materialx.nanmucreative.com/resources/mtlx/nodedef_materials/material_standard_surface_to_UsdPreviewSurface_diffuseColor_out_genglsl.png'; + this.nodedef_group = 'translation'; + this.addInput('metalness','float'); + this.addProperty('metalness', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('base','float'); + this.addProperty('base', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('base_color','color3'); + this.addProperty('base_color', [0.8, 0.8, 0.8], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specular','float'); + this.addProperty('specular', 1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specular_color','color3'); + this.addProperty('specular_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specular_IOR','float'); + this.addProperty('specular_IOR', 1.5, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('specular_roughness','float'); + this.addProperty('specular_roughness', 0.2, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('coat','float'); + this.addProperty('coat', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('coat_color','color3'); + this.addProperty('coat_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('coat_roughness','float'); + this.addProperty('coat_roughness', 0.1, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('emission','float'); + this.addProperty('emission', 0, 'float',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('emission_color','color3'); + this.addProperty('emission_color', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('opacity','color3'); + this.addProperty('opacity', [1, 1, 1], 'color3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addInput('normal','vector3'); + this.addProperty('normal', [0.5, 0.5, 1.0], 'vector3',{"colorspace":"","unit":"","unittype":"","uiname":"","uimin":null,"uimax":null,"uifolder":""}); + this.addOutput('diffuseColor_out','color3'); + this.addOutput('emissiveColor_out','color3'); + this.addOutput('metallic_out','float'); + this.addOutput('roughness_out','float'); + this.addOutput('clearcoat_out','float'); + this.addOutput('clearcoatRoughness_out','float'); + this.addOutput('opacity_out','float'); + this.addOutput('ior_out','float'); + this.addOutput('normal_out','vector3'); + this.title = 'standard_surface_to_UsdPreviewSurface_multioutput'; + this.desc = "MaterialX:mtlx/translation/standard_surface_to_UsdPreviewSurface"; + this.onNodeCreated = function() { + //console.log('Node created:', this); +} + this.onRemoved = function() { + //console.log('Node removed:', this); + } + this.bgcolor = '#111'; + this.color = '#222'; + this.shape = LiteGraph.ROUND_SHAPE; +} +mtlx_translation_standard_surface_to_UsdPreviewSurface.nodedef_name = 'ND_standard_surface_to_UsdPreviewSurface'; +mtlx_translation_standard_surface_to_UsdPreviewSurface.nodedef_node = 'standard_surface_to_UsdPreviewSurface'; +mtlx_translation_standard_surface_to_UsdPreviewSurface.nodedef_href = 'https://materialx.nanmucreative.com/documents/definitions/standard_surface_to_UsdPreviewSurface.html'; +LiteGraph.registerNodeType('mtlx/translation/standard_surface_to_UsdPreviewSurface',mtlx_translation_standard_surface_to_UsdPreviewSurface); diff --git a/javascript/materialxtoy/resources/Images/brass_color.jpg b/javascript/materialxtoy/resources/Images/brass_color.jpg new file mode 100644 index 00000000..047f1619 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/brass_color.jpg differ diff --git a/javascript/materialxtoy/resources/Images/brass_roughness.jpg b/javascript/materialxtoy/resources/Images/brass_roughness.jpg new file mode 100644 index 00000000..2f005401 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/brass_roughness.jpg differ diff --git a/javascript/materialxtoy/resources/Images/brick_base_gray.jpg b/javascript/materialxtoy/resources/Images/brick_base_gray.jpg new file mode 100644 index 00000000..0b77aff1 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/brick_base_gray.jpg differ diff --git a/javascript/materialxtoy/resources/Images/brick_dirt_mask.jpg b/javascript/materialxtoy/resources/Images/brick_dirt_mask.jpg new file mode 100644 index 00000000..b3745644 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/brick_dirt_mask.jpg differ diff --git a/javascript/materialxtoy/resources/Images/brick_mask.jpg b/javascript/materialxtoy/resources/Images/brick_mask.jpg new file mode 100644 index 00000000..66d5439c Binary files /dev/null and b/javascript/materialxtoy/resources/Images/brick_mask.jpg differ diff --git a/javascript/materialxtoy/resources/Images/brick_normal.jpg b/javascript/materialxtoy/resources/Images/brick_normal.jpg new file mode 100644 index 00000000..0f672d82 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/brick_normal.jpg differ diff --git a/javascript/materialxtoy/resources/Images/brick_roughness.jpg b/javascript/materialxtoy/resources/Images/brick_roughness.jpg new file mode 100644 index 00000000..bcf49203 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/brick_roughness.jpg differ diff --git a/javascript/materialxtoy/resources/Images/brick_variation_mask.jpg b/javascript/materialxtoy/resources/Images/brick_variation_mask.jpg new file mode 100644 index 00000000..3ad359b9 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/brick_variation_mask.jpg differ diff --git a/javascript/materialxtoy/resources/Images/cloth.bmp b/javascript/materialxtoy/resources/Images/cloth.bmp new file mode 100644 index 00000000..b6191de9 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/cloth.bmp differ diff --git a/javascript/materialxtoy/resources/Images/cloth.gif b/javascript/materialxtoy/resources/Images/cloth.gif new file mode 100644 index 00000000..d9cd2b48 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/cloth.gif differ diff --git a/javascript/materialxtoy/resources/Images/cloth.jpg b/javascript/materialxtoy/resources/Images/cloth.jpg new file mode 100644 index 00000000..53f55c39 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/cloth.jpg differ diff --git a/javascript/materialxtoy/resources/Images/cloth.png b/javascript/materialxtoy/resources/Images/cloth.png new file mode 100644 index 00000000..c4e3459b Binary files /dev/null and b/javascript/materialxtoy/resources/Images/cloth.png differ diff --git a/javascript/materialxtoy/resources/Images/cloth.tga b/javascript/materialxtoy/resources/Images/cloth.tga new file mode 100644 index 00000000..bd38dd95 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/cloth.tga differ diff --git a/javascript/materialxtoy/resources/Images/greysphere_calibration.png b/javascript/materialxtoy/resources/Images/greysphere_calibration.png new file mode 100644 index 00000000..76bff27d Binary files /dev/null and b/javascript/materialxtoy/resources/Images/greysphere_calibration.png differ diff --git a/javascript/materialxtoy/resources/Images/grid.png b/javascript/materialxtoy/resources/Images/grid.png new file mode 100644 index 00000000..9af2fba9 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/grid.png differ diff --git a/javascript/materialxtoy/resources/Images/mesh_wire_norm.png b/javascript/materialxtoy/resources/Images/mesh_wire_norm.png new file mode 100644 index 00000000..75dc2ccf Binary files /dev/null and b/javascript/materialxtoy/resources/Images/mesh_wire_norm.png differ diff --git a/javascript/materialxtoy/resources/Images/plain_heightmap.png b/javascript/materialxtoy/resources/Images/plain_heightmap.png new file mode 100644 index 00000000..763685fb Binary files /dev/null and b/javascript/materialxtoy/resources/Images/plain_heightmap.png differ diff --git a/javascript/materialxtoy/resources/Images/wood_color.jpg b/javascript/materialxtoy/resources/Images/wood_color.jpg new file mode 100644 index 00000000..c61b13a0 Binary files /dev/null and b/javascript/materialxtoy/resources/Images/wood_color.jpg differ diff --git a/javascript/materialxtoy/resources/Images/wood_roughness.jpg b/javascript/materialxtoy/resources/Images/wood_roughness.jpg new file mode 100644 index 00000000..af292bdd Binary files /dev/null and b/javascript/materialxtoy/resources/Images/wood_roughness.jpg differ diff --git a/javascript/materialxtoy/ui_helpers.js b/javascript/materialxtoy/ui_helpers.js new file mode 100644 index 00000000..e719fbba --- /dev/null +++ b/javascript/materialxtoy/ui_helpers.js @@ -0,0 +1,251 @@ +// UI helpers. + +function setupTheme() { + const body = document.body; + // Check if the user has a preferred color scheme + const prefersDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; + + if (document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')) + prefersDarkMode = true + + // Set the initial theme based on user preferences + if (prefersDarkMode) { + body.setAttribute('data-bs-theme', 'dark'); + } else { + body.setAttribute('data-bs-theme', 'light'); + } +} + +setupTheme(); + +// Interaction for SVG display area +function setUpSVGInteraction(svgContainerId, svgContentId) { + + var svgContainer = document.getElementById(svgContainerId); + var svgContent = document.getElementById(svgContentId); + + var state = { + isPanning: false, + startCoords: { x: 0, y: 0 }, + startViewBox: null + }; + + // Clear or set the style here. Clear max width so that the SVG can be scaled + // to fit the container. + style = svgContent.getAttribute('style') + //svgContent.setAttribute('style', 'max-width:2048px;') + svgContent.setAttribute('style', '') + + // Handle start of panning + function handleMouseDown(event) { + if (event.button !== 0) + return; + + event.preventDefault(); + state.isPanning = true; + state.startCoords.x = event.clientX; + state.startCoords.y = event.clientY; + state.startViewBox = svgContent.getAttribute('viewBox'); + } + + // Handle panning + function handleMouseMove(event) { + if (!state.isPanning) + return; + + event.preventDefault(); + var dx = event.clientX - state.startCoords.x; + var dy = event.clientY - state.startCoords.y; + var viewBox = state.startViewBox.split(' '); + + viewBox[0] -= dx; + viewBox[1] -= dy; + + svgContent.setAttribute('viewBox', viewBox.join(' ')); + } + + // Handle stop of panning + function handleMouseUp(event) { + if (event.button !== 0) + return; + + event.preventDefault(); + state.isPanning = false; + } + + // Handle zooming + function handleWheel(event) { + event.preventDefault(); + + var delta = Math.max(-1, Math.min(1, (event.deltaY || -event.detail))); + var viewBox = svgContent.getAttribute('viewBox').split(' '); + + var scaleFactor = delta > 0 ? 1.1 : 0.9; + + var containerWidth = svgContainer.offsetWidth; + var containerHeight = svgContainer.offsetHeight; + + var center = { + x: containerWidth / 2, + y: containerHeight / 2 + }; + + var oldWidth = parseFloat(viewBox[2]); + var oldHeight = parseFloat(viewBox[3]); + var newWidth = oldWidth / scaleFactor; + var newHeight = oldHeight / scaleFactor; + + var deltaX = (oldWidth - newWidth) * (center.x / containerWidth); + var deltaY = (oldHeight - newHeight) * (center.y / containerHeight); + + var newX = parseFloat(viewBox[0]) + deltaX; + var newY = parseFloat(viewBox[1]) + deltaY; + + viewBox[0] = newX; + viewBox[1] = newY; + viewBox[2] = newWidth; + viewBox[3] = newHeight; + + svgContent.setAttribute('viewBox', viewBox.join(' ')); + } + + // Set up event handling + svgContainer.addEventListener('mousedown', handleMouseDown); + svgContainer.addEventListener('mousemove', handleMouseMove); + svgContainer.addEventListener('mouseup', handleMouseUp); + svgContainer.addEventListener('mouseleave', handleMouseUp); + svgContainer.addEventListener('wheel', handleWheel); +}; + +function copyContentToClipboard(button) { + var targetId = button.getAttribute('data-target'); + var element = document.getElementById(targetId); + + if (!element) { + console.error('Element not found'); + return; + } + + var textToCopy = element.value; + + navigator.clipboard.writeText(textToCopy).then(function() { + // Provide some visual feedback + //button.classList.add('invert'); + //setTimeout(function() { + // button.classList.remove('invert'); + //}, 500); + }).catch(function(err) { + console.error('Could not copy text: ', err); + }); +} + +function pasteContentFromClipboard(button) { + var targetId = button.getAttribute('data-target'); + var element = document.getElementById(targetId); + + navigator.clipboard.readText().then(function(text) { + if (element) { + console.log('Pasting text: ', text); + element.value = text; + } + }).catch(function(err) { + console.error('Could not paste text: ', err); + }); +} + +function addCopyHandler(copyButton) +{ + if (copyButton) + { + //console.log('Adding copy handler for button: ', copyButton.id, copyButton.getAttribute('data-target')); + copyButton.addEventListener('click', function() { + copyContentToClipboard(copyButton); + }); + } +} + +function addPasteHandler(pasteButton) +{ + if (pasteButton) + { + //console.log('Adding paste handler for button: ', pasteButton.id, pasteButton.getAttribute('data-target')); + pasteButton.addEventListener('click', function() { + pasteContentFromClipboard(pasteButton); + }); + } +} + +function pasteContentFromClipboard(button, setterFunction) { + + navigator.clipboard.readText().then(function(text) { + setterFunction.setValue(text); + }).catch(function(err) { + console.error('Could not paste text: ', err); + }); +} + + +function addPasteHandler(pasteButton, setterFunction) +{ + if (pasteButton) + { + console.log('Adding paste handler for button: ', pasteButton.id, pasteButton.getAttribute('data-target')); + pasteButton.addEventListener('click', function() { + pasteContentFromClipboard(pasteButton, setterFunction); + }); + } +} + +function addCopyHandlers() +{ + const darkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; + if (document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')) + darkMode = true + + var copyButtons = document.getElementsByClassName('copy-button'); + for (var i = 0; i < copyButtons.length; i++) + { + var copyButton = copyButtons[i]; + //console.log('Setting copy button theme: ', darkMode ? 'dark' : 'light'); + var childImg = copyButton.getElementsByTagName('img')[0]; + if (childImg) + if (darkMode) + childImg.classList.add('inverted-svg') + else + childImg.classList.remove('inverted-svg') + copyButton.setAttribute('data-bs-theme', darkMode ? 'dark' : 'light'); + addCopyHandler(copyButton); + } + + var invertButtons = document.getElementsByClassName('invert-button'); + for (var i = 0; i < invertButtons.length; i++) + { + var invertButton = invertButtons[i]; + var childImg = invertButton.getElementsByTagName('img')[0]; + if (childImg) + //console.log('Setting invert button theme: ', invertButton.id, darkMode ? 'dark' : 'light'); + if (darkMode) + childImg.classList.add('inverted-svg') + } +} + +function addPasteHandlers() +{ + + const darkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; + if (document.body.classList.contains('vscode-dark') || document.body.classList.contains('vscode-high-contrast')) + darkMode = true + + var pasteButtons = document.getElementsByClassName('paste-button'); + for (var i = 0; i < pasteButtons.length; i++) + { + var pasteButton = pasteButtons[i]; + //console.log('Setting paste button theme: ', darkMode ? 'dark' : 'light'); + var childImg = pasteButton.getElementsByTagName('img')[0]; + if (childImg) + if (darkMode) + childImg.classList.add('inverted-svg') + pasteButton.setAttribute('data-bs-theme', darkMode ? 'dark' : 'light'); + addPasteHandler(pasteButton); + } +} diff --git a/javascript/mtlx_js_utilities.html b/javascript/mtlx_js_utilities.html index b9188fd4..b74d26aa 100644 --- a/javascript/mtlx_js_utilities.html +++ b/javascript/mtlx_js_utilities.html @@ -42,8 +42,10 @@ --> - + + @@ -255,182 +267,233 @@

                            Graph Utilities

                            A simple MaterialX graph is loaded in by default.

                            - + + +
                            -
                            + value='\r\n\r\n'> +

                            -

                            1. Graph Connectivity

                            - -
                            - - - -
                            - - - -
                            - -
                            - - - -
                            - -

                            -
                            Result
                            -
                            -
                            - Mermaid -
                            +
                            + Graph Connectivity +

                            +
                            +
                            + +
                            +
                            + + + +
                            + + + +
                            + +
                            + + + +
                            +
                            -
                            - Connectivity -
                            +
                            +
                            + Connectivity + +
                            +
                            +
                            + Mermaid + +
                            +
                            -
                            -
                            -
                            -
                            - +
                            +
                            + +
                            + +
                            -
                            -
                            -
                            - - +
                            +
                            + + +
                            -
                            +

                            -

                            2. Graph Definitions

                            -
                            -
                            - - -
                            -
                            -
                            -
                            - -
                            -
                            -
                            -
                            - - -
                            -
                            -
                            -
                            - - -
                            -
                            -
                            -
                            - -
                            -
                            -
                            -
                            -
                            - -
                            -
                            -
                            +
                            + Graph Definitions +

                            - - + +
                            diff --git a/javascript/mtlx_js_utilities_internal.html b/javascript/mtlx_js_utilities_internal.html index 017918ce..6d6f501b 100644 --- a/javascript/mtlx_js_utilities_internal.html +++ b/javascript/mtlx_js_utilities_internal.html @@ -8,10 +8,12 @@ Dropdown Menu Example - + - + + + + + + + + + - +
                            -

                            Javascript Utilities

                            +

                            Graph Utilities

                            - The following is a set of utilities to work with MaterialX using it's Javascript - packages. +

                            The following is a set of graph related utilities to work with MaterialX using it's Javascript + packages. Specifically only the JsMaterialXCore package is used as it is much + more lightweight than the the full MaterialX package which includes shader generation. +

                            + The utilities collected together into a + materialxgraph package which can be reused in other projects. Currently the package includes: +
                              +
                            • A class which allows for the extraction of node, graph and connectivity information into a MaterialX + independent format. This can be serialized to JSON for further processing. +
                            • +
                            • A class that can consume the JSON connectivity information and construct Mermaid graphs.
                            • +
                            +

                            -

                            Document Graphing

                            -

                            A MaterialX file can be loaded in and previewed as text. This text can be converted to a `Mermaid` graph - which can then be used to visualize using the - Mermaid Visualizer. A simple MaterialX graph is - provided on load. +

                            Using this package, a MaterialX file can be loaded in and previewed as text or visualized as a "Mermaid" + graph. + The separate Mermaid Visualizer can also be used. + It uses the same JsMaterialXGraph package. + Additionally, the node and connectively information +

                            +

                            + A simple MaterialX graph is loaded in by default.

                            - -
                            -
                            + + + +
                            +
                            -
                            + style="width: 100%; " placeholder="Loaded MaterialX document will be displayed here" + value='\r\n\r\n'> +
                            -

                            -


                            - - - -
                            - - -
                            -
                            -
                            -
                            +
                            + + +
                            + Graph Connectivity +

                            +
                            +
                            + +
                            +
                            + + + +
                            + + + +
                            + +
                            + + + +
                            +
                            +
                            +
                            +
                            + Connectivity + +
                            +
                            +
                            + Mermaid + +
                            +
                            +
                            + +
                            +
                            + +
                            + +
                            +
                            +
                            +
                            +
                            + + +
                            +
                            + +
                            +
                            + +
                            + Graph Definitions +

                            + +
                            +
                            + +
                            +
                            + +
                            +
                            +
                            +
                            + + +
                            +
                            + +
                            +
                            + + +
                            +
                            +
                            +
                            + + +
                            +
                            +
                            +
                            + +
                            +
                            +
                            +
                            +
                            +
                            +
                            + + +
                            +
                            +
                            +
                            +
                            + + +
                            +
                            -
                            -
                            - - - + - + + - \ No newline at end of file diff --git a/javascript/viewer/dist/Geometry/cloth.glb b/javascript/viewer/dist/Geometry/cloth.glb new file mode 100644 index 00000000..e87b65b2 Binary files /dev/null and b/javascript/viewer/dist/Geometry/cloth.glb differ diff --git a/javascript/viewer/dist/Images/clipboard.svg b/javascript/viewer/dist/Images/clipboard.svg new file mode 100644 index 00000000..b92f42a5 --- /dev/null +++ b/javascript/viewer/dist/Images/clipboard.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/javascript/viewer/dist/Images/clipboard_white.svg b/javascript/viewer/dist/Images/clipboard_white.svg new file mode 100644 index 00000000..a4541705 --- /dev/null +++ b/javascript/viewer/dist/Images/clipboard_white.svg @@ -0,0 +1,44 @@ + + + + + + + diff --git a/javascript/viewer/dist/Images/copy-regular.svg b/javascript/viewer/dist/Images/copy-regular.svg new file mode 100644 index 00000000..b5906802 --- /dev/null +++ b/javascript/viewer/dist/Images/copy-regular.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/javascript/viewer/dist/JsMaterialXCore.js b/javascript/viewer/dist/JsMaterialXCore.js index 67794fab..10205181 100644 --- a/javascript/viewer/dist/JsMaterialXCore.js +++ b/javascript/viewer/dist/JsMaterialXCore.js @@ -6,7 +6,7 @@ var MaterialX = (function() { function(MaterialX) { MaterialX = MaterialX || {}; -var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXCore.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Sa"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Va"];addOnInit(Module["asm"]["Ta"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={130748:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},130832:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},130917:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"x":___assert_fail,"r":___cxa_allocate_exception,"n":___cxa_begin_catch,"z":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"i":___cxa_find_matching_catch_3,"Ga":___cxa_find_matching_catch_4,"s":___cxa_free_exception,"fa":___cxa_rethrow,"D":___cxa_throw,"pa":___cxa_uncaught_exceptions,"c":___resumeException,"$":___sys_fcntl64,"wa":___sys_ioctl,"xa":___sys_open,"ta":___sys_stat64,"Oa":__embind_finalize_value_array,"ha":__embind_register_bigint,"za":__embind_register_bool,"t":__embind_register_class,"y":__embind_register_class_class_function,"o":__embind_register_class_class_property,"w":__embind_register_class_constructor,"h":__embind_register_class_function,"L":__embind_register_class_property,"M":__embind_register_constant,"ya":__embind_register_emval,"Ia":__embind_register_enum,"Ha":__embind_register_enum_value,"ca":__embind_register_float,"C":__embind_register_function,"G":__embind_register_integer,"F":__embind_register_memory_view,"p":__embind_register_smart_ptr,"da":__embind_register_std_string,"T":__embind_register_std_wstring,"ea":__embind_register_value_array,"R":__embind_register_value_array_element,"Aa":__embind_register_void,"I":__emval_as,"Pa":__emval_call,"Q":__emval_call_void_method,"_":__emval_decref,"P":__emval_get_method_caller,"Na":__emval_get_property,"ba":__emval_incref,"Ra":__emval_new_array,"Ma":__emval_new_cstring,"Ja":__emval_new_object,"La":__emval_run_destructors,"Qa":__emval_set_property,"A":__emval_take_value,"Ka":__emval_typeof,"oa":_abort,"W":_emscripten_asm_const_int,"na":_emscripten_memcpy_big,"S":_emscripten_resize_heap,"ra":_environ_get,"sa":_environ_sizes_get,"aa":_fd_close,"ua":_fd_read,"ga":_fd_seek,"va":_fd_write,"a":_getTempRet0,"Ba":invoke_di,"U":invoke_fi,"Ea":invoke_fifii,"ka":invoke_fii,"ma":invoke_fiii,"u":invoke_i,"f":invoke_ii,"Ca":invoke_iid,"Da":invoke_iif,"d":invoke_iii,"j":invoke_iiii,"v":invoke_iiiii,"X":invoke_iiiiid,"V":invoke_iiiiii,"H":invoke_iiiiiii,"Y":invoke_iiiiiiii,"O":invoke_iiiiiiiiiiii,"k":invoke_v,"l":invoke_vi,"la":invoke_vid,"Fa":invoke_vif,"e":invoke_vii,"ja":invoke_viif,"g":invoke_viii,"m":invoke_viiii,"q":invoke_viiiii,"K":invoke_viiiiii,"E":invoke_viiiiiii,"Z":invoke_viiiiiiiii,"J":invoke_viiiiiiiiii,"N":invoke_viiiiiiiiiiiiiii,"B":_llvm_eh_typeid_for,"ia":_setTempRet0,"qa":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Ta"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Ua"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["Wa"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["Xa"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["Za"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_a"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$a"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["ab"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["bb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["cb"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["db"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["eb"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["fb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["gb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["ib"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); +var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXCore.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Ta"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Wa"];addOnInit(Module["asm"]["Ua"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={130504:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},130588:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},130673:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"x":___assert_fail,"r":___cxa_allocate_exception,"n":___cxa_begin_catch,"y":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"i":___cxa_find_matching_catch_3,"Ha":___cxa_find_matching_catch_4,"s":___cxa_free_exception,"ha":___cxa_rethrow,"D":___cxa_throw,"sa":___cxa_uncaught_exceptions,"c":___resumeException,"aa":___sys_fcntl64,"za":___sys_getdents64,"ya":___sys_ioctl,"ba":___sys_open,"va":___sys_stat64,"Pa":__embind_finalize_value_array,"ja":__embind_register_bigint,"Ba":__embind_register_bool,"t":__embind_register_class,"z":__embind_register_class_class_function,"o":__embind_register_class_class_property,"w":__embind_register_class_constructor,"h":__embind_register_class_function,"L":__embind_register_class_property,"M":__embind_register_constant,"Aa":__embind_register_emval,"Ja":__embind_register_enum,"Ia":__embind_register_enum_value,"da":__embind_register_float,"C":__embind_register_function,"H":__embind_register_integer,"F":__embind_register_memory_view,"p":__embind_register_smart_ptr,"ea":__embind_register_std_string,"U":__embind_register_std_wstring,"ga":__embind_register_value_array,"S":__embind_register_value_array_element,"Ca":__embind_register_void,"J":__emval_as,"Qa":__emval_call,"R":__emval_call_void_method,"$":__emval_decref,"Q":__emval_get_method_caller,"Oa":__emval_get_property,"ca":__emval_incref,"Sa":__emval_new_array,"Na":__emval_new_cstring,"Ka":__emval_new_object,"Ma":__emval_run_destructors,"Ra":__emval_set_property,"A":__emval_take_value,"La":__emval_typeof,"qa":_abort,"X":_emscripten_asm_const_int,"pa":_emscripten_memcpy_big,"T":_emscripten_resize_heap,"ta":_environ_get,"ua":_environ_sizes_get,"P":_fd_close,"wa":_fd_read,"ia":_fd_seek,"xa":_fd_write,"a":_getTempRet0,"Da":invoke_di,"W":invoke_fi,"Ga":invoke_fifii,"ma":invoke_fii,"oa":invoke_fiii,"u":invoke_i,"g":invoke_ii,"Ea":invoke_iid,"Fa":invoke_iif,"d":invoke_iii,"j":invoke_iiii,"v":invoke_iiiii,"Z":invoke_iiiiid,"V":invoke_iiiiii,"G":invoke_iiiiiii,"Y":invoke_iiiiiiii,"O":invoke_iiiiiiiiiiii,"k":invoke_v,"l":invoke_vi,"na":invoke_vid,"fa":invoke_vif,"e":invoke_vii,"la":invoke_viif,"f":invoke_viii,"m":invoke_viiii,"q":invoke_viiiii,"I":invoke_viiiiii,"E":invoke_viiiiiii,"_":invoke_viiiiiiiii,"K":invoke_viiiiiiiiii,"N":invoke_viiiiiiiiiiiiiii,"B":_llvm_eh_typeid_for,"ka":_setTempRet0,"ra":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Ua"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Va"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["Xa"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["Za"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["_a"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["$a"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["ab"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["bb"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["cb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["db"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["eb"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["fb"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["gb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["ib"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["jb"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); return MaterialX.ready diff --git a/javascript/viewer/dist/JsMaterialXCore.wasm b/javascript/viewer/dist/JsMaterialXCore.wasm index 883d4810..8e4bb349 100644 Binary files a/javascript/viewer/dist/JsMaterialXCore.wasm and b/javascript/viewer/dist/JsMaterialXCore.wasm differ diff --git a/javascript/viewer/dist/JsMaterialXGenShader.data b/javascript/viewer/dist/JsMaterialXGenShader.data index aa711a5d..29f9cb9d 100644 --- a/javascript/viewer/dist/JsMaterialXGenShader.data +++ b/javascript/viewer/dist/JsMaterialXGenShader.data @@ -116,15581 +116,15721 @@ endif() --> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - - - - - - - - - - - - + + + + + + + + - - - - - + + + + + + + + - - - + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + - + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + - - - + + + + - - - + + + + - - - + + + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Copyright Contributors to the MaterialX Project + SPDX-License-Identifier: Apache-2.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - + + - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - + + - - - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - - - + + - - - - - - - - - + + - - - - - - - - - + + - - - - - - - - - + + - - - - - - - - - + + - - - + + + - - - - - + + + - - - - - + + + + - - - - - - + + + + - - - - - - + + + + + + + - - - - - - - - - + + - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + + - - - + +void mx_displacement_float(float disp, float scale, out displacementshader result) +{ + result.offset = vec3(disp); + result.scale = scale; +} +void mx_artistic_ior(vec3 reflectivity, vec3 edge_color, out vec3 ior, out vec3 extinction) +{ + // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 + // http://jcgt.org/published/0003/04/03/paper.pdf - - - - - - + vec3 r = clamp(reflectivity, 0.0, 0.99); + vec3 r_sqrt = sqrt(r); + vec3 n_min = (1.0 - r) / (1.0 + r); + vec3 n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); + ior = mix(n_max, n_min, edge_color); - - - + vec3 np1 = ior + 1.0; + vec3 nm1 = ior - 1.0; + vec3 k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); + k2 = max(k2, 0.0); + extinction = sqrt(k2); +} +#include "lib/mx_microfacet_sheen.glsl" - - - - +void mx_sheen_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - + N = mx_forward_facing_normal(N, V); - - - + vec3 H = normalize(L + V); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float NdotH = clamp(dot(N, H), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + vec3 fr = color * mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); + float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); + bsdf.throughput = vec3(1.0 - dirAlbedo * weight); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // We need to include NdotL from the light integral here + // as in this case it's not cancelled out by the BRDF denominator. + bsdf.response = fr * NdotL * occlusion * weight; +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void mx_sheen_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + N = mx_forward_facing_normal(N, V); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - - - - - - - - - - + float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); + bsdf.throughput = vec3(1.0 - dirAlbedo * weight); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + vec3 Li = mx_environment_irradiance(N); + bsdf.response = Li * color * dirAlbedo * weight; +} +#include "lib/mx_microfacet.glsl" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void mx_generalized_schlick_edf(vec3 N, vec3 V, vec3 color0, vec3 color90, float exponent, EDF base, out EDF result) +{ + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + vec3 f = mx_fresnel_schlick(NdotV, color0, color90, exponent); + result = base * f; +} +#include "lib/mx_microfacet_specular.glsl" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void mx_generalized_schlick_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + N = mx_forward_facing_normal(N, V); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - - - - - - - - - - - - - - - - - - - - - - - - - + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); - - - - - - - - - - - - - - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); - - - - - - - - - - - - - - - - + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - - - - - - + if (scatter_mode != 0) + { + float avgF0 = dot(safeColor0, vec3(1.0 / 3.0)); + fd.ior = vec3(mx_f0_to_ior(avgF0)); + bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeColor0) * weight; + } +} - - - - - - - +void mx_generalized_schlick_bsdf_indirect(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - - + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - - - - - - + vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); + vec3 safeColor90 = max(color90, 0.0); + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); - - - - - - - - - - - - - - - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; + float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); + bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - - - - - - - - - + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); + bsdf.response = Li * comp * weight; +} +void mx_displacement_vector3(vec3 disp, float scale, out displacementshader result) +{ + result.offset = disp; + result.scale = scale; +} +#include "lib/mx_microfacet_diffuse.glsl" - - - - - - - - - +void mx_burley_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - + normal = mx_forward_facing_normal(normal, V); - - - - - - - + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float LdotH = clamp(dot(L, normalize(L + V)), M_FLOAT_EPS, 1.0); - - - - - - - - - - + bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; + bsdf.response *= mx_burley_diffuse(NdotV, NdotL, LdotH, roughness); +} - - - - - +void mx_burley_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - + normal = mx_forward_facing_normal(normal, V); - - - + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + vec3 Li = mx_environment_irradiance(normal) * + mx_burley_diffuse_dir_albedo(NdotV, roughness); + bsdf.response = Li * color * weight; +} +void mx_anisotropic_vdf(vec3 absorption, vec3 scattering, float anisotropy, inout BSDF bsdf) +{ + // TODO: Add some approximation for volumetric light absorption. +} +void mx_roughness_dual(vec2 roughness, out vec2 result) +{ + if (roughness.y < 0.0) + { + roughness.y = roughness.x; + } + result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); + result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); +} +#include "lib/mx_microfacet_diffuse.glsl" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void mx_oren_nayar_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - + normal = mx_forward_facing_normal(normal, V); - - - - - - - - - - - - - - - - - + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; + if (roughness > 0.0) + { + bsdf.response *= mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); + } +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void mx_oren_nayar_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - + normal = mx_forward_facing_normal(normal, V); - - - - - - - - - - - - - - - - - - - - - - - - - + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); - - - + vec3 Li = mx_environment_irradiance(normal) * + mx_oren_nayar_diffuse_dir_albedo(NdotV, roughness); + bsdf.response = Li * color * weight; +} +void mx_roughness_anisotropy(float roughness, float anisotropy, out vec2 result) +{ + float roughness_sqr = clamp(roughness*roughness, M_FLOAT_EPS, 1.0); + if (anisotropy > 0.0) + { + float aspect = sqrt(1.0 - clamp(anisotropy, 0.0, 0.98)); + result.x = min(roughness_sqr / aspect, 1.0); + result.y = roughness_sqr * aspect; + } + else + { + result.x = roughness_sqr; + result.y = roughness_sqr; + } +} +#include "lib/mx_microfacet_diffuse.glsl" - - - - - +void mx_subsurface_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - - - - - - - + normal = mx_forward_facing_normal(normal, V); - - - - - - - - - - - - - - - - - - - + vec3 sss = mx_subsurface_scattering_approx(normal, L, P, color, radius); + float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float visibleOcclusion = 1.0 - NdotL * (1.0 - occlusion); + bsdf.response = sss * visibleOcclusion * weight; +} - - - - - - - - - - - - - - - - - - - +void mx_subsurface_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - - - - - - - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - - - - - - - + normal = mx_forward_facing_normal(normal, V); - - - - - - - - - - - - - - - - - - - + // For now, we render indirect subsurface as simple indirect diffuse. + vec3 Li = mx_environment_irradiance(normal); + bsdf.response = Li * color * weight; +} +void mx_add_edf(vec3 N, vec3 L, EDF in1, EDF in2, out EDF result) +{ + result = in1 + in2; +} +#include "lib/mx_microfacet_specular.glsl" - - - - - - - - - - - - - - - - - - - +void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - - - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - + N = mx_forward_facing_normal(N, V); - - - - - - - + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); - - - - - - - + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); - - - - - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - - - - - - - + FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); - - - - - - - - - - - - - - - - + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - - - - - - - - - - - - - - - - + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void mx_conductor_bsdf_indirect(vec3 V, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); - - - + if (weight < M_FLOAT_EPS) + { + return; + } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + N = mx_forward_facing_normal(N, V); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - - - + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + bsdf.response = Li * comp * weight; +} + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - + + + - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + - Graph definitions of standard nodes included in the MaterialX specification. - --> + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + +void mx_uniform_edf(vec3 N, vec3 L, vec3 color, out EDF result) +{ + result = color; +} +// We fake diffuse transmission by using diffuse reflection from the opposite side. +// So this BTDF is really a BRDF. +void mx_translucent_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + // Invert normal since we're transmitting light from the other side + float NdotL = dot(L, -normal); + if (NdotL <= 0.0 || weight < M_FLOAT_EPS) + { + return; + } + + bsdf.response = color * weight * NdotL * M_PI_INV; +} + +void mx_translucent_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 normal, inout BSDF bsdf) +{ + bsdf.throughput = vec3(0.0); + + if (weight < M_FLOAT_EPS) + { + return; + } + + // Invert normal since we're transmitting light from the other side + vec3 Li = mx_environment_irradiance(-normal); + bsdf.response = Li * color * weight; +} +#include "lib/mx_microfacet_specular.glsl" + +void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + vec3 H = normalize(L + V); + + float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(VdotH, fd); + float D = mx_ggx_NDF(Ht, safeAlpha); + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + // Note: NdotL is cancelled out + bsdf.response = D * F * G * comp * safeTint * occlusion * weight / (4.0 * NdotV); +} + +void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + if (scatter_mode != 0) + { + bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeTint) * weight; + } +} + +void mx_dielectric_bsdf_indirect(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +{ + if (weight < M_FLOAT_EPS) + { + return; + } + + N = mx_forward_facing_normal(N, V); + + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); + + vec3 safeTint = max(tint, 0.0); + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); + vec3 F = mx_compute_fresnel(NdotV, fd); + + vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + + float F0 = mx_ior_to_f0(ior); + vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); + vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; + bsdf.throughput = 1.0 - dirAlbedo * weight; + + vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); + bsdf.response = Li * safeTint * comp * weight; +} +/// XYZ to Rec.709 RGB colorspace conversion +const mat3 XYZ_to_RGB = mat3( 3.2406, -0.9689, 0.0557, + -1.5372, 1.8758, -0.2040, + -0.4986, 0.0415, 1.0570); + +void mx_blackbody(float temperatureKelvin, out vec3 colorValue) +{ + float xc, yc; + float t, t2, t3, xc2, xc3; + + // if value outside valid range of approximation clamp to accepted temperature range + temperatureKelvin = clamp(temperatureKelvin, 1667.0, 25000.0); + + t = 1000.0 / temperatureKelvin; + t2 = t * t; + t3 = t * t * t; + + // Cubic spline approximation for Kelvin temperature to sRGB conversion + // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) + if (temperatureKelvin < 4000.0) { // 1667K <= temperatureKelvin < 4000K + xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; + } + else { // 4000K <= temperatureKelvin <= 25000K + xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; + } + xc2 = xc * xc; + xc3 = xc * xc * xc; + + if (temperatureKelvin < 2222.0) { // 1667K <= temperatureKelvin < 2222K + yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; + } + else if (temperatureKelvin < 4000.0) { // 2222K <= temperatureKelvin < 4000K + yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; + } + else { // 4000K <= temperatureKelvin <= 25000K + yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; + } + + if (yc <= 0.0) { // avoid division by zero + colorValue = vec3(1.0); + return; + } + + vec3 XYZ = vec3(xc / yc, 1.0, (1.0 - xc - yc) / yc); + + colorValue = XYZ_to_RGB * XYZ; + colorValue = max(colorValue, vec3(0.0)); +} +#include "mx_microfacet_specular.glsl" + +vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) +{ + // Approximate the appearance of surface transmission as glossy + // environment map refraction, ignoring any scene geometry that might + // be visible through the surface. + fd.refraction = true; + if ($refractionTwoSided) + { + tint = mx_square(tint); + } + return mx_environment_radiance(N, V, X, alpha, distribution, fd) * tint; +} +#include "mx_microfacet_specular.glsl" + +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) +{ + // Generate tangent frame. + X = normalize(X - dot(X, N) * N); + vec3 Y = cross(N, X); + mat3 tangentToWorld = mat3(X, Y, N); + + // Transform the view vector to tangent space. + V = vec3(dot(V, X), dot(V, Y), dot(V, N)); + + // Compute derived properties. + float NdotV = clamp(V.z, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(alpha); + float G1V = mx_ggx_smith_G1(NdotV, avgAlpha); + + // Integrate outgoing radiance using filtered importance sampling. + // http://cgg.mff.cuni.cz/~jaroslav/papers/2008-egsr-fis/2008-egsr-fis-final-embedded.pdf + vec3 radiance = vec3(0.0); + int envRadianceSamples = $envRadianceSamples; + for (int i = 0; i < envRadianceSamples; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); + + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, alpha); + vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, H, fd.ior.x) : -reflect(V, H); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + // Sample the environment light from the given direction. + vec3 Lw = tangentToWorld * L; + float pdf = mx_ggx_NDF(H, alpha) * G1V / (4.0 * NdotV); + float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); + vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); + + // Compute the Fresnel term. + vec3 F = mx_compute_fresnel(VdotH, fd); + + // Compute the geometric term. + float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + + // Compute the combined FG term, which is inverted for refraction. + vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; + + // Add the radiance contribution of this sample. + // From https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf + // incidentLight = sampleColor * NdotL + // microfacetSpecular = D * F * G / (4 * NdotL * NdotV) + // pdf = D * G1V / (4 * NdotV); + // radiance = incidentLight * microfacetSpecular / pdf + radiance += sampleColor * FG; + } + + // Apply the global component of the geometric term and normalize. + radiance /= G1V * float(envRadianceSamples); + + // Return the final radiance. + return radiance * $envLightIntensity; +} + +vec3 mx_environment_irradiance(vec3 N) +{ + vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + return Li * $envLightIntensity; +} +#define M_PI 3.1415926535897932 +#define M_PI_INV (1.0 / M_PI) + +float mx_pow5(float x) +{ + return mx_square(mx_square(x)) * x; +} + +float mx_pow6(float x) +{ + float x2 = mx_square(x); + return mx_square(x2) * x2; +} + +// Standard Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; +} +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; +} + +// Generalized Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0, float F90) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); +} +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); +} + +// Generalized Schlick Fresnel with a variable exponent +float mx_fresnel_schlick(float cosTheta, float F0, float F90, float exponent) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(F0, F90, pow(x, exponent)); +} +vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90, float exponent) +{ + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(F0, F90, pow(x, exponent)); +} + +// Enforce that the given normal is forward-facing from the specified view direction. +vec3 mx_forward_facing_normal(vec3 N, vec3 V) +{ + return (dot(N, V) < 0.0) ? -N : N; +} + +// https://www.graphics.rwth-aachen.de/publication/2/jgt.pdf +float mx_golden_ratio_sequence(int i) +{ + const float GOLDEN_RATIO = 1.6180339887498948; + return fract((float(i) + 1.0) * GOLDEN_RATIO); +} + +// https://people.irisa.fr/Ricardo.Marques/articles/2013/SF_CGF.pdf +vec2 mx_spherical_fibonacci(int i, int numSamples) +{ + return vec2((float(i) + 0.5) / float(numSamples), mx_golden_ratio_sequence(i)); +} + +// Generate a uniform-weighted sample in the unit hemisphere. +vec3 mx_uniform_sample_hemisphere(vec2 Xi) +{ + float phi = 2.0 * M_PI * Xi.x; + float cosTheta = 1.0 - Xi.y; + float sinTheta = sqrt(1.0 - mx_square(cosTheta)); + return vec3(cos(phi) * sinTheta, + sin(phi) * sinTheta, + cosTheta); +} +#include "mx_microfacet.glsl" + +const int FRESNEL_MODEL_DIELECTRIC = 0; +const int FRESNEL_MODEL_CONDUCTOR = 1; +const int FRESNEL_MODEL_SCHLICK = 2; + +// Parameters for Fresnel calculations +struct FresnelData +{ + // Fresnel model + int model; + bool airy; + + // Physical Fresnel + vec3 ior; + vec3 extinction; + + // Generalized Schlick Fresnel + vec3 F0; + vec3 F82; + vec3 F90; + float exponent; + + // Thin film + float tf_thickness; + float tf_ior; + + // Refraction + bool refraction; +}; + +// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf +// Appendix B.2 Equation 13 +float mx_ggx_NDF(vec3 H, vec2 alpha) +{ + vec2 He = H.xy / alpha; + float denom = dot(He, He) + mx_square(H.z); + return 1.0 / (M_PI * alpha.x * alpha.y * mx_square(denom)); +} + +// https://ggx-research.github.io/publication/2023/06/09/publication-ggx.html +vec3 mx_ggx_importance_sample_VNDF(vec2 Xi, vec3 V, vec2 alpha) +{ + // Transform the view direction to the hemisphere configuration. + V = normalize(vec3(V.xy * alpha, V.z)); + + // Sample a spherical cap in (-V.z, 1]. + float phi = 2.0 * M_PI * Xi.x; + float z = (1.0 - Xi.y) * (1.0 + V.z) - V.z; + float sinTheta = sqrt(clamp(1.0 - z * z, 0.0, 1.0)); + float x = sinTheta * cos(phi); + float y = sinTheta * sin(phi); + vec3 c = vec3(x, y, z); + + // Compute the microfacet normal. + vec3 H = c + V; + + // Transform the microfacet normal back to the ellipsoid configuration. + H = normalize(vec3(H.xy * alpha, max(H.z, 0.0))); + + return H; +} + +// https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf +// Equation 34 +float mx_ggx_smith_G1(float cosTheta, float alpha) +{ + float cosTheta2 = mx_square(cosTheta); + float tanTheta2 = (1.0 - cosTheta2) / cosTheta2; + return 2.0 / (1.0 + sqrt(1.0 + mx_square(alpha) * tanTheta2)); +} + +// Height-correlated Smith masking-shadowing +// http://jcgt.org/published/0003/02/03/paper.pdf +// Equations 72 and 99 +float mx_ggx_smith_G2(float NdotL, float NdotV, float alpha) +{ + float alpha2 = mx_square(alpha); + float lambdaL = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotL)); + float lambdaV = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotV)); + return 2.0 / (lambdaL / NdotL + lambdaV / NdotV); +} + +// Rational quadratic fit to Monte Carlo data for GGX directional albedo. +vec3 mx_ggx_dir_albedo_analytic(float NdotV, float alpha, vec3 F0, vec3 F90) +{ + float x = NdotV; + float y = alpha; + float x2 = mx_square(x); + float y2 = mx_square(y); + vec4 r = vec4(0.1003, 0.9345, 1.0, 1.0) + + vec4(-0.6303, -2.323, -1.765, 0.2281) * x + + vec4(9.748, 2.229, 8.263, 15.94) * y + + vec4(-2.038, -3.748, 11.53, -55.83) * x * y + + vec4(29.34, 1.424, 28.96, 13.08) * x2 + + vec4(-8.245, -0.7684, -7.507, 41.26) * y2 + + vec4(-26.44, 1.436, -36.11, 54.9) * x2 * y + + vec4(19.99, 0.2913, 15.86, 300.2) * x * y2 + + vec4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; + vec2 AB = clamp(r.xy / r.zw, 0.0, 1.0); + return F0 * AB.x + F90 * AB.y; +} + +vec3 mx_ggx_dir_albedo_table_lookup(float NdotV, float alpha, vec3 F0, vec3 F90) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) + { + vec2 AB = texture($albedoTable, vec2(NdotV, alpha)).rg; + return F0 * AB.x + F90 * AB.y; + } +#endif + return vec3(0.0); +} + +// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf +vec3 mx_ggx_dir_albedo_monte_carlo(float NdotV, float alpha, vec3 F0, vec3 F90) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0 - mx_square(NdotV)), 0, NdotV); + + vec2 AB = vec2(0.0); + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); + + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); + vec3 L = -reflect(V, H); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + + // Compute the Fresnel term. + float Fc = mx_fresnel_schlick(VdotH, 0.0, 1.0); + + // Compute the per-sample geometric term. + // https://hal.inria.fr/hal-00996995v2/document, Algorithm 2 + float G2 = mx_ggx_smith_G2(NdotL, NdotV, alpha); + + // Add the contribution of this sample. + AB += vec2(G2 * (1.0 - Fc), G2 * Fc); + } + + // Apply the global component of the geometric term and normalize. + AB /= mx_ggx_smith_G1(NdotV, alpha) * float(SAMPLE_COUNT); + + // Return the final directional albedo. + return F0 * AB.x + F90 * AB.y; +} + +vec3 mx_ggx_dir_albedo(float NdotV, float alpha, vec3 F0, vec3 F90) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 0 + return mx_ggx_dir_albedo_analytic(NdotV, alpha, F0, F90); +#elif DIRECTIONAL_ALBEDO_METHOD == 1 + return mx_ggx_dir_albedo_table_lookup(NdotV, alpha, F0, F90); +#else + return mx_ggx_dir_albedo_monte_carlo(NdotV, alpha, F0, F90); +#endif +} + +float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) +{ + return mx_ggx_dir_albedo(NdotV, alpha, vec3(F0), vec3(F90)).x; +} + +// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf +// Equations 14 and 16 +vec3 mx_ggx_energy_compensation(float NdotV, float alpha, vec3 Fss) +{ + float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); + return 1.0 + Fss * (1.0 - Ess) / Ess; +} + +float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) +{ + return mx_ggx_energy_compensation(NdotV, alpha, vec3(Fss)).x; +} + +// Compute the average of an anisotropic alpha pair. +float mx_average_alpha(vec2 alpha) +{ + return sqrt(alpha.x * alpha.y); +} + +// Convert a real-valued index of refraction to normal-incidence reflectivity. +float mx_ior_to_f0(float ior) +{ + return mx_square((ior - 1.0) / (ior + 1.0)); +} + +// Convert normal-incidence reflectivity to real-valued index of refraction. +float mx_f0_to_ior(float F0) +{ + float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (1.0 + sqrtF0) / (1.0 - sqrtF0); +} +vec3 mx_f0_to_ior(vec3 F0) +{ + vec3 sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0); +} + +// https://renderwonk.com/publications/wp-generalization-adobe/gen-adobe.pdf +vec3 mx_fresnel_hoffman_schlick(float cosTheta, FresnelData fd) +{ + const float COS_THETA_MAX = 1.0 / 7.0; + const float COS_THETA_FACTOR = 1.0 / (COS_THETA_MAX * pow(1.0 - COS_THETA_MAX, 6.0)); + + float x = clamp(cosTheta, 0.0, 1.0); + vec3 a = mix(fd.F0, fd.F90, pow(1.0 - COS_THETA_MAX, fd.exponent)) * (vec3(1.0) - fd.F82) * COS_THETA_FACTOR; + return mix(fd.F0, fd.F90, pow(1.0 - x, fd.exponent)) - a * x * mx_pow6(1.0 - x); +} + +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +float mx_fresnel_dielectric(float cosTheta, float ior) +{ + float c = cosTheta; + float g2 = ior*ior + c*c - 1.0; + if (g2 < 0.0) + { + // Total internal reflection + return 1.0; + } + + float g = sqrt(g2); + return 0.5 * mx_square((g - c) / (g + c)) * + (1.0 + mx_square(((g + c) * c - 1.0) / ((g - c) * c + 1.0))); +} + +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +vec2 mx_fresnel_dielectric_polarized(float cosTheta, float ior) +{ + float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); + float sinTheta2 = 1.0 - cosTheta2; + + float t0 = max(ior * ior - sinTheta2, 0.0); + float t1 = t0 + cosTheta2; + float t2 = 2.0 * sqrt(t0) * cosTheta; + float Rs = (t1 - t2) / (t1 + t2); + + float t3 = cosTheta2 * t0 + sinTheta2 * sinTheta2; + float t4 = t2 * sinTheta2; + float Rp = Rs * (t3 - t4) / (t3 + t4); + + return vec2(Rp, Rs); +} + +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +void mx_fresnel_conductor_polarized(float cosTheta, vec3 n, vec3 k, out vec3 Rp, out vec3 Rs) +{ + float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); + float sinTheta2 = 1.0 - cosTheta2; + vec3 n2 = n * n; + vec3 k2 = k * k; + + vec3 t0 = n2 - k2 - vec3(sinTheta2); + vec3 a2plusb2 = sqrt(t0 * t0 + 4.0 * n2 * k2); + vec3 t1 = a2plusb2 + vec3(cosTheta2); + vec3 a = sqrt(max(0.5 * (a2plusb2 + t0), 0.0)); + vec3 t2 = 2.0 * a * cosTheta; + Rs = (t1 - t2) / (t1 + t2); + + vec3 t3 = cosTheta2 * a2plusb2 + vec3(sinTheta2 * sinTheta2); + vec3 t4 = t2 * sinTheta2; + Rp = Rs * (t3 - t4) / (t3 + t4); +} + +vec3 mx_fresnel_conductor(float cosTheta, vec3 n, vec3 k) +{ + vec3 Rp, Rs; + mx_fresnel_conductor_polarized(cosTheta, n, k, Rp, Rs); + return 0.5 * (Rp + Rs); +} + +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +void mx_fresnel_conductor_phase_polarized(float cosTheta, float eta1, vec3 eta2, vec3 kappa2, out vec3 phiP, out vec3 phiS) +{ + vec3 k2 = kappa2 / eta2; + vec3 sinThetaSqr = vec3(1.0) - cosTheta * cosTheta; + vec3 A = eta2*eta2*(vec3(1.0)-k2*k2) - eta1*eta1*sinThetaSqr; + vec3 B = sqrt(A*A + mx_square(2.0*eta2*eta2*k2)); + vec3 U = sqrt((A+B)/2.0); + vec3 V = max(vec3(0.0), sqrt((B-A)/2.0)); + + phiS = atan(2.0*eta1*V*cosTheta, U*U + V*V - mx_square(eta1*cosTheta)); + phiP = atan(2.0*eta1*eta2*eta2*cosTheta * (2.0*k2*U - (vec3(1.0)-k2*k2) * V), + mx_square(eta2*eta2*(vec3(1.0)+k2*k2)*cosTheta) - eta1*eta1*(U*U+V*V)); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +vec3 mx_eval_sensitivity(float opd, vec3 shift) +{ + // Use Gaussian fits, given by 3 parameters: val, pos and var + float phase = 2.0*M_PI * opd; + vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13); + vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06); + vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09); + vec3 xyz = val * sqrt(2.0*M_PI * var) * cos(pos * phase + shift) * exp(- var * phase*phase); + xyz.x += 9.7470e-14 * sqrt(2.0*M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(- 4.5282e+09 * phase*phase); + return xyz / 1.0685e-7; +} + +// A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html +vec3 mx_fresnel_airy(float cosTheta, FresnelData fd) +{ + // XYZ to CIE 1931 RGB color space (using neutral E illuminant) + const mat3 XYZ_TO_RGB = mat3(2.3706743, -0.5138850, 0.0052982, -0.9000405, 1.4253036, -0.0146949, -0.4706338, 0.0885814, 1.0093968); + + // Assume vacuum on the outside + float eta1 = 1.0; + float eta2 = max(fd.tf_ior, eta1); + vec3 eta3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? mx_f0_to_ior(fd.F0) : fd.ior; + vec3 kappa3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? vec3(0.0) : fd.extinction; + float cosThetaT = sqrt(1.0 - (1.0 - mx_square(cosTheta)) * mx_square(eta1 / eta2)); + + // First interface + vec2 R12 = mx_fresnel_dielectric_polarized(cosTheta, eta2 / eta1); + if (cosThetaT <= 0.0) + { + // Total internal reflection + R12 = vec2(1.0); + } + vec2 T121 = vec2(1.0) - R12; + + // Second interface + vec3 R23p, R23s; + if (fd.model == FRESNEL_MODEL_SCHLICK) + { + vec3 f = mx_fresnel_hoffman_schlick(cosThetaT, fd); + R23p = 0.5 * f; + R23s = 0.5 * f; + } + else + { + mx_fresnel_conductor_polarized(cosThetaT, eta3 / eta2, kappa3 / eta2, R23p, R23s); + } + + // Phase shift + float cosB = cos(atan(eta2 / eta1)); + vec2 phi21 = vec2(cosTheta < cosB ? 0.0 : M_PI, M_PI); + vec3 phi23p, phi23s; + if (fd.model == FRESNEL_MODEL_SCHLICK) + { + phi23p = vec3((eta3[0] < eta2) ? M_PI : 0.0, + (eta3[1] < eta2) ? M_PI : 0.0, + (eta3[2] < eta2) ? M_PI : 0.0); + phi23s = phi23p; + } + else + { + mx_fresnel_conductor_phase_polarized(cosThetaT, eta2, eta3, kappa3, phi23p, phi23s); + } + vec3 r123p = max(sqrt(R12.x*R23p), 0.0); + vec3 r123s = max(sqrt(R12.y*R23s), 0.0); + + // Iridescence term + vec3 I = vec3(0.0); + vec3 Cm, Sm; + + // Optical path difference + float distMeters = fd.tf_thickness * 1.0e-9; + float opd = 2.0 * eta2 * cosThetaT * distMeters; + + // Iridescence term using spectral antialiasing for Parallel polarization + + // Reflectance term for m=0 (DC term amplitude) + vec3 Rs = (mx_square(T121.x) * R23p) / (vec3(1.0) - R12.x*R23p); + I += R12.x + Rs; + + // Reflectance term for m>0 (pairs of diracs) + Cm = Rs - T121.x; + for (int m=1; m<=2; m++) + { + Cm *= r123p; + Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23p+vec3(phi21.x))); + I += Cm*Sm; + } + + // Iridescence term using spectral antialiasing for Perpendicular polarization + + // Reflectance term for m=0 (DC term amplitude) + vec3 Rp = (mx_square(T121.y) * R23s) / (vec3(1.0) - R12.y*R23s); + I += R12.y + Rp; + + // Reflectance term for m>0 (pairs of diracs) + Cm = Rp - T121.y; + for (int m=1; m<=2; m++) + { + Cm *= r123s; + Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23s+vec3(phi21.y))); + I += Cm*Sm; + } + + // Average parallel and perpendicular polarization + I *= 0.5; + + // Convert back to RGB reflectance + I = clamp(XYZ_TO_RGB * I, 0.0, 1.0); + + return I; +} + +FresnelData mx_init_fresnel_dielectric(float ior, float tf_thickness, float tf_ior) +{ + FresnelData fd; + fd.model = FRESNEL_MODEL_DIELECTRIC; + fd.airy = tf_thickness > 0.0; + fd.ior = vec3(ior); + fd.extinction = vec3(0.0); + fd.F0 = vec3(0.0); + fd.F82 = vec3(0.0); + fd.F90 = vec3(0.0); + fd.exponent = 0.0; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; +} + +FresnelData mx_init_fresnel_conductor(vec3 ior, vec3 extinction, float tf_thickness, float tf_ior) +{ + FresnelData fd; + fd.model = FRESNEL_MODEL_CONDUCTOR; + fd.airy = tf_thickness > 0.0; + fd.ior = ior; + fd.extinction = extinction; + fd.F0 = vec3(0.0); + fd.F82 = vec3(0.0); + fd.F90 = vec3(0.0); + fd.exponent = 0.0; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; +} + +FresnelData mx_init_fresnel_schlick(vec3 F0, vec3 F82, vec3 F90, float exponent, float tf_thickness, float tf_ior) +{ + FresnelData fd; + fd.model = FRESNEL_MODEL_SCHLICK; + fd.airy = tf_thickness > 0.0; + fd.ior = vec3(0.0); + fd.extinction = vec3(0.0); + fd.F0 = F0; + fd.F82 = F82; + fd.F90 = F90; + fd.exponent = exponent; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; + return fd; +} + +vec3 mx_compute_fresnel(float cosTheta, FresnelData fd) +{ + if (fd.airy) + { + return mx_fresnel_airy(cosTheta, fd); + } + else if (fd.model == FRESNEL_MODEL_DIELECTRIC) + { + return vec3(mx_fresnel_dielectric(cosTheta, fd.ior.x)); + } + else if (fd.model == FRESNEL_MODEL_CONDUCTOR) + { + return mx_fresnel_conductor(cosTheta, fd.ior, fd.extinction); + } + else + { + return mx_fresnel_hoffman_schlick(cosTheta, fd); + } +} - - - - - - - - - - - - - - - - - - - - - - - - - +// Compute the refraction of a ray through a solid sphere. +vec3 mx_refraction_solid_sphere(vec3 R, vec3 N, float ior) +{ + R = refract(R, N, 1.0 / ior); + vec3 N1 = normalize(R * dot(R, N) - N * 0.5); + return refract(R, N1, ior); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vec2 mx_latlong_projection(vec3 dir) +{ + float latitude = -asin(dir.y) * M_PI_INV + 0.5; + float longitude = atan(dir.x, -dir.z) * M_PI_INV * 0.5 + 0.5; + return vec2(longitude, latitude); +} - - - +vec3 mx_latlong_map_lookup(vec3 dir, mat4 transform, float lod, sampler2D envSampler) +{ + vec3 envDir = normalize((transform * vec4(dir,0.0)).xyz); + vec2 uv = mx_latlong_projection(envDir); + return textureLod(envSampler, uv, lod).rgb; +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Return the mip level with the appropriate coverage for a filtered importance sample. +// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch20.html +// Section 20.4 Equation 13 +float mx_latlong_compute_lod(vec3 dir, float pdf, float maxMipLevel, int envSamples) +{ + const float MIP_LEVEL_OFFSET = 1.5; + float effectiveMaxMipLevel = maxMipLevel - MIP_LEVEL_OFFSET; + float distortion = sqrt(1.0 - mx_square(dir.y)); + return max(effectiveMaxMipLevel - 0.5 * log2(float(envSamples) * pdf * distortion), 0.0); +} +// https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps +float mx_variance_shadow_occlusion(vec2 moments, float fragmentDepth) +{ + const float MIN_VARIANCE = 0.00001; + // One-tailed inequality valid if fragmentDepth > moments.x. + float p = (fragmentDepth <= moments.x) ? 1.0 : 0.0; - - - + // Compute variance. + float variance = moments.y - mx_square(moments.x); + variance = max(variance, MIN_VARIANCE); - - - + // Compute probabilistic upper bound. + float d = fragmentDepth - moments.x; + float pMax = variance / (variance + mx_square(d)); + return max(p, pMax); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +vec2 mx_compute_depth_moments() +{ + float depth = gl_FragCoord.z; + return vec2(depth, mx_square(depth)); +} +#include "mx_microfacet_specular.glsl" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Construct an orthonormal basis from a unit vector. +// https://graphics.pixar.com/library/OrthonormalB/paper.pdf +mat3 mx_orthonormal_basis(vec3 N) +{ + float sign = (N.z < 0.0) ? -1.0 : 1.0; + float a = -1.0 / (sign + N.z); + float b = N.x * N.y * a; + vec3 X = vec3(1.0 + sign * N.x * N.x * a, sign * b, -sign * N.x); + vec3 Y = vec3(b, sign + N.y * N.y * a, -N.y); + return mat3(X, Y, N); +} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// Return the alpha associated with the given mip level in a prefiltered environment. +float mx_latlong_lod_to_alpha(float lod) +{ + float lodBias = lod / float($envRadianceMips - 1); + return (lodBias < 0.5) ? mx_square(lodBias) : 2.0 * (lodBias - 0.375); +} - - - +// The inverse of mx_latlong_projection. +vec3 mx_latlong_map_projection_inverse(vec2 uv) +{ + float latitude = (uv.y - 0.5) * M_PI; + float longitude = (uv.x - 0.5) * M_PI * 2.0; + + float x = -cos(latitude) * sin(longitude); + float y = -sin(latitude); + float z = cos(latitude) * cos(longitude); + + return vec3(x, y, z); +} + +vec3 mx_generate_prefilter_env() +{ + // The tangent view vector is aligned with the normal. + vec3 V = vec3(0.0, 0.0, 1.0); + float NdotV = 1.0; + + // Compute derived properties. + vec2 uv = gl_FragCoord.xy * pow(2.0, $envPrefilterMip) / vec2(textureSize($envRadiance, 0)); + vec3 worldN = mx_latlong_map_projection_inverse(uv); + mat3 tangentToWorld = mx_orthonormal_basis(worldN); + float alpha = mx_latlong_lod_to_alpha(float($envPrefilterMip)); + float G1V = mx_ggx_smith_G1(NdotV, alpha); + + // Integrate the LD term for the given environment and alpha. + vec3 radiance = vec3(0.0, 0.0, 0.0); + float weight = 0.0; + int envRadianceSamples = 1024; + for (int i = 0; i < envRadianceSamples; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); + + // Compute the half vector and incoming light direction. + vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); + vec3 L = -V + 2.0 * H.z * H; + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + + // Compute the geometric term. + float G = mx_ggx_smith_G2(NdotL, NdotV, alpha); + + // Sample the environment light from the given direction. + vec3 Lw = tangentToWorld * L; + float pdf = mx_ggx_NDF(H, vec2(alpha)) * G1V / (4.0 * NdotV); + float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); + vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); - -#include "mx_burn_float.metal" + // Add the radiance contribution of this sample. + radiance += G * sampleColor; + weight += G; + } -void mx_burn_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) + return radiance / weight; +} +#include "mx_microfacet_sheen.glsl" +#include "mx_microfacet_specular.glsl" + +vec3 mx_generate_dir_albedo_table() { - float f; - mx_burn_float(fg.x, bg.x, mixval, f); result.x = f; - mx_burn_float(fg.y, bg.y, mixval, f); result.y = f; - mx_burn_float(fg.z, bg.z, mixval, f); result.z = f; + vec2 uv = gl_FragCoord.xy / $albedoTableSize; + vec2 ggxDirAlbedo = mx_ggx_dir_albedo(uv.x, uv.y, vec3(1, 0, 0), vec3(0, 1, 0)).xy; + float sheenDirAlbedo = mx_imageworks_sheen_dir_albedo(uv.x, uv.y); + return vec3(ggxDirAlbedo, sheenDirAlbedo); } -void mx_smoothstep_float(float val, float low, float high, out float result) +#include "mx_microfacet_specular.glsl" + +vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) { - if (val <= low) - result = 0.0; - else if (val >= high) - result = 1.0; - else - result = smoothstep(low, high, val); + return tint; } -void mx_dodge_float(float fg, float bg, float mixval, out float result) +#include "mx_microfacet.glsl" + +// Based on the implementation of Oren-Nayar diffuse in Open Shading Language. +// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/testrender/shading.cpp +float mx_oren_nayar_diffuse(float NdotV, float NdotL, float LdotV, float roughness) { - if (abs(1.0 - fg) < M_FLOAT_EPS) - { - result = 0.0; - return; - } - result = mixval*(bg / (1.0 - fg)) + ((1.0-mixval)*bg); + float s = LdotV - NdotL * NdotV; + float stinv = (s > 0.0f) ? s / max(NdotL, NdotV) : 0.0; + + float sigma2 = mx_square(roughness); + float A = 1.0 - 0.5 * (sigma2 / (sigma2 + 0.33)); + float B = 0.45 * sigma2 / (sigma2 + 0.09); + + return A + B * stinv; } -#include "mx_dodge_float.metal" -void mx_dodge_color4(vec4 fg , vec4 bg , float mixval, out vec4 result) +// Rational quadratic fit to Monte Carlo data for Oren-Nayar directional albedo. +float mx_oren_nayar_diffuse_dir_albedo_analytic(float NdotV, float roughness) { - float f; - mx_dodge_float(fg.x, bg.x, mixval, f); result.x = f; - mx_dodge_float(fg.y, bg.y, mixval, f); result.y = f; - mx_dodge_float(fg.z, bg.z, mixval, f); result.z = f; - mx_dodge_float(fg.w, bg.w, mixval, f); result.w = f; + vec2 r = vec2(1.0, 1.0) + + vec2(-0.4297, -0.6076) * roughness + + vec2(-0.7632, -0.4993) * NdotV * roughness + + vec2(1.4385, 2.0315) * mx_square(roughness); + return r.x / r.y; } -#include "mx_smoothstep_float.metal" -void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, thread vec3& result) +float mx_oren_nayar_diffuse_dir_albedo_table_lookup(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) { - float f; - mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; - mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; - mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; - } - - + return texture($albedoTable, vec2(NdotV, roughness)).b; + } +#endif + return 0.0; +} - - - +float mx_oren_nayar_diffuse_dir_albedo_monte_carlo(float NdotV, float roughness) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); - - + float radiance = 0.0; + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); - - + // Compute the incoming light direction. + vec3 L = mx_uniform_sample_hemisphere(Xi); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); - - - + // Compute diffuse reflectance. + float reflectance = mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); - - - - - - - - - - - - - - - - - - - + // Add the radiance contribution of this sample. + // uniform_pdf = 1 / (2 * PI) + // radiance = (reflectance * NdotL) / (uniform_pdf * PI); + radiance += reflectance * NdotL; + } - - - + // Apply global components and normalize. + radiance *= 2.0 / float(SAMPLE_COUNT); - - - + // Return the final directional albedo. + return radiance; +} - - - - - - - - - - - - - +float mx_oren_nayar_diffuse_dir_albedo(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 2 + float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_monte_carlo(NdotV, roughness); +#else + float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_analytic(NdotV, roughness); +#endif + return clamp(dirAlbedo, 0.0, 1.0); +} - - - - - - - +// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf +// Section 5.3 +float mx_burley_diffuse(float NdotV, float NdotL, float LdotH, float roughness) +{ + float F90 = 0.5 + (2.0 * roughness * mx_square(LdotH)); + float refL = mx_fresnel_schlick(NdotL, 1.0, F90); + float refV = mx_fresnel_schlick(NdotV, 1.0, F90); + return refL * refV; +} - - - - - - - +// Compute the directional albedo component of Burley diffuse for the given +// view angle and roughness. Curve fit provided by Stephen Hill. +float mx_burley_diffuse_dir_albedo(float NdotV, float roughness) +{ + float x = NdotV; + float fit0 = 0.97619 - 0.488095 * mx_pow5(1.0 - x); + float fit1 = 1.55754 + (-2.02221 + (2.56283 - 1.06244 * x) * x) * x; + return mix(fit0, fit1, roughness); +} - - - - - - - +// Evaluate the Burley diffusion profile for the given distance and diffusion shape. +// Based on https://graphics.pixar.com/library/ApproxBSSRDF/ +vec3 mx_burley_diffusion_profile(float dist, vec3 shape) +{ + vec3 num1 = exp(-shape * dist); + vec3 num2 = exp(-shape * dist / 3.0); + float denom = max(dist, M_FLOAT_EPS); + return (num1 + num2) / denom; +} - - - - - - - +// Integrate the Burley diffusion profile over a sphere of the given radius. +// Inspired by Eric Penner's presentation in http://advances.realtimerendering.com/s2011/ +vec3 mx_integrate_burley_diffusion(vec3 N, vec3 L, float radius, vec3 mfp) +{ + float theta = acos(dot(N, L)); - - - - - + // Estimate the Burley diffusion shape from mean free path. + vec3 shape = vec3(1.0) / max(mfp, 0.1); - - - - - + // Integrate the profile over the sphere. + vec3 sumD = vec3(0.0); + vec3 sumR = vec3(0.0); + const int SAMPLE_COUNT = 32; + const float SAMPLE_WIDTH = (2.0 * M_PI) / float(SAMPLE_COUNT); + for (int i = 0; i < SAMPLE_COUNT; i++) + { + float x = -M_PI + (float(i) + 0.5) * SAMPLE_WIDTH; + float dist = radius * abs(2.0 * sin(x * 0.5)); + vec3 R = mx_burley_diffusion_profile(dist, shape); + sumD += R * max(cos(theta + x), 0.0); + sumR += R; + } - - - - - + return sumD / sumR; +} - - +vec3 mx_subsurface_scattering_approx(vec3 N, vec3 L, vec3 P, vec3 albedo, vec3 mfp) +{ + float curvature = length(fwidth(N)) / length(fwidth(P)); + float radius = 1.0 / max(curvature, 0.01); + return albedo * mx_integrate_burley_diffusion(N, L, radius, mfp) / vec3(M_PI); +} +#include "mx_microfacet_specular.glsl" - - +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 roughness, int distribution, FresnelData fd) +{ + return vec3(0.0); +} - - - - +vec3 mx_environment_irradiance(vec3 N) +{ + return vec3(0.0); +} +#include "mx_microfacet.glsl" - - - - +// http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf +// Equation 2 +float mx_imageworks_sheen_NDF(float NdotH, float roughness) +{ + float invRoughness = 1.0 / max(roughness, 0.005); + float cos2 = NdotH * NdotH; + float sin2 = 1.0 - cos2; + return (2.0 + invRoughness) * pow(sin2, invRoughness * 0.5) / (2.0 * M_PI); +} - - - +float mx_imageworks_sheen_brdf(float NdotL, float NdotV, float NdotH, float roughness) +{ + // Microfacet distribution. + float D = mx_imageworks_sheen_NDF(NdotH, roughness); - + // Fresnel and geometry terms are ignored. + float F = 1.0; + float G = 1.0; - - - + // We use a smoother denominator, as in: + // https://blog.selfshadow.com/publications/s2013-shading-course/rad/s2013_pbs_rad_notes.pdf + return D * F * G / (4.0 * (NdotL + NdotV - NdotL*NdotV)); +} - - +// Rational quadratic fit to Monte Carlo data for Imageworks sheen directional albedo. +float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) +{ + vec2 r = vec2(13.67300, 1.0) + + vec2(-68.78018, 61.57746) * NdotV + + vec2(799.08825, 442.78211) * roughness + + vec2(-905.00061, 2597.49308) * NdotV * roughness + + vec2(60.28956, 121.81241) * mx_square(NdotV) + + vec2(1086.96473, 3045.55075) * mx_square(roughness); + return r.x / r.y; +} - - +float mx_imageworks_sheen_dir_albedo_table_lookup(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) + { + return texture($albedoTable, vec2(NdotV, roughness)).b; + } +#endif + return 0.0; +} - - +float mx_imageworks_sheen_dir_albedo_monte_carlo(float NdotV, float roughness) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); - - + float radiance = 0.0; + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); - - - + // Compute the incoming light direction and half vector. + vec3 L = mx_uniform_sample_hemisphere(Xi); + vec3 H = normalize(L + V); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float NdotH = clamp(H.z, M_FLOAT_EPS, 1.0); - - - - + // Compute sheen reflectance. + float reflectance = mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); - - - - - - - - - - + // Add the radiance contribution of this sample. + // uniform_pdf = 1 / (2 * PI) + // radiance = reflectance * NdotL / uniform_pdf; + radiance += reflectance * NdotL * 2.0 * M_PI; + } - - - + // Return the final directional albedo. + return radiance / float(SAMPLE_COUNT); +} - +float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 0 + float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); +#elif DIRECTIONAL_ALBEDO_METHOD == 1 + float dirAlbedo = mx_imageworks_sheen_dir_albedo_table_lookup(NdotV, roughness); +#else + float dirAlbedo = mx_imageworks_sheen_dir_albedo_monte_carlo(NdotV, roughness); +#endif + return clamp(dirAlbedo, 0.0, 1.0); +} +#include "mx_microfacet_specular.glsl" - +// Return the mip level associated with the given alpha in a prefiltered environment. +float mx_latlong_alpha_to_lod(float alpha) +{ + float lodBias = (alpha < 0.25) ? sqrt(alpha) : 0.5 * alpha + 0.375; + return lodBias * float($envRadianceMips - 1); +} - - +vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) +{ + N = mx_forward_facing_normal(N, V); + vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, N, fd.ior.x) : -reflect(V, N); - - - + float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - - - - - - - - - - - - - - - + float avgAlpha = mx_average_alpha(alpha); + vec3 F = mx_compute_fresnel(NdotV, fd); + float G = mx_ggx_smith_G2(NdotV, NdotV, avgAlpha); + vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; - - - - - - - - - - - - - - - - + vec3 Li = mx_latlong_map_lookup(L, $envMatrix, mx_latlong_alpha_to_lod(avgAlpha), $envRadiance); + return Li * FG * $envLightIntensity; +} - - - - - - - - - - - - - - +vec3 mx_environment_irradiance(vec3 N) +{ + vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + return Li * $envLightIntensity; +} + + - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + - - - - - - - - - - - - + + - - - - - - - + + - - - - - - - - + + - - - - - - - - + + - - - - - - - - + + - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - + + + - - - - - + + + - - - - - + + + - - - - - - - + + + + + - - - - - - - - - - - - + + - - - - - - - - - - - - + + - - - - - - - - - - - - + + + - - - - + + - - - - + + - - - - + + - - + + - - + + - - + +void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) +{ + // TODO: Need to remap parameters to match the new closure, + // or change the MaterialX spec to OSL parameterization. + vdf = 0; +} +void mx_displacement_float(float displacement, float scale, output displacementshader result) +{ + result = vector(displacement * scale); +} +void mx_blackbody(float temp, output color color_value) +{ + float xc, yc; + float t, t2, t3, xc2, xc3; - - + // if value outside valid range of approximation clamp to accepted temperature range + float temperature = clamp(temp, 1667.0, 25000.0); - - - - - + t = 1000.0 / temperature; + t2 = t * t; + t3 = t * t * t; - - - + // Cubic spline approximation for Kelvin temperature to sRGB conversion + // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) + if (temperature < 4000.0) { // 1667K <= temperature < 4000K + xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; + } + else { // 4000K <= temperature <= 25000K + xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; + } + xc2 = xc * xc; + xc3 = xc * xc * xc; - - - + if (temperature < 2222.0) { // 1667K <= temperature < 2222K + yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; + } + else if (temperature < 4000.0) { // 2222K <= temperature < 4000K + yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; + } + else { // 4000K <= temperature <= 25000K + yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; + } + + if (yc <= 0.0) { // avoid division by zero + color_value = color(1.0); + return; + } - - - + vector XYZ = vector(xc / yc, 1.0, (1 - xc - yc) / yc); - - + /// XYZ to Rec.709 RGB colorspace conversion + matrix XYZ_to_RGB = matrix( 3.2406, -0.9689, 0.0557, 0.0, + -1.5372, 1.8758, -0.2040, 0.0, + -0.4986, 0.0415, 1.0570, 0.0, + 0.0, 0.0, 0.0, 1.0); - - + color_value = transform(XYZ_to_RGB, XYZ); + color_value = max(color_value, vector(0.0)); +} +void mx_displacement_vector3(vector displacement, float scale, output displacementshader result) +{ + result = displacement * scale; +} +#include "lib/mx_microfacet.osl" - - - +void mx_generalized_schlick_edf(color color0, color color90, float exponent, EDF base, output EDF result) +{ + float NdotV = fabs(dot(N,-I)); + color f = mx_fresnel_schlick(NdotV, color0, color90, exponent); + result = base * f; +} + + - + + - - - - - - - - - - - - + + - - - - - + + - - - + + - - - + + - - - + + - - - + + - - - - + + - - - - + + - - - - + + - - - - + + - - - - + + + - - - - + + + - - - - + + + - - + + + + + - - + + - - + + + - - + + - - + + - - + + - - - - + + - - - - + +void mx_roughness_anisotropy(float roughness, float anisotropy, output vector2 result) +{ + float roughness_sqr = clamp(roughness*roughness, M_FLOAT_EPS, 1.0); + if (anisotropy > 0.0) + { + float aspect = sqrt(1.0 - clamp(anisotropy, 0.0, 0.98)); + result.x = min(roughness_sqr / aspect, 1.0); + result.y = roughness_sqr * aspect; + } + else + { + result.x = roughness_sqr; + result.y = roughness_sqr; + } +} +void mx_roughness_dual(vector2 roughness, output vector2 result) +{ + result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); + if (roughness.y < 0.0) + { + result.y = result.x; + } + else + { + result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); + } +} +void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +{ + if (scatter_mode == "R") + { + bsdf = weight * dielectric_bsdf(N, U, tint, color(0.0), roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else if (scatter_mode == "T") + { + bsdf = weight * dielectric_bsdf(N, U, color(0.0), tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else + { + bsdf = weight * dielectric_bsdf(N, U, tint, tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } +} + + - - - - - - - - - - - - - + + - - - + + - - - - - - - - - - - - - + + - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - + + - + + - - - - - - - + + - - - - - - - + + - - - + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - + + + - - - - + + + - - - + + + - - - - - - - + + + + + - - + + - - - + + + - - - - - - - - - - - - - - - - - - -#include "mx_burn_float.metal" + + -void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) + + + + + + + + + + +void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) { - float f; - mx_burn_float(fg.x, bg.x, mixval, f); result.x = f; - mx_burn_float(fg.y, bg.y, mixval, f); result.y = f; - mx_burn_float(fg.z, bg.z, mixval, f); result.z = f; - mx_burn_float(fg.w, bg.w, mixval, f); result.w = f; + result.bsdf = bsdf; + result.edf = edf; + result.opacity = clamp(opacity, 0.0, 1.0); } -void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) +void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { - // Decode the normal map. - value = all(value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0; - - // Transform from tangent space if needed. - if (map_space == 0) + if (scatter_mode == "R") { - vec3 B = normalize(cross(N, T)); - value.xy *= normal_scale; - value = T * value.x + B * value.y + N * value.z; + bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(0.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else if (scatter_mode == "T") + { + bsdf = weight * generalized_schlick_bsdf(N, U, color(0.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); + } + else + { + bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); } +} +void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) +{ + // TODO: Subsurface closure is not supported by vanilla OSL. + bsdf = _color * weight * diffuse(N); +} +void mx_artistic_ior(color reflectivity, color edge_color, output vector ior, output vector extinction) +{ + // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 + // http://jcgt.org/published/0003/04/03/paper.pdf - // Normalize the result. - result = normalize(value); + color r = clamp(reflectivity, 0.0, 0.99); + color r_sqrt = sqrt(r); + color n_min = (1.0 - r) / (1.0 + r); + color n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); + ior = mix(n_max, n_min, edge_color); + + color np1 = ior + 1.0; + color nm1 = ior - 1.0; + color k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); + k2 = max(k2, 0.0); + extinction = sqrt(k2); } +#include "mx_microfacet.osl" -void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result) +// Compute the average of an anisotropic alpha pair. +float mx_average_alpha(vector2 alpha) { - mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); + return sqrt(alpha.x * alpha.y); } -void mx_burn_float(float fg, float bg, float mixval, out float result) + +// Convert a real-valued index of refraction to normal-incidence reflectivity. +float mx_ior_to_f0(float ior) { - if (abs(fg) < M_FLOAT_EPS) - { - result = 0.0; - return; - } - result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); + return mx_square((ior - 1.0) / (ior + 1.0)); } -#include "mx_dodge_float.metal" -void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) +// Convert normal-incidence reflectivity to real-valued index of refraction. +float mx_f0_to_ior(float F0) { - float f; - mx_dodge_float(fg.x, bg.x, mixval, f); result.x = f; - mx_dodge_float(fg.y, bg.y, mixval, f); result.y = f; - mx_dodge_float(fg.z, bg.z, mixval, f); result.z = f; + float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); + return (1.0 + sqrtF0) / (1.0 - sqrtF0); } -#include "mx_smoothstep_float.metal" -void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) +// Rational quadratic fit to Monte Carlo data for GGX directional albedo. +color mx_ggx_dir_albedo(float NdotV, float alpha, color F0, color F90) { - float f; - mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; - mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; - mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; - mx_smoothstep_float(val.w, low.w, high.w, f); result.w = f; + float x = NdotV; + float y = alpha; + float x2 = mx_square(x); + float y2 = mx_square(y); + vector4 r = vector4(0.1003, 0.9345, 1.0, 1.0) + + vector4(-0.6303, -2.323, -1.765, 0.2281) * x + + vector4(9.748, 2.229, 8.263, 15.94) * y + + vector4(-2.038, -3.748, 11.53, -55.83) * x * y + + vector4(29.34, 1.424, 28.96, 13.08) * x2 + + vector4(-8.245, -0.7684, -7.507, 41.26) * y2 + + vector4(-26.44, 1.436, -36.11, 54.9) * x2 * y + + vector4(19.99, 0.2913, 15.86, 300.2) * x * y2 + + vector4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; + vector2 AB = vector2(r.x, r.y) / vector2(r.z, r.w); + AB.x = clamp(AB.x, 0.0, 1.0); + AB.y = clamp(AB.y, 0.0, 1.0); + return F0 * AB.x + F90 * AB.y; } -#include "mx_smoothstep_float.metal" -void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) +float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) { - float f; - mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; - mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; + color result = mx_ggx_dir_albedo(NdotV, alpha, color(F0), color(F90)); + return result[0]; } -struct MetalTexture -{ - texture2d tex; - sampler s; - int get_width() { return tex.get_width(); } - int get_height() { return tex.get_height(); } - int get_num_mip_levels() { return tex.get_num_mip_levels(); } -}; - -int get_width(MetalTexture mtlTex) { return mtlTex.get_width(); } -float4 texture(MetalTexture mtlTex, float2 uv) +float mx_ggx_dir_albedo(float NdotV, float alpha, float ior) { - return mtlTex.tex.sample(mtlTex.s, uv); + color result = mx_ggx_dir_albedo(NdotV, alpha, color(mx_ior_to_f0(ior)), color(1.0)); + return result[0]; } -float4 textureLod(MetalTexture mtlTex, float2 uv, float lod) +// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf +// Equations 14 and 16 +color mx_ggx_energy_compensation(float NdotV, float alpha, color Fss) { - return mtlTex.tex.sample(mtlTex.s, uv, level(lod)); + float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); + return 1.0 + Fss * (1.0 - Ess) / Ess; } -int2 textureSize(MetalTexture mtlTex, int mipLevel) +float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) { - return int2(mtlTex.get_width(), mtlTex.get_height()); + color result = mx_ggx_energy_compensation(NdotV, alpha, color(Fss)); + return result[0]; } +#include "mx_microfacet.osl" -int texture_mips(MetalTexture mtlTex) +// Rational curve fit approximation for the directional albedo of Imageworks sheen. +float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) { - return mtlTex.tex.get_num_mip_levels(); + float a = 5.25248 - 7.66024 * NdotV + 14.26377 * roughness; + float b = 1.0 + 30.66449 * NdotV + 32.53420 * roughness; + return a / b; } -#define M_FLOAT_EPS 1e-8 +float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) +{ + float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); + return clamp(dirAlbedo, 0.0, 1.0); +} float mx_square(float x) { return x*x; } -vec2 mx_square(vec2 x) +vector2 mx_square(vector2 x) { return x*x; } -vec3 mx_square(vec3 x) +vector mx_square(vector x) { return x*x; } -#ifdef __DECL_GL_MATH_FUNCTIONS__ - -float radians(float degree) { return (degree * M_PI_F / 180.0f); } - -float3x3 inverse(float3x3 m) +vector4 mx_square(vector4 x) { - float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0]; - float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1]; - float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2]; - - float det = determinant(m); - float idet = 1.0f / det; - - float3x3 ret; - - ret[0][0] = idet * (n22 * n33 - n32 * n23); - ret[1][0] = idet * (n32 * n13 - n12 * n33); - ret[2][0] = idet * (n12 * n23 - n22 * n13); - - ret[0][1] = idet * (n31 * n23 - n21 * n33); - ret[1][1] = idet * (n11 * n33 - n31 * n13); - ret[2][1] = idet * (n21 * n13 - n11 * n23); - - ret[0][2] = idet * (n21 * n32 - n31 * n22); - ret[1][2] = idet * (n31 * n12 - n11 * n32); - ret[2][2] = idet * (n11 * n22 - n21 * n12); - - return ret; + return x*x; } -float4x4 inverse(float4x4 m) +float mx_pow5(float x) { - float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0]; - float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1]; - float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2]; - float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3]; - - float t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44; - float t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44; - float t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44; - float t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; - - float det = determinant(m); - float idet = 1.0f / det; - - float4x4 ret; - - ret[0][0] = t11 * idet; - ret[0][1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * idet; - ret[0][2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * idet; - ret[0][3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * idet; - - ret[1][0] = t12 * idet; - ret[1][1] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * idet; - ret[1][2] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * idet; - ret[1][3] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * idet; + return mx_square(mx_square(x)) * x; +} - ret[2][0] = t13 * idet; - ret[2][1] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * idet; - ret[2][2] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * idet; - ret[2][3] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * idet; +color mx_fresnel_conductor(float cosTheta, vector n, vector k) +{ + float c2 = cosTheta*cosTheta; + vector n2_k2 = n*n + k*k; + vector nc2 = 2.0 * n * cosTheta; - ret[3][0] = t14 * idet; - ret[3][1] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * idet; - ret[3][2] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * idet; - ret[3][3] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * idet; + vector rs_a = n2_k2 + c2; + vector rp_a = n2_k2 * c2 + 1.0; + vector rs = (rs_a - nc2) / (rs_a + nc2); + vector rp = (rp_a - nc2) / (rp_a + nc2); - return ret; + return 0.5 * (rs + rp); } -template -T1 mod(T1 x, T2 y) +// Standard Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0) { - return x - y * floor(x/y); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; } - -template -T atan(T y_over_x) { return ::atan(y_over_x); } - -template -T atan(T y, T x) { return ::atan2(y, x); } - -#define lessThan(a, b) ((a) < (b)) -#define lessThanEqual(a, b) ((a) <= (b)) -#define greaterThan(a, b) ((a) > (b)) -#define greaterThanEqual(a, b) ((a) >= (b)) -#define equal(a, b) ((a) == (b)) -#define notEqual(a, b) ((a) != (b)) - -#endif -float3x3 operator+(float3x3 a, float b) +color mx_fresnel_schlick(float cosTheta, color F0) { - return a + float3x3(b,b,b,b,b,b,b,b,b); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return F0 + (1.0 - F0) * x5; } -float4x4 operator+(float4x4 a, float b) +// Generalized Schlick Fresnel +float mx_fresnel_schlick(float cosTheta, float F0, float F90) { - return a + float4x4(b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); } - -float3x3 operator-(float3x3 a, float b) +color mx_fresnel_schlick(float cosTheta, color F0, color F90) { - return a - float3x3(b,b,b,b,b,b,b,b,b); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + float x5 = mx_pow5(x); + return mix(F0, F90, x5); } -float4x4 operator-(float4x4 a, float b) +// Generalized Schlick Fresnel with a variable exponent +color mx_fresnel_schlick(float cosTheta, float f0, float f90, float exponent) { - return a - float4x4(b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b); + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(f0, f90, pow(x, exponent)); } - -float3x3 operator/(float3x3 a, float3x3 b) +color mx_fresnel_schlick(float cosTheta, color f0, color f90, float exponent) { - for(int i = 0; i < 3; ++i) - for(int j = 0; j < 3; ++j) - a[i][j] /= b[i][j]; - - return a; + float x = clamp(1.0 - cosTheta, 0.0, 1.0); + return mix(f0, f90, pow(x, exponent)); } - -float4x4 operator/(float4x4 a, float4x4 b) +void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) { - for(int i = 0; i < 4; ++i) - for(int j = 0; j < 4; ++j) - a[i][j] /= b[i][j]; - - return a; + // Not implemented in vanilla OSL + vdf = 0; // volume_henyey_greenstein(color(absorption), color(scattering), color(0.0), anisotropy); } - -float3x3 operator/(float3x3 a, float b) +void mx_burley_diffuse_bsdf(float weight, color reflectance, float roughness, normal N, output BSDF bsdf) { - for(int i = 0; i < 3; ++i) - for(int j = 0; j < 3; ++j) - a[i][j] /= b; - - return a; + // TODO: Implement properly. + bsdf.response = reflectance * weight * oren_nayar(N, roughness); + bsdf.throughput = color(0.0); } +#include "../lib/mx_microfacet_specular.osl" -float4x4 operator/(float4x4 a, float b) +void mx_conductor_bsdf(float weight, color ior_n, color ior_k, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, output BSDF bsdf) { - for(int i = 0; i < 4; ++i) - for(int j = 0; j < 4; ++j) - a[i][j] /= b; + bsdf.throughput = color(0.0); - return a; -} -// Restrict to 7x7 kernel size for performance reasons -#define MX_MAX_SAMPLE_COUNT 49 -// Size of all weights for all levels (including level 1) -#define MX_WEIGHT_ARRAY_SIZE 84 + if (weight < M_FLOAT_EPS) + { + bsdf.response = 0; + return; + } -// -// Function to compute the sample size relative to a texture coordinate -// -vec2 mx_compute_sample_size_uv(vec2 uv, float filterSize, float filterOffset) -{ - vec2 derivUVx = dFdx(uv) * 0.5f; - vec2 derivUVy = dFdy(uv) * 0.5f; - float derivX = abs(derivUVx.x) + abs(derivUVy.x); - float derivY = abs(derivUVx.y) + abs(derivUVy.y); - float sampleSizeU = 2.0f * filterSize * derivX + filterOffset; - if (sampleSizeU < 1.0E-05f) - sampleSizeU = 1.0E-05f; - float sampleSizeV = 2.0f * filterSize * derivY + filterOffset; - if (sampleSizeV < 1.0E-05f) - sampleSizeV = 1.0E-05f; - return vec2(sampleSizeU, sampleSizeV); -} + // Calculate conductor fresnel + // + // Fresnel should be based on microfacet normal + // but we have no access to that from here, so just use + // view direction and surface normal instead + // + float NdotV = fabs(dot(N,-I)); + color F = mx_fresnel_conductor(NdotV, ior_n, ior_k); + + // Calculate compensation for multiple scattering. + // This should normally be done inside the closure + // but since vanilla OSL doesen't support this we + // add it here in shader code instead. + vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); + float avgAlpha = mx_average_alpha(safeAlpha); + color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); -// -// Compute a normal mapped to 0..1 space based on a set of input -// samples using a Sobel filter. -// -vec3 mx_normal_from_samples_sobel(constant float S[9], float _scale) -{ - float nx = S[0] - S[2] + (2.0*S[3]) - (2.0*S[5]) + S[6] - S[8]; - float ny = S[0] + (2.0*S[1]) + S[2] - S[6] - (2.0*S[7]) - S[8]; - float nz = max(_scale, M_FLOAT_EPS) * sqrt(max(1.0 - nx * nx - ny * ny, M_FLOAT_EPS)); - vec3 norm = normalize(vec3(nx, ny, nz)); - return (norm + 1.0) * 0.5; + // Set ior to 0.0 to disable the internal dielectric fresnel + bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, false); } +#include "../lib/mx_microfacet_specular.osl" -// -// Apply filter for float samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { - float result = 0.0; - for (int i = 0; i < sampleCount; i++) + if (scatter_mode == "T") { - result += S[i]*W[i+offset]; + bsdf.response = tint * weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); + bsdf.throughput = tint * weight; + return; } - return result; -} -// -// Apply filter for vec2 samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -vec2 mx_convolution_vec2(vec2 S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) -{ - vec2 result = vec2(0.0); - for (int i=0; i + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_burn_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) -{ - mx_burn_float(fg.x, bg.x, mixval, result.x); - mx_burn_float(fg.y, bg.y, mixval, result.y); - mx_burn_float(fg.z, bg.z, mixval, result.z); -} -#include "lib/$fileTransformUv" + + + + -void mx_image_vector3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) -{ - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv).rgb; -} - - - + + + + - - - + + + + - - + + + + - - + + + + - - - + + + + - - - - - - - - - - - - - - - - - - - + + + + - - - + + + + - - - + + + + - - - - - - - - - - - - - + + + + - - - - - - + Nodegraph implementations for the default color transforms in MaterialX. + --> - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + - - - + + + + - + Declarations of common light nodes, used in code generation for hardware + shading languages that require explicit light loops. - - + These nodes are a required implementation detail for hardware shader + generation, and are not themselves part of the MaterialX standard. + --> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + +void mx_point_light(LightData light, vec3 position, out lightshader result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; +} + + - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - + + - - - - - + + - - - - - + +void mx_directional_light(LightData light, vec3 position, out lightshader result) +{ + result.direction = -light.direction; + result.intensity = light.color * light.intensity; +} +void mx_spot_light(LightData light, vec3 position, out lightshader result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; + float low = min(light.inner_angle, light.outer_angle); + float high = light.inner_angle; + float cosDir = dot(result.direction, -light.direction); + float spotAttenuation = smoothstep(low, high, cosDir); + result.intensity *= spotAttenuation; +} +void mx_directional_light(LightData light, float3 position, thread lightshader& result) +{ + result.direction = -light.direction; + result.intensity = light.color * light.intensity; +} +void mx_point_light(LightData light, float3 position, thread lightshader& result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; +} + + - - - - - - - + + - - - - - - - - - - - - + + - - - - - - - - - - - - + + - - - - - - - - - - - - + +void mx_spot_light(LightData light, float3 position, thread lightshader& result) +{ + result.direction = light.position - position; + float distance = length(result.direction) + M_FLOAT_EPS; + float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); + result.intensity = light.color * light.intensity / attenuation; + result.direction /= distance; + float low = min(light.inner_angle, light.outer_angle); + float high = light.inner_angle; + float cosDir = dot(result.direction, -light.direction); + float spotAttenuation = smoothstep(low, high, cosDir); + result.intensity *= spotAttenuation; +} + + + - - - + Graph definitions of standard nodes included in the MaterialX specification. + --> - - - - + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + Declarations of standard data types and nodes included in the MaterialX specification. + --> - - + + + - - - - - + - - - + + + - - - + + + + + - - - + + + + + + + + - - + + + + + + + + + - - + + + + - + - + + - - - - - - - - - - - - + + + + - - - - + Declarations for GLSL implementations of standard nodes included in the MaterialX specification. + --> - - - + + + - - - + + - - - + + + + - + - - + + - - + + + + - - - + Declarations for OSL implementations of standard nodes included in the MaterialX specification. + --> - - - - + + + - - - - + + - - - - + + + + - - - + Graph definitions of standard nodes included in the MaterialX specification. + --> - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - -#include "lib/mx_noise.glsl" + + + -void mx_worleynoise3d_vector3(vec3 position, float jitter, out vec3 result) -{ - result = mx_worley_noise_vec3(position, jitter, 0); -} -void mx_ramptb_vector2(vec2 valuet, vec2 valueb, vec2 texcoord, out vec2 result) -{ - result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); -} -#include "mx_smoothstep_float.glsl" + + + -void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) -{ - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); -} -void mx_creatematrix_vector3_matrix33(vec3 in1, vec3 in2, vec3 in3, out mat3 result) -{ - result = mat3(in1.x, in1.y, in1.z, - in2.x, in2.y, in2.z, - in3.x, in3.y, in3.z); -} -#include "lib/mx_noise.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_worleynoise2d_vector3(vec2 texcoord, float jitter, out vec3 result) -{ - result = mx_worley_noise_vec3(texcoord, jitter, 0); -} -#include "lib/$fileTransformUv" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_image_float(sampler2D tex_sampler, int layer, float defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out float result) -{ - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv).r; -} -void mx_luminance_color4(vec4 _in, vec3 lumacoeffs, out vec4 result) -{ - result = vec4(vec3(dot(_in.rgb, lumacoeffs)), _in.a); -} -void mx_luminance_color3(vec3 _in, vec3 lumacoeffs, out vec3 result) -{ - result = vec3(dot(_in, lumacoeffs)); -} -#include "mx_aastep.glsl" + + + + + + + + + + + + + + + + + + + + + -void mx_splitlr_float(float valuel, float valuer, float center, vec2 texcoord, out float result) -{ - result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); -} -#include "mx_aastep.glsl" + + + + + + + + + + + + + + + + + + + + -void mx_splitlr_vector2(vec2 valuel, vec2 valuer, float center, vec2 texcoord, out vec2 result) -{ - result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); -} -#include "lib/mx_noise.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_noise2d_vector2(vec2 amplitude, float pivot, vec2 texcoord, out vec2 result) -{ - vec3 value = mx_perlin_noise_vec3(texcoord); - result = value.xy * amplitude + pivot; -} -#include "lib/mx_noise.glsl" + + + -void mx_noise2d_vector4(vec4 amplitude, float pivot, vec2 texcoord, out vec4 result) -{ - vec3 xyz = mx_perlin_noise_vec3(texcoord); - float w = mx_perlin_noise_float(texcoord + vec2(19, 73)); - result = vec4(xyz, w) * amplitude + pivot; -} -void mx_transformmatrix_vector2M3(vec2 val, mat3 transform, out vec2 result) -{ - vec3 res = transform * vec3(val, 1.0); - result = res.xy; -} -#include "mx_aastep.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_splittb_float(float valuet, float valueb, float center, vec2 texcoord, out float result) -{ - result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); -} -void mx_ramptb_float(float valuet, float valueb, vec2 texcoord, out float result) -{ - result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); -} -void mx_rotate_vector2(vec2 _in, float amount, out vec2 result) -{ - float rotationRadians = radians(amount); - float sa = sin(rotationRadians); - float ca = cos(rotationRadians); - result = vec2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y); -} -#include "lib/mx_noise.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_fractal3d_vector2(vec2 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec2 result) -{ - vec2 value = mx_fractal_noise_vec2(position, octaves, lacunarity, diminish); - result = value * amplitude; -} -#include "lib/mx_hsv.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_rgbtohsv_color3(vec3 _in, out vec3 result) -{ - result = mx_rgbtohsv(_in); -} -void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) -{ - // Decode the normal map. - value = (value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - // Transform from tangent space if needed. - if (map_space == 0) - { - vec3 B = normalize(cross(N, T)); - value.xy *= normal_scale; - value = T * value.x + B * value.y + N * value.z; - } + + + + + + + + + + + + + + + + + + + + + + + + + - // Normalize the result. - result = normalize(value); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result) -{ - mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); -} -#include "lib/mx_noise.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_worleynoise3d_vector2(vec3 position, float jitter, out vec2 result) -{ - result = mx_worley_noise_vec2(position, jitter, 0); -} -void mx_premult_color4(vec4 _in, out vec4 result) -{ - result = vec4(_in.rgb * _in.a, _in.a); -} -#include "lib/mx_noise.glsl" -void mx_noise2d_vector3(vec3 amplitude, float pivot, vec2 texcoord, out vec3 result) -{ - vec3 value = mx_perlin_noise_vec3(texcoord); - result = value * amplitude + pivot; -} -#include "lib/mx_noise.glsl" + + + -void mx_noise3d_vector2(vec2 amplitude, float pivot, vec3 position, out vec2 result) -{ - vec3 value = mx_perlin_noise_vec3(position); - result = value.xy * amplitude + pivot; -} -#include "mx_smoothstep_float.glsl" + + + -void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, out vec3 result) -{ - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); - mx_smoothstep_float(val.z, low.z, high.z, result.z); -} -#include "lib/mx_hsv.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_hsvtorgb_color3(vec3 _in, out vec3 result) -{ - result = mx_hsvtorgb(_in); -} -#include "mx_smoothstep_float.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) -{ - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); - mx_smoothstep_float(val.z, low.z, high.z, result.z); - mx_smoothstep_float(val.w, low.w, high.w, result.w); -} -void mx_creatematrix_vector4_matrix44(vec4 in1, vec4 in2, vec4 in3, vec4 in4, out mat4 result) -{ - result = mat4(in1.x, in1.y, in1.z, in1.w, - in2.x, in2.y, in2.z, in2.w, - in3.x, in3.y, in3.z, in3.w, - in4.x, in4.y, in4.z, in4.w); -} -#include "lib/mx_noise.glsl" + + + -void mx_worleynoise3d_float(vec3 position, float jitter, out float result) -{ - result = mx_worley_noise_float(position, jitter, 0); -} -void mx_disjointover_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) -{ - float summedAlpha = fg.w + bg.w; + + + + - result.xyz = result.xyz * mixval + (1.0 - mixval) * bg.xyz; - result.w = result.w * mixval + (1.0 - mixval) * bg.w; -} -mat4 mx_rotationMatrix(vec3 axis, float angle) -{ - axis = normalize(axis); - float s = sin(angle); - float c = cos(angle); - float oc = 1.0 - c; + + + - return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, - oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, - oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, - 0.0, 0.0, 0.0, 1.0); -} + + + + + + + + + + + + + + + + + + + -void mx_rotate_vector3(vec3 _in, float amount, vec3 axis, out vec3 result) -{ - float rotationRadians = radians(amount); - mat4 m = mx_rotationMatrix(axis, rotationRadians); - result = (m * vec4(_in, 1.0)).xyz; -} -#include "lib/mx_noise.glsl" + + + + + + + + + -void mx_worleynoise2d_float(vec2 texcoord, float jitter, out float result) -{ - result = mx_worley_noise_float(texcoord, jitter, 0); -} -#include "mx_aastep.glsl" + + + -void mx_splitlr_vector4(vec4 valuel, vec4 valuer, float center, vec2 texcoord, out vec4 result) -{ - result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); -} -#include "lib/mx_noise.glsl" + + + + + + + + + + + + + -void mx_worleynoise2d_vector2(vec2 texcoord, float jitter, out vec2 result) -{ - result = mx_worley_noise_vec2(texcoord, jitter, 0); -} -#include "lib/mx_noise.glsl" + + + + + -void mx_noise3d_vector3(vec3 amplitude, float pivot, vec3 position, out vec3 result) -{ - vec3 value = mx_perlin_noise_vec3(position); - result = value * amplitude + pivot; -} -void mx_ramptb_vector3(vec3 valuet, vec3 valueb, vec2 texcoord, out vec3 result) -{ - result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); -} -void mx_ramplr_vector4(vec4 valuel, vec4 valuer, vec2 texcoord, out vec4 result) -{ - result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); -} -#include "lib/mx_noise.glsl" + + + -void mx_fractal3d_vector4(vec4 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec4 result) -{ - vec4 value = mx_fractal_noise_vec4(position, octaves, lacunarity, diminish); - result = value * amplitude; -} -void mx_creatematrix_vector3_matrix44(vec3 in1, vec3 in2, vec3 in3, vec3 in4, out mat4 result) -{ - result = mat4(in1.x, in1.y, in1.z, 0.0, - in2.x, in2.y, in2.z, 0.0, - in3.x, in3.y, in3.z, 0.0, - in4.x, in4.y, in4.z, 1.0); -} -#include "mx_burn_float.glsl" + + + + + + + + + -void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) -{ - mx_burn_float(fg.x, bg.x, mixval, result.x); - mx_burn_float(fg.y, bg.y, mixval, result.y); - mx_burn_float(fg.z, bg.z, mixval, result.z); - mx_burn_float(fg.w, bg.w, mixval, result.w); -} -#include "lib/mx_noise.glsl" + + + -void mx_noise3d_float(float amplitude, float pivot, vec3 position, out float result) -{ - float value = mx_perlin_noise_float(position); - result = value * amplitude + pivot; -} -#include "mx_aastep.glsl" + + + + + + -void mx_splitlr_vector3(vec3 valuel, vec3 valuer, float center, vec2 texcoord, out vec3 result) -{ - result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); -} -#include "mx_aastep.glsl" + + + + + -void mx_splittb_vector3(vec3 valuet, vec3 valueb, float center, vec2 texcoord, out vec3 result) -{ - result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); -} -void mx_smoothstep_float(float val, float low, float high, out float result) -{ - if (val <= low) - result = 0.0; - else if (val >= high) - result = 1.0; - else - result = smoothstep(low, high, val); -} -#include "lib/mx_hsv.glsl" + + + -void mx_hsvtorgb_color4(vec4 _in, out vec4 result) -{ - result = vec4(mx_hsvtorgb(_in.rgb), 1.0); -} -void mx_ramptb_vector4(vec4 valuet, vec4 valueb, vec2 texcoord, out vec4 result) -{ - result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); -} -#include "lib/$fileTransformUv" + + + + + + + + + -void mx_image_vector4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) -{ - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv); -} -float mx_aastep(float threshold, float value) -{ - float afwidth = length(vec2(dFdx(value), dFdy(value))) * 0.70710678118654757; - return smoothstep(threshold-afwidth, threshold+afwidth, value); -} -void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, out surfaceshader returnshader) -{ - returnshader.color = mix(bg.color, fg.color, w); - returnshader.transparency = mix(bg.transparency, fg.transparency, w); -} -void mx_transformmatrix_vector3M4(vec3 val, mat4 transform, out vec3 result) -{ - vec4 res = transform * vec4(val, 1.0); - result = res.xyz; -} -void mx_burn_float(float fg, float bg, float mixval, out float result) -{ - if (abs(fg) < M_FLOAT_EPS) - { - result = 0.0; - return; - } - result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); -} -#include "mx_aastep.glsl" + + + -void mx_splittb_vector4(vec4 valuet, vec4 valueb, float center, vec2 texcoord, out vec4 result) -{ - result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); -} -#include "mx_dodge_float.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) -{ - mx_dodge_float(fg.x, bg.x, mixval, result.x); - mx_dodge_float(fg.y, bg.y, mixval, result.y); - mx_dodge_float(fg.z, bg.z, mixval, result.z); -} -void mx_ramplr_vector2(vec2 valuel, vec2 valuer, vec2 texcoord, out vec2 result) -{ - result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); -} -#include "lib/mx_noise.glsl" + + + -void mx_fractal3d_vector3(vec3 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec3 result) -{ - vec3 value = mx_fractal_noise_vec3(position, octaves, lacunarity, diminish); - result = value * amplitude; -} -void mx_ramplr_vector3(vec3 valuel, vec3 valuer, vec2 texcoord, out vec3 result) -{ - result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); -} -#include "lib/mx_noise.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_cellnoise3d_float(vec3 position, out float result) -{ - result = mx_cell_noise_float(position); -} -#include "lib/$fileTransformUv" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_image_vector2(sampler2D tex_sampler, int layer, vec2 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec2 result) -{ - vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); - result = texture(tex_sampler, uv).rg; -} -void mx_ramplr_float(float valuel, float valuer, vec2 texcoord, out float result) -{ - result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); -} -#include "lib/mx_noise.glsl" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out float result) -{ - float value = mx_fractal_noise_float(position, octaves, lacunarity, diminish); - result = value * amplitude; -} -// Restrict to 7x7 kernel size for performance reasons -#define MX_MAX_SAMPLE_COUNT 49 -// Size of all weights for all levels (including level 1) -#define MX_WEIGHT_ARRAY_SIZE 84 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -// -// Function to compute the sample size relative to a texture coordinate -// -vec2 mx_compute_sample_size_uv(vec2 uv, float filterSize, float filterOffset) -{ - vec2 derivUVx = dFdx(uv) * 0.5f; - vec2 derivUVy = dFdy(uv) * 0.5f; - float derivX = abs(derivUVx.x) + abs(derivUVy.x); - float derivY = abs(derivUVx.y) + abs(derivUVy.y); - float sampleSizeU = 2.0f * filterSize * derivX + filterOffset; - if (sampleSizeU < 1.0E-05f) - sampleSizeU = 1.0E-05f; - float sampleSizeV = 2.0f * filterSize * derivY + filterOffset; - if (sampleSizeV < 1.0E-05f) - sampleSizeV = 1.0E-05f; - return vec2(sampleSizeU, sampleSizeV); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -// -// Compute a normal mapped to 0..1 space based on a set of input -// samples using a Sobel filter. -// -vec3 mx_normal_from_samples_sobel(float S[9], float _scale) -{ - float nx = S[0] - S[2] + (2.0*S[3]) - (2.0*S[5]) + S[6] - S[8]; - float ny = S[0] + (2.0*S[1]) + S[2] - S[6] - (2.0*S[7]) - S[8]; - float nz = max(_scale, M_FLOAT_EPS) * sqrt(max(1.0 - nx * nx - ny * ny, M_FLOAT_EPS)); - vec3 norm = normalize(vec3(nx, ny, nz)); - return (norm + 1.0) * 0.5; -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -// -// Apply filter for float samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) -{ - float result = 0.0; - for (int i = 0; i < sampleCount; i++) - { - result += S[i]*W[i+offset]; - } - return result; -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -// -// Apply filter for vec2 samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -vec2 mx_convolution_vec2(vec2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) -{ - vec2 result = vec2(0.0); - for (int i=0; i + 3D Fractal noise in 1, 2, 3 or 4 channels. + --> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -// -// Apply filter for vec3 samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -vec3 mx_convolution_vec3(vec3 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) -{ - vec3 result = vec3(0.0); - for (int i=0; i + 2D cellular noise in 1 channel. + --> + + + + -// -// Apply filter for vec4 samples S, using weights W. -// sampleCount should be a square of a odd number { 1, 3, 5, 7 } -// -vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) -{ - vec4 result = vec4(0.0); - for (int i=0; i + 3D cellular noise in 1 channel. + --> + + + + -This library is a modified version of the noise library found in -Open Shading Language: -github.com/imageworks/OpenShadingLanguage/blob/master/src/include/OSL/oslnoise.h + + + + + + + + + + + + + + + + -It contains the subset of noise types needed to implement the MaterialX -standard library. The modifications are mainly conversions from C++ to GLSL. -Produced results should be identical to the OSL noise functions. + + + + + + + + + + + + + + + + -Original copyright notice: ------------------------------------------------------------------------- -Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. -All Rights Reserved. + + + + + + + + + + + + + + + -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of Sony Pictures Imageworks nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------- -*/ + + + + + + + + + + + + + + + -float mx_select(bool b, float t, float f) -{ - return b ? t : f; -} + + + + + + + + + + + + + + + -float mx_negate_if(float val, bool b) -{ - return b ? -val : val; -} + + + + + + + + + + + + + + + + + + + + + + + -int mx_floor(float x) -{ - return int(floor(x)); -} + + + + + + + + + -// return mx_floor as well as the fractional remainder -float mx_floorfrac(float x, out int i) -{ - i = mx_floor(x); - return x - float(i); -} + + + + + + + + + -float mx_bilerp(float v0, float v1, float v2, float v3, float s, float t) -{ - float s1 = 1.0 - s; - return (1.0 - t) * (v0*s1 + v1*s) + t * (v2*s1 + v3*s); -} -vec3 mx_bilerp(vec3 v0, vec3 v1, vec3 v2, vec3 v3, float s, float t) -{ - float s1 = 1.0 - s; - return (1.0 - t) * (v0*s1 + v1*s) + t * (v2*s1 + v3*s); -} -float mx_trilerp(float v0, float v1, float v2, float v3, float v4, float v5, float v6, float v7, float s, float t, float r) -{ - float s1 = 1.0 - s; - float t1 = 1.0 - t; - float r1 = 1.0 - r; - return (r1*(t1*(v0*s1 + v1*s) + t*(v2*s1 + v3*s)) + - r*(t1*(v4*s1 + v5*s) + t*(v6*s1 + v7*s))); -} -vec3 mx_trilerp(vec3 v0, vec3 v1, vec3 v2, vec3 v3, vec3 v4, vec3 v5, vec3 v6, vec3 v7, float s, float t, float r) -{ - float s1 = 1.0 - s; - float t1 = 1.0 - t; - float r1 = 1.0 - r; - return (r1*(t1*(v0*s1 + v1*s) + t*(v2*s1 + v3*s)) + - r*(t1*(v4*s1 + v5*s) + t*(v6*s1 + v7*s))); -} + + + + + + + -// 2 and 3 dimensional gradient functions - perform a dot product against a -// randomly chosen vector. Note that the gradient vector is not normalized, but -// this only affects the overal "scale" of the result, so we simply account for -// the scale by multiplying in the corresponding "perlin" function. -float mx_gradient_float(uint hash, float x, float y) -{ - // 8 possible directions (+-1,+-2) and (+-2,+-1) - uint h = hash & 7u; - float u = mx_select(h<4u, x, y); - float v = 2.0 * mx_select(h<4u, y, x); - // compute the dot product with (x,y). - return mx_negate_if(u, bool(h&1u)) + mx_negate_if(v, bool(h&2u)); -} -float mx_gradient_float(uint hash, float x, float y, float z) -{ - // use vectors pointing to the edges of the cube - uint h = hash & 15u; - float u = mx_select(h<8u, x, y); - float v = mx_select(h<4u, y, mx_select((h==12u)||(h==14u), x, z)); - return mx_negate_if(u, bool(h&1u)) + mx_negate_if(v, bool(h&2u)); -} -vec3 mx_gradient_vec3(uvec3 hash, float x, float y) -{ - return vec3(mx_gradient_float(hash.x, x, y), mx_gradient_float(hash.y, x, y), mx_gradient_float(hash.z, x, y)); -} -vec3 mx_gradient_vec3(uvec3 hash, float x, float y, float z) -{ - return vec3(mx_gradient_float(hash.x, x, y, z), mx_gradient_float(hash.y, x, y, z), mx_gradient_float(hash.z, x, y, z)); -} -// Scaling factors to normalize the result of gradients above. -// These factors were experimentally calculated to be: -// 2D: 0.6616 -// 3D: 0.9820 -float mx_gradient_scale2d(float v) { return 0.6616 * v; } -float mx_gradient_scale3d(float v) { return 0.9820 * v; } -vec3 mx_gradient_scale2d(vec3 v) { return 0.6616 * v; } -vec3 mx_gradient_scale3d(vec3 v) { return 0.9820 * v; } + + + + + + + -/// Bitwise circular rotation left by k bits (for 32 bit unsigned integers) -uint mx_rotl32(uint x, int k) -{ - return (x<>(32-k)); -} + + + + + + + -void mx_bjmix(inout uint a, inout uint b, inout uint c) -{ - a -= c; a ^= mx_rotl32(c, 4); c += b; - b -= a; b ^= mx_rotl32(a, 6); a += c; - c -= b; c ^= mx_rotl32(b, 8); b += a; - a -= c; a ^= mx_rotl32(c,16); c += b; - b -= a; b ^= mx_rotl32(a,19); a += c; - c -= b; c ^= mx_rotl32(b, 4); b += a; -} + + + + + + + + + -// Mix up and combine the bits of a, b, and c (doesn't change them, but -// returns a hash of those three original values). -uint mx_bjfinal(uint a, uint b, uint c) -{ - c ^= b; c -= mx_rotl32(b,14); - a ^= c; a -= mx_rotl32(c,11); - b ^= a; b -= mx_rotl32(a,25); - c ^= b; c -= mx_rotl32(b,16); - a ^= c; a -= mx_rotl32(c,4); - b ^= a; b -= mx_rotl32(a,14); - c ^= b; c -= mx_rotl32(b,24); - return c; -} + + + + + + + + + -// Convert a 32 bit integer into a floating point number in [0,1] -float mx_bits_to_01(uint bits) -{ - return float(bits) / float(uint(0xffffffff)); -} + + + + + + + + + -float mx_fade(float t) -{ - return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); -} + + + + + + + + + -uint mx_hash_int(int x) -{ - uint len = 1u; - uint seed = uint(0xdeadbeef) + (len << 2u) + 13u; - return mx_bjfinal(seed+uint(x), seed, seed); -} + + + + + + + + + -uint mx_hash_int(int x, int y) -{ - uint len = 2u; - uint a, b, c; - a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; - a += uint(x); - b += uint(y); - return mx_bjfinal(a, b, c); -} + + + -uint mx_hash_int(int x, int y, int z) -{ - uint len = 3u; - uint a, b, c; - a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; - a += uint(x); - b += uint(y); - c += uint(z); - return mx_bjfinal(a, b, c); -} + + + + + -uint mx_hash_int(int x, int y, int z, int xx) -{ - uint len = 4u; - uint a, b, c; - a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; - a += uint(x); - b += uint(y); - c += uint(z); - mx_bjmix(a, b, c); - a += uint(xx); - return mx_bjfinal(a, b, c); -} + + + + + -uint mx_hash_int(int x, int y, int z, int xx, int yy) -{ - uint len = 5u; - uint a, b, c; - a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; - a += uint(x); - b += uint(y); - c += uint(z); - mx_bjmix(a, b, c); - a += uint(xx); - b += uint(yy); - return mx_bjfinal(a, b, c); -} + + + + + + -uvec3 mx_hash_vec3(int x, int y) -{ - uint h = mx_hash_int(x, y); - // we only need the low-order bits to be random, so split out - // the 32 bit result into 3 parts for each channel - uvec3 result; - result.x = (h ) & 0xFFu; - result.y = (h >> 8 ) & 0xFFu; - result.z = (h >> 16) & 0xFFu; - return result; -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -uvec3 mx_hash_vec3(int x, int y, int z) -{ - uint h = mx_hash_int(x, y, z); - // we only need the low-order bits to be random, so split out - // the 32 bit result into 3 parts for each channel - uvec3 result; - result.x = (h ) & 0xFFu; - result.y = (h >> 8 ) & 0xFFu; - result.z = (h >> 16) & 0xFFu; - return result; -} + + + + + + + + -float mx_perlin_noise_float(vec2 p) -{ - int X, Y; - float fx = mx_floorfrac(p.x, X); - float fy = mx_floorfrac(p.y, Y); - float u = mx_fade(fx); - float v = mx_fade(fy); - float result = mx_bilerp( - mx_gradient_float(mx_hash_int(X , Y ), fx , fy ), - mx_gradient_float(mx_hash_int(X+1, Y ), fx-1.0, fy ), - mx_gradient_float(mx_hash_int(X , Y+1), fx , fy-1.0), - mx_gradient_float(mx_hash_int(X+1, Y+1), fx-1.0, fy-1.0), - u, v); - return mx_gradient_scale2d(result); -} + + + -float mx_perlin_noise_float(vec3 p) -{ - int X, Y, Z; - float fx = mx_floorfrac(p.x, X); - float fy = mx_floorfrac(p.y, Y); - float fz = mx_floorfrac(p.z, Z); - float u = mx_fade(fx); - float v = mx_fade(fy); - float w = mx_fade(fz); - float result = mx_trilerp( - mx_gradient_float(mx_hash_int(X , Y , Z ), fx , fy , fz ), - mx_gradient_float(mx_hash_int(X+1, Y , Z ), fx-1.0, fy , fz ), - mx_gradient_float(mx_hash_int(X , Y+1, Z ), fx , fy-1.0, fz ), - mx_gradient_float(mx_hash_int(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), - mx_gradient_float(mx_hash_int(X , Y , Z+1), fx , fy , fz-1.0), - mx_gradient_float(mx_hash_int(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), - mx_gradient_float(mx_hash_int(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), - mx_gradient_float(mx_hash_int(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), - u, v, w); - return mx_gradient_scale3d(result); -} + + + + + + -vec3 mx_perlin_noise_vec3(vec2 p) -{ - int X, Y; - float fx = mx_floorfrac(p.x, X); - float fy = mx_floorfrac(p.y, Y); - float u = mx_fade(fx); - float v = mx_fade(fy); - vec3 result = mx_bilerp( - mx_gradient_vec3(mx_hash_vec3(X , Y ), fx , fy ), - mx_gradient_vec3(mx_hash_vec3(X+1, Y ), fx-1.0, fy ), - mx_gradient_vec3(mx_hash_vec3(X , Y+1), fx , fy-1.0), - mx_gradient_vec3(mx_hash_vec3(X+1, Y+1), fx-1.0, fy-1.0), - u, v); - return mx_gradient_scale2d(result); -} + + + -vec3 mx_perlin_noise_vec3(vec3 p) -{ - int X, Y, Z; - float fx = mx_floorfrac(p.x, X); - float fy = mx_floorfrac(p.y, Y); - float fz = mx_floorfrac(p.z, Z); - float u = mx_fade(fx); - float v = mx_fade(fy); - float w = mx_fade(fz); - vec3 result = mx_trilerp( - mx_gradient_vec3(mx_hash_vec3(X , Y , Z ), fx , fy , fz ), - mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z ), fx-1.0, fy , fz ), - mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z ), fx , fy-1.0, fz ), - mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), - mx_gradient_vec3(mx_hash_vec3(X , Y , Z+1), fx , fy , fz-1.0), - mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), - mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), - mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), - u, v, w); - return mx_gradient_scale3d(result); -} + + + + -float mx_cell_noise_float(float p) -{ - int ix = mx_floor(p); - return mx_bits_to_01(mx_hash_int(ix)); -} + + + + + -float mx_cell_noise_float(vec2 p) -{ - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - return mx_bits_to_01(mx_hash_int(ix, iy)); -} + + + -float mx_cell_noise_float(vec3 p) -{ - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - int iz = mx_floor(p.z); - return mx_bits_to_01(mx_hash_int(ix, iy, iz)); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -float mx_cell_noise_float(vec4 p) -{ - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - int iz = mx_floor(p.z); - int iw = mx_floor(p.w); - return mx_bits_to_01(mx_hash_int(ix, iy, iz, iw)); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vec3 mx_cell_noise_vec3(float p) -{ - int ix = mx_floor(p); - return vec3( - mx_bits_to_01(mx_hash_int(ix, 0)), - mx_bits_to_01(mx_hash_int(ix, 1)), - mx_bits_to_01(mx_hash_int(ix, 2)) - ); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vec3 mx_cell_noise_vec3(vec2 p) -{ - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - return vec3( - mx_bits_to_01(mx_hash_int(ix, iy, 0)), - mx_bits_to_01(mx_hash_int(ix, iy, 1)), - mx_bits_to_01(mx_hash_int(ix, iy, 2)) - ); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vec3 mx_cell_noise_vec3(vec3 p) -{ - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - int iz = mx_floor(p.z); - return vec3( - mx_bits_to_01(mx_hash_int(ix, iy, iz, 0)), - mx_bits_to_01(mx_hash_int(ix, iy, iz, 1)), - mx_bits_to_01(mx_hash_int(ix, iy, iz, 2)) - ); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vec3 mx_cell_noise_vec3(vec4 p) -{ - int ix = mx_floor(p.x); - int iy = mx_floor(p.y); - int iz = mx_floor(p.z); - int iw = mx_floor(p.w); - return vec3( - mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 0)), - mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 1)), - mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 2)) - ); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -float mx_fractal_noise_float(vec3 p, int octaves, float lacunarity, float diminish) -{ - float result = 0.0; - float amplitude = 1.0; - for (int i = 0; i < octaves; ++i) - { - result += amplitude * mx_perlin_noise_float(p); - amplitude *= diminish; - p *= lacunarity; - } - return result; -} + + + + + + + + + + + + + + + + + + + + + + + + + -vec3 mx_fractal_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish) -{ - vec3 result = vec3(0.0); - float amplitude = 1.0; - for (int i = 0; i < octaves; ++i) - { - result += amplitude * mx_perlin_noise_vec3(p); - amplitude *= diminish; - p *= lacunarity; - } - return result; -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vec2 mx_fractal_noise_vec2(vec3 p, int octaves, float lacunarity, float diminish) -{ - return vec2(mx_fractal_noise_float(p, octaves, lacunarity, diminish), - mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish)); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vec4 mx_fractal_noise_vec4(vec3 p, int octaves, float lacunarity, float diminish) -{ - vec3 c = mx_fractal_noise_vec3(p, octaves, lacunarity, diminish); - float f = mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish); - return vec4(c, f); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -float mx_worley_distance(vec2 p, int x, int y, int xoff, int yoff, float jitter, int metric) -{ - vec3 tmp = mx_cell_noise_vec3(vec2(x+xoff, y+yoff)); - vec2 off = vec2(tmp.x, tmp.y); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - off -= 0.5f; - off *= jitter; - off += 0.5f; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - vec2 cellpos = vec2(float(x), float(y)) + off; - vec2 diff = cellpos - p; - if (metric == 2) - return abs(diff.x) + abs(diff.y); // Manhattan distance - if (metric == 3) - return max(abs(diff.x), abs(diff.y)); // Chebyshev distance - // Either Euclidian or Distance^2 - return dot(diff, diff); -} + + + + + + + + + + + + + + + + + + + + + + + + + -float mx_worley_distance(vec3 p, int x, int y, int z, int xoff, int yoff, int zoff, float jitter, int metric) -{ - vec3 off = mx_cell_noise_vec3(vec3(x+xoff, y+yoff, z+zoff)); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - off -= 0.5f; - off *= jitter; - off += 0.5f; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - vec3 cellpos = vec3(float(x), float(y), float(z)) + off; - vec3 diff = cellpos - p; - if (metric == 2) - return abs(diff.x) + abs(diff.y) + abs(diff.z); // Manhattan distance - if (metric == 3) - return max(max(abs(diff.x), abs(diff.y)), abs(diff.z)); // Chebyshev distance - // Either Euclidian or Distance^2 - return dot(diff, diff); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -float mx_worley_noise_float(vec2 p, float jitter, int metric) -{ - int X, Y; - vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); - float sqdist = 1e6f; // Some big number for jitter > 1 (not all GPUs may be IEEE) - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); - sqdist = min(sqdist, dist); - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; -} + + + + + + + + + + + + + -vec2 mx_worley_noise_vec2(vec2 p, float jitter, int metric) -{ - int X, Y; - vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); - vec2 sqdist = vec2(1e6f, 1e6f); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); - if (dist < sqdist.x) - { - sqdist.y = sqdist.x; - sqdist.x = dist; - } - else if (dist < sqdist.y) - { - sqdist.y = dist; - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; -} + + + + + + + + + + + + + -vec3 mx_worley_noise_vec3(vec2 p, float jitter, int metric) -{ - int X, Y; - vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); - vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); - if (dist < sqdist.x) - { - sqdist.z = sqdist.y; - sqdist.y = sqdist.x; - sqdist.x = dist; - } - else if (dist < sqdist.y) - { - sqdist.z = sqdist.y; - sqdist.y = dist; - } - else if (dist < sqdist.z) - { - sqdist.z = dist; - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; -} + + + + + + + + + + + + + + + + -float mx_worley_noise_float(vec3 p, float jitter, int metric) -{ - int X, Y, Z; - vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); - float sqdist = 1e6f; - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); - sqdist = min(sqdist, dist); - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; -} + + + + + + + + + + + + + + + + -vec2 mx_worley_noise_vec2(vec3 p, float jitter, int metric) -{ - int X, Y, Z; - vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); - vec2 sqdist = vec2(1e6f, 1e6f); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); - if (dist < sqdist.x) - { - sqdist.y = sqdist.x; - sqdist.x = dist; - } - else if (dist < sqdist.y) - { - sqdist.y = dist; - } - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; -} + + + + + + -vec3 mx_worley_noise_vec3(vec3 p, float jitter, int metric) -{ - int X, Y, Z; - vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); - vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); - if (dist < sqdist.x) - { - sqdist.z = sqdist.y; - sqdist.y = sqdist.x; - sqdist.x = dist; - } - else if (dist < sqdist.y) - { - sqdist.z = sqdist.y; - sqdist.y = dist; - } - else if (dist < sqdist.z) - { - sqdist.z = dist; - } - } - } - } - if (metric == 0) - sqdist = sqrt(sqdist); - return sqdist; -} -vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) -{ - uv = uv * uv_scale + uv_offset; - return vec2(uv.x, 1.0 - uv.y); -} -#define M_FLOAT_EPS 1e-8 + + + + + + + -float mx_square(float x) -{ - return x*x; -} + + + + + + + + + + + + + + -vec2 mx_square(vec2 x) -{ - return x*x; -} + + + + + + + + + + + + + + + + + + + + + -vec3 mx_square(vec3 x) -{ - return x*x; -} -/* -Color transform functions. + + + + + + + + + + + + + + + + + -These funcions are modified versions of the color operators found in Open Shading Language: -github.com/imageworks/OpenShadingLanguage/blob/master/src/liboslexec/opcolor.cpp + + + + + + + + + -It contains the subset of color operators needed to implement the MaterialX -standard library. The modifications are for conversions from C++ to GLSL. + + + + + + + + + -Original copyright notice: ------------------------------------------------------------------------- -Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. -All Rights Reserved. + + + + + + + + + -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -* Neither the name of Sony Pictures Imageworks nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------- -*/ + + + + + + -vec3 mx_hsvtorgb(vec3 hsv) -{ - // Reference for this technique: Foley & van Dam - float h = hsv.x; float s = hsv.y; float v = hsv.z; - if (s < 0.0001f) { - return vec3 (v, v, v); - } else { - h = 6.0f * (h - floor(h)); // expand to [0..6) - int hi = int(trunc(h)); - float f = h - float(hi); - float p = v * (1.0f-s); - float q = v * (1.0f-s*f); - float t = v * (1.0f-s*(1.0f-f)); - if (hi == 0) - return vec3 (v, t, p); - else if (hi == 1) - return vec3 (q, v, p); - else if (hi == 2) - return vec3 (p, v, t); - else if (hi == 3) - return vec3 (p, q, v); - else if (hi == 4) - return vec3 (t, p, v); - return vec3 (v, p, q); - } -} + + + + + + + + + + + + + + + + + + + + + + + -vec3 mx_rgbtohsv(vec3 c) -{ - // See Foley & van Dam - float r = c.x; float g = c.y; float b = c.z; - float mincomp = min (r, min(g, b)); - float maxcomp = max (r, max(g, b)); - float delta = maxcomp - mincomp; // chroma - float h, s, v; - v = maxcomp; - if (maxcomp > 0.0f) - s = delta / maxcomp; - else s = 0.0f; - if (s <= 0.0f) - h = 0.0f; - else { - if (r >= maxcomp) h = (g-b) / delta; - else if (g >= maxcomp) h = 2.0f + (b-r) / delta; - else h = 4.0f + (r-g) / delta; - h *= (1.0f/6.0f); - if (h < 0.0f) - h += 1.0f; - } - return vec3(h, s, v); -} -void mx_geompropvalue_boolean(string geomprop, int defaultVal, output int out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_worleynoise2d_vector3(vector2 texcoord, float jitter, output vector result) -{ - result = mx_worley_noise_vector3(texcoord, jitter, 0); -} -void mx_noise3d_vector3(vector amplitude, float pivot, vector position, output vector result) -{ - vector value = noise("snoise", position); - result = value * amplitude + pivot; -} -void mx_worleynoise3d_vector2(vector position, float jitter, output vector2 result) -{ - result = mx_worley_noise_vector2(position, jitter, 0); -} -#include "mx_burn_float.osl" + + + + + + -void mx_burn_color3(color fg, color bg, float mix, output color result) -{ - mx_burn_float(fg[0], bg[0], mix, result[0]); - mx_burn_float(fg[1], bg[1], mix, result[1]); - mx_burn_float(fg[2], bg[2], mix, result[2]); -} -void mx_dodge_float(float fg, float bg, float mix, output float out) -{ - if (abs(1.0 - fg) < M_FLOAT_EPS) - { - out = 0.0; - return; - } - out = mix*(bg / (1.0 - fg)) + ((1.0-mix)*bg); -} -void mx_noise3d_float(float amplitude, float pivot, vector position, output float result) -{ - float value = noise("snoise", position); - result = value * amplitude + pivot; -} -void mx_worleynoise3d_vector3(vector position, float jitter, output vector result) -{ - result = mx_worley_noise_vector3(position, jitter, 0); -} -void mx_luminance_color3(color in, color lumacoeffs, output color result) -{ - result = dot(in, lumacoeffs); -} -void mx_noise3d_vector4(vector4 amplitude, float pivot, vector position, output vector4 result) -{ - vector4 value = mx_noise("snoise", position); - result = value * amplitude + pivot; -} -void mx_geompropvalue_color(string geomprop, color defaultVal, output color out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_ambientocclusion_float(float coneangle, float maxdistance, output float result) -{ - // This node is a stub and does not currently operate to specification - result = 0; -} -void mx_worleynoise2d_vector2(vector2 texcoord, float jitter, output vector2 result) -{ - result = mx_worley_noise_vector2(texcoord, jitter, 0); -} -void mx_cellnoise2d_float(vector2 texcoord, output float result) -{ - result = cellnoise(texcoord.x, texcoord.y); -} -#include "mx_burn_float.osl" + + + + + + + -void mx_burn_color4(color4 fg, color4 bg, float mix, output color4 result) -{ - mx_burn_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); - mx_burn_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); - mx_burn_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); - mx_burn_float(fg.a, bg.a, mix, result.a); -} -void mx_rgbtohsv_color4(color4 _in, output color4 result) -{ - result = color4(transformc("rgb","hsv", _in.rgb), 1.0); -} -void mx_noise2d_vector3(vector amplitude, float pivot, vector2 texcoord, output vector result) -{ - vector value = noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} -void mx_worleynoise3d_float(vector position, float jitter, output float result) -{ - result = mx_worley_noise_float(position, jitter, 0); -} -void mx_rotate_vector2(vector2 _in, float amount, output vector2 result) -{ - float rotationRadians = radians(amount); - float sa = sin(rotationRadians); - float ca = cos(rotationRadians); - result = vector2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y); -} -#include "lib/$fileTransformUv" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_image_vector4(textureresource file, string layer, vector4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector4 out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - color missingColor = color(default_value.x, default_value.y, default_value.z); - float missingAlpha = default_value.w; - vector2 st = mx_transform_uv(texcoord); - float alpha; - color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, - "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode); + + + + + + + + + + + - out = vector4(rgb[0], rgb[1], rgb[2], alpha); -} -void mx_rgbtohsv_color3(vector _in, output vector result) -{ - result = transformc("rgb","hsv", _in); -} -void mx_geompropvalue_float(string geomprop, float defaultVal, output float result) -{ - if (getattribute(geomprop, result) == 0) - { - result = defaultVal; - } -} -void mx_time_float(float fps, output float result) -{ - float frame; - getattribute("frame", frame); - result = frame / fps; -} -matrix rotationMatrix(vector axis, float angle) -{ - vector nAxis = normalize(axis); - float s = sin(angle); - float c = cos(angle); - float oc = 1.0 - c; + + + + + + + + + + + + + + + + + - return matrix(oc * nAxis[0] * nAxis[0] + c, oc * nAxis[0] * nAxis[1] - nAxis[2] * s, oc * nAxis[2] * nAxis[0] + nAxis[1] * s, 0.0, - oc * nAxis[0] * nAxis[1] + nAxis[2] * s, oc * nAxis[1] * nAxis[1] + c, oc * nAxis[1] * nAxis[2] - nAxis[0] * s, 0.0, - oc * nAxis[2] * nAxis[0] - nAxis[1] * s, oc * nAxis[1] * nAxis[2] + nAxis[0] * s, oc * nAxis[2] * nAxis[2] + c, 0.0, - 0.0, 0.0, 0.0, 1.0); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -void mx_rotate_vector3(vector _in, float amount, vector axis, output vector result) -{ - float rotationRadians = radians(amount); - matrix m = rotationMatrix(axis, rotationRadians); - vector4 trans = transform(m, vector4(_in[0], _in[1], _in[2], 1.0)); - result = vector(trans.x, trans.y, trans.z); -} -void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vector position, output float result) -{ - float f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} -void mx_burn_float(float fg, float bg, float mix, output float result) -{ - if (abs(fg) < M_FLOAT_EPS) - { - result = 0.0; - return; - } - result = mix*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mix)*bg); -} -void mx_noise2d_vector4(vector4 amplitude, float pivot, vector2 texcoord, output vector4 result) -{ - vector4 value = mx_noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} -void mx_transformmatrix_vector2M3(vector2 val, matrix m, output vector2 result) -{ - point res = transform(m, point(val.x, val.y, 1.0)); - result.x = res[0]; - result.y = res[1]; -} - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - + + + + + - + + + + + - - - + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + - - - - - + + + + + + + - - - - - + + + + + + + - - + + + + + + + - - + + + + + + + - - - - + + + + + + + - - - - + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + - - - - + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + - + Declarations for MDL implementations of standard nodes included in the MaterialX specification. + --> - - + + + - - - - - + + - - - + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + - - + - - + + + - + - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + - - - + + + + + - - - + + + + + - - - + + + + + - - + + - - + + - - - - + + + + - - - - + + + + - - - - + + + - - - - + + - - - - + + + - - - - + + - - + + - - + + - - + + - - + + + - - + + + + - - + + + + + + + + + + - - - - + + + - - - - + + - - - - - - - - - - - - - + + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - + + + + + + + + - - - + + + + + + + + - - - + + + + + + + + + + + + - - - - + + + + + + + - - - + + + + + + - - - - - - - + + + + + + - - + + + + + + - - - + + + + + - - - - - - - - - - - - - - - - - - -void mx_noise3d_vector2(vector2 amplitude, float pivot, vector position, output vector2 result) -{ - vector2 value = mx_noise("snoise", position); - result = value * amplitude + pivot; -} -void mx_frame_float(output float result) -{ - getattribute("frame", result); -} -void mx_cellnoise3d_float(vector position, output float result) -{ - result = cellnoise(position); -} -#include "mx_dodge_float.osl" + + + + + -void mx_dodge_color3(color fg, color bg, float mix, output color result) -{ - mx_dodge_float(fg[0], bg[0], mix, result[0]); - mx_dodge_float(fg[1], bg[1], mix, result[1]); - mx_dodge_float(fg[2], bg[2], mix, result[2]); -} -void mx_unpremult_color4(color4 in, output color4 result) -{ - result = color4(in.rgb / in.a, in.a); -} -void mx_geomcolor_color4(int index, output color4 result) -{ - float value[4]; - getattribute("color", value); - result.rgb[0] = value[0]; - result.rgb[1] = value[1]; - result.rgb[2] = value[2]; - result.a = value[3]; -} -void mx_premult_color4(color4 in, output color4 result) -{ - result = color4(in.rgb * in.a, in.a); -} -void mx_geomcolor_color3(int index, output color result) -{ - getattribute("color", result); -} -void mx_geompropvalue_string(string geomprop, string defaultVal, output string out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_fractal3d_vector4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result) -{ - vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} -void mx_disjointover_color4(color4 fg, color4 bg, float mix, output color4 result) -{ - float summedAlpha = fg.a + bg.a; + + + + + + + + + + + + + + + + + + + + + + + + + + - if (summedAlpha <= 1) - { - result.rgb = fg.rgb + bg.rgb; - } - else - { - if (abs(bg.a) < M_FLOAT_EPS) - { - result.rgb = 0.0; - } - else - { - float x = (1 - fg.a) / bg.a; - result.rgb = fg.rgb + bg.rgb * x; - } - } - result.a = min(summedAlpha, 1.0); + + + + + + + + + + + + - result.rgb = result.rgb * mix + (1.0 - mix) * bg.rgb; - result.a = result.a * mix + (1.0 - mix) * bg.a; -} -void mx_geompropvalue_color4(string geomprop, color4 defaultVal, output color4 out) -{ - float value[4]; - if (getattribute(geomprop, value) == 0) - { - out.rgb = defaultVal.rgb; - out.a = defaultVal.a; - } - else - { - out.rgb[0] = value[0]; - out.rgb[1] = value[1]; - out.rgb[2] = value[2]; - out.a = value[3]; - } -} -#include "lib/$fileTransformUv" + + + + + + + + + + + + -void mx_image_color3(textureresource file, string layer, color default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + + + - color missingColor = default_value; - vector2 st = mx_transform_uv(texcoord); - out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); -} -void mx_geompropvalue_vector4(string geomprop, vector4 defaultVal, output vector4 out) -{ - float value[4]; - if (getattribute(geomprop, value) == 0) - { - out = defaultVal; - } - else - { - out.x = value[0]; - out.y = value[1]; - out.z = value[2]; - out.w = value[3]; - } -} -#include "mx_dodge_float.osl" + + + + -void mx_dodge_color4(color4 fg , color4 bg , float mix , output color4 result) -{ - mx_dodge_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); - mx_dodge_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); - mx_dodge_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); - mx_dodge_float(fg.a, bg.a, mix, result.a); -} -void mx_geompropvalue_vector2(string geomprop, vector2 defaultVal, output vector2 out) -{ - float value[2]; - if (getattribute(geomprop, value) == 0) - { - out = defaultVal; - } - else - { - out.x = value[0]; - out.y = value[1]; - } -} -void mx_geomcolor_float(int index, output float result) -{ - getattribute("color", result); -} -void mx_creatematrix_vector3_matrix33(vector in1, vector in2, vector in3, output matrix result) -{ - result = matrix(in1.x, in1.y, in1.z, 0.0, - in2.x, in2.y, in2.z, 0.0, - in3.x, in3.y, in3.z, 0.0, - 0.0, 0.0, 0.0, 1.0); -} + + + + -void mx_creatematrix_vector3_matrix44(vector in1, vector in2, vector in3, vector in4, output matrix result) -{ - result = matrix(in1.x, in1.y, in1.z, 0.0, - in2.x, in2.y, in2.z, 0.0, - in3.x, in3.y, in3.z, 0.0, - in4.x, in4.y, in4.z, 1.0); -} + + -void mx_creatematrix_vector4_matrix44(vector4 in1, vector4 in2, vector4 in3, vector4 in4, output matrix result) -{ - result = matrix(in1.x, in1.y, in1.z, in1.w, - in2.x, in2.y, in2.z, in2.w, - in3.x, in3.y, in3.z, in3.w, - in4.x, in4.y, in4.z, in4.w); -} -#include "lib/$fileTransformUv" + + -void mx_image_vector3(textureresource file, string layer, vector default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + - color missingColor = default_value; - vector2 st = mx_transform_uv(texcoord); - out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); -} -void mx_worleynoise2d_float(vector2 texcoord, float jitter, output float result) -{ - result = mx_worley_noise_float(texcoord, jitter, 0); -} -void mx_normalmap_vector2(vector value, string map_space, vector2 normal_scale, vector N, vector U, output vector result) -{ - // Tangent space - if (map_space == "tangent") - { - vector v = value * 2.0 - 1.0; - vector T = normalize(U - dot(U, N) * N); - vector B = normalize(cross(N, T)); - result = normalize(T * v[0] * normal_scale.x + B * v[1] * normal_scale.y + N * v[2]); - } - // Object space - else - { - vector n = value * 2.0 - 1.0; - result = normalize(n); - } -} + + -void mx_normalmap_float(vector value, string map_space, float normal_scale, vector N, vector U, output vector result) -{ - mx_normalmap_vector2(value, map_space, vector2(normal_scale, normal_scale), N, U, result); -} -void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, output surfaceshader result) -{ - result.bsdf = mix(bg.bsdf, fg.bsdf, w); - result.edf = mix(bg.edf, fg.edf, w); - result.opacity = mix(bg.opacity, fg.opacity, w); -} -void mx_noise2d_vector2(vector2 amplitude, float pivot, vector2 texcoord, output vector2 result) -{ - vector2 value = mx_noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} -void mx_geompropvalue_vector(string geomprop, vector defaultVal, output vector out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_hsvtorgb_color3(vector _in, output vector result) -{ - result = transformc("hsv","rgb", _in); -} -void mx_noise2d_float(float amplitude, float pivot, vector2 texcoord, output float result) -{ - float value = noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} -#include "lib/$fileTransformUv" + + + + + -void mx_image_color4(textureresource file, string layer, color4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color4 out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + + + + + + + + + + + + + - color missingColor = default_value.rgb; - float missingAlpha = default_value.a; - vector2 st = mx_transform_uv(texcoord); - float alpha; - color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, - "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); + + - out = color4(rgb, alpha); -} -void mx_luminance_color4(color4 in, color lumacoeffs, output color4 result) -{ - result = color4(dot(in.rgb, lumacoeffs), in.a); -} -void mx_geompropvalue_integer(string geomprop, int defaultVal, output int out) -{ - if (getattribute(geomprop, out) == 0) - out = defaultVal; -} -void mx_fractal3d_vector2(vector2 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result) -{ - vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} -void mx_hsvtorgb_color4(color4 _in, output color4 result) -{ - result = color4(transformc("hsv","rgb", _in.rgb), 1.0); -} -void mx_surface_unlit(float emission_weight, color emission_color, float transmission_weight, color transmission_color, float opacity, output surfaceshader result) -{ - float trans = clamp(transmission_weight, 0.0, 1.0); - result.bsdf = trans * transmission_color * transparent(); - result.edf = (1.0 - trans) * emission_weight * emission_color * emission(); - result.opacity = clamp(opacity, 0.0, 1.0); -} -#include "lib/$fileTransformUv" + + + -void mx_image_vector2(textureresource file, string layer, vector2 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector2 out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + - color missingColor = color(default_value.x, default_value.y, 0.0); - vector2 st = mx_transform_uv(texcoord); - color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); - out.x = rgb[0]; - out.y = rgb[1]; -} -#include "lib/$fileTransformUv" + + + + + + + + + + + + -void mx_image_float(textureresource file, string layer, float default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output float out) -{ - if (file.filename == "" || - (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || - (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) - { - out = default_value; - return; - } + + + + + - color missingColor = color(default_value); - vector2 st = mx_transform_uv(texcoord); - color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); - out = rgb[0]; -} -void mx_heighttonormal_vector3(float in, float scale, output vector result) -{ - point htP = P + normalize(N) * in * scale; - result = normalize(calculatenormal(htP)); -} -void mx_fractal3d_vector3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result) -{ - vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE -// -// MaterialX specification (c) 2017 Lucasfilm Ltd. -// http://www.materialx.org/ + -#pragma once + + + -#include "color4.h" -#include "vector2.h" -#include "vector4.h" -#include "matrix33.h" + + + -// -// Support functions for OSL implementations of the MaterialX nodes. -// + + + -float mx_ternary(int expr, float v1, float v2) { if (expr) return v1; else return v2; } -color mx_ternary(int expr, color v1, color v2) { if (expr) return v1; else return v2; } -color4 mx_ternary(int expr, color4 v1, color4 v2) { if (expr) return v1; else return v2; } -vector mx_ternary(int expr, vector v1, vector v2) { if (expr) return v1; else return v2; } -vector2 mx_ternary(int expr, vector2 v1, vector2 v2) { if (expr) return v1; else return v2; } -vector4 mx_ternary(int expr, vector4 v1, vector4 v2) { if (expr) return v1; else return v2; } -matrix mx_ternary(int expr, matrix v1, matrix v2) { if (expr) return v1; else return v2; } -matrix33 mx_ternary(int expr, matrix33 v1, matrix33 v2) { if (expr) return v1; else return v2; } + + + + + -matrix33 mx_add(matrix33 a, matrix33 b) -{ - return matrix33(matrix( - a.m[0][0]+b.m[0][0], a.m[0][1]+b.m[0][1], a.m[0][2]+b.m[0][2], 0.0, - a.m[1][0]+b.m[1][0], a.m[1][1]+b.m[1][1], a.m[1][2]+b.m[1][2], 0.0, - a.m[2][0]+b.m[2][0], a.m[2][1]+b.m[2][1], a.m[2][2]+b.m[2][2], 0.0, - 0.0, 0.0, 0.0, 1.0)); -} + + -matrix33 mx_add(matrix33 a, float b) -{ - return matrix33(matrix( - a.m[0][0]+b, a.m[0][1]+b, a.m[0][2]+b, 0.0, - a.m[1][0]+b, a.m[1][1]+b, a.m[1][2]+b, 0.0, - a.m[2][0]+b, a.m[2][1]+b, a.m[2][2]+b, 0.0, - 0.0, 0.0, 0.0, 1.0)); -} + + + + -matrix mx_add(matrix a, matrix b) -{ - return matrix( - a[0][0]+b[0][0], a[0][1]+b[0][1], a[0][2]+b[0][2], a[0][3]+b[0][3], - a[1][0]+b[1][0], a[1][1]+b[1][1], a[1][2]+b[1][2], a[1][3]+b[1][3], - a[2][0]+b[2][0], a[2][1]+b[2][1], a[2][2]+b[2][2], a[2][3]+b[2][3], - a[3][0]+b[3][0], a[3][1]+b[3][1], a[3][2]+b[3][2], a[3][3]+b[3][3]); -} + + + + -matrix mx_add(matrix a, float b) -{ - return matrix( - a[0][0]+b, a[0][1]+b, a[0][2]+b, a[0][3]+b, - a[1][0]+b, a[1][1]+b, a[1][2]+b, a[1][3]+b, - a[2][0]+b, a[2][1]+b, a[2][2]+b, a[2][3]+b, - a[3][0]+b, a[3][1]+b, a[3][2]+b, a[3][3]+b); -} + + + + + + + + -matrix33 mx_subtract(matrix33 a, matrix33 b) -{ - return matrix33(matrix( - a.m[0][0]-b.m[0][0], a.m[0][1]-b.m[0][1], a.m[0][2]-b.m[0][2], 0.0, - a.m[1][0]-b.m[1][0], a.m[1][1]-b.m[1][1], a.m[1][2]-b.m[1][2], 0.0, - a.m[2][0]-b.m[2][0], a.m[2][1]-b.m[2][1], a.m[2][2]-b.m[2][2], 0.0, - 0.0, 0.0, 0.0, 1.0)); -} + + + + -matrix33 mx_subtract(matrix33 a, float b) -{ - return matrix33(matrix( - a.m[0][0]-b, a.m[0][1]-b, a.m[0][2]-b, 0.0, - a.m[1][0]-b, a.m[1][1]-b, a.m[1][2]-b, 0.0, - a.m[2][0]-b, a.m[2][1]-b, a.m[2][2]-b, 0.0, - 0.0, 0.0, 0.0, 1.0)); -} + + + + -matrix mx_subtract(matrix a, matrix b) -{ - return matrix( - a[0][0]-b[0][0], a[0][1]-b[0][1], a[0][2]-b[0][2], a[0][3]-b[0][3], - a[1][0]-b[1][0], a[1][1]-b[1][1], a[1][2]-b[1][2], a[1][3]-b[1][3], - a[2][0]-b[2][0], a[2][1]-b[2][1], a[2][2]-b[2][2], a[2][3]-b[2][3], - a[3][0]-b[3][0], a[3][1]-b[3][1], a[3][2]-b[3][2], a[3][3]-b[3][3]); -} + + -matrix mx_subtract(matrix a, float b) -{ - return matrix( - a[0][0]-b, a[0][1]-b, a[0][2]-b, a[0][3]-b, - a[1][0]-b, a[1][1]-b, a[1][2]-b, a[1][3]-b, - a[2][0]-b, a[2][1]-b, a[2][2]-b, a[2][3]-b, - a[3][0]-b, a[3][1]-b, a[3][2]-b, a[3][3]-b); -} + + + + -float mx_remap(float in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - float x = (in - inLow)/(inHigh-inLow); - if (doClamp == 1) { - x = clamp(x, 0, 1); - } - return outLow + (outHigh - outLow) * x; -} + + -color mx_remap(color in, color inLow, color inHigh, color outLow, color outHigh, int doClamp) -{ - color x = (in - inLow) / (inHigh - inLow); - if (doClamp == 1) { - x = clamp(x, 0, 1); - } - return outLow + (outHigh - outLow) * x; -} + + + + + + + + + + -color mx_remap(color in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - color x = (in - inLow) / (inHigh - inLow); - if (doClamp == 1) { - x = clamp(x, 0, 1); - } - return outLow + (outHigh - outLow) * x; -} + + + + -color4 mx_remap(color4 c, color4 inLow, color4 inHigh, color4 outLow, color4 outHigh, int doClamp) -{ - return color4(mx_remap(c.rgb, inLow.rgb, inHigh.rgb, outLow.rgb, outHigh.rgb, doClamp), - mx_remap(c.a, inLow.a, inHigh.a, outLow.a, outHigh.a, doClamp)); -} + + + + + + + + + + + + + + + -color4 mx_remap(color4 c, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - color4 c4_inLow = color4(color(inLow), inLow); - color4 c4_inHigh = color4(color(inHigh), inHigh); - color4 c4_outLow = color4(color(outLow), outLow); - color4 c4_outHigh = color4(color(outHigh), outHigh); - return mx_remap(c, c4_inLow, c4_inHigh, c4_outLow, c4_outHigh, doClamp); -} + + + -vector2 mx_remap(vector2 in, vector2 inLow, vector2 inHigh, vector2 outLow, vector2 outHigh, int doClamp) -{ - return vector2(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp), - mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp)); -} + + + + + + + + + + + + + + + + + + + -vector2 mx_remap(vector2 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - return vector2(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp), - mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp)); -} + + + + + + + + + + + + + + + + + + + -vector4 mx_remap(vector4 in, vector4 inLow, vector4 inHigh, vector4 outLow, vector4 outHigh, int doClamp) -{ - return vector4(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp), - mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp), - mx_remap(in.z, inLow.z, inHigh.z, outLow.z, outHigh.z, doClamp), - mx_remap(in.w, inLow.w, inHigh.w, outLow.w, outHigh.w, doClamp)); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vector4 mx_remap(vector4 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) -{ - return vector4(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp), - mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp), - mx_remap(in.z, inLow, inHigh, outLow, outHigh, doClamp), - mx_remap(in.w, inLow, inHigh, outLow, outHigh, doClamp)); -} + + + + + + + + + + + + + + + + + + + + + + -float mx_contrast(float in, float amount, float pivot) -{ - float out = in - pivot; - out *= amount; - out += pivot; - return out; -} + + + + + + + + + + + + + + + + + + -color mx_contrast(color in, color amount, color pivot) -{ - color out = in - pivot; - out *= amount; - out += pivot; - return out; -} + + + + + -color mx_contrast(color in, float amount, float pivot) -{ - color out = in - pivot; - out *= amount; - out += pivot; - return out; -} + + + -color4 mx_contrast(color4 c, color4 amount, color4 pivot) -{ - return color4(mx_contrast(c.rgb, amount.rgb, pivot.rgb), - mx_contrast(c.a, amount.a, pivot.a)); -} + + + -color4 mx_contrast(color4 c, float amount, float pivot) -{ - return mx_contrast(c, color4(color(amount), amount), color4(color(pivot), pivot)); -} + + + + -vector2 mx_contrast(vector2 in, vector2 amount, vector2 pivot) -{ - return vector2 (mx_contrast(in.x, amount.x, pivot.x), - mx_contrast(in.y, amount.y, pivot.y)); -} + + + + + + -vector2 mx_contrast(vector2 in, float amount, float pivot) -{ - return mx_contrast(in, vector2(amount, amount), vector2(pivot, pivot)); -} + + + -vector4 mx_contrast(vector4 in, vector4 amount, vector4 pivot) -{ - return vector4(mx_contrast(in.x, amount.x, pivot.x), - mx_contrast(in.y, amount.y, pivot.y), - mx_contrast(in.z, amount.z, pivot.z), - mx_contrast(in.w, amount.w, pivot.w)); -} + + + + + + + -vector4 mx_contrast(vector4 in, float amount, float pivot) -{ - return vector4(mx_contrast(in.x, amount, pivot), - mx_contrast(in.y, amount, pivot), - mx_contrast(in.z, amount, pivot), - mx_contrast(in.w, amount, pivot)); -} + + + + + -vector2 mx_noise(string noisetype, float x, float y) -{ - color cnoise = (color) noise(noisetype, x, y); - return vector2 (cnoise[0], cnoise[1]); -} + + + + + + + + + + + + + + + + + -color4 mx_noise(string noisetype, float x, float y) -{ - color cnoise = (color) noise(noisetype, x, y); - float fnoise = (float) noise(noisetype, x + 19, y + 73); - return color4 (cnoise, fnoise); -} + +#include "mx_aastep.glsl" -vector4 mx_noise(string noisetype, float x, float y) +void mx_splitlr_vector2(vec2 valuel, vec2 valuer, float center, vec2 texcoord, out vec2 result) { - color cnoise = (color) noise(noisetype, x, y); - float fnoise = (float) noise(noisetype, x + 19, y + 73); - return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise); + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); } - -vector2 mx_noise(string noisetype, point position) +float mx_aastep(float threshold, float value) { - color cnoise = (color) noise(noisetype, position); - return vector2 (cnoise[0], cnoise[1]); + float afwidth = length(vec2(dFdx(value), dFdy(value))) * 0.70710678118654757; + return smoothstep(threshold-afwidth, threshold+afwidth, value); } - -color4 mx_noise(string noisetype, point position) +void mx_dodge_float(float fg, float bg, float mixval, out float result) { - color cnoise = (color) noise(noisetype, position); - float fnoise = (float) noise(noisetype, position+vector(19,73,29)); - return color4 (cnoise, fnoise); + if (abs(1.0 - fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(bg / (1.0 - fg)) + ((1.0-mixval)*bg); } +#include "mx_aastep.glsl" -vector4 mx_noise(string noisetype, point position) +void mx_splittb_vector4(vec4 valuet, vec4 valueb, float center, vec2 texcoord, out vec4 result) { - color cnoise = (color) noise(noisetype, position); - float fnoise = (float) noise(noisetype, position+vector(19,73,29)); - return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise); + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); } - - -float mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) +void mx_luminance_color3(vec3 _in, vec3 lumacoeffs, out vec3 result) { - float out = 0; - float amp = 1.0; - point p = position; - - for (int i = 0; i < octaves; i += 1) { - out += amp * noise(noisetype, p); - amp *= diminish; - p *= lacunarity; - } - return out; + result = vec3(dot(_in, lumacoeffs)); } +#include "lib/mx_noise.glsl" -color mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) +void mx_worleynoise2d_vector2(vec2 texcoord, float jitter, out vec2 result) { - color out = 0; - float amp = 1.0; - point p = position; - - for (int i = 0; i < octaves; i += 1) { - out += amp * (color)noise(noisetype, p); - amp *= diminish; - p *= lacunarity; - } - return out; + result = mx_worley_noise_vec2(texcoord, jitter, 0); } +#include "lib/mx_noise.glsl" -vector2 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) +void mx_fractal3d_vector3(vec3 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec3 result) { - return vector2((float) mx_fbm(position, octaves, lacunarity, diminish, noisetype), - (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype)); + vec3 value = mx_fractal_noise_vec3(position, octaves, lacunarity, diminish); + result = value * amplitude; } +#include "lib/mx_noise.glsl" -color4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) +void mx_noise2d_vector4(vec4 amplitude, float pivot, vec2 texcoord, out vec4 result) { - color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype); - float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype); - return color4 (c, f); + vec3 xyz = mx_perlin_noise_vec3(texcoord); + float w = mx_perlin_noise_float(texcoord + vec2(19, 73)); + result = vec4(xyz, w) * amplitude + pivot; } - -vector4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) +void mx_ramptb_vector3(vec3 valuet, vec3 valueb, vec2 texcoord, out vec3 result) { - color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype); - float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype); - return vector4 (c[0], c[1], c[2], f); + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); } +#include "mx_smoothstep_float.glsl" - -void mx_split_float(output float x, output int ix) +void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) { - ix = int(floor(x)); - x -= ix; + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); } - -float mx_worley_distance(vector2 p, int x, int y, int X, int Y, float jitter, int metric) +void mx_ramplr_vector2(vec2 valuel, vec2 valuer, vec2 texcoord, out vec2 result) { - vector o = cellnoise(x+X, y+Y); - o = (o - .5)*jitter + .5; - float cposx = x + o[0]; - float cposy = y + o[1]; - float diffx = cposx - p.x; - float diffy = cposy - p.y; - - if (metric == 2) - return abs(diffx) + abs(diffy); // Manhattan distance - if (metric == 3) - return max(abs(diffx), abs(diffy)); // Chebyshev distance - return diffx*diffx + diffy*diffy; // Euclidean or distance^2 + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); } +#include "lib/mx_noise.glsl" -float mx_worley_distance(vector p, int x, int y, int z, int X, int Y, int Z, float jitter, int metric) +void mx_noise2d_float(float amplitude, float pivot, vec2 texcoord, out float result) { - vector o = cellnoise(vector(x+X, y+Y, z+Z)); - o = (o - .5)*jitter + .5; - vector cpos = vector(x, y, z) + o; - vector diff = cpos - p; - - if (metric == 2) - return abs(diff[0]) + abs(diff[1]); // Manhattan distance - if (metric == 3) - return max(abs(diff[0]), abs(diff[1])); // Chebyshev distance - return dot(diff, diff); // Eucldean or distance^2 + float value = mx_perlin_noise_float(texcoord); + result = value * amplitude + pivot; } +#include "mx_dodge_float.glsl" -void mx_sort_distance(float dist, output vector2 result) +void mx_dodge_color4(vec4 fg , vec4 bg , float mixval, out vec4 result) { - if (dist < result.x) - { - result.y = result.x; - result.x = dist; - } - else if (dist < result.y) - { - result.y = dist; - } + mx_dodge_float(fg.x, bg.x, mixval, result.x); + mx_dodge_float(fg.y, bg.y, mixval, result.y); + mx_dodge_float(fg.z, bg.z, mixval, result.z); + mx_dodge_float(fg.w, bg.w, mixval, result.w); } +#include "mx_aastep.glsl" -void mx_sort_distance(float dist, output vector result) +void mx_splitlr_float(float valuel, float valuer, float center, vec2 texcoord, out float result) { - if (dist < result[0]) - { - result[2] = result[1]; - result[1] = result[0]; - result[0] = dist; - } - else if (dist < result[1]) - { - result[2] = result[1]; - result[1] = dist; - } - else if (dist < result[2]) - { - result[2] = dist; - } + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); } +#include "lib/mx_noise.glsl" -float mx_worley_noise_float(vector2 p, float jitter, int metric) +void mx_cellnoise3d_float(vec3 position, out float result) { - int X, Y; - vector2 seed = p; - float result = 1e6; - - mx_split_float(seed.x, X); - mx_split_float(seed.y, Y); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); - result = min(result, d); - } - } - if (metric == 0) - result = sqrt(result); - return result; + result = mx_cell_noise_float(position); } +#include "mx_smoothstep_float.glsl" -vector2 mx_worley_noise_vector2(vector2 p, float jitter, int metric) +void mx_smoothstep_vector3(vec3 val, vec3 low, vec3 high, out vec3 result) { - int X, Y; - vector2 seed = p; - vector2 result = vector2(1e6, 1e6); - - mx_split_float(seed.x, X); - mx_split_float(seed.y, Y); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); - mx_sort_distance(d, result); - } - } - if (metric == 0) - result = sqrt(result); - return result; + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); + mx_smoothstep_float(val.z, low.z, high.z, result.z); } +#include "lib/mx_noise.glsl" -vector mx_worley_noise_vector3(vector2 p, float jitter, int metric) +void mx_noise3d_vector2(vec2 amplitude, float pivot, vec3 position, out vec2 result) { - int X, Y; - vector2 seed = p; - vector result = vector(1e6, 1e6, 1e6); - - mx_split_float(seed.x, X); - mx_split_float(seed.y, Y); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); - mx_sort_distance(d, result); - } - } - if (metric == 0) - result = sqrt(result); - return result; + vec3 value = mx_perlin_noise_vec3(position); + result = value.xy * amplitude + pivot; } - -float mx_worley_noise_float(vector p, float jitter, int metric) +void mx_transformmatrix_vector3M4(vec3 val, mat4 transform, out vec3 result) { - int X, Y, Z; - vector seed = p; - float result = 1e6; - - mx_split_float(seed[0], X); - mx_split_float(seed[1], Y); - mx_split_float(seed[2], Z); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); - result = min(result, d); - } - } - } - if (metric == 0) - result = sqrt(result); - return result; + vec4 res = transform * vec4(val, 1.0); + result = res.xyz; } +#include "lib/mx_hsv.glsl" -vector2 mx_worley_noise_vector2(vector p, float jitter, int metric) +void mx_rgbtohsv_color3(vec3 _in, out vec3 result) { - int X, Y, Z; - vector seed = p; - vector2 result = vector2(1e6, 1e6); - - mx_split_float(seed[0], X); - mx_split_float(seed[1], Y); - mx_split_float(seed[2], Z); - for (int x = -1; x <= 1; ++x) - { - for (int y = -1; y <= 1; ++y) - { - for (int z = -1; z <= 1; ++z) - { - float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); - mx_sort_distance(d, result); - } - } - } - if (metric == 0) - result = sqrt(result); - return result; + result = mx_rgbtohsv(_in); } - -vector mx_worley_noise_vector3(vector p, float jitter, int metric) +void mx_ramplr_vector3(vec3 valuel, vec3 valuer, vec2 texcoord, out vec3 result) { - int X, Y, Z; - vector result = 1e6; - vector seed = p; + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); +} +void mx_disjointover_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) +{ + float summedAlpha = fg.w + bg.w; - mx_split_float(seed[0], X); - mx_split_float(seed[1], Y); - mx_split_float(seed[2], Z); - for (int x = -1; x <= 1; ++x) + if (summedAlpha <= 1.0) { - for (int y = -1; y <= 1; ++y) + result.xyz = fg.xyz + bg.xyz; + } + else + { + if (abs(bg.w) < M_FLOAT_EPS) { - for (int z = -1; z <= 1; ++z) - { - float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); - mx_sort_distance(d, result); - } + result.xyz = vec3(0.0); + } + else + { + float x = (1.0 - fg.w) / bg.w; + result.xyz = fg.xyz + bg.xyz * x; } } - if (metric == 0) - result = sqrt(result); - return result; -} -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE - -#pragma once -#define VECTOR4_H + result.w = min(summedAlpha, 1.0); + result.xyz = result.xyz * mixval + (1.0 - mixval) * bg.xyz; + result.w = result.w * mixval + (1.0 - mixval) * bg.w; +} +#include "lib/mx_noise.glsl" -// vector4 is a 4D vector -struct vector4 +void mx_cellnoise2d_float(vec2 texcoord, out float result) { - float x; - float y; - float z; - float w; -}; - - - -// -// For vector4, define math operators to match vector -// + result = mx_cell_noise_float(texcoord); +} +#include "mx_aastep.glsl" -vector4 __operator__neg__(vector4 a) +void mx_splitlr_vector4(vec4 valuel, vec4 valuer, float center, vec2 texcoord, out vec4 result) { - return vector4(-a.x, -a.y, -a.z, -a.w); + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); } +#include "lib/$fileTransformUv" -vector4 __operator__add__(vector4 a, vector4 b) +void mx_image_vector2(sampler2D tex_sampler, int layer, vec2 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec2 result) { - return vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rg; } +#include "mx_dodge_float.glsl" -vector4 __operator__add__(vector4 a, int b) +void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) { - return a + vector4(b, b, b, b); + mx_dodge_float(fg.x, bg.x, mixval, result.x); + mx_dodge_float(fg.y, bg.y, mixval, result.y); + mx_dodge_float(fg.z, bg.z, mixval, result.z); } - -vector4 __operator__add__(vector4 a, float b) +void mx_ramptb_vector2(vec2 valuet, vec2 valueb, vec2 texcoord, out vec2 result) { - return a + vector4(b, b, b, b); + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); } +#include "lib/mx_hsv.glsl" -vector4 __operator__add__(int a, vector4 b) +void mx_rgbtohsv_color4(vec4 _in, out vec4 result) { - return vector4(a, a, a, a) + b; + result = vec4(mx_rgbtohsv(_in.rgb), 1.0); } +#include "lib/mx_noise.glsl" -vector4 __operator__add__(float a, vector4 b) +void mx_worleynoise3d_float(vec3 position, float jitter, out float result) { - return vector4(a, a, a, a) + b; + result = mx_worley_noise_float(position, jitter, 0); } +#include "lib/mx_hsv.glsl" -vector4 __operator__sub__(vector4 a, vector4 b) +void mx_hsvtorgb_color3(vec3 _in, out vec3 result) { - return vector4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); + result = mx_hsvtorgb(_in); } +#include "lib/mx_noise.glsl" -vector4 __operator__sub__(vector4 a, int b) +void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out float result) { - return a - vector4(b, b, b, b); + float value = mx_fractal_noise_float(position, octaves, lacunarity, diminish); + result = value * amplitude; } +#include "lib/mx_noise.glsl" -vector4 __operator__sub__(vector4 a, float b) +void mx_noise3d_vector3(vec3 amplitude, float pivot, vec3 position, out vec3 result) { - return a - vector4(b, b, b, b); + vec3 value = mx_perlin_noise_vec3(position); + result = value * amplitude + pivot; } - -vector4 __operator__sub__(int a, vector4 b) +void mx_ramplr_float(float valuel, float valuer, vec2 texcoord, out float result) { - return vector4(a, a, a, a) - b; + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); } - -vector4 __operator__sub__(float a, vector4 b) +void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, out surfaceshader returnshader) { - return vector4(a, a, a, a) - b; + returnshader.color = mix(bg.color, fg.color, w); + returnshader.transparency = mix(bg.transparency, fg.transparency, w); } +void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) +{ + // Decode the normal map. + value = (value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0; -vector4 __operator__mul__(vector4 a, vector4 b) + // Transform from tangent space if needed. + if (map_space == 0) + { + vec3 B = normalize(cross(N, T)); + value.xy *= normal_scale; + value = T * value.x + B * value.y + N * value.z; + } + + // Normalize the result. + result = normalize(value); +} + +void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result) { - return vector4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); + mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); } +#include "lib/mx_noise.glsl" -vector4 __operator__mul__(vector4 a, int b) +void mx_worleynoise2d_vector3(vec2 texcoord, float jitter, out vec3 result) { - return a * vector4(b, b, b, b); + result = mx_worley_noise_vec3(texcoord, jitter, 0); } +#include "mx_aastep.glsl" -vector4 __operator__mul__(vector4 a, float b) +void mx_splittb_vector2(vec2 valuet, vec2 valueb, float center, vec2 texcoord, out vec2 result) { - return a * vector4(b, b, b, b); + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); +} +void mx_creatematrix_vector4_matrix44(vec4 in1, vec4 in2, vec4 in3, vec4 in4, out mat4 result) +{ + result = mat4(in1.x, in1.y, in1.z, in1.w, + in2.x, in2.y, in2.z, in2.w, + in3.x, in3.y, in3.z, in3.w, + in4.x, in4.y, in4.z, in4.w); } +#include "lib/mx_noise.glsl" -vector4 __operator__mul__(int a, vector4 b) +void mx_worleynoise3d_vector2(vec3 position, float jitter, out vec2 result) { - return vector4(a, a, a, a) * b; + result = mx_worley_noise_vec2(position, jitter, 0); } +#include "lib/mx_hsv.glsl" -vector4 __operator__mul__(float a, vector4 b) +void mx_hsvtorgb_color4(vec4 _in, out vec4 result) { - return vector4(a, a, a, a) * b; + result = vec4(mx_hsvtorgb(_in.rgb), 1.0); } +#include "mx_aastep.glsl" -vector4 __operator__div__(vector4 a, vector4 b) +void mx_splittb_float(float valuet, float valueb, float center, vec2 texcoord, out float result) { - return vector4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -vector4 __operator__div__(vector4 a, int b) -{ - float b_inv = 1.0/b; - return a * vector4(b_inv, b_inv, b_inv, b_inv); -} + + + + + + + -vector4 __operator__div__(vector4 a, float b) -{ - float b_inv = 1.0/b; - return a * vector4(b_inv, b_inv, b_inv, b_inv); -} + + + + + + + -vector4 __operator__div__(int a, vector4 b) -{ - return vector4(a, a, a, a) / b; -} + + + + + + + -vector4 __operator__div__(float a, vector4 b) -{ - return vector4(a, a, a, a) / b; -} + + + + + + + -int __operator__eq__(vector4 a, vector4 b) -{ - return (a.x == b.x) && (a.y == b.y) && (a.z == b.z) && (a.w == b.w); -} + + + + + -int __operator__ne__(vector4 a, vector4 b) -{ - return (a.x != b.x) || (a.y != b.y) || (a.z != b.z) || (a.w != b.w); -} + + + + + + + + + + + + + + -// -// For vector4, define most of the stdosl functions to match vector -// + + + + -vector4 abs(vector4 in) -{ - return vector4 (abs(in.x), - abs(in.y), - abs(in.z), - abs(in.w)); -} + + + + -vector4 ceil(vector4 in) -{ - return vector4 (ceil(in.x), - ceil(in.y), - ceil(in.z), - ceil(in.w)); -} + + + -vector4 round(vector4 in) -{ - return vector4 (round(in.x), - round(in.y), - round(in.z), - round(in.w)); -} + -vector4 floor(vector4 in) -{ - return vector4 (floor(in.x), - floor(in.y), - floor(in.z), - floor(in.w)); -} + + + -vector4 sqrt(vector4 in) -{ - return vector4 (sqrt(in.x), - sqrt(in.y), - sqrt(in.z), - sqrt(in.w)); -} + + -vector4 exp(vector4 in) -{ - return vector4 (exp(in.x), - exp(in.y), - exp(in.z), - exp(in.w)); -} + + -vector4 log(vector4 in) -{ - return vector4 (log(in.x), - log(in.y), - log(in.z), - log(in.w)); -} + + -vector4 log2(vector4 in) -{ - return vector4 (log2(in.x), - log2(in.y), - log2(in.z), - log2(in.w)); -} + + -vector4 mix(vector4 value1, vector4 value2, float x ) -{ - return vector4 (mix( value1.x, value2.x, x), - mix( value1.y, value2.y, x), - mix( value1.z, value2.z, x), - mix( value1.w, value2.w, x)); -} + + + -vector4 mix(vector4 value1, vector4 value2, vector4 x ) -{ - return vector4 (mix( value1.x, value2.x, x.x), - mix( value1.y, value2.y, x.y), - mix( value1.z, value2.z, x.z), - mix( value1.w, value2.w, x.w)); -} + + + + -vector vec4ToVec3(vector4 v) -{ - return vector(v.x, v.y, v.z) / v.w; -} + + + + + + + + + + -float dot(vector4 a, vector4 b) -{ - return ((a.x * b.x) + (a.y * b.y) + (a.z * b.z) + (a.w * b.w)); -} + + + -float length (vector4 a) -{ - return sqrt (a.x*a.x + a.y*a.y + a.z*a.z + a.w*a.w); -} + + -vector4 smoothstep(vector4 low, vector4 high, vector4 in) -{ - return vector4 (smoothstep(low.x, high.x, in.x), - smoothstep(low.y, high.y, in.y), - smoothstep(low.z, high.z, in.z), - smoothstep(low.w, high.w, in.w)); -} + + -vector4 smoothstep(float low, float high, vector4 in) -{ - return vector4 (smoothstep(low, high, in.x), - smoothstep(low, high, in.y), - smoothstep(low, high, in.z), - smoothstep(low, high, in.w)); -} + + + -vector4 clamp(vector4 in, vector4 low, vector4 high) -{ - return vector4 (clamp(in.x, low.x, high.x), - clamp(in.y, low.y, high.y), - clamp(in.z, low.z, high.z), - clamp(in.w, low.w, high.w)); -} + + + + + + + + + + + + + + + + + -vector4 clamp(vector4 in, float low, float high) -{ - return vector4 (clamp(in.x, low, high), - clamp(in.y, low, high), - clamp(in.z, low, high), - clamp(in.w, low, high)); -} + + + + + + + + + + + + + + + + + -vector4 max(vector4 a, vector4 b) -{ - return vector4 (max(a.x, b.x), - max(a.y, b.y), - max(a.z, b.z), - max(a.w, b.w)); -} + + + + + + + + + + + + + + -vector4 max(vector4 a, float b) -{ - return max(a, vector4(b, b, b, b)); -} + + + + + + + + + + + + + + -vector4 normalize(vector4 a) -{ - return a / length(a); -} + + + + + + + + + + + + -vector4 min(vector4 a, vector4 b) -{ - return vector4 (min(a.x, b.x), - min(a.y, b.y), - min(a.z, b.z), - min(a.w, b.w)); -} + + + + + + + + + + + + -vector4 min(vector4 a, float b) -{ - return min(a, vector4(b, b, b, b)); -} + + + + + + + -vector4 mod(vector4 a, vector4 b) -{ - return vector4(mod(a.x, b.x), - mod(a.y, b.y), - mod(a.z, b.z), - mod(a.w, b.w)); -} + + + + + + + + -vector4 mod(vector4 a, float b) -{ - return mod(a, vector4(b, b, b, b)); -} + + + + + + + + -vector4 fmod(vector4 a, vector4 b) -{ - return vector4 (fmod(a.x, b.x), - fmod(a.y, b.y), - fmod(a.z, b.z), - fmod(a.w, b.w)); -} + + + + + + + + -vector4 fmod(vector4 a, float b) -{ - return fmod(a, vector4(b, b, b, b)); -} + + + + + + + + + + + + -vector4 pow(vector4 in, vector4 amount) -{ - return vector4 (pow(in.x, amount.x), - pow(in.y, amount.y), - pow(in.z, amount.z), - pow(in.w, amount.w)); -} + + + + + + + + + + + + + + + + + + + + + + + + + -vector4 pow(vector4 in, float amount) -{ - return vector4 (pow(in.x, amount), - pow(in.y, amount), - pow(in.z, amount), - pow(in.w, amount)); -} + + + + + -vector4 sign(vector4 a) -{ - return vector4(sign(a.x), - sign(a.y), - sign(a.z), - sign(a.w)); -} + + + + + -vector4 sin(vector4 a) -{ - return vector4(sin(a.x), - sin(a.y), - sin(a.z), - sin(a.w)); -} + + + + + -vector4 cos(vector4 a) -{ - return vector4(cos(a.x), - cos(a.y), - cos(a.z), - cos(a.w)); -} + + + + + + + + + + + + + + + + + + + + -vector4 tan(vector4 a) -{ - return vector4(tan(a.x), - tan(a.y), - tan(a.z), - tan(a.w)); -} + + + + + + + + + + + + -vector4 asin(vector4 a) -{ - return vector4(asin(a.x), - asin(a.y), - asin(a.z), - asin(a.w)); -} + + + + + + + + + + + + -vector4 acos(vector4 a) -{ - return vector4(acos(a.x), - acos(a.y), - acos(a.z), - acos(a.w)); -} + + + + -vector4 atan2(vector4 a, float f) -{ - return vector4(atan2(a.x, f), - atan2(a.y, f), - atan2(a.z, f), - atan2(a.w, f)); -} + + + + -vector4 atan2(vector4 a, vector4 b) -{ - return vector4(atan2(a.x, b.x), - atan2(a.y, b.y), - atan2(a.z, b.z), - atan2(a.w, b.w)); -} + + + + + + -vector4 transform (matrix M, vector4 p) -{ - return vector4 (M[0][0]*p.x + M[1][0]*p.y + M[2][0]*p.z + M[3][0]*p.w, - M[0][1]*p.x + M[1][1]*p.y + M[2][1]*p.z + M[3][1]*p.w, - M[0][2]*p.x + M[1][2]*p.y + M[2][2]*p.z + M[3][2]*p.w, - M[0][3]*p.x + M[1][3]*p.y + M[2][3]*p.z + M[3][3]*p.w); -} + + -vector4 transform (string fromspace, string tospace, vector4 p) -{ - return transform (matrix(fromspace,tospace), p); -} -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE + + -#pragma once -#define COLOR4_H + + + + + + + -// color4 is a color + alpha -struct color4 -{ - color rgb; - float a; -}; + + + + + + + + + -// -// For color4, define math operators to match color -// + + -color4 __operator__neg__(color4 a) -{ - return color4(-a.rgb, -a.a); -} + + -color4 __operator__add__(color4 a, color4 b) -{ - return color4(a.rgb + b.rgb, a.a + b.a); -} + + + -color4 __operator__add__(color4 a, int b) -{ - return a + color4(color(b), b); -} + -color4 __operator__add__(color4 a, float b) -{ - return a + color4(color(b), b); -} + + + + + + + + + + + + -color4 __operator__add__(int a, color4 b) -{ - return color4(color(a), a) + b; -} + + + + + -color4 __operator__add__(float a, color4 b) -{ - return color4(color(a), a) + b; -} + + + -color4 __operator__sub__(color4 a, color4 b) -{ - return color4(a.rgb - b.rgb, a.a - b.a); -} + + + -color4 __operator__sub__(color4 a, int b) -{ - return a - color4(color(b), b); -} + + + -color4 __operator__sub__(color4 a, float b) -{ - return a - color4(color(b), b); -} + + + -color4 __operator__sub__(int a, color4 b) -{ - return color4(color(a), a) - b; -} + + -color4 __operator__sub__(float a, color4 b) -{ - return color4(color(a), a) - b; -} + + -color4 __operator__mul__(color4 a, color4 b) -{ - return color4(a.rgb * b.rgb, a.a * b.a); -} + + + + -color4 __operator__mul__(color4 a, int b) -{ - return a * color4(color(b), b); -} + + + + -color4 __operator__mul__(color4 a, float b) -{ - return a * color4(color(b), b); -} + + + + -color4 __operator__mul__(int a, color4 b) -{ - return color4(color(a), a) * b; -} + + + + -color4 __operator__mul__(float a, color4 b) -{ - return color4(color(a), a) * b; -} + + + + -color4 __operator__div__(color4 a, color4 b) -{ - return color4(a.rgb / b.rgb, a.a / b.a); -} + + + + + + + -color4 __operator__div__(color4 a, int b) -{ - float b_inv = 1.0/b; - return a * color4(color(b_inv), b_inv); -} + + -color4 __operator__div__(color4 a, float b) -{ - float b_inv = 1.0/b; - return a * color4(color(b_inv), b_inv); -} + + -color4 __operator_div__(int a, color4 b) -{ - return color4(color(a), a) / b; -} + + -color4 __operator__div__(float a, color4 b) -{ - return color4(color(a), a) / b; -} + + -int __operator__eq__(color4 a, color4 b) -{ - return (a.rgb == b.rgb) && (a.a == b.a); -} + + -int __operator__ne__(color4 a, color4 b) -{ - return (a.rgb != b.rgb) || (a.a != b.a); -} + + + + + + + + + + + + + + + + + + + + + -// -// For color4, define most of the stdosl functions to match color -// + + + -color4 abs(color4 a) -{ - return color4(abs(a.rgb), abs(a.a)); -} + + + + + + + + + + + + + + + + + + + -color4 ceil(color4 a) -{ - return color4(ceil(a.rgb), ceil(a.a)); -} + + + + + + + + + + + + + + + + + + + -color4 round(color4 a) -{ - return color4(round(a.rgb), round(a.a)); -} + + + + + + + + + + + + + + + + + + + + + + + + + + + + -color4 floor(color4 a) -{ - return color4(floor(a.rgb), floor(a.a)); -} + -color4 sqrt(color4 a) -{ - return color4(sqrt(a.rgb), sqrt(a.a)); -} + + + + + + + + + -color4 exp(color4 a) -{ - return color4(exp(a.rgb), exp(a.a)); -} + + + + + + + + + -color4 log(color4 a) -{ - return color4(log(a.rgb), log(a.a)); -} + + + -color4 log2(color4 a) -{ - return color4(log2(a.rgb), log2(a.a)); -} + + + + + + + + + + + + + + + + + + -color4 mix(color4 a, color4 b, float x ) -{ - return color4(mix(a.rgb, b.rgb, x), - mix(a.a, b.a, x)); -} + + + + + + + + + -color4 mix(color4 a, color4 b, color4 x ) -{ - return color4(mix(a.rgb, b.rgb, x.rgb), - mix(a.a, b.a, x.a)); -} + + + + -float dot(color4 a, color b) -{ - return dot(a.rgb, b); -} + + + + + + -color4 smoothstep(color4 edge0, color4 edge1, color4 c) -{ - return color4(smoothstep(edge0.rgb, edge1.rgb, c.rgb), - smoothstep(edge0.a, edge1.a, c.a)); -} + + + -color4 smoothstep(float edge0, float edge1, color4 c) -{ - return smoothstep(color4(color(edge0), edge0), color4(color(edge1), edge1), c); -} + + + + + + + -color4 clamp(color4 c, color4 minval, color4 maxval) -{ - return color4(clamp(c.rgb, minval.rgb, maxval.rgb), - clamp(c.a, minval.a, maxval.a)); -} + + -color4 clamp(color4 c, float minval, float maxval) -{ - return clamp(c, color4(color(minval), minval), color4(color(maxval), maxval)); -} + + + + + + + + + + + + + + + + + + + + + + +#include "lib/$fileTransformUv" -color4 max(color4 a, color4 b) +void mx_image_vector4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) { - return color4(max(a.rgb, b.rgb), - max(a.a, b.a)); + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv); } +#include "lib/mx_noise.glsl" -color4 max(color4 a, float b) +void mx_noise2d_vector3(vec3 amplitude, float pivot, vec2 texcoord, out vec3 result) { - return color4(max(a.rgb, b), - max(a.a, b)); + vec3 value = mx_perlin_noise_vec3(texcoord); + result = value * amplitude + pivot; } +#include "lib/mx_noise.glsl" -color4 min(color4 a, color4 b) +void mx_worleynoise2d_float(vec2 texcoord, float jitter, out float result) { - return color4(min(a.rgb, b.rgb), - min(a.a, b.a)); + result = mx_worley_noise_float(texcoord, jitter, 0); } - -color4 min(color4 a, float b) +void mx_ramptb_vector4(vec4 valuet, vec4 valueb, vec2 texcoord, out vec4 result) { - return color4(min(a.rgb, b), - min(a.a, b)); + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); } - -color4 mod(color4 a, color4 b) +void mx_luminance_color4(vec4 _in, vec3 lumacoeffs, out vec4 result) { - return color4(mod(a.rgb, b.rgb), - mod(a.a, b.a)); + result = vec4(vec3(dot(_in.rgb, lumacoeffs)), _in.a); } - -color4 mod(color4 a, int b) +void mx_creatematrix_vector3_matrix44(vec3 in1, vec3 in2, vec3 in3, vec3 in4, out mat4 result) { - return mod(a, color4(color(b), b)); + result = mat4(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + in4.x, in4.y, in4.z, 1.0); } +#include "lib/mx_noise.glsl" -color4 mod(color4 a, float b) +void mx_worleynoise3d_vector3(vec3 position, float jitter, out vec3 result) { - return mod(a, color4(color(b), b)); + result = mx_worley_noise_vec3(position, jitter, 0); } +#include "lib/mx_noise.glsl" -color4 fmod(color4 a, color4 b) +void mx_noise2d_vector2(vec2 amplitude, float pivot, vec2 texcoord, out vec2 result) { - return color4(fmod(a.rgb, b.rgb), - fmod(a.a, b.a)); + vec3 value = mx_perlin_noise_vec3(texcoord); + result = value.xy * amplitude + pivot; } - -color4 fmod(color4 a, int b) +void mx_ramplr_vector4(vec4 valuel, vec4 valuer, vec2 texcoord, out vec4 result) { - return fmod(a, color4(color(b), b)); + result = mix (valuel, valuer, clamp(texcoord.x, 0.0, 1.0) ); } - -color4 fmod(color4 a, float b) +void mx_smoothstep_float(float val, float low, float high, out float result) { - return fmod(a, color4(color(b), b)); + if (val <= low) + result = 0.0; + else if (val >= high) + result = 1.0; + else + result = smoothstep(low, high, val); } - -color4 pow(color4 base, color4 power) +void mx_transformmatrix_vector2M3(vec2 val, mat3 transform, out vec2 result) { - return color4(pow(base.rgb, power.rgb), - pow(base.a, power.a)); + vec3 res = transform * vec3(val, 1.0); + result = res.xy; } +#include "lib/$fileTransformUv" -color4 pow(color4 base, float power) +void mx_image_color4(sampler2D tex_sampler, int layer, vec4 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec4 result) { - return color4(pow(base.rgb, power), - pow(base.a, power)); + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv); } +#include "lib/$fileTransformUv" -color4 sign(color4 a) +void mx_image_float(sampler2D tex_sampler, int layer, float defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out float result) { - return color4(sign(a.rgb), - sign(a.a)); + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).r; } +#include "lib/mx_noise.glsl" -color4 sin(color4 a) +void mx_noise3d_float(float amplitude, float pivot, vec3 position, out float result) { - return color4(sin(a.rgb), - sin(a.a)); + float value = mx_perlin_noise_float(position); + result = value * amplitude + pivot; } - -color4 cos(color4 a) +void mx_creatematrix_vector3_matrix33(vec3 in1, vec3 in2, vec3 in3, out mat3 result) { - return color4(cos(a.rgb), - cos(a.a)); + result = mat3(in1.x, in1.y, in1.z, + in2.x, in2.y, in2.z, + in3.x, in3.y, in3.z); } +#include "mx_aastep.glsl" -color4 tan(color4 a) +void mx_splitlr_vector3(vec3 valuel, vec3 valuer, float center, vec2 texcoord, out vec3 result) { - return color4(tan(a.rgb), - tan(a.a)); + result = mix(valuel, valuer, mx_aastep(center, texcoord.x)); } +#include "mx_burn_float.glsl" -color4 asin(color4 a) +void mx_burn_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) { - return color4(asin(a.rgb), - asin(a.a)); + mx_burn_float(fg.x, bg.x, mixval, result.x); + mx_burn_float(fg.y, bg.y, mixval, result.y); + mx_burn_float(fg.z, bg.z, mixval, result.z); } - -color4 acos(color4 a) +mat4 mx_rotationMatrix(vec3 axis, float angle) { - return color4(acos(a.rgb), - acos(a.a)); -} + axis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; -color4 atan2(color4 a, float f) -{ - return color4(atan2(a.rgb, f), - atan2(a.a, f)); + return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0, + oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0, + oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0, + 0.0, 0.0, 0.0, 1.0); } -color4 atan2(color4 a, color4 b) +void mx_rotate_vector3(vec3 _in, float amount, vec3 axis, out vec3 result) { - return color4(atan2(a.rgb, b.rgb), - atan2(a.a, b.a)); + float rotationRadians = radians(amount); + mat4 m = mx_rotationMatrix(axis, rotationRadians); + result = (m * vec4(_in, 1.0)).xyz; } +#include "lib/mx_noise.glsl" - -color4 transformc (string fromspace, string tospace, color4 C) +void mx_noise3d_vector4(vec4 amplitude, float pivot, vec3 position, out vec4 result) { - return color4 (transformc (fromspace, tospace, C.rgb), C.a); + vec3 xyz = mx_perlin_noise_vec3(position); + float w = mx_perlin_noise_float(position + vec3(19, 73, 29)); + result = vec4(xyz, w) * amplitude + pivot; } -// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. -// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE -// -// MaterialX specification (c) 2017 Lucasfilm Ltd. -// http://www.materialx.org/ - -#pragma once -#define MATRIX33_H - +#include "mx_smoothstep_float.glsl" -struct matrix33 +void mx_smoothstep_vector4(vec4 val, vec4 low, vec4 high, out vec4 result) { - matrix m; -}; + mx_smoothstep_float(val.x, low.x, high.x, result.x); + mx_smoothstep_float(val.y, low.y, high.y, result.y); + mx_smoothstep_float(val.z, low.z, high.z, result.z); + mx_smoothstep_float(val.w, low.w, high.w, result.w); +} +#include "lib/mx_noise.glsl" -int isValidAs33(matrix m44) +void mx_fractal3d_vector2(vec2 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec2 result) { - return m44[0][3] == 0 && - m44[1][3] == 0 && - m44[2][3] == 0 && - m44[3][0] == 0 && - m44[3][1] == 0 && - m44[3][2] == 0 && - m44[3][3] == 1; + vec2 value = mx_fractal_noise_vec2(position, octaves, lacunarity, diminish); + result = value * amplitude; } - -matrix matrix33To44 (matrix33 m33) +void mx_ramptb_float(float valuet, float valueb, vec2 texcoord, out float result) { - return m33.m; + result = mix (valuet, valueb, clamp(texcoord.y, 0.0, 1.0) ); } +#include "lib/$fileTransformUv" -// Convert an arbitrary m44 to m33 by removing the translation -//QUESTION: should we check if it's valid to represent the 4x4 as a 3x3? -matrix33 matrix44To33 (matrix m44) +void mx_image_color3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) { - matrix33 m33; - m33.m = m44; - m33.m[0][3] = 0; - m33.m[1][3] = 0; - m33.m[2][3] = 0; - m33.m[3][0] = 0; - m33.m[3][1] = 0; - m33.m[3][2] = 0; - m33.m[3][3] = 1; - - return m33; + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rgb; } +#include "mx_burn_float.glsl" -matrix33 __operator__neg__(matrix33 a) +void mx_burn_color4(vec4 fg, vec4 bg, float mixval, out vec4 result) { - matrix33 m33; - m33.m = -a.m; - return m33; + mx_burn_float(fg.x, bg.x, mixval, result.x); + mx_burn_float(fg.y, bg.y, mixval, result.y); + mx_burn_float(fg.z, bg.z, mixval, result.z); + mx_burn_float(fg.w, bg.w, mixval, result.w); } - - -matrix33 __operator__mul__(int a, matrix33 b) +void mx_unpremult_color4(vec4 _in, out vec4 result) { - matrix33 m33; - m33.m = a * b.m; - return m33; + result = vec4(_in.rgb / _in.a, _in.a); } +#include "lib/mx_noise.glsl" -matrix33 __operator__mul__(float a, matrix33 b) +void mx_fractal3d_vector4(vec4 amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec4 result) { - matrix33 m33; - m33.m = a * b.m; - return m33; + vec4 value = mx_fractal_noise_vec4(position, octaves, lacunarity, diminish); + result = value * amplitude; } +#include "lib/$fileTransformUv" -matrix33 __operator__mul__(matrix33 a, int b) +void mx_image_vector3(sampler2D tex_sampler, int layer, vec3 defaultval, vec2 texcoord, int uaddressmode, int vaddressmode, int filtertype, int framerange, int frameoffset, int frameendaction, vec2 uv_scale, vec2 uv_offset, out vec3 result) { - matrix33 m33; - m33.m = a.m * b; - return m33; + vec2 uv = mx_transform_uv(texcoord, uv_scale, uv_offset); + result = texture(tex_sampler, uv).rgb; } - -matrix33 __operator__mul__(matrix33 a, float b) +void mx_premult_color4(vec4 _in, out vec4 result) { - matrix33 m33; - m33.m = a.m * b; - return m33; + result = vec4(_in.rgb * _in.a, _in.a); } +#include "mx_aastep.glsl" -matrix33 __operator__mul__(matrix33 a, matrix33 b) +void mx_splittb_vector3(vec3 valuet, vec3 valueb, float center, vec2 texcoord, out vec3 result) { - matrix33 m33; - m33.m = a.m * b.m; - return m33; + result = mix(valuet, valueb, mx_aastep(center, texcoord.y)); } - -matrix33 __operator__div__(int a, matrix33 b) +void mx_rotate_vector2(vec2 _in, float amount, out vec2 result) { - matrix33 m33; - m33.m = a / b.m; - return m33; + float rotationRadians = radians(amount); + float sa = sin(rotationRadians); + float ca = cos(rotationRadians); + result = vec2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y); } - -matrix33 __operator__div__(float a, matrix33 b) +void mx_burn_float(float fg, float bg, float mixval, out float result) { - matrix33 m33; - m33.m = a / b.m; - return m33; + if (abs(fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mixval*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mixval)*bg); } - -matrix33 __operator__div__(matrix33 a, int b) +vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) { - matrix33 m33; - m33.m = a.m / b; - return m33; + uv = uv * uv_scale + uv_offset; + return uv; } - -matrix33 __operator__div__(matrix33 a, float b) +vec2 mx_transform_uv(vec2 uv, vec2 uv_scale, vec2 uv_offset) { - matrix33 m33; - m33.m = a.m / b; - return m33; + uv = uv * uv_scale + uv_offset; + return vec2(uv.x, 1.0 - uv.y); } +#define M_FLOAT_EPS 1e-8 -matrix33 __operator__div__(matrix33 a, matrix33 b) +float mx_square(float x) { - matrix33 m33; - m33.m = a.m / b.m; - return m33; + return x*x; } -int __operator__eq__(matrix33 a, matrix33 b) +vec2 mx_square(vec2 x) { - return a.m == b.m; + return x*x; } -int __operator__ne__(matrix33 a, matrix33 b) +vec3 mx_square(vec3 x) { - return a.m != b.m; + return x*x; } +// Restrict to 7x7 kernel size for performance reasons +#define MX_MAX_SAMPLE_COUNT 49 +// Size of all weights for all levels (including level 1) +#define MX_WEIGHT_ARRAY_SIZE 84 -float determinant (matrix33 a) +// +// Function to compute the sample size relative to a texture coordinate +// +vec2 mx_compute_sample_size_uv(vec2 uv, float filterSize, float filterOffset) { - return determinant(a.m); + vec2 derivUVx = dFdx(uv) * 0.5f; + vec2 derivUVy = dFdy(uv) * 0.5f; + float derivX = abs(derivUVx.x) + abs(derivUVy.x); + float derivY = abs(derivUVx.y) + abs(derivUVy.y); + float sampleSizeU = 2.0f * filterSize * derivX + filterOffset; + if (sampleSizeU < 1.0E-05f) + sampleSizeU = 1.0E-05f; + float sampleSizeV = 2.0f * filterSize * derivY + filterOffset; + if (sampleSizeV < 1.0E-05f) + sampleSizeV = 1.0E-05f; + return vec2(sampleSizeU, sampleSizeV); } -matrix33 transpose(matrix33 a) +// +// Compute a normal mapped to 0..1 space based on a set of input +// samples using a Sobel filter. +// +vec3 mx_normal_from_samples_sobel(float S[9], float _scale) { - matrix33 m33; - m33.m = transpose(a.m); - return m33; + float nx = S[0] - S[2] + (2.0*S[3]) - (2.0*S[5]) + S[6] - S[8]; + float ny = S[0] + (2.0*S[1]) + S[2] - S[6] - (2.0*S[7]) - S[8]; + float nz = max(_scale, M_FLOAT_EPS) * sqrt(max(1.0 - nx * nx - ny * ny, M_FLOAT_EPS)); + vec3 norm = normalize(vec3(nx, ny, nz)); + return (norm + 1.0) * 0.5; } -point transform(matrix33 a, point b) +// +// Apply filter for float samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) { - return transform(a.m, b); + float result = 0.0; + for (int i = 0; i < sampleCount; i++) + { + result += S[i]*W[i+offset]; + } + return result; } -vector transform(matrix33 a, vector b) +// +// Apply filter for vec2 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vec2 mx_convolution_vec2(vec2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) { - return transform(a.m, b); + vec2 result = vec2(0.0); + for (int i=0; i>(32-k)); } -vector2 __operator__mul__(int a, vector2 b) +void mx_bjmix(inout uint a, inout uint b, inout uint c) { - return b * vector2(a, a); + a -= c; a ^= mx_rotl32(c, 4); c += b; + b -= a; b ^= mx_rotl32(a, 6); a += c; + c -= b; c ^= mx_rotl32(b, 8); b += a; + a -= c; a ^= mx_rotl32(c,16); c += b; + b -= a; b ^= mx_rotl32(a,19); a += c; + c -= b; c ^= mx_rotl32(b, 4); b += a; } -vector2 __operator__mul__(float a, vector2 b) +// Mix up and combine the bits of a, b, and c (doesn't change them, but +// returns a hash of those three original values). +uint mx_bjfinal(uint a, uint b, uint c) { - return b * vector2(a, a); + c ^= b; c -= mx_rotl32(b,14); + a ^= c; a -= mx_rotl32(c,11); + b ^= a; b -= mx_rotl32(a,25); + c ^= b; c -= mx_rotl32(b,16); + a ^= c; a -= mx_rotl32(c,4); + b ^= a; b -= mx_rotl32(a,14); + c ^= b; c -= mx_rotl32(b,24); + return c; } -vector2 __operator__div__(vector2 a, vector2 b) +// Convert a 32 bit integer into a floating point number in [0,1] +float mx_bits_to_01(uint bits) { - return vector2(a.x / b.x, a.y / b.y); + return float(bits) / float(uint(0xffffffff)); } -vector2 __operator__div__(vector2 a, int b) +float mx_fade(float t) { - float b_inv = 1.0/b; - return a * vector2(b_inv, b_inv); + return t * t * t * (t * (t * 6.0 - 15.0) + 10.0); } -vector2 __operator__div__(vector2 a, float b) +uint mx_hash_int(int x) { - float b_inv = 1.0/b; - return a * vector2(b_inv, b_inv); + uint len = 1u; + uint seed = uint(0xdeadbeef) + (len << 2u) + 13u; + return mx_bjfinal(seed+uint(x), seed, seed); } -vector2 __operator__div__(int a, vector2 b) +uint mx_hash_int(int x, int y) { - return vector2(a, a) / b; + uint len = 2u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + return mx_bjfinal(a, b, c); } -vector2 __operator__div__(float a, vector2 b) +uint mx_hash_int(int x, int y, int z) { - return vector2(a, a) / b; + uint len = 3u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + return mx_bjfinal(a, b, c); } -int __operator__eq__(vector2 a, vector2 b) +uint mx_hash_int(int x, int y, int z, int xx) { - return (a.x == b.x) && (a.y == b.y); + uint len = 4u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + mx_bjmix(a, b, c); + a += uint(xx); + return mx_bjfinal(a, b, c); } -int __operator__ne__(vector2 a, vector2 b) +uint mx_hash_int(int x, int y, int z, int xx, int yy) { - return (a.x != b.x) || (a.y != b.y); + uint len = 5u; + uint a, b, c; + a = b = c = uint(0xdeadbeef) + (len << 2u) + 13u; + a += uint(x); + b += uint(y); + c += uint(z); + mx_bjmix(a, b, c); + a += uint(xx); + b += uint(yy); + return mx_bjfinal(a, b, c); } - - - -// -// For vector2, define most of the stdosl functions to match vector -// - -vector2 abs(vector2 a) +uvec3 mx_hash_vec3(int x, int y) { - return vector2 (abs(a.x), abs(a.y)); + uint h = mx_hash_int(x, y); + // we only need the low-order bits to be random, so split out + // the 32 bit result into 3 parts for each channel + uvec3 result; + result.x = (h ) & 0xFFu; + result.y = (h >> 8 ) & 0xFFu; + result.z = (h >> 16) & 0xFFu; + return result; } -vector2 ceil(vector2 a) +uvec3 mx_hash_vec3(int x, int y, int z) { - return vector2 (ceil(a.x), ceil(a.y)); + uint h = mx_hash_int(x, y, z); + // we only need the low-order bits to be random, so split out + // the 32 bit result into 3 parts for each channel + uvec3 result; + result.x = (h ) & 0xFFu; + result.y = (h >> 8 ) & 0xFFu; + result.z = (h >> 16) & 0xFFu; + return result; } -vector2 round(vector2 a) +float mx_perlin_noise_float(vec2 p) { - return vector2 (round(a.x), round(a.y)); + int X, Y; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float u = mx_fade(fx); + float v = mx_fade(fy); + float result = mx_bilerp( + mx_gradient_float(mx_hash_int(X , Y ), fx , fy ), + mx_gradient_float(mx_hash_int(X+1, Y ), fx-1.0, fy ), + mx_gradient_float(mx_hash_int(X , Y+1), fx , fy-1.0), + mx_gradient_float(mx_hash_int(X+1, Y+1), fx-1.0, fy-1.0), + u, v); + return mx_gradient_scale2d(result); } -vector2 floor(vector2 a) +float mx_perlin_noise_float(vec3 p) { - return vector2 (floor(a.x), floor(a.y)); + int X, Y, Z; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float fz = mx_floorfrac(p.z, Z); + float u = mx_fade(fx); + float v = mx_fade(fy); + float w = mx_fade(fz); + float result = mx_trilerp( + mx_gradient_float(mx_hash_int(X , Y , Z ), fx , fy , fz ), + mx_gradient_float(mx_hash_int(X+1, Y , Z ), fx-1.0, fy , fz ), + mx_gradient_float(mx_hash_int(X , Y+1, Z ), fx , fy-1.0, fz ), + mx_gradient_float(mx_hash_int(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), + mx_gradient_float(mx_hash_int(X , Y , Z+1), fx , fy , fz-1.0), + mx_gradient_float(mx_hash_int(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), + mx_gradient_float(mx_hash_int(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), + mx_gradient_float(mx_hash_int(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), + u, v, w); + return mx_gradient_scale3d(result); } -vector2 sqrt(vector2 a) +vec3 mx_perlin_noise_vec3(vec2 p) { - return vector2 (sqrt(a.x), sqrt(a.y)); + int X, Y; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float u = mx_fade(fx); + float v = mx_fade(fy); + vec3 result = mx_bilerp( + mx_gradient_vec3(mx_hash_vec3(X , Y ), fx , fy ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y ), fx-1.0, fy ), + mx_gradient_vec3(mx_hash_vec3(X , Y+1), fx , fy-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1), fx-1.0, fy-1.0), + u, v); + return mx_gradient_scale2d(result); } -vector2 exp(vector2 a) +vec3 mx_perlin_noise_vec3(vec3 p) { - return vector2 (exp(a.x), exp(a.y)); + int X, Y, Z; + float fx = mx_floorfrac(p.x, X); + float fy = mx_floorfrac(p.y, Y); + float fz = mx_floorfrac(p.z, Z); + float u = mx_fade(fx); + float v = mx_fade(fy); + float w = mx_fade(fz); + vec3 result = mx_trilerp( + mx_gradient_vec3(mx_hash_vec3(X , Y , Z ), fx , fy , fz ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z ), fx-1.0, fy , fz ), + mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z ), fx , fy-1.0, fz ), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z ), fx-1.0, fy-1.0, fz ), + mx_gradient_vec3(mx_hash_vec3(X , Y , Z+1), fx , fy , fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y , Z+1), fx-1.0, fy , fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X , Y+1, Z+1), fx , fy-1.0, fz-1.0), + mx_gradient_vec3(mx_hash_vec3(X+1, Y+1, Z+1), fx-1.0, fy-1.0, fz-1.0), + u, v, w); + return mx_gradient_scale3d(result); } -vector2 log(vector2 a) +float mx_cell_noise_float(float p) { - return vector2 (log(a.x), log(a.y)); + int ix = mx_floor(p); + return mx_bits_to_01(mx_hash_int(ix)); } -vector2 log2(vector2 a) +float mx_cell_noise_float(vec2 p) { - return vector2 (log2(a.x), log2(a.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + return mx_bits_to_01(mx_hash_int(ix, iy)); } -vector2 mix(vector2 a, vector2 b, float x ) +float mx_cell_noise_float(vec3 p) { - return vector2 (mix(a.x, b.x, x), mix(a.y, b.y, x)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + return mx_bits_to_01(mx_hash_int(ix, iy, iz)); } -vector2 mix(vector2 a, vector2 b, vector2 x ) +float mx_cell_noise_float(vec4 p) { - return vector2 (mix(a.x, b.x, x.x), mix(a.y, b.y, x.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + int iw = mx_floor(p.w); + return mx_bits_to_01(mx_hash_int(ix, iy, iz, iw)); } -float dot(vector2 a, vector2 b) +vec3 mx_cell_noise_vec3(float p) { - return (a.x * b.x + a.y * b.y); + int ix = mx_floor(p); + return vec3( + mx_bits_to_01(mx_hash_int(ix, 0)), + mx_bits_to_01(mx_hash_int(ix, 1)), + mx_bits_to_01(mx_hash_int(ix, 2)) + ); } -float length (vector2 a) +vec3 mx_cell_noise_vec3(vec2 p) { - return hypot (a.x, a.y); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, 2)) + ); } -vector2 smoothstep(vector2 low, vector2 high, vector2 in) +vec3 mx_cell_noise_vec3(vec3 p) { - return vector2 (smoothstep(low.x, high.x, in.x), - smoothstep(low.y, high.y, in.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, iz, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, 2)) + ); } -vector2 smoothstep(float low, float high, vector2 in) +vec3 mx_cell_noise_vec3(vec4 p) { - return vector2 (smoothstep(low, high, in.x), - smoothstep(low, high, in.y)); + int ix = mx_floor(p.x); + int iy = mx_floor(p.y); + int iz = mx_floor(p.z); + int iw = mx_floor(p.w); + return vec3( + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 0)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 1)), + mx_bits_to_01(mx_hash_int(ix, iy, iz, iw, 2)) + ); } -vector2 clamp(vector2 in, vector2 low, vector2 high) +float mx_fractal_noise_float(vec3 p, int octaves, float lacunarity, float diminish) { - return vector2 (clamp(in.x, low.x, high.x), - clamp(in.y, low.y, high.y)); + float result = 0.0; + float amplitude = 1.0; + for (int i = 0; i < octaves; ++i) + { + result += amplitude * mx_perlin_noise_float(p); + amplitude *= diminish; + p *= lacunarity; + } + return result; } -vector2 clamp(vector2 in, float low, float high) +vec3 mx_fractal_noise_vec3(vec3 p, int octaves, float lacunarity, float diminish) { - return clamp(in, vector2(low, low), vector2(high, high)); + vec3 result = vec3(0.0); + float amplitude = 1.0; + for (int i = 0; i < octaves; ++i) + { + result += amplitude * mx_perlin_noise_vec3(p); + amplitude *= diminish; + p *= lacunarity; + } + return result; } -vector2 max(vector2 a, vector2 b) +vec2 mx_fractal_noise_vec2(vec3 p, int octaves, float lacunarity, float diminish) { - return vector2 (max(a.x, b.x), - max(a.y, b.y)); + return vec2(mx_fractal_noise_float(p, octaves, lacunarity, diminish), + mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish)); } -vector2 max(vector2 a, float b) +vec4 mx_fractal_noise_vec4(vec3 p, int octaves, float lacunarity, float diminish) { - return max(a, vector2(b, b)); + vec3 c = mx_fractal_noise_vec3(p, octaves, lacunarity, diminish); + float f = mx_fractal_noise_float(p+vec3(19, 193, 17), octaves, lacunarity, diminish); + return vec4(c, f); } -vector2 normalize(vector2 a) +float mx_worley_distance(vec2 p, int x, int y, int xoff, int yoff, float jitter, int metric) { - return a / length(a); -} + vec3 tmp = mx_cell_noise_vec3(vec2(x+xoff, y+yoff)); + vec2 off = vec2(tmp.x, tmp.y); -vector2 min(vector2 a, vector2 b) -{ - return vector2 (min(a.x, a.x), - min(b.y, b.y)); -} + off -= 0.5f; + off *= jitter; + off += 0.5f; -vector2 min(vector2 a, float b) -{ - return min(a, vector2(b, b)); + vec2 cellpos = vec2(float(x), float(y)) + off; + vec2 diff = cellpos - p; + if (metric == 2) + return abs(diff.x) + abs(diff.y); // Manhattan distance + if (metric == 3) + return max(abs(diff.x), abs(diff.y)); // Chebyshev distance + // Either Euclidian or Distance^2 + return dot(diff, diff); } -vector2 mod(vector2 a, vector2 b) +float mx_worley_distance(vec3 p, int x, int y, int z, int xoff, int yoff, int zoff, float jitter, int metric) { - return vector2(mod(a.x, b.x), - mod(a.y, b.y)); + vec3 off = mx_cell_noise_vec3(vec3(x+xoff, y+yoff, z+zoff)); + + off -= 0.5f; + off *= jitter; + off += 0.5f; + + vec3 cellpos = vec3(float(x), float(y), float(z)) + off; + vec3 diff = cellpos - p; + if (metric == 2) + return abs(diff.x) + abs(diff.y) + abs(diff.z); // Manhattan distance + if (metric == 3) + return max(max(abs(diff.x), abs(diff.y)), abs(diff.z)); // Chebyshev distance + // Either Euclidian or Distance^2 + return dot(diff, diff); } -vector2 mod(vector2 a, float b) +float mx_worley_noise_float(vec2 p, float jitter, int metric) { - return mod(a, vector2(b, b)); + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + float sqdist = 1e6f; // Some big number for jitter > 1 (not all GPUs may be IEEE) + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + sqdist = min(sqdist, dist); + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; } -vector2 fmod(vector2 a, vector2 b) +vec2 mx_worley_noise_vec2(vec2 p, float jitter, int metric) { - return vector2 (fmod(a.x, b.x), - fmod(a.y, b.y)); + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + vec2 sqdist = vec2(1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + if (dist < sqdist.x) + { + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.y = dist; + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; } -vector2 fmod(vector2 a, float b) +vec3 mx_worley_noise_vec3(vec2 p, float jitter, int metric) { - return fmod(a, vector2(b, b)); + int X, Y; + vec2 localpos = vec2(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y)); + vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float dist = mx_worley_distance(localpos, x, y, X, Y, jitter, metric); + if (dist < sqdist.x) + { + sqdist.z = sqdist.y; + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.z = sqdist.y; + sqdist.y = dist; + } + else if (dist < sqdist.z) + { + sqdist.z = dist; + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; } -vector2 pow(vector2 in, vector2 amount) +float mx_worley_noise_float(vec3 p, float jitter, int metric) { - return vector2(pow(in.x, amount.x), - pow(in.y, amount.y)); + int X, Y, Z; + vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); + float sqdist = 1e6f; + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); + sqdist = min(sqdist, dist); + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; } -vector2 pow(vector2 in, float amount) +vec2 mx_worley_noise_vec2(vec3 p, float jitter, int metric) { - return vector2(pow(in.x, amount), - pow(in.y, amount)); + int X, Y, Z; + vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); + vec2 sqdist = vec2(1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); + if (dist < sqdist.x) + { + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.y = dist; + } + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; } -vector2 sign(vector2 a) +vec3 mx_worley_noise_vec3(vec3 p, float jitter, int metric) { - return vector2(sign(a.x), - sign(a.y)); + int X, Y, Z; + vec3 localpos = vec3(mx_floorfrac(p.x, X), mx_floorfrac(p.y, Y), mx_floorfrac(p.z, Z)); + vec3 sqdist = vec3(1e6f, 1e6f, 1e6f); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float dist = mx_worley_distance(localpos, x, y, z, X, Y, Z, jitter, metric); + if (dist < sqdist.x) + { + sqdist.z = sqdist.y; + sqdist.y = sqdist.x; + sqdist.x = dist; + } + else if (dist < sqdist.y) + { + sqdist.z = sqdist.y; + sqdist.y = dist; + } + else if (dist < sqdist.z) + { + sqdist.z = dist; + } + } + } + } + if (metric == 0) + sqdist = sqrt(sqdist); + return sqdist; } +/* +Color transform functions. -vector2 sin(vector2 a) -{ - return vector2(sin(a.x), - sin(a.y)); -} +These funcions are modified versions of the color operators found in Open Shading Language: +github.com/imageworks/OpenShadingLanguage/blob/master/src/liboslexec/opcolor.cpp -vector2 cos(vector2 a) -{ - return vector2(cos(a.x), - cos(a.y)); -} +It contains the subset of color operators needed to implement the MaterialX +standard library. The modifications are for conversions from C++ to GLSL. -vector2 tan(vector2 a) -{ - return vector2(tan(a.x), - tan(a.y)); -} +Original copyright notice: +------------------------------------------------------------------------ +Copyright (c) 2009-2010 Sony Pictures Imageworks Inc., et al. +All Rights Reserved. -vector2 asin(vector2 a) -{ - return vector2(asin(a.x), - asin(a.y)); -} +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of Sony Pictures Imageworks nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +------------------------------------------------------------------------ +*/ -vector2 acos(vector2 a) +vec3 mx_hsvtorgb(vec3 hsv) { - return vector2(acos(a.x), - acos(a.y)); + // Reference for this technique: Foley & van Dam + float h = hsv.x; float s = hsv.y; float v = hsv.z; + if (s < 0.0001f) { + return vec3 (v, v, v); + } else { + h = 6.0f * (h - floor(h)); // expand to [0..6) + int hi = int(trunc(h)); + float f = h - float(hi); + float p = v * (1.0f-s); + float q = v * (1.0f-s*f); + float t = v * (1.0f-s*(1.0f-f)); + if (hi == 0) + return vec3 (v, t, p); + else if (hi == 1) + return vec3 (q, v, p); + else if (hi == 2) + return vec3 (p, v, t); + else if (hi == 3) + return vec3 (p, q, v); + else if (hi == 4) + return vec3 (t, p, v); + return vec3 (v, p, q); + } } -vector2 atan2(vector2 a, float f) -{ - return vector2(atan2(a.x, f), - atan2(a.y, f)); -} -vector2 atan2(vector2 a, vector2 b) +vec3 mx_rgbtohsv(vec3 c) { - return vector2(atan2(a.x, b.x), - atan2(a.y, b.y)); + // See Foley & van Dam + float r = c.x; float g = c.y; float b = c.z; + float mincomp = min (r, min(g, b)); + float maxcomp = max (r, max(g, b)); + float delta = maxcomp - mincomp; // chroma + float h, s, v; + v = maxcomp; + if (maxcomp > 0.0f) + s = delta / maxcomp; + else s = 0.0f; + if (s <= 0.0f) + h = 0.0f; + else { + if (r >= maxcomp) h = (g-b) / delta; + else if (g >= maxcomp) h = 2.0f + (b-r) / delta; + else h = 4.0f + (r-g) / delta; + h *= (1.0f/6.0f); + if (h < 0.0f) + h += 1.0f; + } + return vec3(h, s, v); } +#include "mx_smoothstep_float.metal" - -vector2 mx_transform_uv(vector2 texcoord) +void mx_smoothstep_vector2(vec2 val, vec2 low, vec2 high, out vec2 result) { - return texcoord; + float f; + mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; + mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; } -// Restrict to 7x7 kernel size for performance reasons -#define MX_MAX_SAMPLE_COUNT 49 -// Size of all weights for all levels (including level 1) -#define MX_WEIGHT_ARRAY_SIZE 84 - -// -// Function to compute the sample size relative to a texture coordinate -// -vector2 mx_compute_sample_size_uv(vector2 uv, float filterSize, float filterOffset) +void mx_normalmap_vector2(vec3 value, int map_space, vec2 normal_scale, vec3 N, vec3 T, out vec3 result) { - vector derivUVx = Dx(vector(uv.x, uv.y, 0.0)) * 0.5; - vector derivUVy = Dy(vector(uv.x, uv.y, 0.0)) * 0.5; - float derivX = abs(derivUVx[0]) + abs(derivUVy[0]); - float derivY = abs(derivUVx[1]) + abs(derivUVy[1]); - float sampleSizeU = filterSize * derivX + filterOffset; - if (sampleSizeU < 1.0E-05) - sampleSizeU = 1.0E-05; - float sampleSizeV = filterSize * derivY + filterOffset; - if (sampleSizeV < 1.0E-05) - sampleSizeV = 1.0E-05; - return vector2(sampleSizeU, sampleSizeV); -} + // Decode the normal map. + value = all(value == vec3(0.0f)) ? vec3(0.0, 0.0, 1.0) : value * 2.0 - 1.0; -// Kernel weights for box filter -void mx_get_box_weights(output float W[MX_MAX_SAMPLE_COUNT], int filterSize) -{ - int sampleCount = filterSize*filterSize; - float value = 1.0 / float(sampleCount); - for (int i=0; i= 7) - { - W[0] = 0.000036; W[1] = 0.000363; W[2] = 0.001446; W[3] = 0.002291; W[4] = 0.001446; W[5] = 0.000363; W[6] = 0.000036; - W[7] = 0.000363; W[8] = 0.003676; W[9] = 0.014662; W[10] = 0.023226; W[11] = 0.014662; W[12] = 0.003676; W[13] = 0.000363; - W[14] = 0.001446; W[15] = 0.014662; W[16] = 0.058488; W[17] = 0.092651; W[18] = 0.058488; W[19] = 0.014662; W[20] = 0.001446; - W[21] = 0.002291; W[22] = 0.023226; W[23] = 0.092651; W[24] = 0.146768; W[25] = 0.092651; W[26] = 0.023226; W[27] = 0.002291; - W[28] = 0.001446; W[29] = 0.014662; W[30] = 0.058488; W[31] = 0.092651; W[32] = 0.058488; W[33] = 0.014662; W[34] = 0.001446; - W[35] = 0.000363; W[36] = 0.003676; W[37] = 0.014662; W[38] = 0.023226; W[39] = 0.014662; W[40] = 0.003676; W[41] = 0.000363; - W[42] = 0.000036; W[43] = 0.000363; W[44] = 0.001446; W[45] = 0.002291; W[46] = 0.001446; W[47] = 0.000363; W[48] = 0.000036; - } - else if (filterSize >= 5) - { - W[0] = 0.003765; W[1] = 0.015019; W[2] = 0.023792; W[3] = 0.015019; W[4] = 0.003765; - W[5] = 0.015019; W[6] = 0.059912; W[7] = 0.094907; W[8] = 0.059912; W[9] = 0.015019; - W[10] = 0.023792; W[11] = 0.094907; W[12] = 0.150342; W[13] = 0.094907; W[14] = 0.023792; - W[15] = 0.015019; W[16] = 0.059912; W[17] = 0.094907; W[18] = 0.059912; W[19] = 0.015019; - W[20] = 0.003765; W[21] = 0.015019; W[22] = 0.023792; W[23] = 0.015019; W[24] = 0.003765; - } - else if (filterSize >= 3) - { - W[0] = 0.0625; W[1] = 0.125; W[2] = 0.0625; - W[3] = 0.125; W[4] = 0.25; W[5] = 0.125; - W[6] = 0.0625; W[7] = 0.125; W[8] = 0.0625; - } - else - { - W[0] = 1.0; - } + // Normalize the result. + result = normalize(value); } -// -// Apply filter for float samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +void mx_normalmap_float(vec3 value, int map_space, float normal_scale, vec3 N, vec3 T, out vec3 result) { - float result = 0.0; - for (int i = 0; i < sampleCount; i++) - { - result += S[i]*W[i+offset]; - } - return result; + mx_normalmap_vector2(value, map_space, vec2(normal_scale), N, T, result); } - -// -// Apply filter for vector2 samples S, using weights W. -// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } -// -vector2 mx_convolution_vector2(vector2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +void mx_burn_float(float fg, float bg, float mixval, out float result) { - vector2 result = vector2(0.0, 0.0); - for (int i=0; i= high) + result = 1.0; + else + result = smoothstep(low, high, val); } @@ -15698,7 +15838,7 @@ vector2 mx_transform_uv(vector2 texcoord) Copyright Contributors to the MaterialX Project SPDX-License-Identifier: Apache-2.0 - Declarations for MDL implementations of standard nodes included in the MaterialX specification. + Declarations for msl implementations of standard nodes included in the MaterialX specification. --> @@ -15706,5834 +15846,5951 @@ vector2 mx_transform_uv(vector2 texcoord) - + - + - + - + - + - + - + - + - - - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - + - + - - - + + + - - - + + + - - + - + - + - + - - + + - - - + + + - - - - - - - - - + + + + + + + + + - + + - + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - - - - + + + + - - + + - - + + - - + + - + - + - + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + - - - + + + - - + + - - + + - - + - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - + - + - - - + + + - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#include "mx_dodge_float.metal" + +void mx_dodge_color4(vec4 fg , vec4 bg , float mixval, out vec4 result) +{ + float f; + mx_dodge_float(fg.x, bg.x, mixval, f); result.x = f; + mx_dodge_float(fg.y, bg.y, mixval, f); result.y = f; + mx_dodge_float(fg.z, bg.z, mixval, f); result.z = f; + mx_dodge_float(fg.w, bg.w, mixval, f); result.w = f; +} +#include "mx_dodge_float.metal" - - - +void mx_dodge_color3(vec3 fg, vec3 bg, float mixval, out vec3 result) +{ + float f; + mx_dodge_float(fg.x, bg.x, mixval, f); result.x = f; + mx_dodge_float(fg.y, bg.y, mixval, f); result.y = f; + mx_dodge_float(fg.z, bg.z, mixval, f); result.z = f; +} +struct MetalTexture +{ + texture2d tex; + sampler s; + int get_width() { return tex.get_width(); } + int get_height() { return tex.get_height(); } + int get_num_mip_levels() { return tex.get_num_mip_levels(); } +}; - - - +int get_width(MetalTexture mtlTex) { return mtlTex.get_width(); } - - - - +float4 texture(MetalTexture mtlTex, float2 uv) +{ + return mtlTex.tex.sample(mtlTex.s, uv); +} - - - +float4 textureLod(MetalTexture mtlTex, float2 uv, float lod) +{ + return mtlTex.tex.sample(mtlTex.s, uv, level(lod)); +} - - - - - - - +int2 textureSize(MetalTexture mtlTex, int mipLevel) +{ + return int2(mtlTex.get_width(), mtlTex.get_height()); +} - - +int texture_mips(MetalTexture mtlTex) +{ + return mtlTex.tex.get_num_mip_levels(); +} +#define M_FLOAT_EPS 1e-8 - - - +float mx_square(float x) +{ + return x*x; +} - - - - - - - - - - - - - - - - - +vec2 mx_square(vec2 x) +{ + return x*x; +} - - - - +#ifdef __DECL_GL_MATH_FUNCTIONS__ - - - - - - - - - - - +float radians(float degree) { return (degree * M_PI_F / 180.0f); } - - - - - - - - - - - - - - - +float3x3 inverse(float3x3 m) +{ + float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0]; + float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1]; + float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2]; - - - - - - - - - - - + float det = determinant(m); + float idet = 1.0f / det; - - - - - - - - - - - - - - - + float3x3 ret; - - - - - - - - - - - + ret[0][0] = idet * (n22 * n33 - n32 * n23); + ret[1][0] = idet * (n32 * n13 - n12 * n33); + ret[2][0] = idet * (n12 * n23 - n22 * n13); + + ret[0][1] = idet * (n31 * n23 - n21 * n33); + ret[1][1] = idet * (n11 * n33 - n31 * n13); + ret[2][1] = idet * (n21 * n13 - n11 * n23); + + ret[0][2] = idet * (n21 * n32 - n31 * n22); + ret[1][2] = idet * (n31 * n12 - n11 * n32); + ret[2][2] = idet * (n11 * n22 - n21 * n12); - - - - - - - - - - - - - - - + return ret; +} - - - - - - - - - - - - - - - - +float4x4 inverse(float4x4 m) +{ + float n11 = m[0][0], n12 = m[1][0], n13 = m[2][0], n14 = m[3][0]; + float n21 = m[0][1], n22 = m[1][1], n23 = m[2][1], n24 = m[3][1]; + float n31 = m[0][2], n32 = m[1][2], n33 = m[2][2], n34 = m[3][2]; + float n41 = m[0][3], n42 = m[1][3], n43 = m[2][3], n44 = m[3][3]; - - - - - - - - - - - - - - - + float t11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44; + float t12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44; + float t13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44; + float t14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34; - - - - - - - - - - - - - - + float det = determinant(m); + float idet = 1.0f / det; + + float4x4 ret; - - - - - - - - - - - - - - - + ret[0][0] = t11 * idet; + ret[0][1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * idet; + ret[0][2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * idet; + ret[0][3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * idet; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ret[1][0] = t12 * idet; + ret[1][1] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * idet; + ret[1][2] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * idet; + ret[1][3] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * idet; - - - - - - - - - - - - - - - + ret[2][0] = t13 * idet; + ret[2][1] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * idet; + ret[2][2] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * idet; + ret[2][3] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * idet; - - - - - - - - - - - - - - - - + ret[3][0] = t14 * idet; + ret[3][1] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * idet; + ret[3][2] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * idet; + ret[3][3] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * idet; - - - - - - - - - - - - - - - + return ret; +} - - - - - - - - - - - - - - - - - - +template +T1 mod(T1 x, T2 y) +{ + return x - y * floor(x/y); +} - - - - - - - - - - - - - - - +template +T atan(T y_over_x) { return ::atan(y_over_x); } - - - - - - - - - - - - - - - - - - - - +template +T atan(T y, T x) { return ::atan2(y, x); } - - - - - - - - - - - - - - - +#define lessThan(a, b) ((a) < (b)) +#define lessThanEqual(a, b) ((a) <= (b)) +#define greaterThan(a, b) ((a) > (b)) +#define greaterThanEqual(a, b) ((a) >= (b)) +#define equal(a, b) ((a) == (b)) +#define notEqual(a, b) ((a) != (b)) - - - - - - - - - - - - - - - - +#endif +// Restrict to 7x7 kernel size for performance reasons +#define MX_MAX_SAMPLE_COUNT 49 +// Size of all weights for all levels (including level 1) +#define MX_WEIGHT_ARRAY_SIZE 84 + +// +// Function to compute the sample size relative to a texture coordinate +// +vec2 mx_compute_sample_size_uv(vec2 uv, float filterSize, float filterOffset) +{ + vec2 derivUVx = dFdx(uv) * 0.5f; + vec2 derivUVy = dFdy(uv) * 0.5f; + float derivX = abs(derivUVx.x) + abs(derivUVy.x); + float derivY = abs(derivUVx.y) + abs(derivUVy.y); + float sampleSizeU = 2.0f * filterSize * derivX + filterOffset; + if (sampleSizeU < 1.0E-05f) + sampleSizeU = 1.0E-05f; + float sampleSizeV = 2.0f * filterSize * derivY + filterOffset; + if (sampleSizeV < 1.0E-05f) + sampleSizeV = 1.0E-05f; + return vec2(sampleSizeU, sampleSizeV); +} - - - - - - - - - - - - - - - +// +// Compute a normal mapped to 0..1 space based on a set of input +// samples using a Sobel filter. +// +vec3 mx_normal_from_samples_sobel(constant float S[9], float _scale) +{ + float nx = S[0] - S[2] + (2.0*S[3]) - (2.0*S[5]) + S[6] - S[8]; + float ny = S[0] + (2.0*S[1]) + S[2] - S[6] - (2.0*S[7]) - S[8]; + float nz = max(_scale, M_FLOAT_EPS) * sqrt(max(1.0 - nx * nx - ny * ny, M_FLOAT_EPS)); + vec3 norm = normalize(vec3(nx, ny, nz)); + return (norm + 1.0) * 0.5; +} - - - - +// +// Apply filter for vec2 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vec2 mx_convolution_vec2(vec2 S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vec2 result = vec2(0.0); + for (int i=0; i - - - +// +// Apply filter for vec3 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vec3 mx_convolution_vec3(vec3 S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vec3 result = vec3(0.0); + for (int i=0; i - - - +// +// Apply filter for vec4 samples S, using weights W. +// sampleCount should be a square of a odd number { 1, 3, 5, 7 } +// +vec4 mx_convolution_vec4(vec4 S[MX_MAX_SAMPLE_COUNT], constant float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vec4 result = vec4(0.0); + for (int i=0; i - - - +float4x4 operator+(float4x4 a, float b) +{ + return a + float4x4(b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b); +} - - - - +float3x3 operator-(float3x3 a, float b) +{ + return a - float3x3(b,b,b,b,b,b,b,b,b); +} - - - - +float4x4 operator-(float4x4 a, float b) +{ + return a - float4x4(b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b); +} - - - - +float3x3 operator/(float3x3 a, float3x3 b) +{ + for(int i = 0; i < 3; ++i) + for(int j = 0; j < 3; ++j) + a[i][j] /= b[i][j]; - - - - + return a; +} - - - - +float4x4 operator/(float4x4 a, float4x4 b) +{ + for(int i = 0; i < 4; ++i) + for(int j = 0; j < 4; ++j) + a[i][j] /= b[i][j]; - - - - + return a; +} - - - - +float3x3 operator/(float3x3 a, float b) +{ + for(int i = 0; i < 3; ++i) + for(int j = 0; j < 3; ++j) + a[i][j] /= b; - - - - + return a; +} - - - - +float4x4 operator/(float4x4 a, float b) +{ + for(int i = 0; i < 4; ++i) + for(int j = 0; j < 4; ++j) + a[i][j] /= b; - - - - + return a; +} +void mx_geomcolor_color3(int index, output color result) +{ + getattribute("color", result); +} +#include "mx_burn_float.osl" - - - - +void mx_burn_color3(color fg, color bg, float mix, output color result) +{ + mx_burn_float(fg[0], bg[0], mix, result[0]); + mx_burn_float(fg[1], bg[1], mix, result[1]); + mx_burn_float(fg[2], bg[2], mix, result[2]); +} +void mx_dodge_float(float fg, float bg, float mix, output float out) +{ + if (abs(1.0 - fg) < M_FLOAT_EPS) + { + out = 0.0; + return; + } + out = mix*(bg / (1.0 - fg)) + ((1.0-mix)*bg); +} +void mx_rotate_vector2(vector2 _in, float amount, output vector2 result) +{ + float rotationRadians = radians(amount); + float sa = sin(rotationRadians); + float ca = cos(rotationRadians); + result = vector2(ca*_in.x + sa*_in.y, -sa*_in.x + ca*_in.y); +} +#include "lib/$fileTransformUv" - - - - +void mx_image_vector3(textureresource file, string layer, vector default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } - - - - + color missingColor = default_value; + vector2 st = mx_transform_uv(texcoord); + out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); +} +#include "lib/$fileTransformUv" + +void mx_image_float(textureresource file, string layer, float default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output float out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } + + color missingColor = color(default_value); + vector2 st = mx_transform_uv(texcoord); + color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); + out = rgb[0]; +} +void mx_worleynoise3d_vector2(vector position, float jitter, output vector2 result) +{ + result = mx_worley_noise_vector2(position, jitter, 0); +} +void mx_worleynoise2d_float(vector2 texcoord, float jitter, output float result) +{ + result = mx_worley_noise_float(texcoord, jitter, 0); +} +void mx_frame_float(output float result) +{ + getattribute("frame", result); +} +void mx_hsvtorgb_color3(vector _in, output vector result) +{ + result = transformc("hsv","rgb", _in); +} +void mx_fractal3d_vector2(vector2 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result) +{ + vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_geompropvalue_vector4(string geomprop, vector4 defaultVal, output vector4 out) +{ + float value[4]; + if (getattribute(geomprop, value) == 0) + { + out = defaultVal; + } + else + { + out.x = value[0]; + out.y = value[1]; + out.z = value[2]; + out.w = value[3]; + } +} +#include "mx_dodge_float.osl" - - - - +void mx_dodge_color4(color4 fg , color4 bg , float mix , output color4 result) +{ + mx_dodge_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); + mx_dodge_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); + mx_dodge_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); + mx_dodge_float(fg.a, bg.a, mix, result.a); +} +#include "lib/$fileTransformUv" - - - - +void mx_image_vector2(textureresource file, string layer, vector2 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector2 out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } - - - - + color missingColor = color(default_value.x, default_value.y, 0.0); + vector2 st = mx_transform_uv(texcoord); + color rgb = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode); + out.x = rgb[0]; + out.y = rgb[1]; +} +void mx_geompropvalue_vector(string geomprop, vector defaultVal, output vector out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +void mx_unpremult_color4(color4 in, output color4 result) +{ + result = color4(in.rgb / in.a, in.a); +} +void mx_normalmap_vector2(vector value, string map_space, vector2 normal_scale, vector N, vector U, output vector result) +{ + // Tangent space + if (map_space == "tangent") + { + vector v = value * 2.0 - 1.0; + vector T = normalize(U - dot(U, N) * N); + vector B = normalize(cross(N, T)); + result = normalize(T * v[0] * normal_scale.x + B * v[1] * normal_scale.y + N * v[2]); + } + // Object space + else + { + vector n = value * 2.0 - 1.0; + result = normalize(n); + } +} - - - - +void mx_normalmap_float(vector value, string map_space, float normal_scale, vector N, vector U, output vector result) +{ + mx_normalmap_vector2(value, map_space, vector2(normal_scale, normal_scale), N, U, result); +} +void mx_heighttonormal_vector3(float in, float scale, output vector result) +{ + point htP = P + normalize(N) * in * scale; + result = normalize(calculatenormal(htP)); +} +void mx_geomcolor_color4(int index, output color4 result) +{ + float value[4]; + getattribute("color", value); + result.rgb[0] = value[0]; + result.rgb[1] = value[1]; + result.rgb[2] = value[2]; + result.a = value[3]; +} +void mx_noise3d_float(float amplitude, float pivot, vector position, output float result) +{ + float value = noise("snoise", position); + result = value * amplitude + pivot; +} +void mx_hsvtorgb_color4(color4 _in, output color4 result) +{ + result = color4(transformc("hsv","rgb", _in.rgb), 1.0); +} +void mx_noise2d_vector4(vector4 amplitude, float pivot, vector2 texcoord, output vector4 result) +{ + vector4 value = mx_noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_worleynoise2d_vector2(vector2 texcoord, float jitter, output vector2 result) +{ + result = mx_worley_noise_vector2(texcoord, jitter, 0); +} +void mx_ambientocclusion_float(float coneangle, float maxdistance, output float result) +{ + // This node is a stub and does not currently operate to specification + result = 0; +} +#include "mx_dodge_float.osl" - +void mx_dodge_color3(color fg, color bg, float mix, output color result) +{ + mx_dodge_float(fg[0], bg[0], mix, result[0]); + mx_dodge_float(fg[1], bg[1], mix, result[1]); + mx_dodge_float(fg[2], bg[2], mix, result[2]); +} +void mx_fractal3d_vector3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result) +{ + vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_geompropvalue_string(string geomprop, string defaultVal, output string out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +void mx_geompropvalue_boolean(string geomprop, int defaultVal, output int out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +void mx_worleynoise2d_vector3(vector2 texcoord, float jitter, output vector result) +{ + result = mx_worley_noise_vector3(texcoord, jitter, 0); +} +void mx_transformmatrix_vector2M3(vector2 val, matrix m, output vector2 result) +{ + point res = transform(m, point(val.x, val.y, 1.0)); + result.x = res[0]; + result.y = res[1]; +} +void mx_burn_float(float fg, float bg, float mix, output float result) +{ + if (abs(fg) < M_FLOAT_EPS) + { + result = 0.0; + return; + } + result = mix*(1.0 - ((1.0 - bg) / fg)) + ((1.0-mix)*bg); +} +void mx_fractal3d_float(float amplitude, int octaves, float lacunarity, float diminish, vector position, output float result) +{ + float f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_cellnoise3d_float(vector position, output float result) +{ + result = cellnoise(position); +} +void mx_premult_color4(color4 in, output color4 result) +{ + result = color4(in.rgb * in.a, in.a); +} - - + - - - - + + - + + - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - + - + + + - + - - - - + + + + + + + + + + + + + - + + + + + + + - - - - + + + + + + + - - - - + + + + + + - Graph definitions of standard nodes included in the MaterialX specification. - --> + + + + + + + - - - - - - - - - - - + + + + + - - - - + + + + - Declarations of standard data types and nodes included in the MaterialX specification. - --> + + + + + + + + + + + + + + + + + + + + + - + - - - + + - + - - - - - - - - - - - - - - - - - + + - - - - - - - + + - - - - - - - - - - - - - - + + - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - + + + - - - - - - - - - + + + + - - - - - - - - + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - + + - + - - - - - + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + - - - + + + + + + + + - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - + + + + + - - - - - + + + + + - - - - - - + + + + + + + - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + - - - + + + + + + + + + + + + - - + + + + - - + + + + - - + + + + - - + + - - + + - - + + - - + + + + + + + + - - + + + - - + + + - - - + + + - - - + + - - - + + - - - - - + + + - - + + + + + + + + + + + + - - + + + + + - - - + + + - - + + + - - + + + - - + + + - - + + - - + + - -#include "lib/mx_microfacet_diffuse.glsl" + + + + -void mx_subsurface_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) -{ - bsdf.throughput = vec3(0.0); + + + + - if (weight < M_FLOAT_EPS) - { - return; - } + + + + - normal = mx_forward_facing_normal(normal, V); + + + + - vec3 sss = mx_subsurface_scattering_approx(normal, L, P, color, radius); - float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); - float visibleOcclusion = 1.0 - NdotL * (1.0 - occlusion); - bsdf.response = sss * visibleOcclusion * weight; -} + + + + -void mx_subsurface_bsdf_indirect(vec3 V, float weight, vec3 color, vec3 radius, float anisotropy, vec3 normal, inout BSDF bsdf) -{ - bsdf.throughput = vec3(0.0); + + + + - if (weight < M_FLOAT_EPS) - { - return; - } + + - normal = mx_forward_facing_normal(normal, V); + + - // For now, we render indirect subsurface as simple indirect diffuse. - vec3 Li = mx_environment_irradiance(normal); - bsdf.response = Li * color * weight; -} - - + + - - + + - - + + - - + + - - + + + + - - + + + + - - + + + + + + + + + + + + + - - + + + - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - + + + + + + + + + + + + + + + + + + - - + + + + + - - + + + - - + + + - - - + + + + - - + + + + + + - - + + + - - + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + -#include "lib/mx_microfacet_specular.glsl" +void mx_geompropvalue_vector2(string geomprop, vector2 defaultVal, output vector2 out) +{ + float value[2]; + if (getattribute(geomprop, value) == 0) + { + out = defaultVal; + } + else + { + out.x = value[0]; + out.y = value[1]; + } +} +void mx_geompropvalue_color(string geomprop, color defaultVal, output color out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +#include "lib/$fileTransformUv" -void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +void mx_image_color4(textureresource file, string layer, color4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color4 out) { - if (weight < M_FLOAT_EPS) + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) { + out = default_value; return; } - N = mx_forward_facing_normal(N, V); + color missingColor = default_value.rgb; + float missingAlpha = default_value.a; + vector2 st = mx_transform_uv(texcoord); + float alpha; + color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, + "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); - X = normalize(X - dot(X, N) * N); - vec3 Y = cross(N, X); - vec3 H = normalize(L + V); + out = color4(rgb, alpha); +} +void mx_noise2d_float(float amplitude, float pivot, vector2 texcoord, output float result) +{ + float value = noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_time_float(float fps, output float result) +{ + float frame; + getattribute("frame", frame); + result = frame / fps; +} +void mx_noise3d_vector3(vector amplitude, float pivot, vector position, output vector result) +{ + vector value = noise("snoise", position); + result = value * amplitude + pivot; +} +#include "lib/$fileTransformUv" - float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); +void mx_image_vector4(textureresource file, string layer, vector4 default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output vector4 out) +{ + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) + { + out = default_value; + return; + } - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); + color missingColor = color(default_value.x, default_value.y, default_value.z); + float missingAlpha = default_value.w; + vector2 st = mx_transform_uv(texcoord); + float alpha; + color rgb = texture(file.filename, st.x, st.y, "alpha", alpha, "subimage", layer, + "missingcolor", missingColor, "missingalpha", missingAlpha, "swrap", uaddressmode, "twrap", vaddressmode); - vec3 safeTint = max(tint, 0.0); - FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); - vec3 F = mx_compute_fresnel(VdotH, fd); - float D = mx_ggx_NDF(Ht, safeAlpha); - float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + out = vector4(rgb[0], rgb[1], rgb[2], alpha); +} +void mx_noise2d_vector3(vector amplitude, float pivot, vector2 texcoord, output vector result) +{ + vector value = noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_luminance_color3(color in, color lumacoeffs, output color result) +{ + result = dot(in, lumacoeffs); +} +void mx_geompropvalue_integer(string geomprop, int defaultVal, output int out) +{ + if (getattribute(geomprop, out) == 0) + out = defaultVal; +} +matrix rotationMatrix(vector axis, float angle) +{ + vector nAxis = normalize(axis); + float s = sin(angle); + float c = cos(angle); + float oc = 1.0 - c; - float F0 = mx_ior_to_f0(ior); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; + return matrix(oc * nAxis[0] * nAxis[0] + c, oc * nAxis[0] * nAxis[1] - nAxis[2] * s, oc * nAxis[2] * nAxis[0] + nAxis[1] * s, 0.0, + oc * nAxis[0] * nAxis[1] + nAxis[2] * s, oc * nAxis[1] * nAxis[1] + c, oc * nAxis[1] * nAxis[2] - nAxis[0] * s, 0.0, + oc * nAxis[2] * nAxis[0] - nAxis[1] * s, oc * nAxis[1] * nAxis[2] + nAxis[0] * s, oc * nAxis[2] * nAxis[2] + c, 0.0, + 0.0, 0.0, 0.0, 1.0); +} - // Note: NdotL is cancelled out - bsdf.response = D * F * G * comp * safeTint * occlusion * weight / (4.0 * NdotV); +void mx_rotate_vector3(vector _in, float amount, vector axis, output vector result) +{ + float rotationRadians = radians(amount); + matrix m = rotationMatrix(axis, rotationRadians); + vector4 trans = transform(m, vector4(_in[0], _in[1], _in[2], 1.0)); + result = vector(trans.x, trans.y, trans.z); +} +void mx_geompropvalue_float(string geomprop, float defaultVal, output float result) +{ + if (getattribute(geomprop, result) == 0) + { + result = defaultVal; + } +} +void mx_geomcolor_float(int index, output float result) +{ + getattribute("color", result); +} +void mx_worleynoise3d_vector3(vector position, float jitter, output vector result) +{ + result = mx_worley_noise_vector3(position, jitter, 0); +} +#include "mx_burn_float.osl" + +void mx_burn_color4(color4 fg, color4 bg, float mix, output color4 result) +{ + mx_burn_float(fg.rgb[0], bg.rgb[0], mix, result.rgb[0]); + mx_burn_float(fg.rgb[1], bg.rgb[1], mix, result.rgb[1]); + mx_burn_float(fg.rgb[2], bg.rgb[2], mix, result.rgb[2]); + mx_burn_float(fg.a, bg.a, mix, result.a); +} +void mx_noise3d_vector4(vector4 amplitude, float pivot, vector position, output vector4 result) +{ + vector4 value = mx_noise("snoise", position); + result = value * amplitude + pivot; +} +void mx_noise2d_vector2(vector2 amplitude, float pivot, vector2 texcoord, output vector2 result) +{ + vector2 value = mx_noise("snoise", texcoord.x, texcoord.y); + result = value * amplitude + pivot; +} +void mx_noise3d_vector2(vector2 amplitude, float pivot, vector position, output vector2 result) +{ + vector2 value = mx_noise("snoise", position); + result = value * amplitude + pivot; +} +void mx_luminance_color4(color4 in, color lumacoeffs, output color4 result) +{ + result = color4(dot(in.rgb, lumacoeffs), in.a); } +#include "lib/$fileTransformUv" -void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +void mx_image_color3(textureresource file, string layer, color default_value, vector2 texcoord, string uaddressmode, string vaddressmode, string filtertype, string framerange, int frameoffset, string frameendaction, output color out) { - if (weight < M_FLOAT_EPS) + if (file.filename == "" || + (uaddressmode == "constant" && (texcoord.x<0.0 || texcoord.x>1.0)) || + (vaddressmode == "constant" && (texcoord.y<0.0 || texcoord.y>1.0))) { + out = default_value; return; } - N = mx_forward_facing_normal(N, V); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - vec3 safeTint = max(tint, 0.0); - FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); - vec3 F = mx_compute_fresnel(NdotV, fd); - - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - - float F0 = mx_ior_to_f0(ior); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; + color missingColor = default_value; + vector2 st = mx_transform_uv(texcoord); + out = texture(file.filename, st.x, st.y, "subimage", layer, "missingcolor", missingColor, "swrap", uaddressmode, "twrap", vaddressmode, "colorspace", file.colorspace); +} +void mx_worleynoise3d_float(vector position, float jitter, output float result) +{ + result = mx_worley_noise_float(position, jitter, 0); +} +void mx_fractal3d_vector4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result) +{ + vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); + result = f * amplitude; +} +void mx_mix_surfaceshader(surfaceshader fg, surfaceshader bg, float w, output surfaceshader result) +{ + result.bsdf = mix(bg.bsdf, fg.bsdf, w); + result.edf = mix(bg.edf, fg.edf, w); + result.opacity = mix(bg.opacity, fg.opacity, w); +} +void mx_rgbtohsv_color3(vector _in, output vector result) +{ + result = transformc("rgb","hsv", _in); +} +void mx_rgbtohsv_color4(color4 _in, output color4 result) +{ + result = color4(transformc("rgb","hsv", _in.rgb), 1.0); +} +void mx_disjointover_color4(color4 fg, color4 bg, float mix, output color4 result) +{ + float summedAlpha = fg.a + bg.a; - if (scatter_mode != 0) + if (summedAlpha <= 1) { - bsdf.response = mx_surface_transmission(N, V, X, safeAlpha, distribution, fd, safeTint) * weight; + result.rgb = fg.rgb + bg.rgb; } -} - -void mx_dielectric_bsdf_indirect(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) -{ - if (weight < M_FLOAT_EPS) + else { - return; + if (abs(bg.a) < M_FLOAT_EPS) + { + result.rgb = 0.0; + } + else + { + float x = (1 - fg.a) / bg.a; + result.rgb = fg.rgb + bg.rgb * x; + } } + result.a = min(summedAlpha, 1.0); - N = mx_forward_facing_normal(N, V); - - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - vec3 safeTint = max(tint, 0.0); - FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); - vec3 F = mx_compute_fresnel(NdotV, fd); - - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - - float F0 = mx_ior_to_f0(ior); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, F0, 1.0) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; - - vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); - bsdf.response = Li * safeTint * comp * weight; + result.rgb = result.rgb * mix + (1.0 - mix) * bg.rgb; + result.a = result.a * mix + (1.0 - mix) * bg.a; } -void mx_artistic_ior(vec3 reflectivity, vec3 edge_color, out vec3 ior, out vec3 extinction) +void mx_creatematrix_vector3_matrix33(vector in1, vector in2, vector in3, output matrix result) { - // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 - // http://jcgt.org/published/0003/04/03/paper.pdf - - vec3 r = clamp(reflectivity, 0.0, 0.99); - vec3 r_sqrt = sqrt(r); - vec3 n_min = (1.0 - r) / (1.0 + r); - vec3 n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); - ior = mix(n_max, n_min, edge_color); - - vec3 np1 = ior + 1.0; - vec3 nm1 = ior - 1.0; - vec3 k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); - k2 = max(k2, 0.0); - extinction = sqrt(k2); + result = matrix(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + 0.0, 0.0, 0.0, 1.0); } -#include "lib/mx_microfacet_diffuse.glsl" -void mx_burley_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +void mx_creatematrix_vector3_matrix44(vector in1, vector in2, vector in3, vector in4, output matrix result) { - bsdf.throughput = vec3(0.0); + result = matrix(in1.x, in1.y, in1.z, 0.0, + in2.x, in2.y, in2.z, 0.0, + in3.x, in3.y, in3.z, 0.0, + in4.x, in4.y, in4.z, 1.0); +} - if (weight < M_FLOAT_EPS) +void mx_creatematrix_vector4_matrix44(vector4 in1, vector4 in2, vector4 in3, vector4 in4, output matrix result) +{ + result = matrix(in1.x, in1.y, in1.z, in1.w, + in2.x, in2.y, in2.z, in2.w, + in3.x, in3.y, in3.z, in3.w, + in4.x, in4.y, in4.z, in4.w); +} +void mx_surface_unlit(float emission_weight, color emission_color, float transmission_weight, color transmission_color, float opacity, output surfaceshader result) +{ + float trans = clamp(transmission_weight, 0.0, 1.0); + result.bsdf = trans * transmission_color * transparent(); + result.edf = (1.0 - trans) * emission_weight * emission_color * emission(); + result.opacity = clamp(opacity, 0.0, 1.0); +} +void mx_geompropvalue_color4(string geomprop, color4 defaultVal, output color4 out) +{ + float value[4]; + if (getattribute(geomprop, value) == 0) { - return; + out.rgb = defaultVal.rgb; + out.a = defaultVal.a; } - - normal = mx_forward_facing_normal(normal, V); - - float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); - float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); - float LdotH = clamp(dot(L, normalize(L + V)), M_FLOAT_EPS, 1.0); - - bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; - bsdf.response *= mx_burley_diffuse(NdotV, NdotL, LdotH, roughness); + else + { + out.rgb[0] = value[0]; + out.rgb[1] = value[1]; + out.rgb[2] = value[2]; + out.a = value[3]; + } +} +void mx_cellnoise2d_float(vector2 texcoord, output float result) +{ + result = cellnoise(texcoord.x, texcoord.y); } +// Restrict to 7x7 kernel size for performance reasons +#define MX_MAX_SAMPLE_COUNT 49 +// Size of all weights for all levels (including level 1) +#define MX_WEIGHT_ARRAY_SIZE 84 -void mx_burley_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) +// +// Function to compute the sample size relative to a texture coordinate +// +vector2 mx_compute_sample_size_uv(vector2 uv, float filterSize, float filterOffset) { - bsdf.throughput = vec3(0.0); + vector derivUVx = Dx(vector(uv.x, uv.y, 0.0)) * 0.5; + vector derivUVy = Dy(vector(uv.x, uv.y, 0.0)) * 0.5; + float derivX = abs(derivUVx[0]) + abs(derivUVy[0]); + float derivY = abs(derivUVx[1]) + abs(derivUVy[1]); + float sampleSizeU = filterSize * derivX + filterOffset; + if (sampleSizeU < 1.0E-05) + sampleSizeU = 1.0E-05; + float sampleSizeV = filterSize * derivY + filterOffset; + if (sampleSizeV < 1.0E-05) + sampleSizeV = 1.0E-05; + return vector2(sampleSizeU, sampleSizeV); +} - if (weight < M_FLOAT_EPS) +// Kernel weights for box filter +void mx_get_box_weights(output float W[MX_MAX_SAMPLE_COUNT], int filterSize) +{ + int sampleCount = filterSize*filterSize; + float value = 1.0 / float(sampleCount); + for (int i=0; i= 7) { - return; + W[0] = 0.000036; W[1] = 0.000363; W[2] = 0.001446; W[3] = 0.002291; W[4] = 0.001446; W[5] = 0.000363; W[6] = 0.000036; + W[7] = 0.000363; W[8] = 0.003676; W[9] = 0.014662; W[10] = 0.023226; W[11] = 0.014662; W[12] = 0.003676; W[13] = 0.000363; + W[14] = 0.001446; W[15] = 0.014662; W[16] = 0.058488; W[17] = 0.092651; W[18] = 0.058488; W[19] = 0.014662; W[20] = 0.001446; + W[21] = 0.002291; W[22] = 0.023226; W[23] = 0.092651; W[24] = 0.146768; W[25] = 0.092651; W[26] = 0.023226; W[27] = 0.002291; + W[28] = 0.001446; W[29] = 0.014662; W[30] = 0.058488; W[31] = 0.092651; W[32] = 0.058488; W[33] = 0.014662; W[34] = 0.001446; + W[35] = 0.000363; W[36] = 0.003676; W[37] = 0.014662; W[38] = 0.023226; W[39] = 0.014662; W[40] = 0.003676; W[41] = 0.000363; + W[42] = 0.000036; W[43] = 0.000363; W[44] = 0.001446; W[45] = 0.002291; W[46] = 0.001446; W[47] = 0.000363; W[48] = 0.000036; + } + else if (filterSize >= 5) + { + W[0] = 0.003765; W[1] = 0.015019; W[2] = 0.023792; W[3] = 0.015019; W[4] = 0.003765; + W[5] = 0.015019; W[6] = 0.059912; W[7] = 0.094907; W[8] = 0.059912; W[9] = 0.015019; + W[10] = 0.023792; W[11] = 0.094907; W[12] = 0.150342; W[13] = 0.094907; W[14] = 0.023792; + W[15] = 0.015019; W[16] = 0.059912; W[17] = 0.094907; W[18] = 0.059912; W[19] = 0.015019; + W[20] = 0.003765; W[21] = 0.015019; W[22] = 0.023792; W[23] = 0.015019; W[24] = 0.003765; + } + else if (filterSize >= 3) + { + W[0] = 0.0625; W[1] = 0.125; W[2] = 0.0625; + W[3] = 0.125; W[4] = 0.25; W[5] = 0.125; + W[6] = 0.0625; W[7] = 0.125; W[8] = 0.0625; + } + else + { + W[0] = 1.0; } - - N = mx_forward_facing_normal(N, V); - - X = normalize(X - dot(X, N) * N); - vec3 Y = cross(N, X); - vec3 H = normalize(L + V); - - float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); - - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - - vec3 safeColor0 = max(color0, 0.0); - vec3 safeColor82 = max(color82, 0.0); - vec3 safeColor90 = max(color90, 0.0); - FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); - vec3 F = mx_compute_fresnel(VdotH, fd); - float D = mx_ggx_NDF(Ht, safeAlpha); - float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); - - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; - float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); - bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - - // Note: NdotL is cancelled out - bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); } -void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +// +// Apply filter for float samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +float mx_convolution_float(float S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) { - if (weight < M_FLOAT_EPS) + float result = 0.0; + for (int i = 0; i < sampleCount; i++) { - return; + result += S[i]*W[i+offset]; } + return result; +} - N = mx_forward_facing_normal(N, V); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - - vec3 safeColor0 = max(color0, 0.0); - vec3 safeColor82 = max(color82, 0.0); - vec3 safeColor90 = max(color90, 0.0); - FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); - vec3 F = mx_compute_fresnel(NdotV, fd); - - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - vec3 dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, safeColor0, safeColor90) * comp; - float avgDirAlbedo = dot(dirAlbedo, vec3(1.0 / 3.0)); - bsdf.throughput = vec3(1.0 - avgDirAlbedo * weight); - - if (scatter_mode != 0) +// +// Apply filter for vector2 samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +vector2 mx_convolution_vector2(vector2 S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + vector2 result = vector2(0.0, 0.0); + for (int i=0; i 0.0) +// +// Apply filter for color samples S, using weights W. +// sampleCount should be a square of a odd number in the range { 1, 3, 5, 7 } +// +color mx_convolution_color(color S[MX_MAX_SAMPLE_COUNT], float W[MX_WEIGHT_ARRAY_SIZE], int offset, int sampleCount) +{ + color result = color(0.0); + for (int i=0; i 0.0) - { - float aspect = sqrt(1.0 - clamp(anisotropy, 0.0, 0.98)); - result.x = min(roughness_sqr / aspect, 1.0); - result.y = roughness_sqr * aspect; - } - else - { - result.x = roughness_sqr; - result.y = roughness_sqr; - } + return matrix33(matrix( + a.m[0][0]-b.m[0][0], a.m[0][1]-b.m[0][1], a.m[0][2]-b.m[0][2], 0.0, + a.m[1][0]-b.m[1][0], a.m[1][1]-b.m[1][1], a.m[1][2]-b.m[1][2], 0.0, + a.m[2][0]-b.m[2][0], a.m[2][1]-b.m[2][1], a.m[2][2]-b.m[2][2], 0.0, + 0.0, 0.0, 0.0, 1.0)); } -#include "lib/mx_microfacet_specular.glsl" -void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +matrix33 mx_subtract(matrix33 a, float b) { - bsdf.throughput = vec3(0.0); - - if (weight < M_FLOAT_EPS) - { - return; - } - - N = mx_forward_facing_normal(N, V); + return matrix33(matrix( + a.m[0][0]-b, a.m[0][1]-b, a.m[0][2]-b, 0.0, + a.m[1][0]-b, a.m[1][1]-b, a.m[1][2]-b, 0.0, + a.m[2][0]-b, a.m[2][1]-b, a.m[2][2]-b, 0.0, + 0.0, 0.0, 0.0, 1.0)); +} - X = normalize(X - dot(X, N) * N); - vec3 Y = cross(N, X); - vec3 H = normalize(L + V); +matrix mx_subtract(matrix a, matrix b) +{ + return matrix( + a[0][0]-b[0][0], a[0][1]-b[0][1], a[0][2]-b[0][2], a[0][3]-b[0][3], + a[1][0]-b[1][0], a[1][1]-b[1][1], a[1][2]-b[1][2], a[1][3]-b[1][3], + a[2][0]-b[2][0], a[2][1]-b[2][1], a[2][2]-b[2][2], a[2][3]-b[2][3], + a[3][0]-b[3][0], a[3][1]-b[3][1], a[3][2]-b[3][2], a[3][3]-b[3][3]); +} - float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); +matrix mx_subtract(matrix a, float b) +{ + return matrix( + a[0][0]-b, a[0][1]-b, a[0][2]-b, a[0][3]-b, + a[1][0]-b, a[1][1]-b, a[1][2]-b, a[1][3]-b, + a[2][0]-b, a[2][1]-b, a[2][2]-b, a[2][3]-b, + a[3][0]-b, a[3][1]-b, a[3][2]-b, a[3][3]-b); +} - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); - vec3 F = mx_compute_fresnel(VdotH, fd); - float D = mx_ggx_NDF(Ht, safeAlpha); - float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); +float mx_extract(color in, int index) +{ + return in[index]; +} - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); +float mx_extract(color4 in, int index) +{ + if (index == 0) return in.rgb.r; + else if (index == 1) return in.rgb.g; + else if (index == 2) return in.rgb.b; + else return in.a; +} - // Note: NdotL is cancelled out - bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); +float mx_extract(vector2 in, int index) +{ + if (index == 0) return in.x; + else return in.y; } -void mx_conductor_bsdf_indirect(vec3 V, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +float mx_extract(vector in, int index) { - bsdf.throughput = vec3(0.0); + return in[index]; +} - if (weight < M_FLOAT_EPS) - { - return; - } +float mx_extract(vector4 in, int index) +{ + if (index == 0) return in.x; + else if (index == 1) return in.y; + else if (index == 2) return in.z; + else return in.w; +} - N = mx_forward_facing_normal(N, V); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); +float mx_remap(float in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) +{ + float x = (in - inLow)/(inHigh-inLow); + if (doClamp == 1) { + x = clamp(x, 0, 1); + } + return outLow + (outHigh - outLow) * x; +} - FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); - vec3 F = mx_compute_fresnel(NdotV, fd); +color mx_remap(color in, color inLow, color inHigh, color outLow, color outHigh, int doClamp) +{ + color x = (in - inLow) / (inHigh - inLow); + if (doClamp == 1) { + x = clamp(x, 0, 1); + } + return outLow + (outHigh - outLow) * x; +} - vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - vec3 comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); +color mx_remap(color in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) +{ + color x = (in - inLow) / (inHigh - inLow); + if (doClamp == 1) { + x = clamp(x, 0, 1); + } + return outLow + (outHigh - outLow) * x; +} - vec3 Li = mx_environment_radiance(N, V, X, safeAlpha, distribution, fd); +color4 mx_remap(color4 c, color4 inLow, color4 inHigh, color4 outLow, color4 outHigh, int doClamp) +{ + return color4(mx_remap(c.rgb, inLow.rgb, inHigh.rgb, outLow.rgb, outHigh.rgb, doClamp), + mx_remap(c.a, inLow.a, inHigh.a, outLow.a, outHigh.a, doClamp)); +} - bsdf.response = Li * comp * weight; +color4 mx_remap(color4 c, float inLow, float inHigh, float outLow, float outHigh, int doClamp) +{ + color4 c4_inLow = color4(color(inLow), inLow); + color4 c4_inHigh = color4(color(inHigh), inHigh); + color4 c4_outLow = color4(color(outLow), outLow); + color4 c4_outHigh = color4(color(outHigh), outHigh); + return mx_remap(c, c4_inLow, c4_inHigh, c4_outLow, c4_outHigh, doClamp); } -#include "lib/mx_microfacet_sheen.glsl" -void mx_sheen_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +vector2 mx_remap(vector2 in, vector2 inLow, vector2 inHigh, vector2 outLow, vector2 outHigh, int doClamp) { - if (weight < M_FLOAT_EPS) - { - return; - } + return vector2(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp), + mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp)); +} - N = mx_forward_facing_normal(N, V); +vector2 mx_remap(vector2 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) +{ + return vector2(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp), + mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp)); +} - vec3 H = normalize(L + V); +vector4 mx_remap(vector4 in, vector4 inLow, vector4 inHigh, vector4 outLow, vector4 outHigh, int doClamp) +{ + return vector4(mx_remap(in.x, inLow.x, inHigh.x, outLow.x, outHigh.x, doClamp), + mx_remap(in.y, inLow.y, inHigh.y, outLow.y, outHigh.y, doClamp), + mx_remap(in.z, inLow.z, inHigh.z, outLow.z, outHigh.z, doClamp), + mx_remap(in.w, inLow.w, inHigh.w, outLow.w, outHigh.w, doClamp)); +} - float NdotL = clamp(dot(N, L), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float NdotH = clamp(dot(N, H), M_FLOAT_EPS, 1.0); +vector4 mx_remap(vector4 in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) +{ + return vector4(mx_remap(in.x, inLow, inHigh, outLow, outHigh, doClamp), + mx_remap(in.y, inLow, inHigh, outLow, outHigh, doClamp), + mx_remap(in.z, inLow, inHigh, outLow, outHigh, doClamp), + mx_remap(in.w, inLow, inHigh, outLow, outHigh, doClamp)); +} - vec3 fr = color * mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); - float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); - bsdf.throughput = vec3(1.0 - dirAlbedo * weight); - // We need to include NdotL from the light integral here - // as in this case it's not cancelled out by the BRDF denominator. - bsdf.response = fr * NdotL * occlusion * weight; +float mx_contrast(float in, float amount, float pivot) +{ + float out = in - pivot; + out *= amount; + out += pivot; + return out; } -void mx_sheen_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 N, inout BSDF bsdf) +color mx_contrast(color in, color amount, color pivot) { - if (weight < M_FLOAT_EPS) - { - return; - } + color out = in - pivot; + out *= amount; + out += pivot; + return out; +} - N = mx_forward_facing_normal(N, V); +color mx_contrast(color in, float amount, float pivot) +{ + color out = in - pivot; + out *= amount; + out += pivot; + return out; +} - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); +color4 mx_contrast(color4 c, color4 amount, color4 pivot) +{ + return color4(mx_contrast(c.rgb, amount.rgb, pivot.rgb), + mx_contrast(c.a, amount.a, pivot.a)); +} - float dirAlbedo = mx_imageworks_sheen_dir_albedo(NdotV, roughness); - bsdf.throughput = vec3(1.0 - dirAlbedo * weight); +color4 mx_contrast(color4 c, float amount, float pivot) +{ + return mx_contrast(c, color4(color(amount), amount), color4(color(pivot), pivot)); +} - vec3 Li = mx_environment_irradiance(N); - bsdf.response = Li * color * dirAlbedo * weight; +vector2 mx_contrast(vector2 in, vector2 amount, vector2 pivot) +{ + return vector2 (mx_contrast(in.x, amount.x, pivot.x), + mx_contrast(in.y, amount.y, pivot.y)); } -void mx_uniform_edf(vec3 N, vec3 L, vec3 color, out EDF result) + +vector2 mx_contrast(vector2 in, float amount, float pivot) { - result = color; + return mx_contrast(in, vector2(amount, amount), vector2(pivot, pivot)); } -void mx_displacement_vector3(vec3 disp, float scale, out displacementshader result) + +vector4 mx_contrast(vector4 in, vector4 amount, vector4 pivot) { - result.offset = disp; - result.scale = scale; + return vector4(mx_contrast(in.x, amount.x, pivot.x), + mx_contrast(in.y, amount.y, pivot.y), + mx_contrast(in.z, amount.z, pivot.z), + mx_contrast(in.w, amount.w, pivot.w)); } -/// XYZ to Rec.709 RGB colorspace conversion -const mat3 XYZ_to_RGB = mat3( 3.2406, -0.9689, 0.0557, - -1.5372, 1.8758, -0.2040, - -0.4986, 0.0415, 1.0570); -void mx_blackbody(float temperatureKelvin, out vec3 colorValue) +vector4 mx_contrast(vector4 in, float amount, float pivot) { - float xc, yc; - float t, t2, t3, xc2, xc3; + return vector4(mx_contrast(in.x, amount, pivot), + mx_contrast(in.y, amount, pivot), + mx_contrast(in.z, amount, pivot), + mx_contrast(in.w, amount, pivot)); +} - // if value outside valid range of approximation clamp to accepted temperature range - temperatureKelvin = clamp(temperatureKelvin, 1667.0, 25000.0); - t = 1000.0 / temperatureKelvin; - t2 = t * t; - t3 = t * t * t; +vector2 mx_noise(string noisetype, float x, float y) +{ + color cnoise = (color) noise(noisetype, x, y); + return vector2 (cnoise[0], cnoise[1]); +} - // Cubic spline approximation for Kelvin temperature to sRGB conversion - // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) - if (temperatureKelvin < 4000.0) { // 1667K <= temperatureKelvin < 4000K - xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; - } - else { // 4000K <= temperatureKelvin <= 25000K - xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; - } - xc2 = xc * xc; - xc3 = xc * xc * xc; +color4 mx_noise(string noisetype, float x, float y) +{ + color cnoise = (color) noise(noisetype, x, y); + float fnoise = (float) noise(noisetype, x + 19, y + 73); + return color4 (cnoise, fnoise); +} - if (temperatureKelvin < 2222.0) { // 1667K <= temperatureKelvin < 2222K - yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; - } - else if (temperatureKelvin < 4000.0) { // 2222K <= temperatureKelvin < 4000K - yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; - } - else { // 4000K <= temperatureKelvin <= 25000K - yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; - } +vector4 mx_noise(string noisetype, float x, float y) +{ + color cnoise = (color) noise(noisetype, x, y); + float fnoise = (float) noise(noisetype, x + 19, y + 73); + return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise); +} - if (yc <= 0.0) { // avoid division by zero - colorValue = vec3(1.0); - return; - } +vector2 mx_noise(string noisetype, point position) +{ + color cnoise = (color) noise(noisetype, position); + return vector2 (cnoise[0], cnoise[1]); +} - vec3 XYZ = vec3(xc / yc, 1.0, (1.0 - xc - yc) / yc); +color4 mx_noise(string noisetype, point position) +{ + color cnoise = (color) noise(noisetype, position); + float fnoise = (float) noise(noisetype, position+vector(19,73,29)); + return color4 (cnoise, fnoise); +} - colorValue = XYZ_to_RGB * XYZ; - colorValue = max(colorValue, vec3(0.0)); +vector4 mx_noise(string noisetype, point position) +{ + color cnoise = (color) noise(noisetype, position); + float fnoise = (float) noise(noisetype, position+vector(19,73,29)); + return vector4 (cnoise[0], cnoise[1], cnoise[2], fnoise); } -void mx_roughness_dual(vec2 roughness, out vec2 result) + + +float mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - if (roughness.y < 0.0) - { - roughness.y = roughness.x; + float out = 0; + float amp = 1.0; + point p = position; + + for (int i = 0; i < octaves; i += 1) { + out += amp * noise(noisetype, p); + amp *= diminish; + p *= lacunarity; } - result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); - result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); + return out; } -void mx_displacement_float(float disp, float scale, out displacementshader result) + +color mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - result.offset = vec3(disp); - result.scale = scale; + color out = 0; + float amp = 1.0; + point p = position; + + for (int i = 0; i < octaves; i += 1) { + out += amp * (color)noise(noisetype, p); + amp *= diminish; + p *= lacunarity; + } + return out; } -#include "mx_microfacet_sheen.glsl" -#include "mx_microfacet_specular.glsl" -vec3 mx_generate_dir_albedo_table() +vector2 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - vec2 uv = gl_FragCoord.xy / $albedoTableSize; - vec2 ggxDirAlbedo = mx_ggx_dir_albedo(uv.x, uv.y, vec3(1, 0, 0), vec3(0, 1, 0)).xy; - float sheenDirAlbedo = mx_imageworks_sheen_dir_albedo(uv.x, uv.y); - return vec3(ggxDirAlbedo, sheenDirAlbedo); + return vector2((float) mx_fbm(position, octaves, lacunarity, diminish, noisetype), + (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype)); } -// https://developer.nvidia.com/gpugems/gpugems3/part-ii-light-and-shadows/chapter-8-summed-area-variance-shadow-maps -float mx_variance_shadow_occlusion(vec2 moments, float fragmentDepth) + +color4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) { - const float MIN_VARIANCE = 0.00001; + color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype); + float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype); + return color4 (c, f); +} - // One-tailed inequality valid if fragmentDepth > moments.x. - float p = (fragmentDepth <= moments.x) ? 1.0 : 0.0; +vector4 mx_fbm(point position, int octaves, float lacunarity, float diminish, string noisetype) +{ + color c = (color) mx_fbm(position, octaves, lacunarity, diminish, noisetype); + float f = (float) mx_fbm(position+point(19, 193, 17), octaves, lacunarity, diminish, noisetype); + return vector4 (c[0], c[1], c[2], f); +} - // Compute variance. - float variance = moments.y - mx_square(moments.x); - variance = max(variance, MIN_VARIANCE); - // Compute probabilistic upper bound. - float d = fragmentDepth - moments.x; - float pMax = variance / (variance + mx_square(d)); - return max(p, pMax); +void mx_split_float(output float x, output int ix) +{ + ix = int(floor(x)); + x -= ix; } -vec2 mx_compute_depth_moments() +float mx_worley_distance(vector2 p, int x, int y, int X, int Y, float jitter, int metric) { - float depth = gl_FragCoord.z; - return vec2(depth, mx_square(depth)); + vector o = cellnoise(x+X, y+Y); + o = (o - .5)*jitter + .5; + float cposx = x + o[0]; + float cposy = y + o[1]; + float diffx = cposx - p.x; + float diffy = cposy - p.y; + + if (metric == 2) + return abs(diffx) + abs(diffy); // Manhattan distance + if (metric == 3) + return max(abs(diffx), abs(diffy)); // Chebyshev distance + return diffx*diffx + diffy*diffy; // Euclidean or distance^2 } -#include "mx_microfacet_specular.glsl" -vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) +float mx_worley_distance(vector p, int x, int y, int z, int X, int Y, int Z, float jitter, int metric) { - // Generate tangent frame. - X = normalize(X - dot(X, N) * N); - vec3 Y = cross(N, X); - mat3 tangentToWorld = mat3(X, Y, N); + vector o = cellnoise(vector(x+X, y+Y, z+Z)); + o = (o - .5)*jitter + .5; + vector cpos = vector(x, y, z) + o; + vector diff = cpos - p; - // Transform the view vector to tangent space. - V = vec3(dot(V, X), dot(V, Y), dot(V, N)); + if (metric == 2) + return abs(diff[0]) + abs(diff[1]); // Manhattan distance + if (metric == 3) + return max(abs(diff[0]), abs(diff[1])); // Chebyshev distance + return dot(diff, diff); // Eucldean or distance^2 +} - // Compute derived properties. - float NdotV = clamp(V.z, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(alpha); - float G1V = mx_ggx_smith_G1(NdotV, avgAlpha); - - // Integrate outgoing radiance using filtered importance sampling. - // http://cgg.mff.cuni.cz/~jaroslav/papers/2008-egsr-fis/2008-egsr-fis-final-embedded.pdf - vec3 radiance = vec3(0.0); - int envRadianceSamples = $envRadianceSamples; - for (int i = 0; i < envRadianceSamples; i++) +void mx_sort_distance(float dist, output vector2 result) +{ + if (dist < result.x) { - vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); - - // Compute the half vector and incoming light direction. - vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, alpha); - vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, H, fd.ior.x) : -reflect(V, H); - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + result.y = result.x; + result.x = dist; + } + else if (dist < result.y) + { + result.y = dist; + } +} - // Sample the environment light from the given direction. - vec3 Lw = tangentToWorld * L; - float pdf = mx_ggx_NDF(H, alpha) * G1V / (4.0 * NdotV); - float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); - vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); +void mx_sort_distance(float dist, output vector result) +{ + if (dist < result[0]) + { + result[2] = result[1]; + result[1] = result[0]; + result[0] = dist; + } + else if (dist < result[1]) + { + result[2] = result[1]; + result[1] = dist; + } + else if (dist < result[2]) + { + result[2] = dist; + } +} - // Compute the Fresnel term. - vec3 F = mx_compute_fresnel(VdotH, fd); +float mx_worley_noise_float(vector2 p, float jitter, int metric) +{ + int X, Y; + vector2 seed = p; + float result = 1e6; - // Compute the geometric term. - float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); + mx_split_float(seed.x, X); + mx_split_float(seed.y, Y); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); + result = min(result, d); + } + } + if (metric == 0) + result = sqrt(result); + return result; +} - // Compute the combined FG term, which is inverted for refraction. - vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; +vector2 mx_worley_noise_vector2(vector2 p, float jitter, int metric) +{ + int X, Y; + vector2 seed = p; + vector2 result = vector2(1e6, 1e6); - // Add the radiance contribution of this sample. - // From https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf - // incidentLight = sampleColor * NdotL - // microfacetSpecular = D * F * G / (4 * NdotL * NdotV) - // pdf = D * G1V / (4 * NdotV); - // radiance = incidentLight * microfacetSpecular / pdf - radiance += sampleColor * FG; + mx_split_float(seed.x, X); + mx_split_float(seed.y, Y); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); + mx_sort_distance(d, result); + } } + if (metric == 0) + result = sqrt(result); + return result; +} - // Apply the global component of the geometric term and normalize. - radiance /= G1V * float(envRadianceSamples); +vector mx_worley_noise_vector3(vector2 p, float jitter, int metric) +{ + int X, Y; + vector2 seed = p; + vector result = vector(1e6, 1e6, 1e6); - // Return the final radiance. - return radiance * $envLightIntensity; + mx_split_float(seed.x, X); + mx_split_float(seed.y, Y); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + float d = mx_worley_distance(seed, x, y, X, Y, jitter, metric); + mx_sort_distance(d, result); + } + } + if (metric == 0) + result = sqrt(result); + return result; } -vec3 mx_environment_irradiance(vec3 N) +float mx_worley_noise_float(vector p, float jitter, int metric) { - vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); - return Li * $envLightIntensity; + int X, Y, Z; + vector seed = p; + float result = 1e6; + + mx_split_float(seed[0], X); + mx_split_float(seed[1], Y); + mx_split_float(seed[2], Z); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); + result = min(result, d); + } + } + } + if (metric == 0) + result = sqrt(result); + return result; } -#include "mx_microfacet.glsl" -// Based on the implementation of Oren-Nayar diffuse in Open Shading Language. -// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/testrender/shading.cpp -float mx_oren_nayar_diffuse(float NdotV, float NdotL, float LdotV, float roughness) +vector2 mx_worley_noise_vector2(vector p, float jitter, int metric) { - float s = LdotV - NdotL * NdotV; - float stinv = (s > 0.0f) ? s / max(NdotL, NdotV) : 0.0; - - float sigma2 = mx_square(roughness); - float A = 1.0 - 0.5 * (sigma2 / (sigma2 + 0.33)); - float B = 0.45 * sigma2 / (sigma2 + 0.09); + int X, Y, Z; + vector seed = p; + vector2 result = vector2(1e6, 1e6); - return A + B * stinv; + mx_split_float(seed[0], X); + mx_split_float(seed[1], Y); + mx_split_float(seed[2], Z); + for (int x = -1; x <= 1; ++x) + { + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); + mx_sort_distance(d, result); + } + } + } + if (metric == 0) + result = sqrt(result); + return result; } -// Rational quadratic fit to Monte Carlo data for Oren-Nayar directional albedo. -float mx_oren_nayar_diffuse_dir_albedo_analytic(float NdotV, float roughness) +vector mx_worley_noise_vector3(vector p, float jitter, int metric) { - vec2 r = vec2(1.0, 1.0) + - vec2(-0.4297, -0.6076) * roughness + - vec2(-0.7632, -0.4993) * NdotV * roughness + - vec2(1.4385, 2.0315) * mx_square(roughness); - return r.x / r.y; -} + int X, Y, Z; + vector result = 1e6; + vector seed = p; -float mx_oren_nayar_diffuse_dir_albedo_table_lookup(float NdotV, float roughness) -{ -#if DIRECTIONAL_ALBEDO_METHOD == 1 - if (textureSize($albedoTable, 0).x > 1) + mx_split_float(seed[0], X); + mx_split_float(seed[1], Y); + mx_split_float(seed[2], Z); + for (int x = -1; x <= 1; ++x) { - return texture($albedoTable, vec2(NdotV, roughness)).b; + for (int y = -1; y <= 1; ++y) + { + for (int z = -1; z <= 1; ++z) + { + float d = mx_worley_distance(seed, x, y, z, X, Y, Z, jitter, metric); + mx_sort_distance(d, result); + } + } } -#endif - return 0.0; + if (metric == 0) + result = sqrt(result); + return result; } +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE +// +// MaterialX specification (c) 2017 Lucasfilm Ltd. +// http://www.materialx.org/ -float mx_oren_nayar_diffuse_dir_albedo_monte_carlo(float NdotV, float roughness) +#pragma once +#define MATRIX33_H + + +struct matrix33 { - NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); - vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); + matrix m; +}; - float radiance = 0.0; - const int SAMPLE_COUNT = 64; - for (int i = 0; i < SAMPLE_COUNT; i++) - { - vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); +int isValidAs33(matrix m44) +{ + return m44[0][3] == 0 && + m44[1][3] == 0 && + m44[2][3] == 0 && + m44[3][0] == 0 && + m44[3][1] == 0 && + m44[3][2] == 0 && + m44[3][3] == 1; +} - // Compute the incoming light direction. - vec3 L = mx_uniform_sample_hemisphere(Xi); - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); - float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); +matrix matrix33To44 (matrix33 m33) +{ + return m33.m; +} - // Compute diffuse reflectance. - float reflectance = mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); +// Convert an arbitrary m44 to m33 by removing the translation +//QUESTION: should we check if it's valid to represent the 4x4 as a 3x3? +matrix33 matrix44To33 (matrix m44) +{ + matrix33 m33; + m33.m = m44; + m33.m[0][3] = 0; + m33.m[1][3] = 0; + m33.m[2][3] = 0; + m33.m[3][0] = 0; + m33.m[3][1] = 0; + m33.m[3][2] = 0; + m33.m[3][3] = 1; - // Add the radiance contribution of this sample. - // uniform_pdf = 1 / (2 * PI) - // radiance = (reflectance * NdotL) / (uniform_pdf * PI); - radiance += reflectance * NdotL; - } + return m33; +} - // Apply global components and normalize. - radiance *= 2.0 / float(SAMPLE_COUNT); +matrix33 __operator__neg__(matrix33 a) +{ + matrix33 m33; + m33.m = -a.m; + return m33; +} - // Return the final directional albedo. - return radiance; + +matrix33 __operator__mul__(int a, matrix33 b) +{ + matrix33 m33; + m33.m = a * b.m; + return m33; } -float mx_oren_nayar_diffuse_dir_albedo(float NdotV, float roughness) +matrix33 __operator__mul__(float a, matrix33 b) { -#if DIRECTIONAL_ALBEDO_METHOD == 2 - float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_monte_carlo(NdotV, roughness); -#else - float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_analytic(NdotV, roughness); -#endif - return clamp(dirAlbedo, 0.0, 1.0); + matrix33 m33; + m33.m = a * b.m; + return m33; } -// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf -// Section 5.3 -float mx_burley_diffuse(float NdotV, float NdotL, float LdotH, float roughness) +matrix33 __operator__mul__(matrix33 a, int b) { - float F90 = 0.5 + (2.0 * roughness * mx_square(LdotH)); - float refL = mx_fresnel_schlick(NdotL, 1.0, F90); - float refV = mx_fresnel_schlick(NdotV, 1.0, F90); - return refL * refV; + matrix33 m33; + m33.m = a.m * b; + return m33; } -// Compute the directional albedo component of Burley diffuse for the given -// view angle and roughness. Curve fit provided by Stephen Hill. -float mx_burley_diffuse_dir_albedo(float NdotV, float roughness) +matrix33 __operator__mul__(matrix33 a, float b) { - float x = NdotV; - float fit0 = 0.97619 - 0.488095 * mx_pow5(1.0 - x); - float fit1 = 1.55754 + (-2.02221 + (2.56283 - 1.06244 * x) * x) * x; - return mix(fit0, fit1, roughness); + matrix33 m33; + m33.m = a.m * b; + return m33; } -// Evaluate the Burley diffusion profile for the given distance and diffusion shape. -// Based on https://graphics.pixar.com/library/ApproxBSSRDF/ -vec3 mx_burley_diffusion_profile(float dist, vec3 shape) +matrix33 __operator__mul__(matrix33 a, matrix33 b) { - vec3 num1 = exp(-shape * dist); - vec3 num2 = exp(-shape * dist / 3.0); - float denom = max(dist, M_FLOAT_EPS); - return (num1 + num2) / denom; + matrix33 m33; + m33.m = a.m * b.m; + return m33; } -// Integrate the Burley diffusion profile over a sphere of the given radius. -// Inspired by Eric Penner's presentation in http://advances.realtimerendering.com/s2011/ -vec3 mx_integrate_burley_diffusion(vec3 N, vec3 L, float radius, vec3 mfp) +matrix33 __operator__div__(int a, matrix33 b) { - float theta = acos(dot(N, L)); + matrix33 m33; + m33.m = a / b.m; + return m33; +} - // Estimate the Burley diffusion shape from mean free path. - vec3 shape = vec3(1.0) / max(mfp, 0.1); +matrix33 __operator__div__(float a, matrix33 b) +{ + matrix33 m33; + m33.m = a / b.m; + return m33; +} - // Integrate the profile over the sphere. - vec3 sumD = vec3(0.0); - vec3 sumR = vec3(0.0); - const int SAMPLE_COUNT = 32; - const float SAMPLE_WIDTH = (2.0 * M_PI) / float(SAMPLE_COUNT); - for (int i = 0; i < SAMPLE_COUNT; i++) - { - float x = -M_PI + (float(i) + 0.5) * SAMPLE_WIDTH; - float dist = radius * abs(2.0 * sin(x * 0.5)); - vec3 R = mx_burley_diffusion_profile(dist, shape); - sumD += R * max(cos(theta + x), 0.0); - sumR += R; - } +matrix33 __operator__div__(matrix33 a, int b) +{ + matrix33 m33; + m33.m = a.m / b; + return m33; +} - return sumD / sumR; +matrix33 __operator__div__(matrix33 a, float b) +{ + matrix33 m33; + m33.m = a.m / b; + return m33; } -vec3 mx_subsurface_scattering_approx(vec3 N, vec3 L, vec3 P, vec3 albedo, vec3 mfp) +matrix33 __operator__div__(matrix33 a, matrix33 b) { - float curvature = length(fwidth(N)) / length(fwidth(P)); - float radius = 1.0 / max(curvature, 0.01); - return albedo * mx_integrate_burley_diffusion(N, L, radius, mfp) / vec3(M_PI); + matrix33 m33; + m33.m = a.m / b.m; + return m33; } -#include "mx_microfacet_specular.glsl" -// Construct an orthonormal basis from a unit vector. -// https://graphics.pixar.com/library/OrthonormalB/paper.pdf -mat3 mx_orthonormal_basis(vec3 N) +int __operator__eq__(matrix33 a, matrix33 b) { - float sign = (N.z < 0.0) ? -1.0 : 1.0; - float a = -1.0 / (sign + N.z); - float b = N.x * N.y * a; - vec3 X = vec3(1.0 + sign * N.x * N.x * a, sign * b, -sign * N.x); - vec3 Y = vec3(b, sign + N.y * N.y * a, -N.y); - return mat3(X, Y, N); + return a.m == b.m; } -// Return the alpha associated with the given mip level in a prefiltered environment. -float mx_latlong_lod_to_alpha(float lod) +int __operator__ne__(matrix33 a, matrix33 b) { - float lodBias = lod / float($envRadianceMips - 1); - return (lodBias < 0.5) ? mx_square(lodBias) : 2.0 * (lodBias - 0.375); + return a.m != b.m; } -// The inverse of mx_latlong_projection. -vec3 mx_latlong_map_projection_inverse(vec2 uv) +float determinant (matrix33 a) { - float latitude = (uv.y - 0.5) * M_PI; - float longitude = (uv.x - 0.5) * M_PI * 2.0; - - float x = -cos(latitude) * sin(longitude); - float y = -sin(latitude); - float z = cos(latitude) * cos(longitude); - - return vec3(x, y, z); + return determinant(a.m); } -vec3 mx_generate_prefilter_env() +matrix33 transpose(matrix33 a) { - // The tangent view vector is aligned with the normal. - vec3 V = vec3(0.0, 0.0, 1.0); - float NdotV = 1.0; - - // Compute derived properties. - vec2 uv = gl_FragCoord.xy * pow(2.0, $envPrefilterMip) / vec2(textureSize($envRadiance, 0)); - vec3 worldN = mx_latlong_map_projection_inverse(uv); - mat3 tangentToWorld = mx_orthonormal_basis(worldN); - float alpha = mx_latlong_lod_to_alpha(float($envPrefilterMip)); - float G1V = mx_ggx_smith_G1(NdotV, alpha); - - // Integrate the LD term for the given environment and alpha. - vec3 radiance = vec3(0.0, 0.0, 0.0); - float weight = 0.0; - int envRadianceSamples = 1024; - for (int i = 0; i < envRadianceSamples; i++) - { - vec2 Xi = mx_spherical_fibonacci(i, envRadianceSamples); - - // Compute the half vector and incoming light direction. - vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); - vec3 L = -V + 2.0 * H.z * H; - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); - - // Compute the geometric term. - float G = mx_ggx_smith_G2(NdotL, NdotV, alpha); - - // Sample the environment light from the given direction. - vec3 Lw = tangentToWorld * L; - float pdf = mx_ggx_NDF(H, vec2(alpha)) * G1V / (4.0 * NdotV); - float lod = mx_latlong_compute_lod(Lw, pdf, float($envRadianceMips - 1), envRadianceSamples); - vec3 sampleColor = mx_latlong_map_lookup(Lw, $envMatrix, lod, $envRadiance); - - // Add the radiance contribution of this sample. - radiance += G * sampleColor; - weight += G; - } - - return radiance / weight; + matrix33 m33; + m33.m = transpose(a.m); + return m33; } -#include "mx_microfacet_specular.glsl" -vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 roughness, int distribution, FresnelData fd) +point transform(matrix33 a, point b) { - return vec3(0.0); + return transform(a.m, b); } -vec3 mx_environment_irradiance(vec3 N) +vector transform(matrix33 a, vector b) { - return vec3(0.0); + return transform(a.m, b); } -#include "mx_microfacet.glsl" -const int FRESNEL_MODEL_DIELECTRIC = 0; -const int FRESNEL_MODEL_CONDUCTOR = 1; -const int FRESNEL_MODEL_SCHLICK = 2; - -// Parameters for Fresnel calculations -struct FresnelData +normal transform(matrix33 a, normal b) { - // Fresnel model - int model; - bool airy; + return transform(a.m, b); +} - // Physical Fresnel - vec3 ior; - vec3 extinction; - // Generalized Schlick Fresnel - vec3 F0; - vec3 F82; - vec3 F90; - float exponent; - // Thin film - float tf_thickness; - float tf_ior; +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE - // Refraction - bool refraction; -}; +#pragma once +#define COLOR4_H -// https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf -// Appendix B.2 Equation 13 -float mx_ggx_NDF(vec3 H, vec2 alpha) -{ - vec2 He = H.xy / alpha; - float denom = dot(He, He) + mx_square(H.z); - return 1.0 / (M_PI * alpha.x * alpha.y * mx_square(denom)); -} -// https://ggx-research.github.io/publication/2023/06/09/publication-ggx.html -vec3 mx_ggx_importance_sample_VNDF(vec2 Xi, vec3 V, vec2 alpha) +// color4 is a color + alpha +struct color4 { - // Transform the view direction to the hemisphere configuration. - V = normalize(vec3(V.xy * alpha, V.z)); + color rgb; + float a; +}; - // Sample a spherical cap in (-V.z, 1]. - float phi = 2.0 * M_PI * Xi.x; - float z = (1.0 - Xi.y) * (1.0 + V.z) - V.z; - float sinTheta = sqrt(clamp(1.0 - z * z, 0.0, 1.0)); - float x = sinTheta * cos(phi); - float y = sinTheta * sin(phi); - vec3 c = vec3(x, y, z); - // Compute the microfacet normal. - vec3 H = c + V; - // Transform the microfacet normal back to the ellipsoid configuration. - H = normalize(vec3(H.xy * alpha, max(H.z, 0.0))); +// +// For color4, define math operators to match color +// - return H; +color4 __operator__neg__(color4 a) +{ + return color4(-a.rgb, -a.a); } -// https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf -// Equation 34 -float mx_ggx_smith_G1(float cosTheta, float alpha) +color4 __operator__add__(color4 a, color4 b) { - float cosTheta2 = mx_square(cosTheta); - float tanTheta2 = (1.0 - cosTheta2) / cosTheta2; - return 2.0 / (1.0 + sqrt(1.0 + mx_square(alpha) * tanTheta2)); + return color4(a.rgb + b.rgb, a.a + b.a); } -// Height-correlated Smith masking-shadowing -// http://jcgt.org/published/0003/02/03/paper.pdf -// Equations 72 and 99 -float mx_ggx_smith_G2(float NdotL, float NdotV, float alpha) +color4 __operator__add__(color4 a, int b) { - float alpha2 = mx_square(alpha); - float lambdaL = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotL)); - float lambdaV = sqrt(alpha2 + (1.0 - alpha2) * mx_square(NdotV)); - return 2.0 / (lambdaL / NdotL + lambdaV / NdotV); + return a + color4(color(b), b); } -// Rational quadratic fit to Monte Carlo data for GGX directional albedo. -vec3 mx_ggx_dir_albedo_analytic(float NdotV, float alpha, vec3 F0, vec3 F90) +color4 __operator__add__(color4 a, float b) { - float x = NdotV; - float y = alpha; - float x2 = mx_square(x); - float y2 = mx_square(y); - vec4 r = vec4(0.1003, 0.9345, 1.0, 1.0) + - vec4(-0.6303, -2.323, -1.765, 0.2281) * x + - vec4(9.748, 2.229, 8.263, 15.94) * y + - vec4(-2.038, -3.748, 11.53, -55.83) * x * y + - vec4(29.34, 1.424, 28.96, 13.08) * x2 + - vec4(-8.245, -0.7684, -7.507, 41.26) * y2 + - vec4(-26.44, 1.436, -36.11, 54.9) * x2 * y + - vec4(19.99, 0.2913, 15.86, 300.2) * x * y2 + - vec4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; - vec2 AB = clamp(r.xy / r.zw, 0.0, 1.0); - return F0 * AB.x + F90 * AB.y; + return a + color4(color(b), b); } -vec3 mx_ggx_dir_albedo_table_lookup(float NdotV, float alpha, vec3 F0, vec3 F90) +color4 __operator__add__(int a, color4 b) { -#if DIRECTIONAL_ALBEDO_METHOD == 1 - if (textureSize($albedoTable, 0).x > 1) - { - vec2 AB = texture($albedoTable, vec2(NdotV, alpha)).rg; - return F0 * AB.x + F90 * AB.y; - } -#endif - return vec3(0.0); + return color4(color(a), a) + b; } -// https://cdn2.unrealengine.com/Resources/files/2013SiggraphPresentationsNotes-26915738.pdf -vec3 mx_ggx_dir_albedo_monte_carlo(float NdotV, float alpha, vec3 F0, vec3 F90) +color4 __operator__add__(float a, color4 b) { - NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); - vec3 V = vec3(sqrt(1.0 - mx_square(NdotV)), 0, NdotV); - - vec2 AB = vec2(0.0); - const int SAMPLE_COUNT = 64; - for (int i = 0; i < SAMPLE_COUNT; i++) - { - vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); - - // Compute the half vector and incoming light direction. - vec3 H = mx_ggx_importance_sample_VNDF(Xi, V, vec2(alpha)); - vec3 L = -reflect(V, H); - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); - float VdotH = clamp(dot(V, H), M_FLOAT_EPS, 1.0); + return color4(color(a), a) + b; +} - // Compute the Fresnel term. - float Fc = mx_fresnel_schlick(VdotH, 0.0, 1.0); +color4 __operator__sub__(color4 a, color4 b) +{ + return color4(a.rgb - b.rgb, a.a - b.a); +} - // Compute the per-sample geometric term. - // https://hal.inria.fr/hal-00996995v2/document, Algorithm 2 - float G2 = mx_ggx_smith_G2(NdotL, NdotV, alpha); - - // Add the contribution of this sample. - AB += vec2(G2 * (1.0 - Fc), G2 * Fc); - } +color4 __operator__sub__(color4 a, int b) +{ + return a - color4(color(b), b); +} - // Apply the global component of the geometric term and normalize. - AB /= mx_ggx_smith_G1(NdotV, alpha) * float(SAMPLE_COUNT); +color4 __operator__sub__(color4 a, float b) +{ + return a - color4(color(b), b); +} - // Return the final directional albedo. - return F0 * AB.x + F90 * AB.y; +color4 __operator__sub__(int a, color4 b) +{ + return color4(color(a), a) - b; } -vec3 mx_ggx_dir_albedo(float NdotV, float alpha, vec3 F0, vec3 F90) +color4 __operator__sub__(float a, color4 b) { -#if DIRECTIONAL_ALBEDO_METHOD == 0 - return mx_ggx_dir_albedo_analytic(NdotV, alpha, F0, F90); -#elif DIRECTIONAL_ALBEDO_METHOD == 1 - return mx_ggx_dir_albedo_table_lookup(NdotV, alpha, F0, F90); -#else - return mx_ggx_dir_albedo_monte_carlo(NdotV, alpha, F0, F90); -#endif + return color4(color(a), a) - b; } -float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) +color4 __operator__mul__(color4 a, color4 b) { - return mx_ggx_dir_albedo(NdotV, alpha, vec3(F0), vec3(F90)).x; + return color4(a.rgb * b.rgb, a.a * b.a); } -// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf -// Equations 14 and 16 -vec3 mx_ggx_energy_compensation(float NdotV, float alpha, vec3 Fss) +color4 __operator__mul__(color4 a, int b) { - float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); - return 1.0 + Fss * (1.0 - Ess) / Ess; + return a * color4(color(b), b); } -float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) +color4 __operator__mul__(color4 a, float b) { - return mx_ggx_energy_compensation(NdotV, alpha, vec3(Fss)).x; + return a * color4(color(b), b); } -// Compute the average of an anisotropic alpha pair. -float mx_average_alpha(vec2 alpha) +color4 __operator__mul__(int a, color4 b) { - return sqrt(alpha.x * alpha.y); + return color4(color(a), a) * b; } -// Convert a real-valued index of refraction to normal-incidence reflectivity. -float mx_ior_to_f0(float ior) +color4 __operator__mul__(float a, color4 b) { - return mx_square((ior - 1.0) / (ior + 1.0)); + return color4(color(a), a) * b; } -// Convert normal-incidence reflectivity to real-valued index of refraction. -float mx_f0_to_ior(float F0) +color4 __operator__div__(color4 a, color4 b) { - float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); - return (1.0 + sqrtF0) / (1.0 - sqrtF0); + return color4(a.rgb / b.rgb, a.a / b.a); } -vec3 mx_f0_to_ior(vec3 F0) + +color4 __operator__div__(color4 a, int b) { - vec3 sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); - return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0); + float b_inv = 1.0/b; + return a * color4(color(b_inv), b_inv); } -// https://renderwonk.com/publications/wp-generalization-adobe/gen-adobe.pdf -vec3 mx_fresnel_hoffman_schlick(float cosTheta, FresnelData fd) +color4 __operator__div__(color4 a, float b) { - const float COS_THETA_MAX = 1.0 / 7.0; - const float COS_THETA_FACTOR = 1.0 / (COS_THETA_MAX * pow(1.0 - COS_THETA_MAX, 6.0)); + float b_inv = 1.0/b; + return a * color4(color(b_inv), b_inv); +} - float x = clamp(cosTheta, 0.0, 1.0); - vec3 a = mix(fd.F0, fd.F90, pow(1.0 - COS_THETA_MAX, fd.exponent)) * (vec3(1.0) - fd.F82) * COS_THETA_FACTOR; - return mix(fd.F0, fd.F90, pow(1.0 - x, fd.exponent)) - a * x * mx_pow6(1.0 - x); +color4 __operator_div__(int a, color4 b) +{ + return color4(color(a), a) / b; } -// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ -float mx_fresnel_dielectric(float cosTheta, float ior) +color4 __operator__div__(float a, color4 b) { - float c = cosTheta; - float g2 = ior*ior + c*c - 1.0; - if (g2 < 0.0) - { - // Total internal reflection - return 1.0; - } + return color4(color(a), a) / b; +} - float g = sqrt(g2); - return 0.5 * mx_square((g - c) / (g + c)) * - (1.0 + mx_square(((g + c) * c - 1.0) / ((g - c) * c + 1.0))); +int __operator__eq__(color4 a, color4 b) +{ + return (a.rgb == b.rgb) && (a.a == b.a); } -// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ -vec2 mx_fresnel_dielectric_polarized(float cosTheta, float ior) +int __operator__ne__(color4 a, color4 b) { - float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); - float sinTheta2 = 1.0 - cosTheta2; + return (a.rgb != b.rgb) || (a.a != b.a); +} - float t0 = max(ior * ior - sinTheta2, 0.0); - float t1 = t0 + cosTheta2; - float t2 = 2.0 * sqrt(t0) * cosTheta; - float Rs = (t1 - t2) / (t1 + t2); - float t3 = cosTheta2 * t0 + sinTheta2 * sinTheta2; - float t4 = t2 * sinTheta2; - float Rp = Rs * (t3 - t4) / (t3 + t4); - return vec2(Rp, Rs); +// +// For color4, define most of the stdosl functions to match color +// + +color4 abs(color4 a) +{ + return color4(abs(a.rgb), abs(a.a)); } -// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ -void mx_fresnel_conductor_polarized(float cosTheta, vec3 n, vec3 k, out vec3 Rp, out vec3 Rs) +color4 ceil(color4 a) { - float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); - float sinTheta2 = 1.0 - cosTheta2; - vec3 n2 = n * n; - vec3 k2 = k * k; + return color4(ceil(a.rgb), ceil(a.a)); +} - vec3 t0 = n2 - k2 - vec3(sinTheta2); - vec3 a2plusb2 = sqrt(t0 * t0 + 4.0 * n2 * k2); - vec3 t1 = a2plusb2 + vec3(cosTheta2); - vec3 a = sqrt(max(0.5 * (a2plusb2 + t0), 0.0)); - vec3 t2 = 2.0 * a * cosTheta; - Rs = (t1 - t2) / (t1 + t2); +color4 round(color4 a) +{ + return color4(round(a.rgb), round(a.a)); +} - vec3 t3 = cosTheta2 * a2plusb2 + vec3(sinTheta2 * sinTheta2); - vec3 t4 = t2 * sinTheta2; - Rp = Rs * (t3 - t4) / (t3 + t4); +color4 floor(color4 a) +{ + return color4(floor(a.rgb), floor(a.a)); } -vec3 mx_fresnel_conductor(float cosTheta, vec3 n, vec3 k) +color4 sqrt(color4 a) { - vec3 Rp, Rs; - mx_fresnel_conductor_polarized(cosTheta, n, k, Rp, Rs); - return 0.5 * (Rp + Rs); + return color4(sqrt(a.rgb), sqrt(a.a)); } -// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html -void mx_fresnel_conductor_phase_polarized(float cosTheta, float eta1, vec3 eta2, vec3 kappa2, out vec3 phiP, out vec3 phiS) +color4 exp(color4 a) { - vec3 k2 = kappa2 / eta2; - vec3 sinThetaSqr = vec3(1.0) - cosTheta * cosTheta; - vec3 A = eta2*eta2*(vec3(1.0)-k2*k2) - eta1*eta1*sinThetaSqr; - vec3 B = sqrt(A*A + mx_square(2.0*eta2*eta2*k2)); - vec3 U = sqrt((A+B)/2.0); - vec3 V = max(vec3(0.0), sqrt((B-A)/2.0)); + return color4(exp(a.rgb), exp(a.a)); +} - phiS = atan(2.0*eta1*V*cosTheta, U*U + V*V - mx_square(eta1*cosTheta)); - phiP = atan(2.0*eta1*eta2*eta2*cosTheta * (2.0*k2*U - (vec3(1.0)-k2*k2) * V), - mx_square(eta2*eta2*(vec3(1.0)+k2*k2)*cosTheta) - eta1*eta1*(U*U+V*V)); +color4 log(color4 a) +{ + return color4(log(a.rgb), log(a.a)); } -// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html -vec3 mx_eval_sensitivity(float opd, vec3 shift) +color4 log2(color4 a) { - // Use Gaussian fits, given by 3 parameters: val, pos and var - float phase = 2.0*M_PI * opd; - vec3 val = vec3(5.4856e-13, 4.4201e-13, 5.2481e-13); - vec3 pos = vec3(1.6810e+06, 1.7953e+06, 2.2084e+06); - vec3 var = vec3(4.3278e+09, 9.3046e+09, 6.6121e+09); - vec3 xyz = val * sqrt(2.0*M_PI * var) * cos(pos * phase + shift) * exp(- var * phase*phase); - xyz.x += 9.7470e-14 * sqrt(2.0*M_PI * 4.5282e+09) * cos(2.2399e+06 * phase + shift[0]) * exp(- 4.5282e+09 * phase*phase); - return xyz / 1.0685e-7; + return color4(log2(a.rgb), log2(a.a)); } -// A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence -// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html -vec3 mx_fresnel_airy(float cosTheta, FresnelData fd) +color4 mix(color4 a, color4 b, float x ) { - // XYZ to CIE 1931 RGB color space (using neutral E illuminant) - const mat3 XYZ_TO_RGB = mat3(2.3706743, -0.5138850, 0.0052982, -0.9000405, 1.4253036, -0.0146949, -0.4706338, 0.0885814, 1.0093968); + return color4(mix(a.rgb, b.rgb, x), + mix(a.a, b.a, x)); +} - // Assume vacuum on the outside - float eta1 = 1.0; - float eta2 = max(fd.tf_ior, eta1); - vec3 eta3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? mx_f0_to_ior(fd.F0) : fd.ior; - vec3 kappa3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? vec3(0.0) : fd.extinction; - float cosThetaT = sqrt(1.0 - (1.0 - mx_square(cosTheta)) * mx_square(eta1 / eta2)); +color4 mix(color4 a, color4 b, color4 x ) +{ + return color4(mix(a.rgb, b.rgb, x.rgb), + mix(a.a, b.a, x.a)); +} - // First interface - vec2 R12 = mx_fresnel_dielectric_polarized(cosTheta, eta2 / eta1); - if (cosThetaT <= 0.0) - { - // Total internal reflection - R12 = vec2(1.0); - } - vec2 T121 = vec2(1.0) - R12; +float dot(color4 a, color b) +{ + return dot(a.rgb, b); +} - // Second interface - vec3 R23p, R23s; - if (fd.model == FRESNEL_MODEL_SCHLICK) - { - vec3 f = mx_fresnel_hoffman_schlick(cosThetaT, fd); - R23p = 0.5 * f; - R23s = 0.5 * f; - } - else - { - mx_fresnel_conductor_polarized(cosThetaT, eta3 / eta2, kappa3 / eta2, R23p, R23s); - } +color4 smoothstep(color4 edge0, color4 edge1, color4 c) +{ + return color4(smoothstep(edge0.rgb, edge1.rgb, c.rgb), + smoothstep(edge0.a, edge1.a, c.a)); +} - // Phase shift - float cosB = cos(atan(eta2 / eta1)); - vec2 phi21 = vec2(cosTheta < cosB ? 0.0 : M_PI, M_PI); - vec3 phi23p, phi23s; - if (fd.model == FRESNEL_MODEL_SCHLICK) - { - phi23p = vec3((eta3[0] < eta2) ? M_PI : 0.0, - (eta3[1] < eta2) ? M_PI : 0.0, - (eta3[2] < eta2) ? M_PI : 0.0); - phi23s = phi23p; - } - else - { - mx_fresnel_conductor_phase_polarized(cosThetaT, eta2, eta3, kappa3, phi23p, phi23s); - } - vec3 r123p = max(sqrt(R12.x*R23p), 0.0); - vec3 r123s = max(sqrt(R12.y*R23s), 0.0); +color4 smoothstep(float edge0, float edge1, color4 c) +{ + return smoothstep(color4(color(edge0), edge0), color4(color(edge1), edge1), c); +} - // Iridescence term - vec3 I = vec3(0.0); - vec3 Cm, Sm; +color4 clamp(color4 c, color4 minval, color4 maxval) +{ + return color4(clamp(c.rgb, minval.rgb, maxval.rgb), + clamp(c.a, minval.a, maxval.a)); +} - // Optical path difference - float distMeters = fd.tf_thickness * 1.0e-9; - float opd = 2.0 * eta2 * cosThetaT * distMeters; +color4 clamp(color4 c, float minval, float maxval) +{ + return clamp(c, color4(color(minval), minval), color4(color(maxval), maxval)); +} + +color4 max(color4 a, color4 b) +{ + return color4(max(a.rgb, b.rgb), + max(a.a, b.a)); +} + +color4 max(color4 a, float b) +{ + return color4(max(a.rgb, b), + max(a.a, b)); +} - // Iridescence term using spectral antialiasing for Parallel polarization +color4 min(color4 a, color4 b) +{ + return color4(min(a.rgb, b.rgb), + min(a.a, b.a)); +} - // Reflectance term for m=0 (DC term amplitude) - vec3 Rs = (mx_square(T121.x) * R23p) / (vec3(1.0) - R12.x*R23p); - I += R12.x + Rs; +color4 min(color4 a, float b) +{ + return color4(min(a.rgb, b), + min(a.a, b)); +} - // Reflectance term for m>0 (pairs of diracs) - Cm = Rs - T121.x; - for (int m=1; m<=2; m++) - { - Cm *= r123p; - Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23p+vec3(phi21.x))); - I += Cm*Sm; - } +color4 mod(color4 a, color4 b) +{ + return color4(mod(a.rgb, b.rgb), + mod(a.a, b.a)); +} - // Iridescence term using spectral antialiasing for Perpendicular polarization +color4 mod(color4 a, int b) +{ + return mod(a, color4(color(b), b)); +} - // Reflectance term for m=0 (DC term amplitude) - vec3 Rp = (mx_square(T121.y) * R23s) / (vec3(1.0) - R12.y*R23s); - I += R12.y + Rp; +color4 mod(color4 a, float b) +{ + return mod(a, color4(color(b), b)); +} - // Reflectance term for m>0 (pairs of diracs) - Cm = Rp - T121.y; - for (int m=1; m<=2; m++) - { - Cm *= r123s; - Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23s+vec3(phi21.y))); - I += Cm*Sm; - } +color4 fmod(color4 a, color4 b) +{ + return color4(fmod(a.rgb, b.rgb), + fmod(a.a, b.a)); +} - // Average parallel and perpendicular polarization - I *= 0.5; +color4 fmod(color4 a, int b) +{ + return fmod(a, color4(color(b), b)); +} - // Convert back to RGB reflectance - I = clamp(XYZ_TO_RGB * I, 0.0, 1.0); +color4 fmod(color4 a, float b) +{ + return fmod(a, color4(color(b), b)); +} - return I; +color4 pow(color4 base, color4 power) +{ + return color4(pow(base.rgb, power.rgb), + pow(base.a, power.a)); } -FresnelData mx_init_fresnel_dielectric(float ior, float tf_thickness, float tf_ior) +color4 pow(color4 base, float power) { - FresnelData fd; - fd.model = FRESNEL_MODEL_DIELECTRIC; - fd.airy = tf_thickness > 0.0; - fd.ior = vec3(ior); - fd.extinction = vec3(0.0); - fd.F0 = vec3(0.0); - fd.F82 = vec3(0.0); - fd.F90 = vec3(0.0); - fd.exponent = 0.0; - fd.tf_thickness = tf_thickness; - fd.tf_ior = tf_ior; - fd.refraction = false; - return fd; + return color4(pow(base.rgb, power), + pow(base.a, power)); } -FresnelData mx_init_fresnel_conductor(vec3 ior, vec3 extinction, float tf_thickness, float tf_ior) +color4 sign(color4 a) { - FresnelData fd; - fd.model = FRESNEL_MODEL_CONDUCTOR; - fd.airy = tf_thickness > 0.0; - fd.ior = ior; - fd.extinction = extinction; - fd.F0 = vec3(0.0); - fd.F82 = vec3(0.0); - fd.F90 = vec3(0.0); - fd.exponent = 0.0; - fd.tf_thickness = tf_thickness; - fd.tf_ior = tf_ior; - fd.refraction = false; - return fd; + return color4(sign(a.rgb), + sign(a.a)); } -FresnelData mx_init_fresnel_schlick(vec3 F0, vec3 F82, vec3 F90, float exponent, float tf_thickness, float tf_ior) +color4 sin(color4 a) { - FresnelData fd; - fd.model = FRESNEL_MODEL_SCHLICK; - fd.airy = tf_thickness > 0.0; - fd.ior = vec3(0.0); - fd.extinction = vec3(0.0); - fd.F0 = F0; - fd.F82 = F82; - fd.F90 = F90; - fd.exponent = exponent; - fd.tf_thickness = tf_thickness; - fd.tf_ior = tf_ior; - fd.refraction = false; - return fd; + return color4(sin(a.rgb), + sin(a.a)); } -vec3 mx_compute_fresnel(float cosTheta, FresnelData fd) +color4 cos(color4 a) { - if (fd.airy) - { - return mx_fresnel_airy(cosTheta, fd); - } - else if (fd.model == FRESNEL_MODEL_DIELECTRIC) - { - return vec3(mx_fresnel_dielectric(cosTheta, fd.ior.x)); - } - else if (fd.model == FRESNEL_MODEL_CONDUCTOR) - { - return mx_fresnel_conductor(cosTheta, fd.ior, fd.extinction); - } - else - { - return mx_fresnel_hoffman_schlick(cosTheta, fd); - } + return color4(cos(a.rgb), + cos(a.a)); } -// Compute the refraction of a ray through a solid sphere. -vec3 mx_refraction_solid_sphere(vec3 R, vec3 N, float ior) +color4 tan(color4 a) { - R = refract(R, N, 1.0 / ior); - vec3 N1 = normalize(R * dot(R, N) - N * 0.5); - return refract(R, N1, ior); + return color4(tan(a.rgb), + tan(a.a)); } -vec2 mx_latlong_projection(vec3 dir) +color4 asin(color4 a) { - float latitude = -asin(dir.y) * M_PI_INV + 0.5; - float longitude = atan(dir.x, -dir.z) * M_PI_INV * 0.5 + 0.5; - return vec2(longitude, latitude); + return color4(asin(a.rgb), + asin(a.a)); } -vec3 mx_latlong_map_lookup(vec3 dir, mat4 transform, float lod, sampler2D envSampler) +color4 acos(color4 a) { - vec3 envDir = normalize((transform * vec4(dir,0.0)).xyz); - vec2 uv = mx_latlong_projection(envDir); - return textureLod(envSampler, uv, lod).rgb; + return color4(acos(a.rgb), + acos(a.a)); } -// Return the mip level with the appropriate coverage for a filtered importance sample. -// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch20.html -// Section 20.4 Equation 13 -float mx_latlong_compute_lod(vec3 dir, float pdf, float maxMipLevel, int envSamples) +color4 atan2(color4 a, float f) { - const float MIP_LEVEL_OFFSET = 1.5; - float effectiveMaxMipLevel = maxMipLevel - MIP_LEVEL_OFFSET; - float distortion = sqrt(1.0 - mx_square(dir.y)); - return max(effectiveMaxMipLevel - 0.5 * log2(float(envSamples) * pdf * distortion), 0.0); + return color4(atan2(a.rgb, f), + atan2(a.a, f)); } -#include "mx_microfacet_specular.glsl" -vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) +color4 atan2(color4 a, color4 b) { - // Approximate the appearance of surface transmission as glossy - // environment map refraction, ignoring any scene geometry that might - // be visible through the surface. - fd.refraction = true; - if ($refractionTwoSided) - { - tint = mx_square(tint); - } - return mx_environment_radiance(N, V, X, alpha, distribution, fd) * tint; + return color4(atan2(a.rgb, b.rgb), + atan2(a.a, b.a)); } -#include "mx_microfacet_specular.glsl" -// Return the mip level associated with the given alpha in a prefiltered environment. -float mx_latlong_alpha_to_lod(float alpha) + +color4 transformc (string fromspace, string tospace, color4 C) { - float lodBias = (alpha < 0.25) ? sqrt(alpha) : 0.5 * alpha + 0.375; - return lodBias * float($envRadianceMips - 1); + return color4 (transformc (fromspace, tospace, C.rgb), C.a); } +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE -vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) +#pragma once +#define VECTOR2_H + +// vector2 is a 2D vector +struct vector2 { - N = mx_forward_facing_normal(N, V); - vec3 L = fd.refraction ? mx_refraction_solid_sphere(-V, N, fd.ior.x) : -reflect(V, N); + float x; + float y; +}; - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(alpha); - vec3 F = mx_compute_fresnel(NdotV, fd); - float G = mx_ggx_smith_G2(NdotV, NdotV, avgAlpha); - vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; - vec3 Li = mx_latlong_map_lookup(L, $envMatrix, mx_latlong_alpha_to_lod(avgAlpha), $envRadiance); - return Li * FG * $envLightIntensity; +// +// For vector2, define math operators to match vector +// + +vector2 __operator__neg__(vector2 a) +{ + return vector2(-a.x, -a.y); } -vec3 mx_environment_irradiance(vec3 N) +vector2 __operator__add__(vector2 a, vector2 b) { - vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); - return Li * $envLightIntensity; + return vector2(a.x + b.x, a.y + b.y); } -#include "mx_microfacet_specular.glsl" -vec3 mx_surface_transmission(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd, vec3 tint) +vector2 __operator__add__(vector2 a, int b) { - return tint; + return a + vector2(b, b); } -#define M_PI 3.1415926535897932 -#define M_PI_INV (1.0 / M_PI) -float mx_pow5(float x) +vector2 __operator__add__(vector2 a, float b) +{ + return a + vector2(b, b); +} + +vector2 __operator__add__(int a, vector2 b) +{ + return vector2(a, a) + b; +} + +vector2 __operator__add__(float a, vector2 b) +{ + return vector2(a, a) + b; +} + +vector2 __operator__sub__(vector2 a, vector2 b) { - return mx_square(mx_square(x)) * x; + return vector2(a.x - b.x, a.y - b.y); } -float mx_pow6(float x) +vector2 __operator__sub__(vector2 a, int b) { - float x2 = mx_square(x); - return mx_square(x2) * x2; + return a - vector2(b, b); } -// Standard Schlick Fresnel -float mx_fresnel_schlick(float cosTheta, float F0) +vector2 __operator__sub__(vector2 a, float b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return F0 + (1.0 - F0) * x5; + return a - vector2(b, b); } -vec3 mx_fresnel_schlick(float cosTheta, vec3 F0) + +vector2 __operator__sub__(int a, vector2 b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return F0 + (1.0 - F0) * x5; + return vector2(a, a) - b; } -// Generalized Schlick Fresnel -float mx_fresnel_schlick(float cosTheta, float F0, float F90) +vector2 __operator__sub__(float a, vector2 b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return mix(F0, F90, x5); + return vector2(a, a) - b; } -vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90) + +vector2 __operator__mul__(vector2 a, vector2 b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return mix(F0, F90, x5); + return vector2(a.x * b.x, a.y * b.y); } -// Generalized Schlick Fresnel with a variable exponent -float mx_fresnel_schlick(float cosTheta, float F0, float F90, float exponent) +vector2 __operator__mul__(vector2 a, int b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - return mix(F0, F90, pow(x, exponent)); + return a * vector2(b, b); } -vec3 mx_fresnel_schlick(float cosTheta, vec3 F0, vec3 F90, float exponent) + +vector2 __operator__mul__(vector2 a, float b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - return mix(F0, F90, pow(x, exponent)); + return a * vector2(b, b); } -// Enforce that the given normal is forward-facing from the specified view direction. -vec3 mx_forward_facing_normal(vec3 N, vec3 V) +vector2 __operator__mul__(int a, vector2 b) { - return (dot(N, V) < 0.0) ? -N : N; + return b * vector2(a, a); } -// https://www.graphics.rwth-aachen.de/publication/2/jgt.pdf -float mx_golden_ratio_sequence(int i) +vector2 __operator__mul__(float a, vector2 b) { - const float GOLDEN_RATIO = 1.6180339887498948; - return fract((float(i) + 1.0) * GOLDEN_RATIO); + return b * vector2(a, a); } -// https://people.irisa.fr/Ricardo.Marques/articles/2013/SF_CGF.pdf -vec2 mx_spherical_fibonacci(int i, int numSamples) +vector2 __operator__div__(vector2 a, vector2 b) { - return vec2((float(i) + 0.5) / float(numSamples), mx_golden_ratio_sequence(i)); + return vector2(a.x / b.x, a.y / b.y); } -// Generate a uniform-weighted sample in the unit hemisphere. -vec3 mx_uniform_sample_hemisphere(vec2 Xi) +vector2 __operator__div__(vector2 a, int b) { - float phi = 2.0 * M_PI * Xi.x; - float cosTheta = 1.0 - Xi.y; - float sinTheta = sqrt(1.0 - mx_square(cosTheta)); - return vec3(cos(phi) * sinTheta, - sin(phi) * sinTheta, - cosTheta); + float b_inv = 1.0/b; + return a * vector2(b_inv, b_inv); } -#include "mx_microfacet.glsl" -// http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf -// Equation 2 -float mx_imageworks_sheen_NDF(float NdotH, float roughness) +vector2 __operator__div__(vector2 a, float b) { - float invRoughness = 1.0 / max(roughness, 0.005); - float cos2 = NdotH * NdotH; - float sin2 = 1.0 - cos2; - return (2.0 + invRoughness) * pow(sin2, invRoughness * 0.5) / (2.0 * M_PI); + float b_inv = 1.0/b; + return a * vector2(b_inv, b_inv); } -float mx_imageworks_sheen_brdf(float NdotL, float NdotV, float NdotH, float roughness) +vector2 __operator__div__(int a, vector2 b) { - // Microfacet distribution. - float D = mx_imageworks_sheen_NDF(NdotH, roughness); - - // Fresnel and geometry terms are ignored. - float F = 1.0; - float G = 1.0; - - // We use a smoother denominator, as in: - // https://blog.selfshadow.com/publications/s2013-shading-course/rad/s2013_pbs_rad_notes.pdf - return D * F * G / (4.0 * (NdotL + NdotV - NdotL*NdotV)); + return vector2(a, a) / b; } -// Rational quadratic fit to Monte Carlo data for Imageworks sheen directional albedo. -float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) +vector2 __operator__div__(float a, vector2 b) { - vec2 r = vec2(13.67300, 1.0) + - vec2(-68.78018, 61.57746) * NdotV + - vec2(799.08825, 442.78211) * roughness + - vec2(-905.00061, 2597.49308) * NdotV * roughness + - vec2(60.28956, 121.81241) * mx_square(NdotV) + - vec2(1086.96473, 3045.55075) * mx_square(roughness); - return r.x / r.y; + return vector2(a, a) / b; } -float mx_imageworks_sheen_dir_albedo_table_lookup(float NdotV, float roughness) +int __operator__eq__(vector2 a, vector2 b) { -#if DIRECTIONAL_ALBEDO_METHOD == 1 - if (textureSize($albedoTable, 0).x > 1) - { - return texture($albedoTable, vec2(NdotV, roughness)).b; - } -#endif - return 0.0; + return (a.x == b.x) && (a.y == b.y); } -float mx_imageworks_sheen_dir_albedo_monte_carlo(float NdotV, float roughness) +int __operator__ne__(vector2 a, vector2 b) { - NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); - vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); + return (a.x != b.x) || (a.y != b.y); +} - float radiance = 0.0; - const int SAMPLE_COUNT = 64; - for (int i = 0; i < SAMPLE_COUNT; i++) - { - vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); - // Compute the incoming light direction and half vector. - vec3 L = mx_uniform_sample_hemisphere(Xi); - vec3 H = normalize(L + V); - - // Compute dot products for this sample. - float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); - float NdotH = clamp(H.z, M_FLOAT_EPS, 1.0); - // Compute sheen reflectance. - float reflectance = mx_imageworks_sheen_brdf(NdotL, NdotV, NdotH, roughness); - // Add the radiance contribution of this sample. - // uniform_pdf = 1 / (2 * PI) - // radiance = reflectance * NdotL / uniform_pdf; - radiance += reflectance * NdotL * 2.0 * M_PI; - } +// +// For vector2, define most of the stdosl functions to match vector +// - // Return the final directional albedo. - return radiance / float(SAMPLE_COUNT); +vector2 abs(vector2 a) +{ + return vector2 (abs(a.x), abs(a.y)); } -float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) +vector2 ceil(vector2 a) { -#if DIRECTIONAL_ALBEDO_METHOD == 0 - float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); -#elif DIRECTIONAL_ALBEDO_METHOD == 1 - float dirAlbedo = mx_imageworks_sheen_dir_albedo_table_lookup(NdotV, roughness); -#else - float dirAlbedo = mx_imageworks_sheen_dir_albedo_monte_carlo(NdotV, roughness); -#endif - return clamp(dirAlbedo, 0.0, 1.0); + return vector2 (ceil(a.x), ceil(a.y)); } -void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) + +vector2 round(vector2 a) { - // TODO: Need to remap parameters to match the new closure, - // or change the MaterialX spec to OSL parameterization. - vdf = 0; + return vector2 (round(a.x), round(a.y)); } -#include "lib/mx_microfacet.osl" -void mx_generalized_schlick_edf(color color0, color color90, float exponent, EDF base, output EDF result) +vector2 floor(vector2 a) { - float NdotV = fabs(dot(N,-I)); - color f = mx_fresnel_schlick(NdotV, color0, color90, exponent); - result = base * f; + return vector2 (floor(a.x), floor(a.y)); } -void mx_displacement_vector3(vector displacement, float scale, output displacementshader result) + +vector2 sqrt(vector2 a) { - result = displacement * scale; + return vector2 (sqrt(a.x), sqrt(a.y)); } -void mx_blackbody(float temp, output color color_value) -{ - float xc, yc; - float t, t2, t3, xc2, xc3; - - // if value outside valid range of approximation clamp to accepted temperature range - float temperature = clamp(temp, 1667.0, 25000.0); - - t = 1000.0 / temperature; - t2 = t * t; - t3 = t * t * t; - - // Cubic spline approximation for Kelvin temperature to sRGB conversion - // (https://en.wikipedia.org/wiki/Planckian_locus#Approximation) - if (temperature < 4000.0) { // 1667K <= temperature < 4000K - xc = -0.2661239 * t3 - 0.2343580 * t2 + 0.8776956 * t + 0.179910; - } - else { // 4000K <= temperature <= 25000K - xc = -3.0258469 * t3 + 2.1070379 * t2 + 0.2226347 * t + 0.240390; - } - xc2 = xc * xc; - xc3 = xc * xc * xc; - - if (temperature < 2222.0) { // 1667K <= temperature < 2222K - yc = -1.1063814 * xc3 - 1.34811020 * xc2 + 2.18555832 * xc - 0.20219683; - } - else if (temperature < 4000.0) { // 2222K <= temperature < 4000K - yc = -0.9549476 * xc3 - 1.37418593 * xc2 + 2.09137015 * xc - 0.16748867; - } - else { // 4000K <= temperature <= 25000K - yc = 3.0817580 * xc3 - 5.87338670 * xc2 + 3.75112997 * xc - 0.37001483; - } - - if (yc <= 0.0) { // avoid division by zero - color_value = color(1.0); - return; - } - - vector XYZ = vector(xc / yc, 1.0, (1 - xc - yc) / yc); - /// XYZ to Rec.709 RGB colorspace conversion - matrix XYZ_to_RGB = matrix( 3.2406, -0.9689, 0.0557, 0.0, - -1.5372, 1.8758, -0.2040, 0.0, - -0.4986, 0.0415, 1.0570, 0.0, - 0.0, 0.0, 0.0, 1.0); +vector2 exp(vector2 a) +{ + return vector2 (exp(a.x), exp(a.y)); +} - color_value = transform(XYZ_to_RGB, XYZ); - color_value = max(color_value, vector(0.0)); +vector2 log(vector2 a) +{ + return vector2 (log(a.x), log(a.y)); } -void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) + +vector2 log2(vector2 a) { - // TODO: Subsurface closure is not supported by vanilla OSL. - bsdf = _color * weight * diffuse(N); + return vector2 (log2(a.x), log2(a.y)); } -void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) + +vector2 mix(vector2 a, vector2 b, float x ) { - if (scatter_mode == "R") - { - bsdf = weight * dielectric_bsdf(N, U, tint, color(0.0), roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } - else if (scatter_mode == "T") - { - bsdf = weight * dielectric_bsdf(N, U, color(0.0), tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } - else - { - bsdf = weight * dielectric_bsdf(N, U, tint, tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } + return vector2 (mix(a.x, b.x, x), mix(a.y, b.y, x)); } -void mx_roughness_anisotropy(float roughness, float anisotropy, output vector2 result) + +vector2 mix(vector2 a, vector2 b, vector2 x ) { - float roughness_sqr = clamp(roughness*roughness, M_FLOAT_EPS, 1.0); - if (anisotropy > 0.0) - { - float aspect = sqrt(1.0 - clamp(anisotropy, 0.0, 0.98)); - result.x = min(roughness_sqr / aspect, 1.0); - result.y = roughness_sqr * aspect; - } - else - { - result.x = roughness_sqr; - result.y = roughness_sqr; - } + return vector2 (mix(a.x, b.x, x.x), mix(a.y, b.y, x.y)); } -void mx_artistic_ior(color reflectivity, color edge_color, output vector ior, output vector extinction) + +float dot(vector2 a, vector2 b) { - // "Artist Friendly Metallic Fresnel", Ole Gulbrandsen, 2014 - // http://jcgt.org/published/0003/04/03/paper.pdf + return (a.x * b.x + a.y * b.y); +} - color r = clamp(reflectivity, 0.0, 0.99); - color r_sqrt = sqrt(r); - color n_min = (1.0 - r) / (1.0 + r); - color n_max = (1.0 + r_sqrt) / (1.0 - r_sqrt); - ior = mix(n_max, n_min, edge_color); +float length (vector2 a) +{ + return hypot (a.x, a.y); +} - color np1 = ior + 1.0; - color nm1 = ior - 1.0; - color k2 = (np1*np1 * r - nm1*nm1) / (1.0 - r); - k2 = max(k2, 0.0); - extinction = sqrt(k2); +vector2 smoothstep(vector2 low, vector2 high, vector2 in) +{ + return vector2 (smoothstep(low.x, high.x, in.x), + smoothstep(low.y, high.y, in.y)); } - - - - +vector2 smoothstep(float low, float high, vector2 in) +{ + return vector2 (smoothstep(low, high, in.x), + smoothstep(low, high, in.y)); +} - - +vector2 clamp(vector2 in, vector2 low, vector2 high) +{ + return vector2 (clamp(in.x, low.x, high.x), + clamp(in.y, low.y, high.y)); +} - - +vector2 clamp(vector2 in, float low, float high) +{ + return clamp(in, vector2(low, low), vector2(high, high)); +} - - +vector2 max(vector2 a, vector2 b) +{ + return vector2 (max(a.x, b.x), + max(a.y, b.y)); +} - - +vector2 max(vector2 a, float b) +{ + return max(a, vector2(b, b)); +} - - +vector2 normalize(vector2 a) +{ + return a / length(a); +} - - +vector2 min(vector2 a, vector2 b) +{ + return vector2 (min(a.x, a.x), + min(b.y, b.y)); +} - - +vector2 min(vector2 a, float b) +{ + return min(a, vector2(b, b)); +} - - +vector2 mod(vector2 a, vector2 b) +{ + return vector2(mod(a.x, b.x), + mod(a.y, b.y)); +} - - +vector2 mod(vector2 a, float b) +{ + return mod(a, vector2(b, b)); +} - - +vector2 fmod(vector2 a, vector2 b) +{ + return vector2 (fmod(a.x, b.x), + fmod(a.y, b.y)); +} - - - +vector2 fmod(vector2 a, float b) +{ + return fmod(a, vector2(b, b)); +} - - - +vector2 pow(vector2 in, vector2 amount) +{ + return vector2(pow(in.x, amount.x), + pow(in.y, amount.y)); +} - - - +vector2 pow(vector2 in, float amount) +{ + return vector2(pow(in.x, amount), + pow(in.y, amount)); +} - - - - - +vector2 sign(vector2 a) +{ + return vector2(sign(a.x), + sign(a.y)); +} - - +vector2 sin(vector2 a) +{ + return vector2(sin(a.x), + sin(a.y)); +} - - - +vector2 cos(vector2 a) +{ + return vector2(cos(a.x), + cos(a.y)); +} - - +vector2 tan(vector2 a) +{ + return vector2(tan(a.x), + tan(a.y)); +} - - +vector2 asin(vector2 a) +{ + return vector2(asin(a.x), + asin(a.y)); +} - - +vector2 acos(vector2 a) +{ + return vector2(acos(a.x), + acos(a.y)); +} - - +vector2 atan2(vector2 a, float f) +{ + return vector2(atan2(a.x, f), + atan2(a.y, f)); +} - -void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) +vector2 atan2(vector2 a, vector2 b) { - result.bsdf = bsdf; - result.edf = edf; - result.opacity = clamp(opacity, 0.0, 1.0); + return vector2(atan2(a.x, b.x), + atan2(a.y, b.y)); } - - - - - - +// Open Shading Language : Copyright (c) 2009-2017 Sony Pictures Imageworks Inc., et al. +// https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE - - +#pragma once +#define VECTOR4_H - - - - +// vector4 is a 4D vector +struct vector4 +{ + float x; + float y; + float z; + float w; +}; - - - - - - +// +// For vector4, define math operators to match vector +// - - +vector4 __operator__neg__(vector4 a) +{ + return vector4(-a.x, -a.y, -a.z, -a.w); +} - - +vector4 __operator__add__(vector4 a, vector4 b) +{ + return vector4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); +} - - +vector4 __operator__add__(vector4 a, int b) +{ + return a + vector4(b, b, b, b); +} - - - +vector4 __operator__add__(vector4 a, float b) +{ + return a + vector4(b, b, b, b); +} - - - +vector4 __operator__add__(int a, vector4 b) +{ + return vector4(a, a, a, a) + b; +} - - - +vector4 __operator__add__(float a, vector4 b) +{ + return vector4(a, a, a, a) + b; +} - - - - - +vector4 __operator__sub__(vector4 a, vector4 b) +{ + return vector4(a.x - b.x, a.y - b.y, a.z - b.z, a.w - b.w); +} - - +vector4 __operator__sub__(vector4 a, int b) +{ + return a - vector4(b, b, b, b); +} - - - +vector4 __operator__sub__(vector4 a, float b) +{ + return a - vector4(b, b, b, b); +} - - +vector4 __operator__sub__(int a, vector4 b) +{ + return vector4(a, a, a, a) - b; +} - - +vector4 __operator__sub__(float a, vector4 b) +{ + return vector4(a, a, a, a) - b; +} - - +vector4 __operator__mul__(vector4 a, vector4 b) +{ + return vector4(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w); +} - - +vector4 __operator__mul__(vector4 a, int b) +{ + return a * vector4(b, b, b, b); +} - -void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +vector4 __operator__mul__(vector4 a, float b) { - if (scatter_mode == "R") - { - bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(0.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } - else if (scatter_mode == "T") - { - bsdf = weight * generalized_schlick_bsdf(N, U, color(0.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } - else - { - bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); - } + return a * vector4(b, b, b, b); } -void mx_displacement_float(float displacement, float scale, output displacementshader result) + +vector4 __operator__mul__(int a, vector4 b) { - result = vector(displacement * scale); + return vector4(a, a, a, a) * b; } -void mx_roughness_dual(vector2 roughness, output vector2 result) + +vector4 __operator__mul__(float a, vector4 b) { - result.x = clamp(roughness.x * roughness.x, M_FLOAT_EPS, 1.0); - if (roughness.y < 0.0) - { - result.y = result.x; - } - else - { - result.y = clamp(roughness.y * roughness.y, M_FLOAT_EPS, 1.0); - } + return vector4(a, a, a, a) * b; } -void mx_anisotropic_vdf(vector absorption, vector scattering, float anisotropy, output VDF vdf) + +vector4 __operator__div__(vector4 a, vector4 b) { - // Not implemented in vanilla OSL - vdf = 0; // volume_henyey_greenstein(color(absorption), color(scattering), color(0.0), anisotropy); + return vector4(a.x / b.x, a.y / b.y, a.z / b.z, a.w / b.w); } -void mx_translucent_bsdf(float weight, color _color, normal N, output BSDF bsdf) + +vector4 __operator__div__(vector4 a, int b) { - bsdf.response = _color * weight * translucent(N); - bsdf.throughput = color(0.0); + float b_inv = 1.0/b; + return a * vector4(b_inv, b_inv, b_inv, b_inv); } -void mx_subsurface_bsdf(float weight, color _color, vector radius, float anisotropy, normal N, output BSDF bsdf) + +vector4 __operator__div__(vector4 a, float b) { - // TODO: Subsurface closure is not supported by vanilla OSL. - bsdf.response = _color * weight * diffuse(N); - bsdf.throughput = color(0.0); + float b_inv = 1.0/b; + return a * vector4(b_inv, b_inv, b_inv, b_inv); } -#include "../lib/mx_microfacet_sheen.osl" -// TODO: Vanilla OSL doesn't have a proper sheen closure, -// so use 'diffuse' scaled by sheen directional albedo for now. -void mx_sheen_bsdf(float weight, color Ks, float roughness, vector N, output BSDF bsdf) +vector4 __operator__div__(int a, vector4 b) { - if (weight < M_FLOAT_EPS) - { - bsdf.response = 0; - bsdf.throughput = color(1.0); - return; - } + return vector4(a, a, a, a) / b; +} - // TODO: Normalization should not be needed. My suspicion is that - // BSDF sampling of new outgoing direction in 'testrender' needs - // to be fixed. - vector V = normalize(-I); +vector4 __operator__div__(float a, vector4 b) +{ + return vector4(a, a, a, a) / b; +} - float NdotV = fabs(dot(N,V)); - float alpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float albedo = weight * mx_imageworks_sheen_dir_albedo(NdotV, alpha); - bsdf.response = albedo * Ks * diffuse(N); - bsdf.throughput = 1.0 - albedo; +int __operator__eq__(vector4 a, vector4 b) +{ + return (a.x == b.x) && (a.y == b.y) && (a.z == b.z) && (a.w == b.w); } -#include "../lib/mx_microfacet_specular.osl" -void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +int __operator__ne__(vector4 a, vector4 b) { - if (scatter_mode == "T") - { - bsdf.response = tint * weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); - bsdf.throughput = tint * weight; - return; - } + return (a.x != b.x) || (a.y != b.y) || (a.z != b.z) || (a.w != b.w); +} - float NdotV = clamp(dot(N,-I), M_FLOAT_EPS, 1.0); - float F0 = mx_ior_to_f0(ior); - float F = mx_fresnel_schlick(NdotV, F0); - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - float comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); - // Calculate throughput from directional albedo. - float dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, ior) * comp; - bsdf.throughput = 1.0 - dirAlbedo * weight; - if (scatter_mode == "R") - { - bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 0); - } - else - { - bsdf.response = tint * weight * comp * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 2); - } -} -void mx_oren_nayar_diffuse_bsdf(float weight, color _color, float roughness, normal N, output BSDF bsdf) +// +// For vector4, define most of the stdosl functions to match vector +// + +vector4 abs(vector4 in) { - bsdf.response = _color * weight * oren_nayar(N, roughness); - bsdf.throughput = color(0.0); + return vector4 (abs(in.x), + abs(in.y), + abs(in.z), + abs(in.w)); } -#include "../lib/mx_microfacet_specular.osl" -void mx_conductor_bsdf(float weight, color ior_n, color ior_k, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, output BSDF bsdf) +vector4 ceil(vector4 in) { - bsdf.throughput = color(0.0); + return vector4 (ceil(in.x), + ceil(in.y), + ceil(in.z), + ceil(in.w)); +} - if (weight < M_FLOAT_EPS) - { - bsdf.response = 0; - return; - } +vector4 round(vector4 in) +{ + return vector4 (round(in.x), + round(in.y), + round(in.z), + round(in.w)); +} - // Calculate conductor fresnel - // - // Fresnel should be based on microfacet normal - // but we have no access to that from here, so just use - // view direction and surface normal instead - // - float NdotV = fabs(dot(N,-I)); - color F = mx_fresnel_conductor(NdotV, ior_n, ior_k); +vector4 floor(vector4 in) +{ + return vector4 (floor(in.x), + floor(in.y), + floor(in.z), + floor(in.w)); +} - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); +vector4 sqrt(vector4 in) +{ + return vector4 (sqrt(in.x), + sqrt(in.y), + sqrt(in.z), + sqrt(in.w)); +} - // Set ior to 0.0 to disable the internal dielectric fresnel - bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, false); +vector4 exp(vector4 in) +{ + return vector4 (exp(in.x), + exp(in.y), + exp(in.z), + exp(in.w)); } -void mx_surface(BSDF bsdf, EDF edf, float opacity, output surfaceshader result) + +vector4 log(vector4 in) { - result.bsdf = bsdf.response; - result.edf = edf; - result.opacity = clamp(opacity, 0.0, 1.0); + return vector4 (log(in.x), + log(in.y), + log(in.z), + log(in.w)); } -#include "../lib/mx_microfacet_specular.osl" -void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +vector4 log2(vector4 in) { - float avgF0 = dot(color0, color(1.0 / 3.0)); - float ior = mx_f0_to_ior(avgF0); - - if (scatter_mode == "T") - { - bsdf.response = weight * microfacet(distribution, N, U, roughness.x, roughness.y, ior, 1); - bsdf.throughput = weight; - return; - } + return vector4 (log2(in.x), + log2(in.y), + log2(in.z), + log2(in.w)); +} - float NdotV = fabs(dot(N,-I)); - color F = mx_fresnel_schlick(NdotV, color0, color90, exponent); +vector4 mix(vector4 value1, vector4 value2, float x ) +{ + return vector4 (mix( value1.x, value2.x, x), + mix( value1.y, value2.y, x), + mix( value1.z, value2.z, x), + mix( value1.w, value2.w, x)); +} - // Calculate compensation for multiple scattering. - // This should normally be done inside the closure - // but since vanilla OSL doesen't support this we - // add it here in shader code instead. - vector2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); - float avgAlpha = mx_average_alpha(safeAlpha); - color comp = mx_ggx_energy_compensation(NdotV, avgAlpha, F); +vector4 mix(vector4 value1, vector4 value2, vector4 x ) +{ + return vector4 (mix( value1.x, value2.x, x.x), + mix( value1.y, value2.y, x.y), + mix( value1.z, value2.z, x.z), + mix( value1.w, value2.w, x.w)); +} - // Calculate throughput from directional albedo. - color dirAlbedo = mx_ggx_dir_albedo(NdotV, avgAlpha, color0, color90) * comp; - float avgDirAlbedo = dot(dirAlbedo, color(1.0 / 3.0)); - bsdf.throughput = 1.0 - avgDirAlbedo * weight; +vector vec4ToVec3(vector4 v) +{ + return vector(v.x, v.y, v.z) / v.w; +} - // Calculate the reflection response, setting IOR to zero to disable internal Fresnel. - bsdf.response = F * comp * weight * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, 0.0, 0); +float dot(vector4 a, vector4 b) +{ + return ((a.x * b.x) + (a.y * b.y) + (a.z * b.z) + (a.w * b.w)); +} - if (scatter_mode == "RT") - { - bsdf.response += bsdf.throughput * microfacet(distribution, N, U, safeAlpha.x, safeAlpha.y, ior, 1); - } +float length (vector4 a) +{ + return sqrt (a.x*a.x + a.y*a.y + a.z*a.z + a.w*a.w); } -void mx_burley_diffuse_bsdf(float weight, color reflectance, float roughness, normal N, output BSDF bsdf) + +vector4 smoothstep(vector4 low, vector4 high, vector4 in) { - // TODO: Implement properly. - bsdf.response = reflectance * weight * oren_nayar(N, roughness); - bsdf.throughput = color(0.0); + return vector4 (smoothstep(low.x, high.x, in.x), + smoothstep(low.y, high.y, in.y), + smoothstep(low.z, high.z, in.z), + smoothstep(low.w, high.w, in.w)); } -float mx_square(float x) + +vector4 smoothstep(float low, float high, vector4 in) { - return x*x; + return vector4 (smoothstep(low, high, in.x), + smoothstep(low, high, in.y), + smoothstep(low, high, in.z), + smoothstep(low, high, in.w)); } -vector2 mx_square(vector2 x) +vector4 clamp(vector4 in, vector4 low, vector4 high) { - return x*x; + return vector4 (clamp(in.x, low.x, high.x), + clamp(in.y, low.y, high.y), + clamp(in.z, low.z, high.z), + clamp(in.w, low.w, high.w)); } -vector mx_square(vector x) +vector4 clamp(vector4 in, float low, float high) { - return x*x; + return vector4 (clamp(in.x, low, high), + clamp(in.y, low, high), + clamp(in.z, low, high), + clamp(in.w, low, high)); } -vector4 mx_square(vector4 x) +vector4 max(vector4 a, vector4 b) { - return x*x; + return vector4 (max(a.x, b.x), + max(a.y, b.y), + max(a.z, b.z), + max(a.w, b.w)); } -float mx_pow5(float x) +vector4 max(vector4 a, float b) { - return mx_square(mx_square(x)) * x; + return max(a, vector4(b, b, b, b)); } -color mx_fresnel_conductor(float cosTheta, vector n, vector k) +vector4 normalize(vector4 a) { - float c2 = cosTheta*cosTheta; - vector n2_k2 = n*n + k*k; - vector nc2 = 2.0 * n * cosTheta; + return a / length(a); +} - vector rs_a = n2_k2 + c2; - vector rp_a = n2_k2 * c2 + 1.0; - vector rs = (rs_a - nc2) / (rs_a + nc2); - vector rp = (rp_a - nc2) / (rp_a + nc2); +vector4 min(vector4 a, vector4 b) +{ + return vector4 (min(a.x, b.x), + min(a.y, b.y), + min(a.z, b.z), + min(a.w, b.w)); +} - return 0.5 * (rs + rp); +vector4 min(vector4 a, float b) +{ + return min(a, vector4(b, b, b, b)); } -// Standard Schlick Fresnel -float mx_fresnel_schlick(float cosTheta, float F0) +vector4 mod(vector4 a, vector4 b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return F0 + (1.0 - F0) * x5; + return vector4(mod(a.x, b.x), + mod(a.y, b.y), + mod(a.z, b.z), + mod(a.w, b.w)); } -color mx_fresnel_schlick(float cosTheta, color F0) + +vector4 mod(vector4 a, float b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return F0 + (1.0 - F0) * x5; + return mod(a, vector4(b, b, b, b)); } -// Generalized Schlick Fresnel -float mx_fresnel_schlick(float cosTheta, float F0, float F90) +vector4 fmod(vector4 a, vector4 b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return mix(F0, F90, x5); + return vector4 (fmod(a.x, b.x), + fmod(a.y, b.y), + fmod(a.z, b.z), + fmod(a.w, b.w)); } -color mx_fresnel_schlick(float cosTheta, color F0, color F90) + +vector4 fmod(vector4 a, float b) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - float x5 = mx_pow5(x); - return mix(F0, F90, x5); + return fmod(a, vector4(b, b, b, b)); } -// Generalized Schlick Fresnel with a variable exponent -color mx_fresnel_schlick(float cosTheta, float f0, float f90, float exponent) +vector4 pow(vector4 in, vector4 amount) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - return mix(f0, f90, pow(x, exponent)); + return vector4 (pow(in.x, amount.x), + pow(in.y, amount.y), + pow(in.z, amount.z), + pow(in.w, amount.w)); } -color mx_fresnel_schlick(float cosTheta, color f0, color f90, float exponent) + +vector4 pow(vector4 in, float amount) { - float x = clamp(1.0 - cosTheta, 0.0, 1.0); - return mix(f0, f90, pow(x, exponent)); + return vector4 (pow(in.x, amount), + pow(in.y, amount), + pow(in.z, amount), + pow(in.w, amount)); } -#include "mx_microfacet.osl" -// Compute the average of an anisotropic alpha pair. -float mx_average_alpha(vector2 alpha) +vector4 sign(vector4 a) { - return sqrt(alpha.x * alpha.y); + return vector4(sign(a.x), + sign(a.y), + sign(a.z), + sign(a.w)); } -// Convert a real-valued index of refraction to normal-incidence reflectivity. -float mx_ior_to_f0(float ior) +vector4 sin(vector4 a) { - return mx_square((ior - 1.0) / (ior + 1.0)); + return vector4(sin(a.x), + sin(a.y), + sin(a.z), + sin(a.w)); } -// Convert normal-incidence reflectivity to real-valued index of refraction. -float mx_f0_to_ior(float F0) +vector4 cos(vector4 a) { - float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); - return (1.0 + sqrtF0) / (1.0 - sqrtF0); + return vector4(cos(a.x), + cos(a.y), + cos(a.z), + cos(a.w)); } -// Rational quadratic fit to Monte Carlo data for GGX directional albedo. -color mx_ggx_dir_albedo(float NdotV, float alpha, color F0, color F90) +vector4 tan(vector4 a) { - float x = NdotV; - float y = alpha; - float x2 = mx_square(x); - float y2 = mx_square(y); - vector4 r = vector4(0.1003, 0.9345, 1.0, 1.0) + - vector4(-0.6303, -2.323, -1.765, 0.2281) * x + - vector4(9.748, 2.229, 8.263, 15.94) * y + - vector4(-2.038, -3.748, 11.53, -55.83) * x * y + - vector4(29.34, 1.424, 28.96, 13.08) * x2 + - vector4(-8.245, -0.7684, -7.507, 41.26) * y2 + - vector4(-26.44, 1.436, -36.11, 54.9) * x2 * y + - vector4(19.99, 0.2913, 15.86, 300.2) * x * y2 + - vector4(-5.448, 0.6286, 33.37, -285.1) * x2 * y2; - vector2 AB = vector2(r.x, r.y) / vector2(r.z, r.w); - AB.x = clamp(AB.x, 0.0, 1.0); - AB.y = clamp(AB.y, 0.0, 1.0); - return F0 * AB.x + F90 * AB.y; + return vector4(tan(a.x), + tan(a.y), + tan(a.z), + tan(a.w)); } -float mx_ggx_dir_albedo(float NdotV, float alpha, float F0, float F90) +vector4 asin(vector4 a) { - color result = mx_ggx_dir_albedo(NdotV, alpha, color(F0), color(F90)); - return result[0]; + return vector4(asin(a.x), + asin(a.y), + asin(a.z), + asin(a.w)); } -float mx_ggx_dir_albedo(float NdotV, float alpha, float ior) +vector4 acos(vector4 a) { - color result = mx_ggx_dir_albedo(NdotV, alpha, color(mx_ior_to_f0(ior)), color(1.0)); - return result[0]; + return vector4(acos(a.x), + acos(a.y), + acos(a.z), + acos(a.w)); } -// https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf -// Equations 14 and 16 -color mx_ggx_energy_compensation(float NdotV, float alpha, color Fss) +vector4 atan2(vector4 a, float f) { - float Ess = mx_ggx_dir_albedo(NdotV, alpha, 1.0, 1.0); - return 1.0 + Fss * (1.0 - Ess) / Ess; + return vector4(atan2(a.x, f), + atan2(a.y, f), + atan2(a.z, f), + atan2(a.w, f)); } -float mx_ggx_energy_compensation(float NdotV, float alpha, float Fss) +vector4 atan2(vector4 a, vector4 b) { - color result = mx_ggx_energy_compensation(NdotV, alpha, color(Fss)); - return result[0]; + return vector4(atan2(a.x, b.x), + atan2(a.y, b.y), + atan2(a.z, b.z), + atan2(a.w, b.w)); } -#include "mx_microfacet.osl" -// Rational curve fit approximation for the directional albedo of Imageworks sheen. -float mx_imageworks_sheen_dir_albedo_analytic(float NdotV, float roughness) + +vector4 transform (matrix M, vector4 p) { - float a = 5.25248 - 7.66024 * NdotV + 14.26377 * roughness; - float b = 1.0 + 30.66449 * NdotV + 32.53420 * roughness; - return a / b; + return vector4 (M[0][0]*p.x + M[1][0]*p.y + M[2][0]*p.z + M[3][0]*p.w, + M[0][1]*p.x + M[1][1]*p.y + M[2][1]*p.z + M[3][1]*p.w, + M[0][2]*p.x + M[1][2]*p.y + M[2][2]*p.z + M[3][2]*p.w, + M[0][3]*p.x + M[1][3]*p.y + M[2][3]*p.z + M[3][3]*p.w); } -float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) +vector4 transform (string fromspace, string tospace, vector4 p) { - float dirAlbedo = mx_imageworks_sheen_dir_albedo_analytic(NdotV, roughness); - return clamp(dirAlbedo, 0.0, 1.0); + return transform (matrix(fromspace,tospace), p); } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + - - + + + - - + - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - - - - + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + - - + - - + + + + + + + + + + + + + - - - + + + - - - - - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + - - - - + + - - - - + + - - - - - - - - + + + + + + + + + - - - + + + + + + + + + - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + - - - - + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + - - - - + + + - - - - + + - - - - + + + - - - + + + + + + + + + + + - - - - - - - - + + + + + + + + + + - - + + + + + - + - - - + + - - - - - - - - - - - - - + + + - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + - - - - - - - - - + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + - - + + + + - - + + + + - - - - - - - - - + + + + + + + + - - - - - - - - - + + + - - - - - + + + + + + + + + - - - - - - + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - + + + + + - - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + @@ -21556,246 +21813,696 @@ float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + - - - - - - - + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + - + - - - - + + + + + - - - + + + + + + + + + + - - - + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -21839,52 +22546,6 @@ float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - + + - - + + + + - - + + - - - - - + - - - + + + + + + - - + + - - - + + + + + + + + + - - - + + + + + + + + + + + + @@ -22102,148 +22753,110 @@ float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) - + - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + - - + - - - - + + + + + + + + + + + + + + + + + + + + - + - - + + + - - - - + + - - - - + + + + - + - - - - - - + + + - - + + - - - - - - - - - - - - - - + + + - - - - - - - + + + @@ -22283,123 +22896,129 @@ float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - - - - - - - - - - - + + - - - - + + + + - - - - - - - + - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - + + + + + + + + + + @@ -22427,380 +23046,342 @@ float mx_imageworks_sheen_dir_albedo(float NdotV, float roughness) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - + - - - - - - - + + + + + + + + + + + + + + - - - - - - - - + + + + + + - + + + + + + + + - - + - - - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + - - + + + + + + + + + + - - - - + + + + + + + + + + - Declarations for MDL implementations of standard nodes included in the MaterialX specification. - --> + + + + + + + + + + - - - + + + + + - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + - -void mx_spot_light(LightData light, float3 position, thread lightshader& result) -{ - result.direction = light.position - position; - float distance = length(result.direction) + M_FLOAT_EPS; - float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); - result.intensity = light.color * light.intensity / attenuation; - result.direction /= distance; - float low = min(light.inner_angle, light.outer_angle); - float high = light.inner_angle; - float cosDir = dot(result.direction, -light.direction); - float spotAttenuation = smoothstep(low, high, cosDir); - result.intensity *= spotAttenuation; -} -void mx_directional_light(LightData light, float3 position, thread lightshader& result) -{ - result.direction = -light.direction; - result.intensity = light.color * light.intensity; -} -void mx_point_light(LightData light, float3 position, thread lightshader& result) -{ - result.direction = light.position - position; - float distance = length(result.direction) + M_FLOAT_EPS; - float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); - result.intensity = light.color * light.intensity / attenuation; - result.direction /= distance; -} - - - - - + - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + - -void mx_directional_light(LightData light, vec3 position, out lightshader result) -{ - result.direction = -light.direction; - result.intensity = light.color * light.intensity; -} - - + + + + + + + + + + + + - - + + + + + - - + + + + + - - + + + + + + + + + + + + + + + + + + + -void mx_spot_light(LightData light, vec3 position, out lightshader result) -{ - result.direction = light.position - position; - float distance = length(result.direction) + M_FLOAT_EPS; - float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); - result.intensity = light.color * light.intensity / attenuation; - result.direction /= distance; - float low = min(light.inner_angle, light.outer_angle); - float high = light.inner_angle; - float cosDir = dot(result.direction, -light.direction); - float spotAttenuation = smoothstep(low, high, cosDir); - result.intensity *= spotAttenuation; -} -void mx_point_light(LightData light, vec3 position, out lightshader result) -{ - result.direction = light.position - position; - float distance = length(result.direction) + M_FLOAT_EPS; - float attenuation = pow(distance + 1.0, light.decay_rate + M_FLOAT_EPS); - result.intensity = light.color * light.intensity / attenuation; - result.direction /= distance; -} diff --git a/javascript/viewer/dist/JsMaterialXGenShader.js b/javascript/viewer/dist/JsMaterialXGenShader.js index 663c2d9e..c86cae3d 100644 --- a/javascript/viewer/dist/JsMaterialXGenShader.js +++ b/javascript/viewer/dist/JsMaterialXGenShader.js @@ -6,7 +6,7 @@ var MaterialX = (function() { function(MaterialX) { MaterialX = MaterialX || {}; -var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){var loadPackage=function(metadata){var PACKAGE_PATH;if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}else{throw"using preloaded data can only be done on a web page or in a web worker"}var PACKAGE_NAME="../../bin/JsMaterialXGenShader.data";var REMOTE_PACKAGE_BASE="JsMaterialXGenShader.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];var PACKAGE_UUID=metadata["package_uuid"];function fetchRemotePackage(packageName,packageSize,callback,errback){var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","libraries",true,true);Module["FS_createPath"]("/libraries","stdlib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genmsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genglsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genosl",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","include",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmdl",true,true);Module["FS_createPath"]("/libraries","cmlib",true,true);Module["FS_createPath"]("/libraries","targets",true,true);Module["FS_createPath"]("/libraries","pbrlib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmsl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genglsl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genosl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","legacy",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmdl",true,true);Module["FS_createPath"]("/libraries","bxdf",true,true);Module["FS_createPath"]("/libraries/bxdf","translation",true,true);Module["FS_createPath"]("/libraries/bxdf","lama",true,true);Module["FS_createPath"]("/libraries","nprlib",true,true);Module["FS_createPath"]("/libraries/nprlib","genmsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genglsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genosl",true,true);Module["FS_createPath"]("/libraries/nprlib","genmdl",true,true);Module["FS_createPath"]("/libraries","lights",true,true);Module["FS_createPath"]("/libraries/lights","genmsl",true,true);Module["FS_createPath"]("/libraries/lights","genglsl",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null}};var files=metadata["files"];for(var i=0;i1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXGenShader.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Wa"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Za"];addOnInit(Module["asm"]["Xa"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={220012:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},220096:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},220181:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"B":___assert_fail,"n":___cxa_allocate_exception,"q":___cxa_begin_catch,"z":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"h":___cxa_find_matching_catch_3,"Ka":___cxa_find_matching_catch_4,"o":___cxa_free_exception,"da":___cxa_rethrow,"L":___cxa_throw,"va":___cxa_uncaught_exceptions,"e":___resumeException,"ha":___sys_fcntl64,"Aa":___sys_getdents64,"Da":___sys_ioctl,"ia":___sys_open,"za":___sys_stat64,"Qa":__embind_finalize_value_array,"Va":__embind_register_bigint,"Fa":__embind_register_bool,"v":__embind_register_class,"A":__embind_register_class_class_function,"s":__embind_register_class_class_property,"y":__embind_register_class_constructor,"j":__embind_register_class_function,"I":__embind_register_class_property,"T":__embind_register_constant,"Ea":__embind_register_emval,"S":__embind_register_enum,"R":__embind_register_enum_value,"ja":__embind_register_float,"G":__embind_register_function,"N":__embind_register_integer,"M":__embind_register_memory_view,"r":__embind_register_smart_ptr,"ka":__embind_register_std_string,"aa":__embind_register_std_wstring,"oa":__embind_register_value_array,"_":__embind_register_value_array_element,"Ga":__embind_register_void,"O":__emval_as,"Ra":__emval_call,"Z":__emval_call_void_method,"ga":__emval_decref,"Y":__emval_get_method_caller,"Pa":__emval_get_property,"la":__emval_incref,"Ta":__emval_new_array,"Oa":__emval_new_cstring,"La":__emval_new_object,"Na":__emval_run_destructors,"Sa":__emval_set_property,"C":__emval_take_value,"Ma":__emval_typeof,"ua":_abort,"ca":_emscripten_asm_const_int,"ta":_emscripten_memcpy_big,"$":_emscripten_resize_heap,"xa":_environ_get,"ya":_environ_sizes_get,"W":_fd_close,"Ba":_fd_read,"Ua":_fd_seek,"Ca":_fd_write,"a":_getTempRet0,"Ha":invoke_di,"ba":invoke_fi,"Ja":invoke_fifii,"ra":invoke_fii,"na":invoke_fiii,"x":invoke_i,"g":invoke_ii,"Ia":invoke_iid,"K":invoke_iif,"ma":invoke_iiff,"X":invoke_iifff,"d":invoke_iii,"i":invoke_iiii,"u":invoke_iiiii,"ea":invoke_iiiiid,"w":invoke_iiiiii,"D":invoke_iiiiiii,"H":invoke_iiiiiiii,"V":invoke_iiiiiiiiiiii,"m":invoke_v,"l":invoke_vi,"sa":invoke_vid,"J":invoke_vif,"f":invoke_vii,"qa":invoke_viif,"c":invoke_viii,"k":invoke_viiii,"Q":invoke_viiiiffiiii,"p":invoke_viiiii,"t":invoke_viiiiii,"F":invoke_viiiiiii,"fa":invoke_viiiiiiiii,"P":invoke_viiiiiiiiii,"U":invoke_viiiiiiiiiiiiiii,"E":_llvm_eh_typeid_for,"pa":_setTempRet0,"wa":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Xa"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["_a"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["$a"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["ab"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["bb"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["cb"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["db"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["eb"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["fb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["gb"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["ib"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["jb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["kb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["lb"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["mb"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iifff(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiff(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiffiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); +var Module=typeof MaterialX!=="undefined"?MaterialX:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject});if(!Module.expectedDataFileDownloads){Module.expectedDataFileDownloads=0}Module.expectedDataFileDownloads++;(function(){var loadPackage=function(metadata){var PACKAGE_PATH;if(typeof window==="object"){PACKAGE_PATH=window["encodeURIComponent"](window.location.pathname.toString().substring(0,window.location.pathname.toString().lastIndexOf("/"))+"/")}else if(typeof location!=="undefined"){PACKAGE_PATH=encodeURIComponent(location.pathname.toString().substring(0,location.pathname.toString().lastIndexOf("/"))+"/")}else{throw"using preloaded data can only be done on a web page or in a web worker"}var PACKAGE_NAME="../../bin/JsMaterialXGenShader.data";var REMOTE_PACKAGE_BASE="JsMaterialXGenShader.data";if(typeof Module["locateFilePackage"]==="function"&&!Module["locateFile"]){Module["locateFile"]=Module["locateFilePackage"];err("warning: you defined Module.locateFilePackage, that has been renamed to Module.locateFile (using your locateFilePackage for now)")}var REMOTE_PACKAGE_NAME=Module["locateFile"]?Module["locateFile"](REMOTE_PACKAGE_BASE,""):REMOTE_PACKAGE_BASE;var REMOTE_PACKAGE_SIZE=metadata["remote_package_size"];var PACKAGE_UUID=metadata["package_uuid"];function fetchRemotePackage(packageName,packageSize,callback,errback){var xhr=new XMLHttpRequest;xhr.open("GET",packageName,true);xhr.responseType="arraybuffer";xhr.onprogress=function(event){var url=packageName;var size=packageSize;if(event.total)size=event.total;if(event.loaded){if(!xhr.addedTotal){xhr.addedTotal=true;if(!Module.dataFileDownloads)Module.dataFileDownloads={};Module.dataFileDownloads[url]={loaded:event.loaded,total:size}}else{Module.dataFileDownloads[url].loaded=event.loaded}var total=0;var loaded=0;var num=0;for(var download in Module.dataFileDownloads){var data=Module.dataFileDownloads[download];total+=data.total;loaded+=data.loaded;num++}total=Math.ceil(total*Module.expectedDataFileDownloads/num);if(Module["setStatus"])Module["setStatus"]("Downloading data... ("+loaded+"/"+total+")")}else if(!Module.dataFileDownloads){if(Module["setStatus"])Module["setStatus"]("Downloading data...")}};xhr.onerror=function(event){throw new Error("NetworkError for: "+packageName)};xhr.onload=function(event){if(xhr.status==200||xhr.status==304||xhr.status==206||xhr.status==0&&xhr.response){var packageData=xhr.response;callback(packageData)}else{throw new Error(xhr.statusText+" : "+xhr.responseURL)}};xhr.send(null)}function handleError(error){console.error("package error:",error)}var fetchedCallback=null;var fetched=Module["getPreloadedPackage"]?Module["getPreloadedPackage"](REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE):null;if(!fetched)fetchRemotePackage(REMOTE_PACKAGE_NAME,REMOTE_PACKAGE_SIZE,function(data){if(fetchedCallback){fetchedCallback(data);fetchedCallback=null}else{fetched=data}},handleError);function runWithFS(){function assert(check,msg){if(!check)throw msg+(new Error).stack}Module["FS_createPath"]("/","libraries",true,true);Module["FS_createPath"]("/libraries","pbrlib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmdl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genglsl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib","genmsl",true,true);Module["FS_createPath"]("/libraries/pbrlib","genosl",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/pbrlib/genosl","legacy",true,true);Module["FS_createPath"]("/libraries","cmlib",true,true);Module["FS_createPath"]("/libraries","lights",true,true);Module["FS_createPath"]("/libraries/lights","genglsl",true,true);Module["FS_createPath"]("/libraries/lights","genmsl",true,true);Module["FS_createPath"]("/libraries","nprlib",true,true);Module["FS_createPath"]("/libraries/nprlib","genmdl",true,true);Module["FS_createPath"]("/libraries/nprlib","genglsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genmsl",true,true);Module["FS_createPath"]("/libraries/nprlib","genosl",true,true);Module["FS_createPath"]("/libraries","stdlib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmdl",true,true);Module["FS_createPath"]("/libraries/stdlib","genglsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genglsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genmsl",true,true);Module["FS_createPath"]("/libraries/stdlib/genmsl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib","genosl",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","lib",true,true);Module["FS_createPath"]("/libraries/stdlib/genosl","include",true,true);Module["FS_createPath"]("/libraries","targets",true,true);Module["FS_createPath"]("/libraries","bxdf",true,true);Module["FS_createPath"]("/libraries/bxdf","lama",true,true);Module["FS_createPath"]("/libraries/bxdf","translation",true,true);function DataRequest(start,end,audio){this.start=start;this.end=end;this.audio=audio}DataRequest.prototype={requests:{},open:function(mode,name){this.name=name;this.requests[name]=this;Module["addRunDependency"]("fp "+this.name)},send:function(){},onload:function(){var byteArray=this.byteArray.subarray(this.start,this.end);this.finish(byteArray)},finish:function(byteArray){var that=this;Module["FS_createDataFile"](this.name,null,byteArray,true,true,true);Module["removeRunDependency"]("fp "+that.name);this.requests[this.name]=null}};var files=metadata["files"];for(var i=0;i1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"}}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(_scriptDir){scriptDirectory=_scriptDir}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else{var str="";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else{var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit)}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}else{str+=String.fromCharCode(utf32)}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="JsMaterialXGenShader.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["Wa"];updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["Za"];addOnInit(Module["asm"]["Xa"]);removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");function receiveInstantiationResult(result){receiveInstance(result["instance"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return{}}var tempDouble;var tempI64;var ASM_CONSTS={199384:function(){Module["TreeIterator"]["prototype"][Symbol.iterator]=function(){return this}},199468:function(){Module["GraphIterator"]["prototype"][Symbol.iterator]=function(){return this}},199553:function(){Module["InheritanceIterator"]["prototype"][Symbol.iterator]=function(){return this}}};function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;return prev===1}}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0)}else{this.ptr=ptr}}var exceptionCaught=[];function exception_addRef(info){info.add_ref()}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){return _free(new ExceptionInfo(ptr).ptr)}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr)}___cxa_free_exception(info.excPtr)}}function ___cxa_end_catch(){_setThrew(0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_4(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted)}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw")}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++}else{catchInfo.free()}exceptionLast=ptr;throw ptr}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_fcntl64(fd,cmd,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(cmd){case 0:{var arg=SYSCALLS.get();if(arg<0){return-28}var newStream;newStream=FS.open(stream.path,stream.flags,0,arg);return newStream.fd}case 1:case 2:return 0;case 3:return stream.flags;case 4:{var arg=SYSCALLS.get();stream.flags|=arg;return 0}case 12:{var arg=SYSCALLS.get();var offset=0;HEAP16[arg+offset>>1]=2;return 0}case 13:case 14:return 0;case 16:case 8:return-28;case 9:setErrNo(28);return-1;default:{return-28}}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_getdents64(fd,dirp,count){try{var stream=SYSCALLS.getStreamFromFD(fd);if(!stream.getdents){stream.getdents=FS.readdir(stream.path)}var struct_size=280;var pos=0;var off=FS.llseek(stream,0,1);var idx=Math.floor(off/struct_size);while(idx>>0,(tempDouble=id,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos>>2]=tempI64[0],HEAP32[dirp+pos+4>>2]=tempI64[1];tempI64=[(idx+1)*struct_size>>>0,(tempDouble=(idx+1)*struct_size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[dirp+pos+8>>2]=tempI64[0],HEAP32[dirp+pos+12>>2]=tempI64[1];HEAP16[dirp+pos+16>>1]=280;HEAP8[dirp+pos+18>>0]=type;stringToUTF8(name,dirp+pos+19,256);pos+=struct_size;idx+=1}FS.llseek(stream,idx*struct_size,0);return pos}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_ioctl(fd,op,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_open(path,flags,varargs){SYSCALLS.varargs=varargs;try{var pathname=SYSCALLS.getStr(path);var mode=varargs?SYSCALLS.get():0;var stream=FS.open(pathname,flags,mode);return stream.fd}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___sys_stat64(path,buf){try{path=SYSCALLS.getStr(path);return SYSCALLS.doStat(FS.stat,path,buf)}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}var tupleRegistrations={};function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}};return errorClass}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i>shift])},destructorFunction:null})}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return{count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted")}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr)}else{$$.ptrType.registeredClass.rawDestructor($$.ptr)}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$)}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr)}else{releaseClassHandle($$)}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$)};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else{var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined}}function ClassHandle_isDeleted(){return!this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]()}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this)}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion")}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes)}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[]}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name)}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr)}return ptr}else{return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal")}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name)}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr}else{var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]()}));if(destructors!==null){destructors.push(this.rawDestructor,ptr)}}break;default:throwBindingError("Unsupporting sharing policy")}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name)}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name)}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name)}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name)}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr)}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr)}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]()}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k])}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes)}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined")}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType")}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified")}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else{var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType}else{toType=registeredPointerRecord.pointerType}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else{return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null}else{this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null}}else{this["toWireType"]=genericPointerToWireType}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}function dynCallLegacy(sig,ptr,args){var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i>2)+i])}return array}function __embind_register_class_class_function(rawClassType,methodName,argCount,rawArgTypesAddr,invokerSignature,rawInvoker,fn){var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);methodName=readLatin1String(methodName);rawInvoker=embind__requireFunction(invokerSignature,rawInvoker);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+methodName;function unboundTypesHandler(){throwUnboundTypeError("Cannot call "+humanName+" due to unbound types",rawArgTypes)}var proto=classType.registeredClass.constructor;if(undefined===proto[methodName]){unboundTypesHandler.argCount=argCount-1;proto[methodName]=unboundTypesHandler}else{ensureOverloadTable(proto,methodName,humanName);proto[methodName].overloadTable[argCount-1]=unboundTypesHandler}whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));var func=craftInvokerFunction(humanName,invokerArgsArray,null,rawInvoker,fn);if(undefined===proto[methodName].overloadTable){func.argCount=argCount-1;proto[methodName]=func}else{proto[methodName].overloadTable[argCount-1]=func}return[]});return[]})}function validateThis(this_,classType,humanName){if(!(this_ instanceof Object)){throwBindingError(humanName+' with invalid "this": '+this_)}if(!(this_ instanceof classType.registeredClass.constructor)){throwBindingError(humanName+' incompatible with "this" of type '+this_.constructor.name)}if(!this_.$$.ptr){throwBindingError("cannot call emscripten binding method "+humanName+" on deleted object")}return upcastPointer(this_.$$.ptr,this_.$$.ptrType.registeredClass,classType.registeredClass)}function __embind_register_class_class_property(rawClassType,fieldName,rawFieldType,rawFieldPtr,getterSignature,getter,setterSignature,setter){fieldName=readLatin1String(fieldName);getter=embind__requireFunction(getterSignature,getter);whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName=classType.name+"."+fieldName;var desc={get:function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])},enumerable:true,configurable:true};if(setter){desc.set=function(){throwUnboundTypeError("Cannot access "+humanName+" due to unbound types",[rawFieldType])}}else{desc.set=function(v){throwBindingError(humanName+" is a read-only property")}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);whenDependentTypesAreResolved([],[rawFieldType],function(fieldType){fieldType=fieldType[0];var desc={get:function(){return fieldType["fromWireType"](getter(rawFieldPtr))},enumerable:true};if(setter){setter=embind__requireFunction(setterSignature,setter);desc.set=function(v){var destructors=[];setter(rawFieldPtr,fieldType["toWireType"](destructors,v));runDestructors(destructors)}}Object.defineProperty(classType.registeredClass.constructor,fieldName,desc);return[]});return[]})}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[]}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes)};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1))}destructors.length=0;args.length=argCount;for(var i=1;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i>1])};case 2:return function(pointer){var heap=signed?HEAP32:HEAPU32;return this["fromWireType"](heap[pointer>>2])};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_enum(rawType,name,size,isSigned){var shift=getShiftFromSize(size);name=readLatin1String(name);function ctor(){}ctor.values={};registerType(rawType,{name:name,constructor:ctor,"fromWireType":function(c){return this.constructor.values[c]},"toWireType":function(destructors,c){return c.value},"argPackAdvance":8,"readValueFromPointer":enumReadValueFromPointer(name,shift,isSigned),destructorFunction:null});exposePublicSymbol(name,ctor)}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType))}return impl}function __embind_register_enum_value(rawEnumType,name,enumValue){var enumType=requireRegisteredType(rawEnumType,"enum");name=readLatin1String(name);var Enum=enumType.constructor;var Value=Object.create(enumType.constructor.prototype,{value:{value:enumValue},constructor:{value:createNamedFunction(enumType.name+"_"+name,function(){})}});Enum.values[enumValue]=Value;Enum[name]=Value}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]})}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift}}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function __embind_register_smart_ptr(rawType,rawPointeeType,name,sharingPolicy,getPointeeSignature,rawGetPointee,constructorSignature,rawConstructor,shareSignature,rawShare,destructorSignature,rawDestructor){name=readLatin1String(name);rawGetPointee=embind__requireFunction(getPointeeSignature,rawGetPointee);rawConstructor=embind__requireFunction(constructorSignature,rawConstructor);rawShare=embind__requireFunction(shareSignature,rawShare);rawDestructor=embind__requireFunction(destructorSignature,rawDestructor);whenDependentTypesAreResolved([rawType],[rawPointeeType],function(pointeeType){pointeeType=pointeeType[0];var registeredPointer=new RegisteredPointer(name,pointeeType.registeredClass,false,false,true,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor);return[registeredPointer]})}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+1}}}else{var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1)}else{if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}}else{for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment}else{str+=String.fromCharCode(0);str+=stringSegment}decodeStartPtr=currentBytePtr+charSize}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name)}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr)}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr)}})}function __embind_register_value_array(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){tupleRegistrations[rawType]={name:readLatin1String(name),rawConstructor:embind__requireFunction(constructorSignature,rawConstructor),rawDestructor:embind__requireFunction(destructorSignature,rawDestructor),elements:[]}}function __embind_register_value_array_element(rawTupleType,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){tupleRegistrations[rawTupleType].elements.push({getterReturnType:getterReturnType,getter:embind__requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:embind__requireFunction(setterSignature,setter),setterContext:setterContext})}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}})}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle)}return emval_handle_array[handle].value}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i)}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1}}function __emval_new_array(){return __emval_register([])}function __emval_new_cstring(v){return __emval_register(getStringOrSymbol(v))}function __emval_new_object(){return __emval_register({})}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle)}function __emval_set_property(handle,key,value){handle=requireHandle(handle);key=requireHandle(key);value=requireHandle(value);handle[key]=value}function __emval_take_value(type,argv){type=requireRegisteredType(type,"_emval_take_value");var v=type["readValueFromPointer"](argv);return __emval_register(v)}function __emval_typeof(handle){handle=requireHandle(handle);return __emval_register(typeof handle)}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize+33554432/cutDown;var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function _setTempRet0(val){setTempRet0(val)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;InternalError=Module["InternalError"]=extendError(Error,"InternalError");embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"B":___assert_fail,"n":___cxa_allocate_exception,"q":___cxa_begin_catch,"z":___cxa_end_catch,"b":___cxa_find_matching_catch_2,"h":___cxa_find_matching_catch_3,"Ka":___cxa_find_matching_catch_4,"o":___cxa_free_exception,"da":___cxa_rethrow,"K":___cxa_throw,"wa":___cxa_uncaught_exceptions,"e":___resumeException,"ga":___sys_fcntl64,"Da":___sys_getdents64,"Ca":___sys_ioctl,"ia":___sys_open,"za":___sys_stat64,"Qa":__embind_finalize_value_array,"Va":__embind_register_bigint,"Fa":__embind_register_bool,"u":__embind_register_class,"A":__embind_register_class_class_function,"s":__embind_register_class_class_property,"y":__embind_register_class_constructor,"j":__embind_register_class_function,"H":__embind_register_class_property,"S":__embind_register_constant,"Ea":__embind_register_emval,"R":__embind_register_enum,"Q":__embind_register_enum_value,"ja":__embind_register_float,"F":__embind_register_function,"N":__embind_register_integer,"M":__embind_register_memory_view,"r":__embind_register_smart_ptr,"ka":__embind_register_std_string,"$":__embind_register_std_wstring,"oa":__embind_register_value_array,"Z":__embind_register_value_array_element,"Ga":__embind_register_void,"O":__emval_as,"Ra":__emval_call,"Y":__emval_call_void_method,"ha":__emval_decref,"X":__emval_get_method_caller,"Pa":__emval_get_property,"la":__emval_incref,"Ta":__emval_new_array,"Oa":__emval_new_cstring,"La":__emval_new_object,"Na":__emval_run_destructors,"Sa":__emval_set_property,"C":__emval_take_value,"Ma":__emval_typeof,"ua":_abort,"ca":_emscripten_asm_const_int,"ta":_emscripten_memcpy_big,"_":_emscripten_resize_heap,"xa":_environ_get,"ya":_environ_sizes_get,"V":_fd_close,"Aa":_fd_read,"Ua":_fd_seek,"Ba":_fd_write,"a":_getTempRet0,"Ha":invoke_di,"ba":invoke_fi,"Ja":invoke_fifii,"ra":invoke_fii,"na":invoke_fiii,"x":invoke_i,"g":invoke_ii,"Ia":invoke_iid,"L":invoke_iif,"ma":invoke_iiff,"W":invoke_iifff,"d":invoke_iii,"i":invoke_iiii,"t":invoke_iiiii,"ea":invoke_iiiiid,"w":invoke_iiiiii,"E":invoke_iiiiiii,"I":invoke_iiiiiiii,"U":invoke_iiiiiiiiiiii,"l":invoke_v,"m":invoke_vi,"sa":invoke_vid,"J":invoke_vif,"f":invoke_vii,"qa":invoke_viif,"c":invoke_viii,"k":invoke_viiii,"aa":invoke_viiiiffiiii,"p":invoke_viiiii,"v":invoke_viiiiii,"G":invoke_viiiiiii,"fa":invoke_viiiiiiiii,"P":invoke_viiiiiiiiii,"T":invoke_viiiiiiiiiiiiiii,"D":_llvm_eh_typeid_for,"pa":_setTempRet0,"va":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["Xa"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Ya"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["_a"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["$a"]).apply(null,arguments)};var ___getTypeName=Module["___getTypeName"]=function(){return(___getTypeName=Module["___getTypeName"]=Module["asm"]["ab"]).apply(null,arguments)};var ___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=function(){return(___embind_register_native_and_builtin_types=Module["___embind_register_native_and_builtin_types"]=Module["asm"]["bb"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["cb"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["db"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["eb"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=function(){return(_setThrew=Module["_setThrew"]=Module["asm"]["fb"]).apply(null,arguments)};var ___cxa_can_catch=Module["___cxa_can_catch"]=function(){return(___cxa_can_catch=Module["___cxa_can_catch"]=Module["asm"]["gb"]).apply(null,arguments)};var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=function(){return(___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=Module["asm"]["hb"]).apply(null,arguments)};var dynCall_viijii=Module["dynCall_viijii"]=function(){return(dynCall_viijii=Module["dynCall_viijii"]=Module["asm"]["ib"]).apply(null,arguments)};var dynCall_jiji=Module["dynCall_jiji"]=function(){return(dynCall_jiji=Module["dynCall_jiji"]=Module["asm"]["jb"]).apply(null,arguments)};var dynCall_iiiiij=Module["dynCall_iiiiij"]=function(){return(dynCall_iiiiij=Module["dynCall_iiiiij"]=Module["asm"]["kb"]).apply(null,arguments)};var dynCall_iiiiijj=Module["dynCall_iiiiijj"]=function(){return(dynCall_iiiiijj=Module["dynCall_iiiiijj"]=Module["asm"]["lb"]).apply(null,arguments)};var dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=function(){return(dynCall_iiiiiijj=Module["dynCall_iiiiiijj"]=Module["asm"]["mb"]).apply(null,arguments)};function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vif(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fifii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iif(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fi(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_di(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iifff(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiff(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiffiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_fii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viif(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0)}}Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_createPath"]=FS.createPath;Module["FS_createDataFile"]=FS.createDataFile;Module["FS_createPreloadedFile"]=FS.createPreloadedFile;Module["FS_createLazyFile"]=FS.createLazyFile;Module["FS_createDevice"]=FS.createDevice;Module["FS_unlink"]=FS.unlink;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function run(args){args=args||arguments_;if(runDependencies>0){return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}run();var postRegistrations=[];function onModuleReady(callback){postRegistrations.push(callback)}Module.onRuntimeInitialized=function(){for(var callback of postRegistrations){callback()}};(function(){var nodeFs;var nodePath;var nodeProcess;var pathSep;var wasmPathSep="/";var ENVIRONMENT_IS_WEB;var ENVIRONMENT_IS_NODE;var PATH_LIST_SEPARATOR=";";var callId=0;var MAX_CALL_ID=99999;function removeDuplicates(array){var seen={};return array.filter(function(item){return seen.hasOwnProperty(item)?false:seen[item]=true})}function createFilePath(fileName,filePath,sep=pathSep){var pathSlash=filePath.endsWith(sep);var fileSlash=fileName.startsWith(sep);var path;if(pathSlash||fileSlash){if(pathSlash&&fileSlash){path=filePath.substring(0,filePath.length-1)+fileName}else{path=filePath+fileName}}else{path=filePath+sep+fileName}return path}function fetchXml(fileName,searchPaths){var i=0;function fetchHandler(){var filePath=createFilePath(fileName,searchPaths[i++]);return fetch(filePath).then(function(response){if(response.status===200){return response.text().then(function(data){var url=new URL(response.url);var filePath=url.pathname.substring(1);filePath=filePath.replace(new RegExp(pathSep,"g"),wasmPathSep);return{data:data,filePath:filePath,fullPath:url.origin+url.pathname}})}else if(i/g;var matches=file.matchAll(includeRegex);var includes=[];for(var match of matches){includes.push(match[1])}return includes}function loadFile(fileToLoad,searchPaths){var promise;if(ENVIRONMENT_IS_WEB){promise=fetchXml(fileToLoad,searchPaths)}else if(ENVIRONMENT_IS_NODE){promise=loadXml(fileToLoad,searchPaths)}else{throw new Error("Unknown environment!")}return promise}function trackPath(path,filesUploaded,isFile=false){if(isFile){if(!filesUploaded.files){filesUploaded.files=[]}filesUploaded.files.push(path)}else{if(!filesUploaded.folders){filesUploaded.folders=[]}filesUploaded.folders.splice(0,0,path)}}function createInWasm(file,data,filesUploaded,wasmRootFolder,isFile=true){var folders;if(isFile){folders=file.substring(1,file.lastIndexOf(wasmPathSep)).split(wasmPathSep)}else{folders=file.substring(wasmRootFolder.length).split(wasmPathSep)}var folder=wasmRootFolder;for(var i=1;i-1?pos+1:0);var element=document.createElement("a");element.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(content));element.setAttribute("download",fileName);element.style.display="none";document.body.appendChild(element);element.click();document.body.removeChild(element)}}onModuleReady(function(){ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";if(ENVIRONMENT_IS_WEB){pathSep="/"}if(ENVIRONMENT_IS_NODE){nodeFs=require("fs");nodePath=require("path");nodeProcess=require("process");pathSep=nodePath.sep}function _readFromXmlString(doc,str,searchPath,readOptions,filesLoaded=[],initialFilePath=""){var wasmRootFolder="/readFromXml"+callId++%MAX_CALL_ID;var searchPaths=prepareSearchPaths(searchPath);try{FS.mkdir(wasmRootFolder)}catch(e){throw new Error("Failed to create folder in WASM FS.")}var includes=[];if(!readOptions||readOptions.readXIncludes){includes=getIncludes(str)}var filesUploaded={files:[],folders:[]};var wasmCwd=getWasmCwd(wasmRootFolder);var initialFileName=wasmCwd+"/ChosenToHopefullyNotClashWithAnyOtherFile123";if(initialFilePath){var sep=pathSep==="\\"?"\\\\":pathSep;initialFileName=initialFilePath.replace(new RegExp(sep,"g"),wasmPathSep);initialFileName=createFilePath(initialFileName,wasmRootFolder,wasmPathSep);createInWasm(wasmCwd,null,filesUploaded,wasmRootFolder,false)}createInWasm(initialFileName,str,filesUploaded,wasmRootFolder);function loadFiles(filesLoadedList,fileList,pathsList){var promises=[Promise.resolve()];for(var fileToLoad of fileList){var filesLoadedCopy=filesLoadedList.slice();var searchPathsCopy=pathsList.slice();var promise=loadFile(fileToLoad,searchPathsCopy).then(function(result){if(filesLoadedCopy.includes(result.fullPath)){throw new Error("Cycle detected!\n"+filesLoadedCopy.join("\n-> ")+"\n-> "+result.fullPath)}filesLoadedCopy.push(result.fullPath);var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);if(!searchPathsCopy.includes(path)){searchPathsCopy.splice(0,0,path)}var includes=getIncludes(result.data);var wasmPath=createFilePath(result.filePath,wasmRootFolder,wasmPathSep);if(!filesUploaded.files.includes(wasmPath)){createInWasm(wasmPath,result.data,filesUploaded,wasmRootFolder)}return loadFiles(filesLoadedCopy,includes,searchPathsCopy)});promises.push(promise)}return Promise.all(promises)}return loadFiles(filesLoaded,includes,searchPaths).then(function(){var wasmSearchPath=getWasmSearchPath(searchPath,wasmRootFolder);FS.chdir(wasmCwd);try{var searchPathEnv=Module.getEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR);if(searchPathEnv){var wasmSearchPathEnv=makeWasmAbsolute(searchPathEnv,wasmRootFolder);Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,wasmSearchPathEnv)}Module._readFromXmlFile(doc,initialFileName,wasmSearchPath,readOptions);if(searchPathEnv){Module.setEnviron(Module.MATERIALX_SEARCH_PATH_ENV_VAR,searchPathEnv)}}catch(errPtr){throw new Error("Failed to read MaterialX files from WASM FS: "+Module.getExceptionMessage(errPtr))}try{for(var file of filesUploaded.files){FS.unlink(file)}FS.chdir("/");for(var folder of filesUploaded.folders){FS.rmdir(folder)}FS.rmdir(wasmRootFolder)}catch(e){throw new Error("Failed to delete temporary files from WASM FS.")}})}Module.readFromXmlString=function(doc,str,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlString called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}return _readFromXmlString(doc,str,searchPath,readOptions)};Module.readFromXmlFile=function(doc,fileName,searchPath="",readOptions=null){if(arguments.length<2||arguments.length>4){throw new Error("Function readFromXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 4!")}var searchPaths=prepareSearchPaths(searchPath);return loadFile(fileName,searchPaths).then(function(result){var filesLoaded=[result.fullPath];var pos=result.fullPath.lastIndexOf(pathSep);var path=result.fullPath.substring(0,pos>-1?pos:0);searchPath=searchPath.concat(PATH_LIST_SEPARATOR,path);return _readFromXmlString(doc,result.data,searchPath,readOptions,filesLoaded,result.filePath)})};Module.writeToXmlFile=function(doc,fileName,writeOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function writeToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.writeToXmlString(doc,writeOptions);storeFileToDisk(fileName,file)};Module.exportToXmlFile=function(doc,fileName,exportOptions=null){if(arguments.length<2||arguments.length>3){throw new Error("Function exportToXmlFile called with an invalid number of arguments ("+arguments.length+") - expects 2 to 3!")}var file=Module.exportToXmlString(doc,exportOptions);storeFileToDisk(fileName,file)}})})(); return MaterialX.ready diff --git a/javascript/viewer/dist/JsMaterialXGenShader.wasm b/javascript/viewer/dist/JsMaterialXGenShader.wasm index 364c91c8..4fe7b990 100644 Binary files a/javascript/viewer/dist/JsMaterialXGenShader.wasm and b/javascript/viewer/dist/JsMaterialXGenShader.wasm differ diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_boombox.md b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_boombox.md new file mode 100644 index 00000000..ffb0de9a --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_boombox.md @@ -0,0 +1,18 @@ +```mermaid +graph LR + image_basecolor[image_basecolor:BoomBox_baseColor.png] + image_orm[image_orm:BoomBox_occlusionRoughnessMetallic.png] + image_normal[image_normal:BoomBox_normal.png] + image_emission[image_emission:BoomBox_emissive.png] + SR_boombox[SR_boombox] + style Material_boombox fill:#090, color:#FFF + Material_boombox([Material_boombox]) + image_basecolor --"outcolor-->base_color"--> SR_boombox + image_basecolor --"outa-->alpha"--> SR_boombox + image_orm --"metallic"--> SR_boombox + image_orm --"roughness"--> SR_boombox + image_orm --"occlusion"--> SR_boombox + image_normal --"normal"--> SR_boombox + image_emission --"emissive"--> SR_boombox + SR_boombox --"surfaceshader"--> Material_boombox +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_boombox_connections.json b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_boombox_connections.json new file mode 100644 index 00000000..f37e489e --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_boombox_connections.json @@ -0,0 +1,102 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_boombox.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "image_basecolor", + "gltf_colorimage", + "multioutput", + "BoomBox_baseColor.png" + ], + [ + "image_orm", + "gltf_image", + "vector3", + "BoomBox_occlusionRoughnessMetallic.png" + ], + [ + "image_normal", + "gltf_normalmap", + "vector3", + "BoomBox_normal.png" + ], + [ + "image_emission", + "gltf_image", + "color3", + "BoomBox_emissive.png" + ], + [ + "SR_boombox", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "Material_boombox", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "image_basecolor", + "outcolor", + "SR_boombox", + "base_color", + "nodename" + ], + [ + "image_basecolor", + "outa", + "SR_boombox", + "alpha", + "nodename" + ], + [ + "image_orm", + "", + "SR_boombox", + "metallic", + "nodename" + ], + [ + "image_orm", + "", + "SR_boombox", + "roughness", + "nodename" + ], + [ + "image_orm", + "", + "SR_boombox", + "occlusion", + "nodename" + ], + [ + "image_normal", + "", + "SR_boombox", + "normal", + "nodename" + ], + [ + "image_emission", + "", + "SR_boombox", + "emissive", + "nodename" + ], + [ + "SR_boombox", + "", + "Material_boombox", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_carpaint.md b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_carpaint.md new file mode 100644 index 00000000..a0e6ec8b --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_carpaint.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_carpaint[SR_carpaint] + style PBR_Car_Paint fill:#090, color:#FFF + PBR_Car_Paint([PBR_Car_Paint]) + SR_carpaint --"surfaceshader"--> PBR_Car_Paint +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_carpaint_connections.json b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_carpaint_connections.json new file mode 100644 index 00000000..63fbae55 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_carpaint_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_carpaint.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_carpaint", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "PBR_Car_Paint", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_carpaint", + "", + "PBR_Car_Paint", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_default.md b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_default.md new file mode 100644 index 00000000..3c7985c6 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_default.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_default[SR_default] + style Default fill:#090, color:#FFF + Default([Default]) + SR_default --"surfaceshader"--> Default +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_default_connections.json b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_default_connections.json new file mode 100644 index 00000000..87728cbe --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_default_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_default.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_default", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "Default", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_default", + "", + "Default", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_glass.md b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_glass.md new file mode 100644 index 00000000..a7661de1 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_glass.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_glass[SR_glass] + style PBR_Glass fill:#090, color:#FFF + PBR_Glass([PBR_Glass]) + SR_glass --"surfaceshader"--> PBR_Glass +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_glass_connections.json b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_glass_connections.json new file mode 100644 index 00000000..2882dd49 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_glass_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_glass.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_glass", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "PBR_Glass", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_glass", + "", + "PBR_Glass", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_gold.md b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_gold.md new file mode 100644 index 00000000..74b99d82 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_gold.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_gold[SR_gold] + style PBR_Gold fill:#090, color:#FFF + PBR_Gold([PBR_Gold]) + SR_gold --"surfaceshader"--> PBR_Gold +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_gold_connections.json b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_gold_connections.json new file mode 100644 index 00000000..0ff9563c --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_gold_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_gold.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_gold", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "PBR_Gold", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_gold", + "", + "PBR_Gold", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_plastic.md b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_plastic.md new file mode 100644 index 00000000..b1f729f1 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_plastic.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_plastic[SR_plastic] + style PBR_Plastic fill:#090, color:#FFF + PBR_Plastic([PBR_Plastic]) + SR_plastic --"surfaceshader"--> PBR_Plastic +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_plastic_connections.json b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_plastic_connections.json new file mode 100644 index 00000000..66656a33 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/GltfPbr/gltf_pbr_plastic_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_plastic.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_plastic", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "PBR_Plastic", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_plastic", + "", + "PBR_Plastic", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_aluminum_brushed.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_aluminum_brushed.mtlx new file mode 100644 index 00000000..7f7072d4 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_aluminum_brushed.mtlx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_carpaint.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_carpaint.mtlx new file mode 100644 index 00000000..fd42fdf4 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_carpaint.mtlx @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_default.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_default.mtlx new file mode 100644 index 00000000..85c53791 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_default.mtlx @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_glass.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_glass.mtlx new file mode 100644 index 00000000..a661b9d1 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_glass.mtlx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_honey.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_honey.mtlx new file mode 100644 index 00000000..41e076d2 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_honey.mtlx @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_ketchup.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_ketchup.mtlx new file mode 100644 index 00000000..cda2ebdf --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_ketchup.mtlx @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_lightbulb.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_lightbulb.mtlx new file mode 100644 index 00000000..a915f842 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_lightbulb.mtlx @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_pearl.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_pearl.mtlx new file mode 100644 index 00000000..83db774b --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_pearl.mtlx @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_soapbubble.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_soapbubble.mtlx new file mode 100644 index 00000000..af0faccb --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_soapbubble.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_velvet.mtlx b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_velvet.mtlx new file mode 100644 index 00000000..bf81e082 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/OpenPBR/open_pbr_velvet.mtlx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/gooch_shade.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/gooch_shade.md new file mode 100644 index 00000000..304c1c2b --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/gooch_shade.md @@ -0,0 +1,15 @@ +```mermaid +graph LR + default_gooch[default_gooch] + unlit_surface[unlit_surface] + style default_gooch_material fill:#090, color:#FFF + default_gooch_material([default_gooch_material]) + red_blue_gooch[red_blue_gooch] + redblue_gooch_surface[redblue_gooch_surface] + style redblue_gooch_material fill:#090, color:#FFF + redblue_gooch_material([redblue_gooch_material]) + default_gooch --"emission_color"--> unlit_surface + unlit_surface --"surfaceshader"--> default_gooch_material + red_blue_gooch --"emission_color"--> redblue_gooch_surface + redblue_gooch_surface --"surfaceshader"--> redblue_gooch_material +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/gooch_shade_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/gooch_shade_connections.json new file mode 100644 index 00000000..02d174d0 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/gooch_shade_connections.json @@ -0,0 +1,74 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\gooch_shade.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "default_gooch", + "gooch_shade", + "color3", + "" + ], + [ + "unlit_surface", + "surface_unlit", + "surfaceshader", + "" + ], + [ + "default_gooch_material", + "surfacematerial", + "material", + "" + ], + [ + "red_blue_gooch", + "gooch_shade", + "color3", + "" + ], + [ + "redblue_gooch_surface", + "surface_unlit", + "surfaceshader", + "" + ], + [ + "redblue_gooch_material", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "default_gooch", + "", + "unlit_surface", + "emission_color", + "nodename" + ], + [ + "unlit_surface", + "", + "default_gooch_material", + "surfaceshader", + "nodename" + ], + [ + "red_blue_gooch", + "", + "redblue_gooch_surface", + "emission_color", + "nodename" + ], + [ + "redblue_gooch_surface", + "", + "redblue_gooch_material", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brass_tiled.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brass_tiled.md new file mode 100644 index 00000000..bcf6abd8 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brass_tiled.md @@ -0,0 +1,20 @@ +```mermaid +graph LR + subgraph NG_brass1 + style NG_brass1_out_color fill:#0C0, color:#FFF + NG_brass1_out_color([out_color]) + style NG_brass1_out_roughness fill:#0C0, color:#FFF + NG_brass1_out_roughness([out_roughness]) + NG_brass1_image_color[image_color] + NG_brass1_image_roughness[image_roughness] + end + SR_brass1[SR_brass1] + style Tiled_Brass fill:#090, color:#FFF + Tiled_Brass([Tiled_Brass]) + NG_brass1_image_color --> NG_brass1_out_color + NG_brass1_image_roughness --> NG_brass1_out_roughness + NG_brass1_out_roughness --"specular_roughness"--> SR_brass1 + NG_brass1_out_color --"coat_color"--> SR_brass1 + NG_brass1_out_roughness --"coat_roughness"--> SR_brass1 + SR_brass1 --"surfaceshader"--> Tiled_Brass +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brick_procedural.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brick_procedural.md new file mode 100644 index 00000000..18bfd0ff --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brick_procedural.md @@ -0,0 +1,107 @@ +```mermaid +graph LR + subgraph NG_BrickPattern + style NG_BrickPattern_brick_color fill:#09D, color:#FFF + NG_BrickPattern_brick_color([brick_color:0.661876, 0.19088, 0]) + style NG_BrickPattern_hue_variation fill:#09D, color:#FFF + NG_BrickPattern_hue_variation([hue_variation:0.083]) + style NG_BrickPattern_value_variation fill:#09D, color:#FFF + NG_BrickPattern_value_variation([value_variation:0.787]) + style NG_BrickPattern_roughness_amount fill:#09D, color:#FFF + NG_BrickPattern_roughness_amount([roughness_amount:0.853]) + style NG_BrickPattern_dirt_color fill:#09D, color:#FFF + NG_BrickPattern_dirt_color([dirt_color:0.56372, 0.56372, 0.56372]) + style NG_BrickPattern_dirt_amount fill:#09D, color:#FFF + NG_BrickPattern_dirt_amount([dirt_amount:0.248]) + style NG_BrickPattern_uvtiling fill:#09D, color:#FFF + NG_BrickPattern_uvtiling([uvtiling:3]) + style NG_BrickPattern_base_color_output fill:#0C0, color:#FFF + NG_BrickPattern_base_color_output([base_color_output]) + style NG_BrickPattern_specular_roughness_output fill:#0C0, color:#FFF + NG_BrickPattern_specular_roughness_output([specular_roughness_output]) + style NG_BrickPattern_normal_output fill:#0C0, color:#FFF + NG_BrickPattern_normal_output([normal_output]) + NG_BrickPattern_node_multiply_5[node_multiply_5] + NG_BrickPattern_node_mix_8[node_mix_8] + style NG_BrickPattern_node_color_11 fill:#500, color:#FFF + NG_BrickPattern_node_color_11([node_color_11:0.263273, 0.263273, 0.263273]) + NG_BrickPattern_node_multiply_9[node_multiply_9] + NG_BrickPattern_node_rgbtohsv_12[node_rgbtohsv_12] + NG_BrickPattern_node_combine3_color3_13[node_combine3_color3_13] + NG_BrickPattern_node_add_16[node_add_16] + NG_BrickPattern_node_hsvtorgb_17[node_hsvtorgb_17] + NG_BrickPattern_node_subtract_18[node_subtract_18] + NG_BrickPattern_node_multiply_14[node_multiply_14] + NG_BrickPattern_node_multiply_15[node_multiply_15] + NG_BrickPattern_node_clamp_0[node_clamp_0] + NG_BrickPattern_node_multiply_1[node_multiply_1] + NG_BrickPattern_node_max_1[node_max_1] + NG_BrickPattern_node_divide_21[node_divide_21] + NG_BrickPattern_node_mix_6[node_mix_6] + NG_BrickPattern_node_multiply_23[node_multiply_23] + NG_BrickPattern_node_multiply_25[node_multiply_25] + NG_BrickPattern_node_add_19[node_add_19] + NG_BrickPattern_node_multiply_20[node_multiply_20] + NG_BrickPattern_node_normalmap_3[node_normalmap_3] + NG_BrickPattern_node_convert_1[node_convert_1] + NG_BrickPattern_node_tiledimage_vector3_27[node_tiledimage_vector3_27] + NG_BrickPattern_node_tiledimage_float_22[node_tiledimage_float_22] + NG_BrickPattern_node_tiledimage_float_10[node_tiledimage_float_10] + NG_BrickPattern_node_tiledimage_float_7[node_tiledimage_float_7] + NG_BrickPattern_node_tiledimage_float_26[node_tiledimage_float_26] + NG_BrickPattern_node_tiledimage_float_24[node_tiledimage_float_24] + end + N_StandardSurface[N_StandardSurface] + style M_BrickPattern fill:#090, color:#FFF + M_BrickPattern([M_BrickPattern]) + NG_BrickPattern_node_mix_6 --"in1"--> NG_BrickPattern_node_multiply_5 + NG_BrickPattern_node_tiledimage_float_7 --"in2"--> NG_BrickPattern_node_multiply_5 + NG_BrickPattern_node_multiply_5 --"fg"--> NG_BrickPattern_node_mix_8 + NG_BrickPattern_node_multiply_9 --"bg"--> NG_BrickPattern_node_mix_8 + NG_BrickPattern_node_tiledimage_float_10 --"mix"--> NG_BrickPattern_node_mix_8 + NG_BrickPattern_node_color_11 --"in1"--> NG_BrickPattern_node_multiply_9 + NG_BrickPattern_node_tiledimage_float_7 --"in2"--> NG_BrickPattern_node_multiply_9 + NG_BrickPattern_brick_color --"in"--> NG_BrickPattern_node_rgbtohsv_12 + NG_BrickPattern_node_multiply_14 --"in1"--> NG_BrickPattern_node_combine3_color3_13 + NG_BrickPattern_node_multiply_15 --"in3"--> NG_BrickPattern_node_combine3_color3_13 + NG_BrickPattern_node_combine3_color3_13 --"in1"--> NG_BrickPattern_node_add_16 + NG_BrickPattern_node_rgbtohsv_12 --"in2"--> NG_BrickPattern_node_add_16 + NG_BrickPattern_node_add_16 --"in"--> NG_BrickPattern_node_hsvtorgb_17 + NG_BrickPattern_node_add_19 --"in1"--> NG_BrickPattern_node_subtract_18 + NG_BrickPattern_node_subtract_18 --"in1"--> NG_BrickPattern_node_multiply_14 + NG_BrickPattern_hue_variation --"in2"--> NG_BrickPattern_node_multiply_14 + NG_BrickPattern_node_add_19 --"in1"--> NG_BrickPattern_node_multiply_15 + NG_BrickPattern_node_multiply_20 --"in2"--> NG_BrickPattern_node_multiply_15 + NG_BrickPattern_node_mix_8 --"in"--> NG_BrickPattern_node_clamp_0 + NG_BrickPattern_node_divide_21 --"in1"--> NG_BrickPattern_node_multiply_1 + NG_BrickPattern_node_tiledimage_float_22 --"in2"--> NG_BrickPattern_node_multiply_1 + NG_BrickPattern_node_tiledimage_float_10 --"in1"--> NG_BrickPattern_node_max_1 + NG_BrickPattern_roughness_amount --"in1"--> NG_BrickPattern_node_divide_21 + NG_BrickPattern_node_max_1 --"in2"--> NG_BrickPattern_node_divide_21 + NG_BrickPattern_dirt_color --"fg"--> NG_BrickPattern_node_mix_6 + NG_BrickPattern_node_hsvtorgb_17 --"bg"--> NG_BrickPattern_node_mix_6 + NG_BrickPattern_node_multiply_23 --"mix"--> NG_BrickPattern_node_mix_6 + NG_BrickPattern_dirt_amount --"in1"--> NG_BrickPattern_node_multiply_23 + NG_BrickPattern_node_tiledimage_float_24 --"in2"--> NG_BrickPattern_node_multiply_23 + NG_BrickPattern_hue_variation --"in1"--> NG_BrickPattern_node_multiply_25 + NG_BrickPattern_node_tiledimage_float_26 --"in2"--> NG_BrickPattern_node_multiply_25 + NG_BrickPattern_node_multiply_25 --"in1"--> NG_BrickPattern_node_add_19 + NG_BrickPattern_node_tiledimage_float_7 --"in2"--> NG_BrickPattern_node_add_19 + NG_BrickPattern_value_variation --"in1"--> NG_BrickPattern_node_multiply_20 + NG_BrickPattern_node_tiledimage_float_26 --"in2"--> NG_BrickPattern_node_multiply_20 + NG_BrickPattern_node_tiledimage_vector3_27 --"in"--> NG_BrickPattern_node_normalmap_3 + NG_BrickPattern_uvtiling --"in"--> NG_BrickPattern_node_convert_1 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_vector3_27 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_22 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_10 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_7 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_26 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_24 + NG_BrickPattern_node_clamp_0 --> NG_BrickPattern_base_color_output + NG_BrickPattern_node_multiply_1 --> NG_BrickPattern_specular_roughness_output + NG_BrickPattern_node_normalmap_3 --> NG_BrickPattern_normal_output + NG_BrickPattern_base_color_output --"base_color"--> N_StandardSurface + NG_BrickPattern_specular_roughness_output --"specular_roughness"--> N_StandardSurface + NG_BrickPattern_normal_output --"normal"--> N_StandardSurface + N_StandardSurface --"surfaceshader"--> M_BrickPattern +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brick_procedural_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brick_procedural_connections.json new file mode 100644 index 00000000..84089c55 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_brick_procedural_connections.json @@ -0,0 +1,602 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_brick_procedural.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "NG_BrickPattern": [ + [ + "NG_BrickPattern/brick_color", + "input", + "color3", + "0.661876, 0.19088, 0" + ], + [ + "NG_BrickPattern/hue_variation", + "input", + "float", + "0.083" + ], + [ + "NG_BrickPattern/value_variation", + "input", + "float", + "0.787" + ], + [ + "NG_BrickPattern/roughness_amount", + "input", + "float", + "0.853" + ], + [ + "NG_BrickPattern/dirt_color", + "input", + "color3", + "0.56372, 0.56372, 0.56372" + ], + [ + "NG_BrickPattern/dirt_amount", + "input", + "float", + "0.248" + ], + [ + "NG_BrickPattern/uvtiling", + "input", + "float", + "3" + ], + [ + "NG_BrickPattern/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_BrickPattern/specular_roughness_output", + "output", + "float", + "" + ], + [ + "NG_BrickPattern/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_BrickPattern/node_multiply_5", + "multiply", + "color3", + "" + ], + [ + "NG_BrickPattern/node_mix_8", + "mix", + "color3", + "" + ], + [ + "NG_BrickPattern/node_color_11", + "constant", + "color3", + "0.263273, 0.263273, 0.263273" + ], + [ + "NG_BrickPattern/node_multiply_9", + "multiply", + "color3", + "" + ], + [ + "NG_BrickPattern/node_rgbtohsv_12", + "rgbtohsv", + "color3", + "" + ], + [ + "NG_BrickPattern/node_combine3_color3_13", + "combine3", + "color3", + "" + ], + [ + "NG_BrickPattern/node_add_16", + "add", + "color3", + "" + ], + [ + "NG_BrickPattern/node_hsvtorgb_17", + "hsvtorgb", + "color3", + "" + ], + [ + "NG_BrickPattern/node_subtract_18", + "subtract", + "float", + "" + ], + [ + "NG_BrickPattern/node_multiply_14", + "multiply", + "float", + "" + ], + [ + "NG_BrickPattern/node_multiply_15", + "multiply", + "float", + "" + ], + [ + "NG_BrickPattern/node_clamp_0", + "clamp", + "color3", + "" + ], + [ + "NG_BrickPattern/node_multiply_1", + "multiply", + "float", + "" + ], + [ + "NG_BrickPattern/node_max_1", + "max", + "float", + "" + ], + [ + "NG_BrickPattern/node_divide_21", + "divide", + "float", + "" + ], + [ + "NG_BrickPattern/node_mix_6", + "mix", + "color3", + "" + ], + [ + "NG_BrickPattern/node_multiply_23", + "multiply", + "float", + "" + ], + [ + "NG_BrickPattern/node_multiply_25", + "multiply", + "float", + "" + ], + [ + "NG_BrickPattern/node_add_19", + "add", + "float", + "" + ], + [ + "NG_BrickPattern/node_multiply_20", + "multiply", + "float", + "" + ], + [ + "NG_BrickPattern/node_normalmap_3", + "normalmap", + "vector3", + "" + ], + [ + "NG_BrickPattern/node_convert_1", + "convert", + "vector2", + "" + ], + [ + "NG_BrickPattern/node_tiledimage_vector3_27", + "tiledimage", + "vector3", + "" + ], + [ + "NG_BrickPattern/node_tiledimage_float_22", + "tiledimage", + "float", + "" + ], + [ + "NG_BrickPattern/node_tiledimage_float_10", + "tiledimage", + "float", + "" + ], + [ + "NG_BrickPattern/node_tiledimage_float_7", + "tiledimage", + "float", + "" + ], + [ + "NG_BrickPattern/node_tiledimage_float_26", + "tiledimage", + "float", + "" + ], + [ + "NG_BrickPattern/node_tiledimage_float_24", + "tiledimage", + "float", + "" + ] + ], + "": [ + [ + "N_StandardSurface", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_BrickPattern", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "NG_BrickPattern/node_mix_6", + "", + "NG_BrickPattern/node_multiply_5", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_7", + "", + "NG_BrickPattern/node_multiply_5", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/node_multiply_5", + "", + "NG_BrickPattern/node_mix_8", + "fg", + "nodename" + ], + [ + "NG_BrickPattern/node_multiply_9", + "", + "NG_BrickPattern/node_mix_8", + "bg", + "nodename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_10", + "", + "NG_BrickPattern/node_mix_8", + "mix", + "nodename" + ], + [ + "NG_BrickPattern/node_color_11", + "", + "NG_BrickPattern/node_multiply_9", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_7", + "", + "NG_BrickPattern/node_multiply_9", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/brick_color", + "", + "NG_BrickPattern/node_rgbtohsv_12", + "in", + "interfacename" + ], + [ + "NG_BrickPattern/node_multiply_14", + "", + "NG_BrickPattern/node_combine3_color3_13", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/node_multiply_15", + "", + "NG_BrickPattern/node_combine3_color3_13", + "in3", + "nodename" + ], + [ + "NG_BrickPattern/node_combine3_color3_13", + "", + "NG_BrickPattern/node_add_16", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/node_rgbtohsv_12", + "", + "NG_BrickPattern/node_add_16", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/node_add_16", + "", + "NG_BrickPattern/node_hsvtorgb_17", + "in", + "nodename" + ], + [ + "NG_BrickPattern/node_add_19", + "", + "NG_BrickPattern/node_subtract_18", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/node_subtract_18", + "", + "NG_BrickPattern/node_multiply_14", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/hue_variation", + "", + "NG_BrickPattern/node_multiply_14", + "in2", + "interfacename" + ], + [ + "NG_BrickPattern/node_add_19", + "", + "NG_BrickPattern/node_multiply_15", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/node_multiply_20", + "", + "NG_BrickPattern/node_multiply_15", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/node_mix_8", + "", + "NG_BrickPattern/node_clamp_0", + "in", + "nodename" + ], + [ + "NG_BrickPattern/node_divide_21", + "", + "NG_BrickPattern/node_multiply_1", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_22", + "", + "NG_BrickPattern/node_multiply_1", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_10", + "", + "NG_BrickPattern/node_max_1", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/roughness_amount", + "", + "NG_BrickPattern/node_divide_21", + "in1", + "interfacename" + ], + [ + "NG_BrickPattern/node_max_1", + "", + "NG_BrickPattern/node_divide_21", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/dirt_color", + "", + "NG_BrickPattern/node_mix_6", + "fg", + "interfacename" + ], + [ + "NG_BrickPattern/node_hsvtorgb_17", + "", + "NG_BrickPattern/node_mix_6", + "bg", + "nodename" + ], + [ + "NG_BrickPattern/node_multiply_23", + "", + "NG_BrickPattern/node_mix_6", + "mix", + "nodename" + ], + [ + "NG_BrickPattern/dirt_amount", + "", + "NG_BrickPattern/node_multiply_23", + "in1", + "interfacename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_24", + "", + "NG_BrickPattern/node_multiply_23", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/hue_variation", + "", + "NG_BrickPattern/node_multiply_25", + "in1", + "interfacename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_26", + "", + "NG_BrickPattern/node_multiply_25", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/node_multiply_25", + "", + "NG_BrickPattern/node_add_19", + "in1", + "nodename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_7", + "", + "NG_BrickPattern/node_add_19", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/value_variation", + "", + "NG_BrickPattern/node_multiply_20", + "in1", + "interfacename" + ], + [ + "NG_BrickPattern/node_tiledimage_float_26", + "", + "NG_BrickPattern/node_multiply_20", + "in2", + "nodename" + ], + [ + "NG_BrickPattern/node_tiledimage_vector3_27", + "", + "NG_BrickPattern/node_normalmap_3", + "in", + "nodename" + ], + [ + "NG_BrickPattern/uvtiling", + "", + "NG_BrickPattern/node_convert_1", + "in", + "interfacename" + ], + [ + "NG_BrickPattern/node_convert_1", + "", + "NG_BrickPattern/node_tiledimage_vector3_27", + "uvtiling", + "nodename" + ], + [ + "NG_BrickPattern/node_convert_1", + "", + "NG_BrickPattern/node_tiledimage_float_22", + "uvtiling", + "nodename" + ], + [ + "NG_BrickPattern/node_convert_1", + "", + "NG_BrickPattern/node_tiledimage_float_10", + "uvtiling", + "nodename" + ], + [ + "NG_BrickPattern/node_convert_1", + "", + "NG_BrickPattern/node_tiledimage_float_7", + "uvtiling", + "nodename" + ], + [ + "NG_BrickPattern/node_convert_1", + "", + "NG_BrickPattern/node_tiledimage_float_26", + "uvtiling", + "nodename" + ], + [ + "NG_BrickPattern/node_convert_1", + "", + "NG_BrickPattern/node_tiledimage_float_24", + "uvtiling", + "nodename" + ], + [ + "NG_BrickPattern/node_clamp_0", + "", + "NG_BrickPattern/base_color_output", + "", + "nodename" + ], + [ + "NG_BrickPattern/node_multiply_1", + "", + "NG_BrickPattern/specular_roughness_output", + "", + "nodename" + ], + [ + "NG_BrickPattern/node_normalmap_3", + "", + "NG_BrickPattern/normal_output", + "", + "nodename" + ], + [ + "NG_BrickPattern/base_color_output", + "", + "N_StandardSurface", + "base_color", + "nodename" + ], + [ + "NG_BrickPattern/specular_roughness_output", + "", + "N_StandardSurface", + "specular_roughness", + "nodename" + ], + [ + "NG_BrickPattern/normal_output", + "", + "N_StandardSurface", + "normal", + "nodename" + ], + [ + "N_StandardSurface", + "", + "M_BrickPattern", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_carpaint.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_carpaint.md new file mode 100644 index 00000000..c186e416 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_carpaint.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_carpaint[SR_carpaint] + style Car_Paint fill:#090, color:#FFF + Car_Paint([Car_Paint]) + SR_carpaint --"surfaceshader"--> Car_Paint +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_carpaint_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_carpaint_connections.json new file mode 100644 index 00000000..81287a81 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_carpaint_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_carpaint.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_carpaint", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Car_Paint", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_carpaint", + "", + "Car_Paint", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chess_set.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chess_set.md new file mode 100644 index 00000000..e449681e --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chess_set.md @@ -0,0 +1,439 @@ +```mermaid +graph LR + subgraph NG_BishopBlack + style NG_BishopBlack_base_color_output fill:#0C0, color:#FFF + NG_BishopBlack_base_color_output([base_color_output]) + style NG_BishopBlack_metalness_output fill:#0C0, color:#FFF + NG_BishopBlack_metalness_output([metalness_output]) + style NG_BishopBlack_roughness_output fill:#0C0, color:#FFF + NG_BishopBlack_roughness_output([roughness_output]) + style NG_BishopBlack_normal_output fill:#0C0, color:#FFF + NG_BishopBlack_normal_output([normal_output]) + NG_BishopBlack_diffuse2[diffuse2:chess_set/bishop_black_base_color.jpg] + NG_BishopBlack_metallic2[metallic2:chess_set/bishop_shared_metallic.jpg] + NG_BishopBlack_roughness2[roughness2:chess_set/bishop_black_roughness.jpg] + NG_BishopBlack_normal2[normal2:chess_set/bishop_black_normal.jpg] + NG_BishopBlack_mtlxnormalmap4[mtlxnormalmap4] + end + Bishop_B[Bishop_B] + style M_Bishop_B fill:#090, color:#FFF + M_Bishop_B([M_Bishop_B]) + Bishop_W[Bishop_W] + style M_Bishop_W fill:#090, color:#FFF + M_Bishop_W([M_Bishop_W]) + Castle_B[Castle_B] + style M_Castle_B fill:#090, color:#FFF + M_Castle_B([M_Castle_B]) + Castle_W[Castle_W] + style M_Castle_W fill:#090, color:#FFF + M_Castle_W([M_Castle_W]) + Chessboard[Chessboard] + style M_Chessboard fill:#090, color:#FFF + M_Chessboard([M_Chessboard]) + King_B[King_B] + style M_King_B fill:#090, color:#FFF + M_King_B([M_King_B]) + King_W[King_W] + style M_King_W fill:#090, color:#FFF + M_King_W([M_King_W]) + Knight_B[Knight_B] + style M_Knight_B fill:#090, color:#FFF + M_Knight_B([M_Knight_B]) + Knight_W[Knight_W] + style M_Knight_W fill:#090, color:#FFF + M_Knight_W([M_Knight_W]) + Pawn_Body_B[Pawn_Body_B] + style M_Pawn_Body_B fill:#090, color:#FFF + M_Pawn_Body_B([M_Pawn_Body_B]) + Pawn_Body_W[Pawn_Body_W] + style M_Pawn_Body_W fill:#090, color:#FFF + M_Pawn_Body_W([M_Pawn_Body_W]) + Pawn_Top_B[Pawn_Top_B] + style M_Pawn_Top_B fill:#090, color:#FFF + M_Pawn_Top_B([M_Pawn_Top_B]) + Pawn_Top_W[Pawn_Top_W] + style M_Pawn_Top_W fill:#090, color:#FFF + M_Pawn_Top_W([M_Pawn_Top_W]) + Queen_B[Queen_B] + style M_Queen_B fill:#090, color:#FFF + M_Queen_B([M_Queen_B]) + Queen_W[Queen_W] + style M_Queen_W fill:#090, color:#FFF + M_Queen_W([M_Queen_W]) + subgraph NG_BishopWhite + style NG_BishopWhite_base_color_output fill:#0C0, color:#FFF + NG_BishopWhite_base_color_output([base_color_output]) + style NG_BishopWhite_metalness_output fill:#0C0, color:#FFF + NG_BishopWhite_metalness_output([metalness_output]) + style NG_BishopWhite_roughness_output fill:#0C0, color:#FFF + NG_BishopWhite_roughness_output([roughness_output]) + style NG_BishopWhite_normal_output fill:#0C0, color:#FFF + NG_BishopWhite_normal_output([normal_output]) + NG_BishopWhite_diffuse3[diffuse3:chess_set/bishop_white_base_color.jpg] + NG_BishopWhite_metallic3[metallic3:chess_set/bishop_shared_metallic.jpg] + NG_BishopWhite_roughness3[roughness3:chess_set/bishop_white_roughness.jpg] + NG_BishopWhite_normal3[normal3:chess_set/bishop_white_normal.jpg] + NG_BishopWhite_mtlxnormalmap5[mtlxnormalmap5] + end + subgraph NG_CastleBlack + style NG_CastleBlack_base_color_output fill:#0C0, color:#FFF + NG_CastleBlack_base_color_output([base_color_output]) + style NG_CastleBlack_metalness_output fill:#0C0, color:#FFF + NG_CastleBlack_metalness_output([metalness_output]) + style NG_CastleBlack_roughness_output fill:#0C0, color:#FFF + NG_CastleBlack_roughness_output([roughness_output]) + style NG_CastleBlack_normal_output fill:#0C0, color:#FFF + NG_CastleBlack_normal_output([normal_output]) + NG_CastleBlack_diffuse6[diffuse6:chess_set/castle_black_base_color.jpg] + NG_CastleBlack_metallic6[metallic6:chess_set/castle_shared_metallic.jpg] + NG_CastleBlack_roughness6[roughness6:chess_set/castle_shared_roughness.jpg] + NG_CastleBlack_normal6[normal6:chess_set/castle_shared_normal.jpg] + NG_CastleBlack_mtlxnormalmap8[mtlxnormalmap8] + end + subgraph NG_CastleWhite + style NG_CastleWhite_base_color_output fill:#0C0, color:#FFF + NG_CastleWhite_base_color_output([base_color_output]) + style NG_CastleWhite_metalness_output fill:#0C0, color:#FFF + NG_CastleWhite_metalness_output([metalness_output]) + style NG_CastleWhite_roughness_output fill:#0C0, color:#FFF + NG_CastleWhite_roughness_output([roughness_output]) + style NG_CastleWhite_normal_output fill:#0C0, color:#FFF + NG_CastleWhite_normal_output([normal_output]) + NG_CastleWhite_diffuse7[diffuse7:chess_set/castle_white_base_color.jpg] + NG_CastleWhite_metallic7[metallic7:chess_set/castle_shared_metallic.jpg] + NG_CastleWhite_roughness7[roughness7:chess_set/castle_shared_roughness.jpg] + NG_CastleWhite_normal7[normal7:chess_set/castle_shared_normal.jpg] + NG_CastleWhite_mtlxnormalmap9[mtlxnormalmap9] + end + subgraph NG_ChessBoard + style NG_ChessBoard_base_color_output fill:#0C0, color:#FFF + NG_ChessBoard_base_color_output([base_color_output]) + style NG_ChessBoard_metalness_output fill:#0C0, color:#FFF + NG_ChessBoard_metalness_output([metalness_output]) + style NG_ChessBoard_roughness_output fill:#0C0, color:#FFF + NG_ChessBoard_roughness_output([roughness_output]) + style NG_ChessBoard_normal_output fill:#0C0, color:#FFF + NG_ChessBoard_normal_output([normal_output]) + NG_ChessBoard_mtlximage13[mtlximage13:chess_set/chessboard_base_color.jpg] + NG_ChessBoard_mtlximage16[mtlximage16:chess_set/chessboard_metallic.jpg] + NG_ChessBoard_mtlximage17[mtlximage17:chess_set/chessboard_roughness.jpg] + NG_ChessBoard_mtlximage15[mtlximage15:chess_set/chessboard_normal.jpg] + NG_ChessBoard_mtlxnormalmap12[mtlxnormalmap12] + end + subgraph NG_KingBlack + style NG_KingBlack_base_color_output fill:#0C0, color:#FFF + NG_KingBlack_base_color_output([base_color_output]) + style NG_KingBlack_metalness_output fill:#0C0, color:#FFF + NG_KingBlack_metalness_output([metalness_output]) + style NG_KingBlack_roughness_output fill:#0C0, color:#FFF + NG_KingBlack_roughness_output([roughness_output]) + style NG_KingBlack_subsurface_output fill:#0C0, color:#FFF + NG_KingBlack_subsurface_output([subsurface_output]) + style NG_KingBlack_normal_output fill:#0C0, color:#FFF + NG_KingBlack_normal_output([normal_output]) + NG_KingBlack_mtlximage1[mtlximage1:chess_set/king_black_base_color.jpg] + NG_KingBlack_mtlximage2[mtlximage2:chess_set/king_shared_metallic.jpg] + NG_KingBlack_mtlximage4[mtlximage4:chess_set/king_black_roughness.jpg] + NG_KingBlack_mtlximage3[mtlximage3:chess_set/king_shared_scattering.jpg] + NG_KingBlack_mtlximage6[mtlximage6:chess_set/king_black_normal.jpg] + NG_KingBlack_mtlxnormalmap1[mtlxnormalmap1] + end + subgraph NG_KingWhite + style NG_KingWhite_base_color_output fill:#0C0, color:#FFF + NG_KingWhite_base_color_output([base_color_output]) + style NG_KingWhite_metalness_output fill:#0C0, color:#FFF + NG_KingWhite_metalness_output([metalness_output]) + style NG_KingWhite_roughness_output fill:#0C0, color:#FFF + NG_KingWhite_roughness_output([roughness_output]) + style NG_KingWhite_subsurface_output fill:#0C0, color:#FFF + NG_KingWhite_subsurface_output([subsurface_output]) + style NG_KingWhite_normal_output fill:#0C0, color:#FFF + NG_KingWhite_normal_output([normal_output]) + NG_KingWhite_mtlximage7[mtlximage7:chess_set/king_white_base_color.jpg] + NG_KingWhite_mtlximage10[mtlximage10:chess_set/king_shared_metallic.jpg] + NG_KingWhite_mtlximage11[mtlximage11:chess_set/king_white_roughness.jpg] + NG_KingWhite_mtlximage8[mtlximage8:chess_set/king_shared_scattering.jpg] + NG_KingWhite_mtlximage9[mtlximage9:chess_set/king_white_normal.jpg] + NG_KingWhite_mtlxnormalmap11[mtlxnormalmap11] + end + subgraph NG_KnightBlack + style NG_KnightBlack_base_color_output fill:#0C0, color:#FFF + NG_KnightBlack_base_color_output([base_color_output]) + style NG_KnightBlack_roughness_output fill:#0C0, color:#FFF + NG_KnightBlack_roughness_output([roughness_output]) + style NG_KnightBlack_normal_output fill:#0C0, color:#FFF + NG_KnightBlack_normal_output([normal_output]) + NG_KnightBlack_diffuse4[diffuse4:chess_set/knight_black_base_color.jpg] + NG_KnightBlack_roughness4[roughness4:chess_set/knight_black_roughness.jpg] + NG_KnightBlack_normal4[normal4:chess_set/knight_black_normal.jpg] + NG_KnightBlack_mtlxnormalmap6[mtlxnormalmap6] + end + subgraph NG_KnightWhite + style NG_KnightWhite_base_color_output fill:#0C0, color:#FFF + NG_KnightWhite_base_color_output([base_color_output]) + style NG_KnightWhite_roughness_output fill:#0C0, color:#FFF + NG_KnightWhite_roughness_output([roughness_output]) + style NG_KnightWhite_normal_output fill:#0C0, color:#FFF + NG_KnightWhite_normal_output([normal_output]) + NG_KnightWhite_diffuse5[diffuse5:chess_set/knight_white_base_color.jpg] + NG_KnightWhite_roughness5[roughness5:chess_set/knight_white_roughness.jpg] + NG_KnightWhite_normal5[normal5:chess_set/knight_white_normal.jpg] + NG_KnightWhite_mtlxnormalmap7[mtlxnormalmap7] + end + subgraph NG_PawnBodyBlack + style NG_PawnBodyBlack_base_color_output fill:#0C0, color:#FFF + NG_PawnBodyBlack_base_color_output([base_color_output]) + style NG_PawnBodyBlack_metalness_output fill:#0C0, color:#FFF + NG_PawnBodyBlack_metalness_output([metalness_output]) + style NG_PawnBodyBlack_roughness_output fill:#0C0, color:#FFF + NG_PawnBodyBlack_roughness_output([roughness_output]) + style NG_PawnBodyBlack_normal_output fill:#0C0, color:#FFF + NG_PawnBodyBlack_normal_output([normal_output]) + NG_PawnBodyBlack_diffuse9[diffuse9:chess_set/pawn_black_base_color.jpg] + NG_PawnBodyBlack_metallic9[metallic9:chess_set/pawn_shared_metallic.jpg] + NG_PawnBodyBlack_roughness9[roughness9:chess_set/pawn_shared_roughness.jpg] + NG_PawnBodyBlack_normal9[normal9:chess_set/pawn_shared_normal.jpg] + NG_PawnBodyBlack_mtlxnormalmap13[mtlxnormalmap13] + end + subgraph NG_PawnBodyWhite + style NG_PawnBodyWhite_base_color_output fill:#0C0, color:#FFF + NG_PawnBodyWhite_base_color_output([base_color_output]) + style NG_PawnBodyWhite_metalness_output fill:#0C0, color:#FFF + NG_PawnBodyWhite_metalness_output([metalness_output]) + style NG_PawnBodyWhite_roughness_output fill:#0C0, color:#FFF + NG_PawnBodyWhite_roughness_output([roughness_output]) + style NG_PawnBodyWhite_normal_output fill:#0C0, color:#FFF + NG_PawnBodyWhite_normal_output([normal_output]) + NG_PawnBodyWhite_diffuse8[diffuse8:chess_set/pawn_white_base_color.jpg] + NG_PawnBodyWhite_metallic8[metallic8:chess_set/pawn_shared_metallic.jpg] + NG_PawnBodyWhite_roughness8[roughness8:chess_set/pawn_shared_roughness.jpg] + NG_PawnBodyWhite_normal8[normal8:chess_set/pawn_shared_normal.jpg] + NG_PawnBodyWhite_mtlxnormalmap10[mtlxnormalmap10] + end + subgraph NG_PawnTopBlack + style NG_PawnTopBlack_roughness_output fill:#0C0, color:#FFF + NG_PawnTopBlack_roughness_output([roughness_output]) + style NG_PawnTopBlack_normal_output fill:#0C0, color:#FFF + NG_PawnTopBlack_normal_output([normal_output]) + NG_PawnTopBlack_mtlximage19[mtlximage19:chess_set/pawn_shared_roughness.jpg] + NG_PawnTopBlack_mtlximage18[mtlximage18:chess_set/pawn_shared_normal.jpg] + NG_PawnTopBlack_mtlxnormalmap14[mtlxnormalmap14] + end + subgraph NG_PawnTopWhite + style NG_PawnTopWhite_roughness_output fill:#0C0, color:#FFF + NG_PawnTopWhite_roughness_output([roughness_output]) + style NG_PawnTopWhite_normal_output fill:#0C0, color:#FFF + NG_PawnTopWhite_normal_output([normal_output]) + NG_PawnTopWhite_mtlximage21[mtlximage21:chess_set/pawn_shared_roughness.jpg] + NG_PawnTopWhite_mtlximage20[mtlximage20:chess_set/pawn_shared_normal.jpg] + NG_PawnTopWhite_mtlxnormalmap15[mtlxnormalmap15] + end + subgraph NG_QueenBlack + style NG_QueenBlack_base_color_output fill:#0C0, color:#FFF + NG_QueenBlack_base_color_output([base_color_output]) + style NG_QueenBlack_metalness_output fill:#0C0, color:#FFF + NG_QueenBlack_metalness_output([metalness_output]) + style NG_QueenBlack_roughness_output fill:#0C0, color:#FFF + NG_QueenBlack_roughness_output([roughness_output]) + style NG_QueenBlack_subsurface_output fill:#0C0, color:#FFF + NG_QueenBlack_subsurface_output([subsurface_output]) + style NG_QueenBlack_normal_output fill:#0C0, color:#FFF + NG_QueenBlack_normal_output([normal_output]) + NG_QueenBlack_diffuse[diffuse:chess_set/queen_black_base_color.jpg] + NG_QueenBlack_metallic[metallic:chess_set/queen_shared_metallic.jpg] + NG_QueenBlack_roughness[roughness:chess_set/queen_black_roughness.jpg] + NG_QueenBlack_sss[sss:chess_set/queen_shared_scattering.jpg] + NG_QueenBlack_normal[normal:chess_set/queen_black_normal.jpg] + NG_QueenBlack_mtlxnormalmap2[mtlxnormalmap2] + end + subgraph NG_QueenWhite + style NG_QueenWhite_base_color_output fill:#0C0, color:#FFF + NG_QueenWhite_base_color_output([base_color_output]) + style NG_QueenWhite_metalness_output fill:#0C0, color:#FFF + NG_QueenWhite_metalness_output([metalness_output]) + style NG_QueenWhite_roughness_output fill:#0C0, color:#FFF + NG_QueenWhite_roughness_output([roughness_output]) + style NG_QueenWhite_subsurface_output fill:#0C0, color:#FFF + NG_QueenWhite_subsurface_output([subsurface_output]) + style NG_QueenWhite_normal_output fill:#0C0, color:#FFF + NG_QueenWhite_normal_output([normal_output]) + NG_QueenWhite_diffuse1[diffuse1:chess_set/queen_white_base_color.jpg] + NG_QueenWhite_metallic1[metallic1:chess_set/queen_shared_metallic.jpg] + NG_QueenWhite_roughness1[roughness1:chess_set/queen_white_roughness.jpg] + NG_QueenWhite_sss1[sss1:chess_set/queen_shared_scattering.jpg] + NG_QueenWhite_normal1[normal1:chess_set/queen_white_normal.jpg] + NG_QueenWhite_mtlxnormalmap3[mtlxnormalmap3] + end + NG_BishopBlack_normal2 --"in"--> NG_BishopBlack_mtlxnormalmap4 + NG_BishopBlack_diffuse2 --> NG_BishopBlack_base_color_output + NG_BishopBlack_metallic2 --> NG_BishopBlack_metalness_output + NG_BishopBlack_roughness2 --> NG_BishopBlack_roughness_output + NG_BishopBlack_mtlxnormalmap4 --> NG_BishopBlack_normal_output + NG_BishopBlack_base_color_output --"base_color"--> Bishop_B + NG_BishopBlack_metalness_output --"metalness"--> Bishop_B + NG_BishopBlack_roughness_output --"specular_roughness"--> Bishop_B + NG_BishopBlack_base_color_output --"subsurface_color"--> Bishop_B + NG_BishopBlack_base_color_output --"subsurface_radius"--> Bishop_B + NG_BishopBlack_normal_output --"normal"--> Bishop_B + Bishop_B --"surfaceshader"--> M_Bishop_B + NG_BishopWhite_normal3 --"in"--> NG_BishopWhite_mtlxnormalmap5 + NG_BishopWhite_diffuse3 --> NG_BishopWhite_base_color_output + NG_BishopWhite_metallic3 --> NG_BishopWhite_metalness_output + NG_BishopWhite_roughness3 --> NG_BishopWhite_roughness_output + NG_BishopWhite_mtlxnormalmap5 --> NG_BishopWhite_normal_output + NG_BishopWhite_base_color_output --"base_color"--> Bishop_W + NG_BishopWhite_metalness_output --"metalness"--> Bishop_W + NG_BishopWhite_roughness_output --"specular_roughness"--> Bishop_W + NG_BishopWhite_base_color_output --"subsurface_color"--> Bishop_W + NG_BishopWhite_base_color_output --"subsurface_radius"--> Bishop_W + NG_BishopWhite_normal_output --"normal"--> Bishop_W + Bishop_W --"surfaceshader"--> M_Bishop_W + NG_CastleBlack_normal6 --"in"--> NG_CastleBlack_mtlxnormalmap8 + NG_CastleBlack_diffuse6 --> NG_CastleBlack_base_color_output + NG_CastleBlack_metallic6 --> NG_CastleBlack_metalness_output + NG_CastleBlack_roughness6 --> NG_CastleBlack_roughness_output + NG_CastleBlack_mtlxnormalmap8 --> NG_CastleBlack_normal_output + NG_CastleBlack_base_color_output --"base_color"--> Castle_B + NG_CastleBlack_metalness_output --"metalness"--> Castle_B + NG_CastleBlack_roughness_output --"specular_roughness"--> Castle_B + NG_CastleBlack_base_color_output --"subsurface_color"--> Castle_B + NG_CastleBlack_base_color_output --"subsurface_radius"--> Castle_B + NG_CastleBlack_normal_output --"normal"--> Castle_B + Castle_B --"surfaceshader"--> M_Castle_B + NG_CastleWhite_normal7 --"in"--> NG_CastleWhite_mtlxnormalmap9 + NG_CastleWhite_diffuse7 --> NG_CastleWhite_base_color_output + NG_CastleWhite_metallic7 --> NG_CastleWhite_metalness_output + NG_CastleWhite_roughness7 --> NG_CastleWhite_roughness_output + NG_CastleWhite_mtlxnormalmap9 --> NG_CastleWhite_normal_output + NG_CastleWhite_base_color_output --"base_color"--> Castle_W + NG_CastleWhite_metalness_output --"metalness"--> Castle_W + NG_CastleWhite_roughness_output --"specular_roughness"--> Castle_W + NG_CastleWhite_base_color_output --"subsurface_color"--> Castle_W + NG_CastleWhite_base_color_output --"subsurface_radius"--> Castle_W + NG_CastleWhite_normal_output --"normal"--> Castle_W + Castle_W --"surfaceshader"--> M_Castle_W + NG_ChessBoard_mtlximage15 --"in"--> NG_ChessBoard_mtlxnormalmap12 + NG_ChessBoard_mtlximage13 --> NG_ChessBoard_base_color_output + NG_ChessBoard_mtlximage16 --> NG_ChessBoard_metalness_output + NG_ChessBoard_mtlximage17 --> NG_ChessBoard_roughness_output + NG_ChessBoard_mtlxnormalmap12 --> NG_ChessBoard_normal_output + NG_ChessBoard_base_color_output --"base_color"--> Chessboard + NG_ChessBoard_metalness_output --"metalness"--> Chessboard + NG_ChessBoard_roughness_output --"specular_roughness"--> Chessboard + NG_ChessBoard_base_color_output --"subsurface_color"--> Chessboard + NG_ChessBoard_base_color_output --"subsurface_radius"--> Chessboard + NG_ChessBoard_normal_output --"normal"--> Chessboard + Chessboard --"surfaceshader"--> M_Chessboard + NG_KingBlack_mtlximage6 --"in"--> NG_KingBlack_mtlxnormalmap1 + NG_KingBlack_mtlximage1 --> NG_KingBlack_base_color_output + NG_KingBlack_mtlximage2 --> NG_KingBlack_metalness_output + NG_KingBlack_mtlximage4 --> NG_KingBlack_roughness_output + NG_KingBlack_mtlximage3 --> NG_KingBlack_subsurface_output + NG_KingBlack_mtlxnormalmap1 --> NG_KingBlack_normal_output + NG_KingBlack_base_color_output --"base_color"--> King_B + NG_KingBlack_metalness_output --"metalness"--> King_B + NG_KingBlack_roughness_output --"specular_roughness"--> King_B + NG_KingBlack_subsurface_output --"subsurface"--> King_B + NG_KingBlack_base_color_output --"subsurface_color"--> King_B + NG_KingBlack_base_color_output --"subsurface_radius"--> King_B + NG_KingBlack_normal_output --"normal"--> King_B + King_B --"surfaceshader"--> M_King_B + NG_KingWhite_mtlximage9 --"in"--> NG_KingWhite_mtlxnormalmap11 + NG_KingWhite_mtlximage7 --> NG_KingWhite_base_color_output + NG_KingWhite_mtlximage10 --> NG_KingWhite_metalness_output + NG_KingWhite_mtlximage11 --> NG_KingWhite_roughness_output + NG_KingWhite_mtlximage8 --> NG_KingWhite_subsurface_output + NG_KingWhite_mtlxnormalmap11 --> NG_KingWhite_normal_output + NG_KingWhite_base_color_output --"base_color"--> King_W + NG_KingWhite_metalness_output --"metalness"--> King_W + NG_KingWhite_roughness_output --"specular_roughness"--> King_W + NG_KingWhite_subsurface_output --"subsurface"--> King_W + NG_KingWhite_base_color_output --"subsurface_color"--> King_W + NG_KingWhite_base_color_output --"subsurface_radius"--> King_W + NG_KingWhite_normal_output --"normal"--> King_W + King_W --"surfaceshader"--> M_King_W + NG_KnightBlack_normal4 --"in"--> NG_KnightBlack_mtlxnormalmap6 + NG_KnightBlack_diffuse4 --> NG_KnightBlack_base_color_output + NG_KnightBlack_roughness4 --> NG_KnightBlack_roughness_output + NG_KnightBlack_mtlxnormalmap6 --> NG_KnightBlack_normal_output + NG_KnightBlack_base_color_output --"base_color"--> Knight_B + NG_KnightBlack_roughness_output --"specular_roughness"--> Knight_B + NG_KnightBlack_base_color_output --"subsurface_color"--> Knight_B + NG_KnightBlack_base_color_output --"subsurface_radius"--> Knight_B + NG_KnightBlack_normal_output --"normal"--> Knight_B + Knight_B --"surfaceshader"--> M_Knight_B + NG_KnightWhite_normal5 --"in"--> NG_KnightWhite_mtlxnormalmap7 + NG_KnightWhite_diffuse5 --> NG_KnightWhite_base_color_output + NG_KnightWhite_roughness5 --> NG_KnightWhite_roughness_output + NG_KnightWhite_mtlxnormalmap7 --> NG_KnightWhite_normal_output + NG_KnightWhite_base_color_output --"base_color"--> Knight_W + NG_KnightWhite_roughness_output --"specular_roughness"--> Knight_W + NG_KnightWhite_base_color_output --"subsurface_color"--> Knight_W + NG_KnightWhite_base_color_output --"subsurface_radius"--> Knight_W + NG_KnightWhite_normal_output --"normal"--> Knight_W + Knight_W --"surfaceshader"--> M_Knight_W + NG_PawnBodyBlack_normal9 --"in"--> NG_PawnBodyBlack_mtlxnormalmap13 + NG_PawnBodyBlack_diffuse9 --> NG_PawnBodyBlack_base_color_output + NG_PawnBodyBlack_metallic9 --> NG_PawnBodyBlack_metalness_output + NG_PawnBodyBlack_roughness9 --> NG_PawnBodyBlack_roughness_output + NG_PawnBodyBlack_mtlxnormalmap13 --> NG_PawnBodyBlack_normal_output + NG_PawnBodyBlack_base_color_output --"base_color"--> Pawn_Body_B + NG_PawnBodyBlack_metalness_output --"metalness"--> Pawn_Body_B + NG_PawnBodyBlack_roughness_output --"specular_roughness"--> Pawn_Body_B + NG_PawnBodyBlack_base_color_output --"subsurface_color"--> Pawn_Body_B + NG_PawnBodyBlack_base_color_output --"subsurface_radius"--> Pawn_Body_B + NG_PawnBodyBlack_normal_output --"normal"--> Pawn_Body_B + Pawn_Body_B --"surfaceshader"--> M_Pawn_Body_B + NG_PawnBodyWhite_normal8 --"in"--> NG_PawnBodyWhite_mtlxnormalmap10 + NG_PawnBodyWhite_diffuse8 --> NG_PawnBodyWhite_base_color_output + NG_PawnBodyWhite_metallic8 --> NG_PawnBodyWhite_metalness_output + NG_PawnBodyWhite_roughness8 --> NG_PawnBodyWhite_roughness_output + NG_PawnBodyWhite_mtlxnormalmap10 --> NG_PawnBodyWhite_normal_output + NG_PawnBodyWhite_base_color_output --"base_color"--> Pawn_Body_W + NG_PawnBodyWhite_metalness_output --"metalness"--> Pawn_Body_W + NG_PawnBodyWhite_roughness_output --"specular_roughness"--> Pawn_Body_W + NG_PawnBodyWhite_base_color_output --"subsurface_color"--> Pawn_Body_W + NG_PawnBodyWhite_base_color_output --"subsurface_radius"--> Pawn_Body_W + NG_PawnBodyWhite_normal_output --"normal"--> Pawn_Body_W + Pawn_Body_W --"surfaceshader"--> M_Pawn_Body_W + NG_PawnTopBlack_mtlximage18 --"in"--> NG_PawnTopBlack_mtlxnormalmap14 + NG_PawnTopBlack_mtlximage19 --> NG_PawnTopBlack_roughness_output + NG_PawnTopBlack_mtlxnormalmap14 --> NG_PawnTopBlack_normal_output + NG_PawnTopBlack_roughness_output --"specular_roughness"--> Pawn_Top_B + NG_PawnTopBlack_normal_output --"normal"--> Pawn_Top_B + Pawn_Top_B --"surfaceshader"--> M_Pawn_Top_B + NG_PawnTopWhite_mtlximage20 --"in"--> NG_PawnTopWhite_mtlxnormalmap15 + NG_PawnTopWhite_mtlximage21 --> NG_PawnTopWhite_roughness_output + NG_PawnTopWhite_mtlxnormalmap15 --> NG_PawnTopWhite_normal_output + NG_PawnTopWhite_roughness_output --"specular_roughness"--> Pawn_Top_W + NG_PawnTopWhite_normal_output --"normal"--> Pawn_Top_W + Pawn_Top_W --"surfaceshader"--> M_Pawn_Top_W + NG_QueenBlack_normal --"in"--> NG_QueenBlack_mtlxnormalmap2 + NG_QueenBlack_diffuse --> NG_QueenBlack_base_color_output + NG_QueenBlack_metallic --> NG_QueenBlack_metalness_output + NG_QueenBlack_roughness --> NG_QueenBlack_roughness_output + NG_QueenBlack_sss --> NG_QueenBlack_subsurface_output + NG_QueenBlack_mtlxnormalmap2 --> NG_QueenBlack_normal_output + NG_QueenBlack_base_color_output --"base_color"--> Queen_B + NG_QueenBlack_metalness_output --"metalness"--> Queen_B + NG_QueenBlack_roughness_output --"specular_roughness"--> Queen_B + NG_QueenBlack_subsurface_output --"subsurface"--> Queen_B + NG_QueenBlack_base_color_output --"subsurface_color"--> Queen_B + NG_QueenBlack_base_color_output --"subsurface_radius"--> Queen_B + NG_QueenBlack_normal_output --"normal"--> Queen_B + Queen_B --"surfaceshader"--> M_Queen_B + NG_QueenWhite_normal1 --"in"--> NG_QueenWhite_mtlxnormalmap3 + NG_QueenWhite_diffuse1 --> NG_QueenWhite_base_color_output + NG_QueenWhite_metallic1 --> NG_QueenWhite_metalness_output + NG_QueenWhite_roughness1 --> NG_QueenWhite_roughness_output + NG_QueenWhite_sss1 --> NG_QueenWhite_subsurface_output + NG_QueenWhite_mtlxnormalmap3 --> NG_QueenWhite_normal_output + NG_QueenWhite_base_color_output --"base_color"--> Queen_W + NG_QueenWhite_metalness_output --"metalness"--> Queen_W + NG_QueenWhite_roughness_output --"specular_roughness"--> Queen_W + NG_QueenWhite_subsurface_output --"subsurface"--> Queen_W + NG_QueenWhite_base_color_output --"subsurface_color"--> Queen_W + NG_QueenWhite_base_color_output --"subsurface_radius"--> Queen_W + NG_QueenWhite_normal_output --"normal"--> Queen_W + Queen_W --"surfaceshader"--> M_Queen_W +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chess_set_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chess_set_connections.json new file mode 100644 index 00000000..ad9f0ba7 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chess_set_connections.json @@ -0,0 +1,2210 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_chess_set.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "NG_BishopBlack": [ + [ + "NG_BishopBlack/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_BishopBlack/metalness_output", + "output", + "float", + "" + ], + [ + "NG_BishopBlack/roughness_output", + "output", + "float", + "" + ], + [ + "NG_BishopBlack/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_BishopBlack/diffuse2", + "image", + "color3", + "chess_set/bishop_black_base_color.jpg" + ], + [ + "NG_BishopBlack/metallic2", + "image", + "float", + "chess_set/bishop_shared_metallic.jpg" + ], + [ + "NG_BishopBlack/roughness2", + "image", + "float", + "chess_set/bishop_black_roughness.jpg" + ], + [ + "NG_BishopBlack/normal2", + "image", + "vector3", + "chess_set/bishop_black_normal.jpg" + ], + [ + "NG_BishopBlack/mtlxnormalmap4", + "normalmap", + "vector3", + "" + ] + ], + "": [ + [ + "Bishop_B", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Bishop_B", + "surfacematerial", + "material", + "" + ], + [ + "Bishop_W", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Bishop_W", + "surfacematerial", + "material", + "" + ], + [ + "Castle_B", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Castle_B", + "surfacematerial", + "material", + "" + ], + [ + "Castle_W", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Castle_W", + "surfacematerial", + "material", + "" + ], + [ + "Chessboard", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Chessboard", + "surfacematerial", + "material", + "" + ], + [ + "King_B", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_King_B", + "surfacematerial", + "material", + "" + ], + [ + "King_W", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_King_W", + "surfacematerial", + "material", + "" + ], + [ + "Knight_B", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Knight_B", + "surfacematerial", + "material", + "" + ], + [ + "Knight_W", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Knight_W", + "surfacematerial", + "material", + "" + ], + [ + "Pawn_Body_B", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Pawn_Body_B", + "surfacematerial", + "material", + "" + ], + [ + "Pawn_Body_W", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Pawn_Body_W", + "surfacematerial", + "material", + "" + ], + [ + "Pawn_Top_B", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Pawn_Top_B", + "surfacematerial", + "material", + "" + ], + [ + "Pawn_Top_W", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Pawn_Top_W", + "surfacematerial", + "material", + "" + ], + [ + "Queen_B", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Queen_B", + "surfacematerial", + "material", + "" + ], + [ + "Queen_W", + "standard_surface", + "surfaceshader", + "" + ], + [ + "M_Queen_W", + "surfacematerial", + "material", + "" + ] + ], + "NG_BishopWhite": [ + [ + "NG_BishopWhite/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_BishopWhite/metalness_output", + "output", + "float", + "" + ], + [ + "NG_BishopWhite/roughness_output", + "output", + "float", + "" + ], + [ + "NG_BishopWhite/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_BishopWhite/diffuse3", + "image", + "color3", + "chess_set/bishop_white_base_color.jpg" + ], + [ + "NG_BishopWhite/metallic3", + "image", + "float", + "chess_set/bishop_shared_metallic.jpg" + ], + [ + "NG_BishopWhite/roughness3", + "image", + "float", + "chess_set/bishop_white_roughness.jpg" + ], + [ + "NG_BishopWhite/normal3", + "image", + "vector3", + "chess_set/bishop_white_normal.jpg" + ], + [ + "NG_BishopWhite/mtlxnormalmap5", + "normalmap", + "vector3", + "" + ] + ], + "NG_CastleBlack": [ + [ + "NG_CastleBlack/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_CastleBlack/metalness_output", + "output", + "float", + "" + ], + [ + "NG_CastleBlack/roughness_output", + "output", + "float", + "" + ], + [ + "NG_CastleBlack/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_CastleBlack/diffuse6", + "image", + "color3", + "chess_set/castle_black_base_color.jpg" + ], + [ + "NG_CastleBlack/metallic6", + "image", + "float", + "chess_set/castle_shared_metallic.jpg" + ], + [ + "NG_CastleBlack/roughness6", + "image", + "float", + "chess_set/castle_shared_roughness.jpg" + ], + [ + "NG_CastleBlack/normal6", + "image", + "vector3", + "chess_set/castle_shared_normal.jpg" + ], + [ + "NG_CastleBlack/mtlxnormalmap8", + "normalmap", + "vector3", + "" + ] + ], + "NG_CastleWhite": [ + [ + "NG_CastleWhite/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_CastleWhite/metalness_output", + "output", + "float", + "" + ], + [ + "NG_CastleWhite/roughness_output", + "output", + "float", + "" + ], + [ + "NG_CastleWhite/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_CastleWhite/diffuse7", + "image", + "color3", + "chess_set/castle_white_base_color.jpg" + ], + [ + "NG_CastleWhite/metallic7", + "image", + "float", + "chess_set/castle_shared_metallic.jpg" + ], + [ + "NG_CastleWhite/roughness7", + "image", + "float", + "chess_set/castle_shared_roughness.jpg" + ], + [ + "NG_CastleWhite/normal7", + "image", + "vector3", + "chess_set/castle_shared_normal.jpg" + ], + [ + "NG_CastleWhite/mtlxnormalmap9", + "normalmap", + "vector3", + "" + ] + ], + "NG_ChessBoard": [ + [ + "NG_ChessBoard/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_ChessBoard/metalness_output", + "output", + "float", + "" + ], + [ + "NG_ChessBoard/roughness_output", + "output", + "float", + "" + ], + [ + "NG_ChessBoard/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_ChessBoard/mtlximage13", + "image", + "color3", + "chess_set/chessboard_base_color.jpg" + ], + [ + "NG_ChessBoard/mtlximage16", + "image", + "float", + "chess_set/chessboard_metallic.jpg" + ], + [ + "NG_ChessBoard/mtlximage17", + "image", + "float", + "chess_set/chessboard_roughness.jpg" + ], + [ + "NG_ChessBoard/mtlximage15", + "image", + "vector3", + "chess_set/chessboard_normal.jpg" + ], + [ + "NG_ChessBoard/mtlxnormalmap12", + "normalmap", + "vector3", + "" + ] + ], + "NG_KingBlack": [ + [ + "NG_KingBlack/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_KingBlack/metalness_output", + "output", + "float", + "" + ], + [ + "NG_KingBlack/roughness_output", + "output", + "float", + "" + ], + [ + "NG_KingBlack/subsurface_output", + "output", + "float", + "" + ], + [ + "NG_KingBlack/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_KingBlack/mtlximage1", + "image", + "color3", + "chess_set/king_black_base_color.jpg" + ], + [ + "NG_KingBlack/mtlximage2", + "image", + "float", + "chess_set/king_shared_metallic.jpg" + ], + [ + "NG_KingBlack/mtlximage4", + "image", + "float", + "chess_set/king_black_roughness.jpg" + ], + [ + "NG_KingBlack/mtlximage3", + "image", + "float", + "chess_set/king_shared_scattering.jpg" + ], + [ + "NG_KingBlack/mtlximage6", + "image", + "vector3", + "chess_set/king_black_normal.jpg" + ], + [ + "NG_KingBlack/mtlxnormalmap1", + "normalmap", + "vector3", + "" + ] + ], + "NG_KingWhite": [ + [ + "NG_KingWhite/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_KingWhite/metalness_output", + "output", + "float", + "" + ], + [ + "NG_KingWhite/roughness_output", + "output", + "float", + "" + ], + [ + "NG_KingWhite/subsurface_output", + "output", + "float", + "" + ], + [ + "NG_KingWhite/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_KingWhite/mtlximage7", + "image", + "color3", + "chess_set/king_white_base_color.jpg" + ], + [ + "NG_KingWhite/mtlximage10", + "image", + "float", + "chess_set/king_shared_metallic.jpg" + ], + [ + "NG_KingWhite/mtlximage11", + "image", + "float", + "chess_set/king_white_roughness.jpg" + ], + [ + "NG_KingWhite/mtlximage8", + "image", + "float", + "chess_set/king_shared_scattering.jpg" + ], + [ + "NG_KingWhite/mtlximage9", + "image", + "vector3", + "chess_set/king_white_normal.jpg" + ], + [ + "NG_KingWhite/mtlxnormalmap11", + "normalmap", + "vector3", + "" + ] + ], + "NG_KnightBlack": [ + [ + "NG_KnightBlack/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_KnightBlack/roughness_output", + "output", + "float", + "" + ], + [ + "NG_KnightBlack/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_KnightBlack/diffuse4", + "image", + "color3", + "chess_set/knight_black_base_color.jpg" + ], + [ + "NG_KnightBlack/roughness4", + "image", + "float", + "chess_set/knight_black_roughness.jpg" + ], + [ + "NG_KnightBlack/normal4", + "image", + "vector3", + "chess_set/knight_black_normal.jpg" + ], + [ + "NG_KnightBlack/mtlxnormalmap6", + "normalmap", + "vector3", + "" + ] + ], + "NG_KnightWhite": [ + [ + "NG_KnightWhite/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_KnightWhite/roughness_output", + "output", + "float", + "" + ], + [ + "NG_KnightWhite/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_KnightWhite/diffuse5", + "image", + "color3", + "chess_set/knight_white_base_color.jpg" + ], + [ + "NG_KnightWhite/roughness5", + "image", + "float", + "chess_set/knight_white_roughness.jpg" + ], + [ + "NG_KnightWhite/normal5", + "image", + "vector3", + "chess_set/knight_white_normal.jpg" + ], + [ + "NG_KnightWhite/mtlxnormalmap7", + "normalmap", + "vector3", + "" + ] + ], + "NG_PawnBodyBlack": [ + [ + "NG_PawnBodyBlack/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_PawnBodyBlack/metalness_output", + "output", + "float", + "" + ], + [ + "NG_PawnBodyBlack/roughness_output", + "output", + "float", + "" + ], + [ + "NG_PawnBodyBlack/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_PawnBodyBlack/diffuse9", + "image", + "color3", + "chess_set/pawn_black_base_color.jpg" + ], + [ + "NG_PawnBodyBlack/metallic9", + "image", + "float", + "chess_set/pawn_shared_metallic.jpg" + ], + [ + "NG_PawnBodyBlack/roughness9", + "image", + "float", + "chess_set/pawn_shared_roughness.jpg" + ], + [ + "NG_PawnBodyBlack/normal9", + "image", + "vector3", + "chess_set/pawn_shared_normal.jpg" + ], + [ + "NG_PawnBodyBlack/mtlxnormalmap13", + "normalmap", + "vector3", + "" + ] + ], + "NG_PawnBodyWhite": [ + [ + "NG_PawnBodyWhite/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_PawnBodyWhite/metalness_output", + "output", + "float", + "" + ], + [ + "NG_PawnBodyWhite/roughness_output", + "output", + "float", + "" + ], + [ + "NG_PawnBodyWhite/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_PawnBodyWhite/diffuse8", + "image", + "color3", + "chess_set/pawn_white_base_color.jpg" + ], + [ + "NG_PawnBodyWhite/metallic8", + "image", + "float", + "chess_set/pawn_shared_metallic.jpg" + ], + [ + "NG_PawnBodyWhite/roughness8", + "image", + "float", + "chess_set/pawn_shared_roughness.jpg" + ], + [ + "NG_PawnBodyWhite/normal8", + "image", + "vector3", + "chess_set/pawn_shared_normal.jpg" + ], + [ + "NG_PawnBodyWhite/mtlxnormalmap10", + "normalmap", + "vector3", + "" + ] + ], + "NG_PawnTopBlack": [ + [ + "NG_PawnTopBlack/roughness_output", + "output", + "float", + "" + ], + [ + "NG_PawnTopBlack/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_PawnTopBlack/mtlximage19", + "image", + "float", + "chess_set/pawn_shared_roughness.jpg" + ], + [ + "NG_PawnTopBlack/mtlximage18", + "image", + "vector3", + "chess_set/pawn_shared_normal.jpg" + ], + [ + "NG_PawnTopBlack/mtlxnormalmap14", + "normalmap", + "vector3", + "" + ] + ], + "NG_PawnTopWhite": [ + [ + "NG_PawnTopWhite/roughness_output", + "output", + "float", + "" + ], + [ + "NG_PawnTopWhite/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_PawnTopWhite/mtlximage21", + "image", + "float", + "chess_set/pawn_shared_roughness.jpg" + ], + [ + "NG_PawnTopWhite/mtlximage20", + "image", + "vector3", + "chess_set/pawn_shared_normal.jpg" + ], + [ + "NG_PawnTopWhite/mtlxnormalmap15", + "normalmap", + "vector3", + "" + ] + ], + "NG_QueenBlack": [ + [ + "NG_QueenBlack/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_QueenBlack/metalness_output", + "output", + "float", + "" + ], + [ + "NG_QueenBlack/roughness_output", + "output", + "float", + "" + ], + [ + "NG_QueenBlack/subsurface_output", + "output", + "float", + "" + ], + [ + "NG_QueenBlack/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_QueenBlack/diffuse", + "image", + "color3", + "chess_set/queen_black_base_color.jpg" + ], + [ + "NG_QueenBlack/metallic", + "image", + "float", + "chess_set/queen_shared_metallic.jpg" + ], + [ + "NG_QueenBlack/roughness", + "image", + "float", + "chess_set/queen_black_roughness.jpg" + ], + [ + "NG_QueenBlack/sss", + "image", + "float", + "chess_set/queen_shared_scattering.jpg" + ], + [ + "NG_QueenBlack/normal", + "image", + "vector3", + "chess_set/queen_black_normal.jpg" + ], + [ + "NG_QueenBlack/mtlxnormalmap2", + "normalmap", + "vector3", + "" + ] + ], + "NG_QueenWhite": [ + [ + "NG_QueenWhite/base_color_output", + "output", + "color3", + "" + ], + [ + "NG_QueenWhite/metalness_output", + "output", + "float", + "" + ], + [ + "NG_QueenWhite/roughness_output", + "output", + "float", + "" + ], + [ + "NG_QueenWhite/subsurface_output", + "output", + "float", + "" + ], + [ + "NG_QueenWhite/normal_output", + "output", + "vector3", + "" + ], + [ + "NG_QueenWhite/diffuse1", + "image", + "color3", + "chess_set/queen_white_base_color.jpg" + ], + [ + "NG_QueenWhite/metallic1", + "image", + "float", + "chess_set/queen_shared_metallic.jpg" + ], + [ + "NG_QueenWhite/roughness1", + "image", + "float", + "chess_set/queen_white_roughness.jpg" + ], + [ + "NG_QueenWhite/sss1", + "image", + "float", + "chess_set/queen_shared_scattering.jpg" + ], + [ + "NG_QueenWhite/normal1", + "image", + "vector3", + "chess_set/queen_white_normal.jpg" + ], + [ + "NG_QueenWhite/mtlxnormalmap3", + "normalmap", + "vector3", + "" + ] + ] + }, + "connections": [ + [ + "NG_BishopBlack/normal2", + "", + "NG_BishopBlack/mtlxnormalmap4", + "in", + "nodename" + ], + [ + "NG_BishopBlack/diffuse2", + "", + "NG_BishopBlack/base_color_output", + "", + "nodename" + ], + [ + "NG_BishopBlack/metallic2", + "", + "NG_BishopBlack/metalness_output", + "", + "nodename" + ], + [ + "NG_BishopBlack/roughness2", + "", + "NG_BishopBlack/roughness_output", + "", + "nodename" + ], + [ + "NG_BishopBlack/mtlxnormalmap4", + "", + "NG_BishopBlack/normal_output", + "", + "nodename" + ], + [ + "NG_BishopBlack/base_color_output", + "", + "Bishop_B", + "base_color", + "nodename" + ], + [ + "NG_BishopBlack/metalness_output", + "", + "Bishop_B", + "metalness", + "nodename" + ], + [ + "NG_BishopBlack/roughness_output", + "", + "Bishop_B", + "specular_roughness", + "nodename" + ], + [ + "NG_BishopBlack/base_color_output", + "", + "Bishop_B", + "subsurface_color", + "nodename" + ], + [ + "NG_BishopBlack/base_color_output", + "", + "Bishop_B", + "subsurface_radius", + "nodename" + ], + [ + "NG_BishopBlack/normal_output", + "", + "Bishop_B", + "normal", + "nodename" + ], + [ + "Bishop_B", + "", + "M_Bishop_B", + "surfaceshader", + "nodename" + ], + [ + "NG_BishopWhite/normal3", + "", + "NG_BishopWhite/mtlxnormalmap5", + "in", + "nodename" + ], + [ + "NG_BishopWhite/diffuse3", + "", + "NG_BishopWhite/base_color_output", + "", + "nodename" + ], + [ + "NG_BishopWhite/metallic3", + "", + "NG_BishopWhite/metalness_output", + "", + "nodename" + ], + [ + "NG_BishopWhite/roughness3", + "", + "NG_BishopWhite/roughness_output", + "", + "nodename" + ], + [ + "NG_BishopWhite/mtlxnormalmap5", + "", + "NG_BishopWhite/normal_output", + "", + "nodename" + ], + [ + "NG_BishopWhite/base_color_output", + "", + "Bishop_W", + "base_color", + "nodename" + ], + [ + "NG_BishopWhite/metalness_output", + "", + "Bishop_W", + "metalness", + "nodename" + ], + [ + "NG_BishopWhite/roughness_output", + "", + "Bishop_W", + "specular_roughness", + "nodename" + ], + [ + "NG_BishopWhite/base_color_output", + "", + "Bishop_W", + "subsurface_color", + "nodename" + ], + [ + "NG_BishopWhite/base_color_output", + "", + "Bishop_W", + "subsurface_radius", + "nodename" + ], + [ + "NG_BishopWhite/normal_output", + "", + "Bishop_W", + "normal", + "nodename" + ], + [ + "Bishop_W", + "", + "M_Bishop_W", + "surfaceshader", + "nodename" + ], + [ + "NG_CastleBlack/normal6", + "", + "NG_CastleBlack/mtlxnormalmap8", + "in", + "nodename" + ], + [ + "NG_CastleBlack/diffuse6", + "", + "NG_CastleBlack/base_color_output", + "", + "nodename" + ], + [ + "NG_CastleBlack/metallic6", + "", + "NG_CastleBlack/metalness_output", + "", + "nodename" + ], + [ + "NG_CastleBlack/roughness6", + "", + "NG_CastleBlack/roughness_output", + "", + "nodename" + ], + [ + "NG_CastleBlack/mtlxnormalmap8", + "", + "NG_CastleBlack/normal_output", + "", + "nodename" + ], + [ + "NG_CastleBlack/base_color_output", + "", + "Castle_B", + "base_color", + "nodename" + ], + [ + "NG_CastleBlack/metalness_output", + "", + "Castle_B", + "metalness", + "nodename" + ], + [ + "NG_CastleBlack/roughness_output", + "", + "Castle_B", + "specular_roughness", + "nodename" + ], + [ + "NG_CastleBlack/base_color_output", + "", + "Castle_B", + "subsurface_color", + "nodename" + ], + [ + "NG_CastleBlack/base_color_output", + "", + "Castle_B", + "subsurface_radius", + "nodename" + ], + [ + "NG_CastleBlack/normal_output", + "", + "Castle_B", + "normal", + "nodename" + ], + [ + "Castle_B", + "", + "M_Castle_B", + "surfaceshader", + "nodename" + ], + [ + "NG_CastleWhite/normal7", + "", + "NG_CastleWhite/mtlxnormalmap9", + "in", + "nodename" + ], + [ + "NG_CastleWhite/diffuse7", + "", + "NG_CastleWhite/base_color_output", + "", + "nodename" + ], + [ + "NG_CastleWhite/metallic7", + "", + "NG_CastleWhite/metalness_output", + "", + "nodename" + ], + [ + "NG_CastleWhite/roughness7", + "", + "NG_CastleWhite/roughness_output", + "", + "nodename" + ], + [ + "NG_CastleWhite/mtlxnormalmap9", + "", + "NG_CastleWhite/normal_output", + "", + "nodename" + ], + [ + "NG_CastleWhite/base_color_output", + "", + "Castle_W", + "base_color", + "nodename" + ], + [ + "NG_CastleWhite/metalness_output", + "", + "Castle_W", + "metalness", + "nodename" + ], + [ + "NG_CastleWhite/roughness_output", + "", + "Castle_W", + "specular_roughness", + "nodename" + ], + [ + "NG_CastleWhite/base_color_output", + "", + "Castle_W", + "subsurface_color", + "nodename" + ], + [ + "NG_CastleWhite/base_color_output", + "", + "Castle_W", + "subsurface_radius", + "nodename" + ], + [ + "NG_CastleWhite/normal_output", + "", + "Castle_W", + "normal", + "nodename" + ], + [ + "Castle_W", + "", + "M_Castle_W", + "surfaceshader", + "nodename" + ], + [ + "NG_ChessBoard/mtlximage15", + "", + "NG_ChessBoard/mtlxnormalmap12", + "in", + "nodename" + ], + [ + "NG_ChessBoard/mtlximage13", + "", + "NG_ChessBoard/base_color_output", + "", + "nodename" + ], + [ + "NG_ChessBoard/mtlximage16", + "", + "NG_ChessBoard/metalness_output", + "", + "nodename" + ], + [ + "NG_ChessBoard/mtlximage17", + "", + "NG_ChessBoard/roughness_output", + "", + "nodename" + ], + [ + "NG_ChessBoard/mtlxnormalmap12", + "", + "NG_ChessBoard/normal_output", + "", + "nodename" + ], + [ + "NG_ChessBoard/base_color_output", + "", + "Chessboard", + "base_color", + "nodename" + ], + [ + "NG_ChessBoard/metalness_output", + "", + "Chessboard", + "metalness", + "nodename" + ], + [ + "NG_ChessBoard/roughness_output", + "", + "Chessboard", + "specular_roughness", + "nodename" + ], + [ + "NG_ChessBoard/base_color_output", + "", + "Chessboard", + "subsurface_color", + "nodename" + ], + [ + "NG_ChessBoard/base_color_output", + "", + "Chessboard", + "subsurface_radius", + "nodename" + ], + [ + "NG_ChessBoard/normal_output", + "", + "Chessboard", + "normal", + "nodename" + ], + [ + "Chessboard", + "", + "M_Chessboard", + "surfaceshader", + "nodename" + ], + [ + "NG_KingBlack/mtlximage6", + "", + "NG_KingBlack/mtlxnormalmap1", + "in", + "nodename" + ], + [ + "NG_KingBlack/mtlximage1", + "", + "NG_KingBlack/base_color_output", + "", + "nodename" + ], + [ + "NG_KingBlack/mtlximage2", + "", + "NG_KingBlack/metalness_output", + "", + "nodename" + ], + [ + "NG_KingBlack/mtlximage4", + "", + "NG_KingBlack/roughness_output", + "", + "nodename" + ], + [ + "NG_KingBlack/mtlximage3", + "", + "NG_KingBlack/subsurface_output", + "", + "nodename" + ], + [ + "NG_KingBlack/mtlxnormalmap1", + "", + "NG_KingBlack/normal_output", + "", + "nodename" + ], + [ + "NG_KingBlack/base_color_output", + "", + "King_B", + "base_color", + "nodename" + ], + [ + "NG_KingBlack/metalness_output", + "", + "King_B", + "metalness", + "nodename" + ], + [ + "NG_KingBlack/roughness_output", + "", + "King_B", + "specular_roughness", + "nodename" + ], + [ + "NG_KingBlack/subsurface_output", + "", + "King_B", + "subsurface", + "nodename" + ], + [ + "NG_KingBlack/base_color_output", + "", + "King_B", + "subsurface_color", + "nodename" + ], + [ + "NG_KingBlack/base_color_output", + "", + "King_B", + "subsurface_radius", + "nodename" + ], + [ + "NG_KingBlack/normal_output", + "", + "King_B", + "normal", + "nodename" + ], + [ + "King_B", + "", + "M_King_B", + "surfaceshader", + "nodename" + ], + [ + "NG_KingWhite/mtlximage9", + "", + "NG_KingWhite/mtlxnormalmap11", + "in", + "nodename" + ], + [ + "NG_KingWhite/mtlximage7", + "", + "NG_KingWhite/base_color_output", + "", + "nodename" + ], + [ + "NG_KingWhite/mtlximage10", + "", + "NG_KingWhite/metalness_output", + "", + "nodename" + ], + [ + "NG_KingWhite/mtlximage11", + "", + "NG_KingWhite/roughness_output", + "", + "nodename" + ], + [ + "NG_KingWhite/mtlximage8", + "", + "NG_KingWhite/subsurface_output", + "", + "nodename" + ], + [ + "NG_KingWhite/mtlxnormalmap11", + "", + "NG_KingWhite/normal_output", + "", + "nodename" + ], + [ + "NG_KingWhite/base_color_output", + "", + "King_W", + "base_color", + "nodename" + ], + [ + "NG_KingWhite/metalness_output", + "", + "King_W", + "metalness", + "nodename" + ], + [ + "NG_KingWhite/roughness_output", + "", + "King_W", + "specular_roughness", + "nodename" + ], + [ + "NG_KingWhite/subsurface_output", + "", + "King_W", + "subsurface", + "nodename" + ], + [ + "NG_KingWhite/base_color_output", + "", + "King_W", + "subsurface_color", + "nodename" + ], + [ + "NG_KingWhite/base_color_output", + "", + "King_W", + "subsurface_radius", + "nodename" + ], + [ + "NG_KingWhite/normal_output", + "", + "King_W", + "normal", + "nodename" + ], + [ + "King_W", + "", + "M_King_W", + "surfaceshader", + "nodename" + ], + [ + "NG_KnightBlack/normal4", + "", + "NG_KnightBlack/mtlxnormalmap6", + "in", + "nodename" + ], + [ + "NG_KnightBlack/diffuse4", + "", + "NG_KnightBlack/base_color_output", + "", + "nodename" + ], + [ + "NG_KnightBlack/roughness4", + "", + "NG_KnightBlack/roughness_output", + "", + "nodename" + ], + [ + "NG_KnightBlack/mtlxnormalmap6", + "", + "NG_KnightBlack/normal_output", + "", + "nodename" + ], + [ + "NG_KnightBlack/base_color_output", + "", + "Knight_B", + "base_color", + "nodename" + ], + [ + "NG_KnightBlack/roughness_output", + "", + "Knight_B", + "specular_roughness", + "nodename" + ], + [ + "NG_KnightBlack/base_color_output", + "", + "Knight_B", + "subsurface_color", + "nodename" + ], + [ + "NG_KnightBlack/base_color_output", + "", + "Knight_B", + "subsurface_radius", + "nodename" + ], + [ + "NG_KnightBlack/normal_output", + "", + "Knight_B", + "normal", + "nodename" + ], + [ + "Knight_B", + "", + "M_Knight_B", + "surfaceshader", + "nodename" + ], + [ + "NG_KnightWhite/normal5", + "", + "NG_KnightWhite/mtlxnormalmap7", + "in", + "nodename" + ], + [ + "NG_KnightWhite/diffuse5", + "", + "NG_KnightWhite/base_color_output", + "", + "nodename" + ], + [ + "NG_KnightWhite/roughness5", + "", + "NG_KnightWhite/roughness_output", + "", + "nodename" + ], + [ + "NG_KnightWhite/mtlxnormalmap7", + "", + "NG_KnightWhite/normal_output", + "", + "nodename" + ], + [ + "NG_KnightWhite/base_color_output", + "", + "Knight_W", + "base_color", + "nodename" + ], + [ + "NG_KnightWhite/roughness_output", + "", + "Knight_W", + "specular_roughness", + "nodename" + ], + [ + "NG_KnightWhite/base_color_output", + "", + "Knight_W", + "subsurface_color", + "nodename" + ], + [ + "NG_KnightWhite/base_color_output", + "", + "Knight_W", + "subsurface_radius", + "nodename" + ], + [ + "NG_KnightWhite/normal_output", + "", + "Knight_W", + "normal", + "nodename" + ], + [ + "Knight_W", + "", + "M_Knight_W", + "surfaceshader", + "nodename" + ], + [ + "NG_PawnBodyBlack/normal9", + "", + "NG_PawnBodyBlack/mtlxnormalmap13", + "in", + "nodename" + ], + [ + "NG_PawnBodyBlack/diffuse9", + "", + "NG_PawnBodyBlack/base_color_output", + "", + "nodename" + ], + [ + "NG_PawnBodyBlack/metallic9", + "", + "NG_PawnBodyBlack/metalness_output", + "", + "nodename" + ], + [ + "NG_PawnBodyBlack/roughness9", + "", + "NG_PawnBodyBlack/roughness_output", + "", + "nodename" + ], + [ + "NG_PawnBodyBlack/mtlxnormalmap13", + "", + "NG_PawnBodyBlack/normal_output", + "", + "nodename" + ], + [ + "NG_PawnBodyBlack/base_color_output", + "", + "Pawn_Body_B", + "base_color", + "nodename" + ], + [ + "NG_PawnBodyBlack/metalness_output", + "", + "Pawn_Body_B", + "metalness", + "nodename" + ], + [ + "NG_PawnBodyBlack/roughness_output", + "", + "Pawn_Body_B", + "specular_roughness", + "nodename" + ], + [ + "NG_PawnBodyBlack/base_color_output", + "", + "Pawn_Body_B", + "subsurface_color", + "nodename" + ], + [ + "NG_PawnBodyBlack/base_color_output", + "", + "Pawn_Body_B", + "subsurface_radius", + "nodename" + ], + [ + "NG_PawnBodyBlack/normal_output", + "", + "Pawn_Body_B", + "normal", + "nodename" + ], + [ + "Pawn_Body_B", + "", + "M_Pawn_Body_B", + "surfaceshader", + "nodename" + ], + [ + "NG_PawnBodyWhite/normal8", + "", + "NG_PawnBodyWhite/mtlxnormalmap10", + "in", + "nodename" + ], + [ + "NG_PawnBodyWhite/diffuse8", + "", + "NG_PawnBodyWhite/base_color_output", + "", + "nodename" + ], + [ + "NG_PawnBodyWhite/metallic8", + "", + "NG_PawnBodyWhite/metalness_output", + "", + "nodename" + ], + [ + "NG_PawnBodyWhite/roughness8", + "", + "NG_PawnBodyWhite/roughness_output", + "", + "nodename" + ], + [ + "NG_PawnBodyWhite/mtlxnormalmap10", + "", + "NG_PawnBodyWhite/normal_output", + "", + "nodename" + ], + [ + "NG_PawnBodyWhite/base_color_output", + "", + "Pawn_Body_W", + "base_color", + "nodename" + ], + [ + "NG_PawnBodyWhite/metalness_output", + "", + "Pawn_Body_W", + "metalness", + "nodename" + ], + [ + "NG_PawnBodyWhite/roughness_output", + "", + "Pawn_Body_W", + "specular_roughness", + "nodename" + ], + [ + "NG_PawnBodyWhite/base_color_output", + "", + "Pawn_Body_W", + "subsurface_color", + "nodename" + ], + [ + "NG_PawnBodyWhite/base_color_output", + "", + "Pawn_Body_W", + "subsurface_radius", + "nodename" + ], + [ + "NG_PawnBodyWhite/normal_output", + "", + "Pawn_Body_W", + "normal", + "nodename" + ], + [ + "Pawn_Body_W", + "", + "M_Pawn_Body_W", + "surfaceshader", + "nodename" + ], + [ + "NG_PawnTopBlack/mtlximage18", + "", + "NG_PawnTopBlack/mtlxnormalmap14", + "in", + "nodename" + ], + [ + "NG_PawnTopBlack/mtlximage19", + "", + "NG_PawnTopBlack/roughness_output", + "", + "nodename" + ], + [ + "NG_PawnTopBlack/mtlxnormalmap14", + "", + "NG_PawnTopBlack/normal_output", + "", + "nodename" + ], + [ + "NG_PawnTopBlack/roughness_output", + "", + "Pawn_Top_B", + "specular_roughness", + "nodename" + ], + [ + "NG_PawnTopBlack/normal_output", + "", + "Pawn_Top_B", + "normal", + "nodename" + ], + [ + "Pawn_Top_B", + "", + "M_Pawn_Top_B", + "surfaceshader", + "nodename" + ], + [ + "NG_PawnTopWhite/mtlximage20", + "", + "NG_PawnTopWhite/mtlxnormalmap15", + "in", + "nodename" + ], + [ + "NG_PawnTopWhite/mtlximage21", + "", + "NG_PawnTopWhite/roughness_output", + "", + "nodename" + ], + [ + "NG_PawnTopWhite/mtlxnormalmap15", + "", + "NG_PawnTopWhite/normal_output", + "", + "nodename" + ], + [ + "NG_PawnTopWhite/roughness_output", + "", + "Pawn_Top_W", + "specular_roughness", + "nodename" + ], + [ + "NG_PawnTopWhite/normal_output", + "", + "Pawn_Top_W", + "normal", + "nodename" + ], + [ + "Pawn_Top_W", + "", + "M_Pawn_Top_W", + "surfaceshader", + "nodename" + ], + [ + "NG_QueenBlack/normal", + "", + "NG_QueenBlack/mtlxnormalmap2", + "in", + "nodename" + ], + [ + "NG_QueenBlack/diffuse", + "", + "NG_QueenBlack/base_color_output", + "", + "nodename" + ], + [ + "NG_QueenBlack/metallic", + "", + "NG_QueenBlack/metalness_output", + "", + "nodename" + ], + [ + "NG_QueenBlack/roughness", + "", + "NG_QueenBlack/roughness_output", + "", + "nodename" + ], + [ + "NG_QueenBlack/sss", + "", + "NG_QueenBlack/subsurface_output", + "", + "nodename" + ], + [ + "NG_QueenBlack/mtlxnormalmap2", + "", + "NG_QueenBlack/normal_output", + "", + "nodename" + ], + [ + "NG_QueenBlack/base_color_output", + "", + "Queen_B", + "base_color", + "nodename" + ], + [ + "NG_QueenBlack/metalness_output", + "", + "Queen_B", + "metalness", + "nodename" + ], + [ + "NG_QueenBlack/roughness_output", + "", + "Queen_B", + "specular_roughness", + "nodename" + ], + [ + "NG_QueenBlack/subsurface_output", + "", + "Queen_B", + "subsurface", + "nodename" + ], + [ + "NG_QueenBlack/base_color_output", + "", + "Queen_B", + "subsurface_color", + "nodename" + ], + [ + "NG_QueenBlack/base_color_output", + "", + "Queen_B", + "subsurface_radius", + "nodename" + ], + [ + "NG_QueenBlack/normal_output", + "", + "Queen_B", + "normal", + "nodename" + ], + [ + "Queen_B", + "", + "M_Queen_B", + "surfaceshader", + "nodename" + ], + [ + "NG_QueenWhite/normal1", + "", + "NG_QueenWhite/mtlxnormalmap3", + "in", + "nodename" + ], + [ + "NG_QueenWhite/diffuse1", + "", + "NG_QueenWhite/base_color_output", + "", + "nodename" + ], + [ + "NG_QueenWhite/metallic1", + "", + "NG_QueenWhite/metalness_output", + "", + "nodename" + ], + [ + "NG_QueenWhite/roughness1", + "", + "NG_QueenWhite/roughness_output", + "", + "nodename" + ], + [ + "NG_QueenWhite/sss1", + "", + "NG_QueenWhite/subsurface_output", + "", + "nodename" + ], + [ + "NG_QueenWhite/mtlxnormalmap3", + "", + "NG_QueenWhite/normal_output", + "", + "nodename" + ], + [ + "NG_QueenWhite/base_color_output", + "", + "Queen_W", + "base_color", + "nodename" + ], + [ + "NG_QueenWhite/metalness_output", + "", + "Queen_W", + "metalness", + "nodename" + ], + [ + "NG_QueenWhite/roughness_output", + "", + "Queen_W", + "specular_roughness", + "nodename" + ], + [ + "NG_QueenWhite/subsurface_output", + "", + "Queen_W", + "subsurface", + "nodename" + ], + [ + "NG_QueenWhite/base_color_output", + "", + "Queen_W", + "subsurface_color", + "nodename" + ], + [ + "NG_QueenWhite/base_color_output", + "", + "Queen_W", + "subsurface_radius", + "nodename" + ], + [ + "NG_QueenWhite/normal_output", + "", + "Queen_W", + "normal", + "nodename" + ], + [ + "Queen_W", + "", + "M_Queen_W", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chrome.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chrome.md new file mode 100644 index 00000000..b284944a --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chrome.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_chrome[SR_chrome] + style Chrome fill:#090, color:#FFF + Chrome([Chrome]) + SR_chrome --"surfaceshader"--> Chrome +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chrome_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chrome_connections.json new file mode 100644 index 00000000..258248b1 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_chrome_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_chrome.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_chrome", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Chrome", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_chrome", + "", + "Chrome", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_copper.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_copper.md new file mode 100644 index 00000000..1054d1f4 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_copper.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_copper[SR_copper] + style Copper fill:#090, color:#FFF + Copper([Copper]) + SR_copper --"surfaceshader"--> Copper +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_copper_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_copper_connections.json new file mode 100644 index 00000000..3833d41d --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_copper_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_copper.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_copper", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Copper", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_copper", + "", + "Copper", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_default.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_default.md new file mode 100644 index 00000000..3c7985c6 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_default.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_default[SR_default] + style Default fill:#090, color:#FFF + Default([Default]) + SR_default --"surfaceshader"--> Default +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_default_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_default_connections.json new file mode 100644 index 00000000..2047b7ed --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_default_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_default.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_default", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Default", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_default", + "", + "Default", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass.md new file mode 100644 index 00000000..f136d0b2 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_glass[SR_glass] + style Glass fill:#090, color:#FFF + Glass([Glass]) + SR_glass --"surfaceshader"--> Glass +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_connections.json new file mode 100644 index 00000000..982525de --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_glass.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_glass", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Glass", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_glass", + "", + "Glass", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_tinted.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_tinted.md new file mode 100644 index 00000000..efe2e778 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_tinted.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_glass_tinted[SR_glass_tinted] + style GlassTinted fill:#090, color:#FFF + GlassTinted([GlassTinted]) + SR_glass_tinted --"surfaceshader"--> GlassTinted +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_tinted_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_tinted_connections.json new file mode 100644 index 00000000..40a24142 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_glass_tinted_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_glass_tinted.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_glass_tinted", + "standard_surface", + "surfaceshader", + "" + ], + [ + "GlassTinted", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_glass_tinted", + "", + "GlassTinted", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_gold.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_gold.md new file mode 100644 index 00000000..0e112dfb --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_gold.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_gold[SR_gold] + style Gold fill:#090, color:#FFF + Gold([Gold]) + SR_gold --"surfaceshader"--> Gold +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_gold_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_gold_connections.json new file mode 100644 index 00000000..593271aa --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_gold_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_gold.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_gold", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Gold", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_gold", + "", + "Gold", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere.md new file mode 100644 index 00000000..82d1daf9 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_greysphere[SR_greysphere] + style Greysphere fill:#090, color:#FFF + Greysphere([Greysphere]) + SR_greysphere --"surfaceshader"--> Greysphere +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.md new file mode 100644 index 00000000..d7121f73 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.md @@ -0,0 +1,18 @@ +```mermaid +graph LR + subgraph NG_Greysphere_Calibration + style NG_Greysphere_Calibration_out1 fill:#0C0, color:#FFF + NG_Greysphere_Calibration_out1([out1]) + NG_Greysphere_Calibration_texcoord1[texcoord1] + NG_Greysphere_Calibration_place2d[place2d] + NG_Greysphere_Calibration_image1[image1] + end + SR_Greysphere_Calibration[SR_Greysphere_Calibration] + style Greysphere_Calibration fill:#090, color:#FFF + Greysphere_Calibration([Greysphere_Calibration]) + NG_Greysphere_Calibration_texcoord1 --"texcoord"--> NG_Greysphere_Calibration_place2d + NG_Greysphere_Calibration_place2d --"texcoord"--> NG_Greysphere_Calibration_image1 + NG_Greysphere_Calibration_image1 --> NG_Greysphere_Calibration_out1 + NG_Greysphere_Calibration_out1 --"base_color"--> SR_Greysphere_Calibration + SR_Greysphere_Calibration --"surfaceshader"--> Greysphere_Calibration +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration_connections.json new file mode 100644 index 00000000..e2ca94c8 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration_connections.json @@ -0,0 +1,83 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_greysphere_calibration.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "NG_Greysphere_Calibration": [ + [ + "NG_Greysphere_Calibration/out1", + "output", + "color3", + "" + ], + [ + "NG_Greysphere_Calibration/texcoord1", + "texcoord", + "vector2", + "" + ], + [ + "NG_Greysphere_Calibration/place2d", + "place2d", + "vector2", + "" + ], + [ + "NG_Greysphere_Calibration/image1", + "image", + "color3", + "" + ] + ], + "": [ + [ + "SR_Greysphere_Calibration", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Greysphere_Calibration", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "NG_Greysphere_Calibration/texcoord1", + "", + "NG_Greysphere_Calibration/place2d", + "texcoord", + "nodename" + ], + [ + "NG_Greysphere_Calibration/place2d", + "", + "NG_Greysphere_Calibration/image1", + "texcoord", + "nodename" + ], + [ + "NG_Greysphere_Calibration/image1", + "", + "NG_Greysphere_Calibration/out1", + "", + "nodename" + ], + [ + "NG_Greysphere_Calibration/out1", + "", + "SR_Greysphere_Calibration", + "base_color", + "nodename" + ], + [ + "SR_Greysphere_Calibration", + "", + "Greysphere_Calibration", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_connections.json new file mode 100644 index 00000000..26087e8b --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_greysphere_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_greysphere.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_greysphere", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Greysphere", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_greysphere", + "", + "Greysphere", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_jade.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_jade.md new file mode 100644 index 00000000..b9396a08 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_jade.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_jade[SR_jade] + style Jade fill:#090, color:#FFF + Jade([Jade]) + SR_jade --"surfaceshader"--> Jade +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_jade_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_jade_connections.json new file mode 100644 index 00000000..aba369f0 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_jade_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_jade.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_jade", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Jade", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_jade", + "", + "Jade", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_look_brass_tiled.mtlx b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_look_brass_tiled.mtlx new file mode 100644 index 00000000..8c3a181a --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_look_brass_tiled.mtlx @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_look_wood_tiled.mtlx b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_look_wood_tiled.mtlx new file mode 100644 index 00000000..89979932 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_look_wood_tiled.mtlx @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_marble_solid.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_marble_solid.md new file mode 100644 index 00000000..48267dcd --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_marble_solid.md @@ -0,0 +1,56 @@ +```mermaid +graph LR + subgraph NG_marble1 + style NG_marble1_base_color_1 fill:#09D, color:#FFF + NG_marble1_base_color_1([base_color_1:0.8, 0.8, 0.8]) + style NG_marble1_base_color_2 fill:#09D, color:#FFF + NG_marble1_base_color_2([base_color_2:0.1, 0.1, 0.3]) + style NG_marble1_noise_scale_1 fill:#09D, color:#FFF + NG_marble1_noise_scale_1([noise_scale_1:6.0]) + style NG_marble1_noise_scale_2 fill:#09D, color:#FFF + NG_marble1_noise_scale_2([noise_scale_2:4.0]) + style NG_marble1_noise_power fill:#09D, color:#FFF + NG_marble1_noise_power([noise_power:3.0]) + style NG_marble1_noise_octaves fill:#09D, color:#FFF + NG_marble1_noise_octaves([noise_octaves:3]) + style NG_marble1_out fill:#0C0, color:#FFF + NG_marble1_out([out]) + NG_marble1_obj_pos[obj_pos] + NG_marble1_add_xyz[add_xyz] + NG_marble1_scale_xyz[scale_xyz] + NG_marble1_scale_pos[scale_pos] + NG_marble1_noise[noise] + NG_marble1_scale_noise[scale_noise] + NG_marble1_sum[sum] + NG_marble1_sin[sin] + NG_marble1_scale[scale] + NG_marble1_bias[bias] + NG_marble1_power[power] + NG_marble1_color_mix[color_mix] + end + SR_marble1[SR_marble1] + style Marble_3D fill:#090, color:#FFF + Marble_3D([Marble_3D]) + NG_marble1_obj_pos --"in1"--> NG_marble1_add_xyz + NG_marble1_add_xyz --"in1"--> NG_marble1_scale_xyz + NG_marble1_noise_scale_1 --"in2"--> NG_marble1_scale_xyz + NG_marble1_obj_pos --"in1"--> NG_marble1_scale_pos + NG_marble1_noise_scale_2 --"in2"--> NG_marble1_scale_pos + NG_marble1_noise_octaves --"octaves"--> NG_marble1_noise + NG_marble1_scale_pos --"position"--> NG_marble1_noise + NG_marble1_noise --"in1"--> NG_marble1_scale_noise + NG_marble1_scale_xyz --"in1"--> NG_marble1_sum + NG_marble1_scale_noise --"in2"--> NG_marble1_sum + NG_marble1_sum --"in"--> NG_marble1_sin + NG_marble1_sin --"in1"--> NG_marble1_scale + NG_marble1_scale --"in1"--> NG_marble1_bias + NG_marble1_bias --"in1"--> NG_marble1_power + NG_marble1_noise_power --"in2"--> NG_marble1_power + NG_marble1_base_color_1 --"bg"--> NG_marble1_color_mix + NG_marble1_base_color_2 --"fg"--> NG_marble1_color_mix + NG_marble1_power --"mix"--> NG_marble1_color_mix + NG_marble1_color_mix --> NG_marble1_out + NG_marble1_out --"base_color"--> SR_marble1 + NG_marble1_out --"subsurface_color"--> SR_marble1 + SR_marble1 --"surfaceshader"--> Marble_3D +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_metal_brushed.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_metal_brushed.md new file mode 100644 index 00000000..a0f081d4 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_metal_brushed.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_metal_brushed[SR_metal_brushed] + style Metal_Brushed fill:#090, color:#FFF + Metal_Brushed([Metal_Brushed]) + SR_metal_brushed --"surfaceshader"--> Metal_Brushed +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_metal_brushed_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_metal_brushed_connections.json new file mode 100644 index 00000000..6e08955f --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_metal_brushed_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_metal_brushed.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_metal_brushed", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Metal_Brushed", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_metal_brushed", + "", + "Metal_Brushed", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_plastic.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_plastic.md new file mode 100644 index 00000000..a110b556 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_plastic.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_plastic[SR_plastic] + style Plastic fill:#090, color:#FFF + Plastic([Plastic]) + SR_plastic --"surfaceshader"--> Plastic +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_plastic_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_plastic_connections.json new file mode 100644 index 00000000..49e8f579 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_plastic_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_plastic.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_plastic", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Plastic", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_plastic", + "", + "Plastic", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_thin_film.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_thin_film.md new file mode 100644 index 00000000..b9402528 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_thin_film.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_thin_film[SR_thin_film] + style ThinFilm fill:#090, color:#FFF + ThinFilm([ThinFilm]) + SR_thin_film --"surfaceshader"--> ThinFilm +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_thin_film_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_thin_film_connections.json new file mode 100644 index 00000000..fcafc4d9 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_thin_film_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_thin_film.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_thin_film", + "standard_surface", + "surfaceshader", + "" + ], + [ + "ThinFilm", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_thin_film", + "", + "ThinFilm", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_velvet.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_velvet.md new file mode 100644 index 00000000..0227ac68 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_velvet.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_velvet[SR_velvet] + style Velvet fill:#090, color:#FFF + Velvet([Velvet]) + SR_velvet --"surfaceshader"--> Velvet +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_velvet_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_velvet_connections.json new file mode 100644 index 00000000..e41c01bb --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_velvet_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_velvet.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_velvet", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Velvet", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_velvet", + "", + "Velvet", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_wood_tiled.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_wood_tiled.md new file mode 100644 index 00000000..53716320 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_wood_tiled.md @@ -0,0 +1,19 @@ +```mermaid +graph LR + subgraph NG_wood1 + style NG_wood1_out_color fill:#0C0, color:#FFF + NG_wood1_out_color([out_color]) + style NG_wood1_out_roughness fill:#0C0, color:#FFF + NG_wood1_out_roughness([out_roughness]) + NG_wood1_image_color[image_color] + NG_wood1_image_roughness[image_roughness] + end + SR_wood1[SR_wood1] + style Tiled_Wood fill:#090, color:#FFF + Tiled_Wood([Tiled_Wood]) + NG_wood1_image_color --> NG_wood1_out_color + NG_wood1_image_roughness --> NG_wood1_out_roughness + NG_wood1_out_color --"base_color"--> SR_wood1 + NG_wood1_out_roughness --"specular_roughness"--> SR_wood1 + SR_wood1 --"surfaceshader"--> Tiled_Wood +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_wood_tiled_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_wood_tiled_connections.json new file mode 100644 index 00000000..a445d612 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/standard_surface_wood_tiled_connections.json @@ -0,0 +1,83 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\standard_surface_wood_tiled.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "NG_wood1": [ + [ + "NG_wood1/out_color", + "output", + "color3", + "" + ], + [ + "NG_wood1/out_roughness", + "output", + "float", + "" + ], + [ + "NG_wood1/image_color", + "tiledimage", + "color3", + "" + ], + [ + "NG_wood1/image_roughness", + "tiledimage", + "float", + "" + ] + ], + "": [ + [ + "SR_wood1", + "standard_surface", + "surfaceshader", + "" + ], + [ + "Tiled_Wood", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "NG_wood1/image_color", + "", + "NG_wood1/out_color", + "", + "nodename" + ], + [ + "NG_wood1/image_roughness", + "", + "NG_wood1/out_roughness", + "", + "nodename" + ], + [ + "NG_wood1/out_color", + "", + "SR_wood1", + "base_color", + "nodename" + ], + [ + "NG_wood1/out_roughness", + "", + "SR_wood1", + "specular_roughness", + "nodename" + ], + [ + "SR_wood1", + "", + "Tiled_Wood", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/toon_shade.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/toon_shade.md new file mode 100644 index 00000000..9d042204 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/toon_shade.md @@ -0,0 +1,110 @@ +```mermaid +graph LR + surface_unlit[surface_unlit] + style surfacematerial fill:#090, color:#FFF + surfacematerial([surfacematerial]) + style ND_toon_sample fill:#00C, color:#FFF + ND_toon_sample[[ND_toon_sample]] + toon_shade1[toon_shade1] + subgraph NG_toon_sample + style NG_toon_sample_base_color fill:#09D, color:#FFF + NG_toon_sample_base_color([base_color:0.0156384, 0.632771, 0.799511]) + style NG_toon_sample_ambient_color fill:#09D, color:#FFF + NG_toon_sample_ambient_color([ambient_color:0.574572, 0.207914, 0.207914]) + style NG_toon_sample_specular_color fill:#09D, color:#FFF + NG_toon_sample_specular_color([specular_color:0.726161, 0.726161, 0.726161]) + style NG_toon_sample_glossiness fill:#09D, color:#FFF + NG_toon_sample_glossiness([glossiness:16]) + style NG_toon_sample_rim_color fill:#09D, color:#FFF + NG_toon_sample_rim_color([rim_color:0.775061, 0.775061, 0.775061]) + style NG_toon_sample_light_direction fill:#09D, color:#FFF + NG_toon_sample_light_direction([light_direction:1.0, -0.5, -0.5]) + style NG_toon_sample_light_color fill:#09D, color:#FFF + NG_toon_sample_light_color([light_color:0.885086, 0.885086, 0.885086]) + style NG_toon_sample_output_color3 fill:#0C0, color:#FFF + NG_toon_sample_output_color3([output_color3]) + NG_toon_sample_normal[normal:world] + NG_toon_sample_NdotL[NdotL] + NG_toon_sample_unit_light_direction[unit_light_direction] + NG_toon_sample_multiply_color3[multiply_color3] + NG_toon_sample_add_color3[add_color3] + NG_toon_sample_smooth_gradient[smooth_gradient] + NG_toon_sample_viewdirection_vector3[viewdirection_vector3:world] + NG_toon_sample_unit_viewdirection[unit_viewdirection] + NG_toon_sample_multiply_float[multiply_float] + NG_toon_sample_specular_intensity_power[specular_intensity_power] + NG_toon_sample_specular_intensity_color[specular_intensity_color] + NG_toon_sample_add_color4[add_color4] + NG_toon_sample_multiply_vector3[multiply_vector3] + NG_toon_sample_specular_remap[specular_remap] + NG_toon_sample_specular[specular] + NG_toon_sample_NdotV[NdotV] + NG_toon_sample_NdotV_invert[NdotV_invert] + NG_toon_sample_add_color5[add_color5] + NG_toon_sample_rim_gradient[rim_gradient] + style NG_toon_sample_rim_amount fill:#500, color:#FFF + NG_toon_sample_rim_amount([rim_amount:0.7]) + NG_toon_sample_add_float[add_float] + NG_toon_sample_subtract_float[subtract_float] + NG_toon_sample_rmi_intensity[rmi_intensity] + style NG_toon_sample_rim_threshold fill:#500, color:#FFF + NG_toon_sample_rim_threshold([rim_threshold:0.1]) + NG_toon_sample_rim_power[rim_power] + NG_toon_sample_multiply_vector4[multiply_vector4] + NG_toon_sample_unit_normal[unit_normal] + NG_toon_sample_rim[rim] + NG_toon_sample_gradient_light[gradient_light] + NG_toon_sample_reflect[reflect] + NG_toon_sample_LdotV[LdotV] + NG_toon_sample_max_float[max_float] + end + toon_shade1 --"emission_color"--> surface_unlit + surface_unlit --"surfaceshader"--> surfacematerial + NG_toon_sample --> ND_toon_sample + NG_toon_sample_multiply_color3 --> NG_toon_sample_output_color3 + NG_toon_sample_unit_normal --"in1"--> NG_toon_sample_NdotL + NG_toon_sample_multiply_vector4 --"in2"--> NG_toon_sample_NdotL + NG_toon_sample_light_direction --"in"--> NG_toon_sample_unit_light_direction + NG_toon_sample_base_color --"in1"--> NG_toon_sample_multiply_color3 + NG_toon_sample_add_color5 --"in2"--> NG_toon_sample_multiply_color3 + NG_toon_sample_gradient_light --"in1"--> NG_toon_sample_add_color3 + NG_toon_sample_ambient_color --"in2"--> NG_toon_sample_add_color3 + NG_toon_sample_NdotL --"in"--> NG_toon_sample_smooth_gradient + NG_toon_sample_viewdirection_vector3 --"in"--> NG_toon_sample_unit_viewdirection + NG_toon_sample_smooth_gradient --"in1"--> NG_toon_sample_multiply_float + NG_toon_sample_max_float --"in2"--> NG_toon_sample_multiply_float + NG_toon_sample_multiply_float --"in1"--> NG_toon_sample_specular_intensity_power + NG_toon_sample_glossiness --"in2"--> NG_toon_sample_specular_intensity_power + NG_toon_sample_specular_remap --"in"--> NG_toon_sample_specular_intensity_color + NG_toon_sample_add_color3 --"in1"--> NG_toon_sample_add_color4 + NG_toon_sample_specular --"in2"--> NG_toon_sample_add_color4 + NG_toon_sample_unit_viewdirection --"in1"--> NG_toon_sample_multiply_vector3 + NG_toon_sample_specular_intensity_power --"in"--> NG_toon_sample_specular_remap + NG_toon_sample_specular_intensity_color --"in1"--> NG_toon_sample_specular + NG_toon_sample_specular_color --"in2"--> NG_toon_sample_specular + NG_toon_sample_unit_normal --"in1"--> NG_toon_sample_NdotV + NG_toon_sample_multiply_vector3 --"in2"--> NG_toon_sample_NdotV + NG_toon_sample_NdotV --"in"--> NG_toon_sample_NdotV_invert + NG_toon_sample_add_color4 --"in1"--> NG_toon_sample_add_color5 + NG_toon_sample_rim --"in2"--> NG_toon_sample_add_color5 + NG_toon_sample_rmi_intensity --"in"--> NG_toon_sample_rim_gradient + NG_toon_sample_add_float --"low"--> NG_toon_sample_rim_gradient + NG_toon_sample_subtract_float --"high"--> NG_toon_sample_rim_gradient + NG_toon_sample_rim_amount --"in1"--> NG_toon_sample_add_float + NG_toon_sample_rim_amount --"in1"--> NG_toon_sample_subtract_float + NG_toon_sample_NdotV_invert --"in1"--> NG_toon_sample_rmi_intensity + NG_toon_sample_rim_power --"in2"--> NG_toon_sample_rmi_intensity + NG_toon_sample_NdotL --"in1"--> NG_toon_sample_rim_power + NG_toon_sample_rim_threshold --"in2"--> NG_toon_sample_rim_power + NG_toon_sample_unit_light_direction --"in1"--> NG_toon_sample_multiply_vector4 + NG_toon_sample_normal --"in"--> NG_toon_sample_unit_normal + NG_toon_sample_rim_color --"in1"--> NG_toon_sample_rim + NG_toon_sample_rim_gradient --"in2"--> NG_toon_sample_rim + NG_toon_sample_smooth_gradient --"in2"--> NG_toon_sample_gradient_light + NG_toon_sample_light_color --"in1"--> NG_toon_sample_gradient_light + NG_toon_sample_unit_viewdirection --"in"--> NG_toon_sample_reflect + NG_toon_sample_unit_normal --"normal"--> NG_toon_sample_reflect + NG_toon_sample_reflect --"in2"--> NG_toon_sample_LdotV + NG_toon_sample_multiply_vector4 --"in1"--> NG_toon_sample_LdotV + NG_toon_sample_LdotV --"in1"--> NG_toon_sample_max_float +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/toon_shade_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/toon_shade_connections.json new file mode 100644 index 00000000..ba658b01 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/toon_shade_connections.json @@ -0,0 +1,619 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\toon_shade.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "surface_unlit", + "surface_unlit", + "surfaceshader", + "" + ], + [ + "surfacematerial", + "surfacematerial", + "material", + "" + ], + [ + "ND_toon_sample", + "nodedef", + "color3", + "" + ], + [ + "toon_shade1", + "npr_test:toon_shade", + "color3", + "" + ] + ], + "NG_toon_sample": [ + [ + "NG_toon_sample/base_color", + "input", + "color3", + "0.0156384, 0.632771, 0.799511" + ], + [ + "NG_toon_sample/ambient_color", + "input", + "color3", + "0.574572, 0.207914, 0.207914" + ], + [ + "NG_toon_sample/specular_color", + "input", + "color3", + "0.726161, 0.726161, 0.726161" + ], + [ + "NG_toon_sample/glossiness", + "input", + "float", + "16" + ], + [ + "NG_toon_sample/rim_color", + "input", + "color3", + "0.775061, 0.775061, 0.775061" + ], + [ + "NG_toon_sample/light_direction", + "input", + "vector3", + "1.0, -0.5, -0.5" + ], + [ + "NG_toon_sample/light_color", + "input", + "color3", + "0.885086, 0.885086, 0.885086" + ], + [ + "NG_toon_sample/output_color3", + "output", + "color3", + "" + ], + [ + "NG_toon_sample/normal", + "normal", + "vector3", + "world" + ], + [ + "NG_toon_sample/NdotL", + "dotproduct", + "float", + "" + ], + [ + "NG_toon_sample/unit_light_direction", + "normalize", + "vector3", + "" + ], + [ + "NG_toon_sample/multiply_color3", + "multiply", + "color3", + "" + ], + [ + "NG_toon_sample/add_color3", + "add", + "color3", + "" + ], + [ + "NG_toon_sample/smooth_gradient", + "smoothstep", + "float", + "" + ], + [ + "NG_toon_sample/viewdirection_vector3", + "viewdirection", + "vector3", + "world" + ], + [ + "NG_toon_sample/unit_viewdirection", + "normalize", + "vector3", + "" + ], + [ + "NG_toon_sample/multiply_float", + "multiply", + "float", + "" + ], + [ + "NG_toon_sample/specular_intensity_power", + "power", + "float", + "" + ], + [ + "NG_toon_sample/specular_intensity_color", + "convert", + "color3", + "" + ], + [ + "NG_toon_sample/add_color4", + "add", + "color3", + "" + ], + [ + "NG_toon_sample/multiply_vector3", + "multiply", + "vector3", + "" + ], + [ + "NG_toon_sample/specular_remap", + "smoothstep", + "float", + "" + ], + [ + "NG_toon_sample/specular", + "multiply", + "color3", + "" + ], + [ + "NG_toon_sample/NdotV", + "dotproduct", + "float", + "" + ], + [ + "NG_toon_sample/NdotV_invert", + "invert", + "float", + "" + ], + [ + "NG_toon_sample/add_color5", + "add", + "color3", + "" + ], + [ + "NG_toon_sample/rim_gradient", + "smoothstep", + "float", + "" + ], + [ + "NG_toon_sample/rim_amount", + "constant", + "float", + "0.7" + ], + [ + "NG_toon_sample/add_float", + "add", + "float", + "" + ], + [ + "NG_toon_sample/subtract_float", + "subtract", + "float", + "" + ], + [ + "NG_toon_sample/rmi_intensity", + "multiply", + "float", + "" + ], + [ + "NG_toon_sample/rim_threshold", + "constant", + "float", + "0.1" + ], + [ + "NG_toon_sample/rim_power", + "power", + "float", + "" + ], + [ + "NG_toon_sample/multiply_vector4", + "multiply", + "vector3", + "" + ], + [ + "NG_toon_sample/unit_normal", + "normalize", + "vector3", + "" + ], + [ + "NG_toon_sample/rim", + "multiply", + "color3", + "" + ], + [ + "NG_toon_sample/gradient_light", + "multiply", + "color3", + "" + ], + [ + "NG_toon_sample/reflect", + "reflect", + "vector3", + "" + ], + [ + "NG_toon_sample/LdotV", + "dotproduct", + "float", + "" + ], + [ + "NG_toon_sample/max_float", + "max", + "float", + "" + ] + ] + }, + "connections": [ + [ + "toon_shade1", + "", + "surface_unlit", + "emission_color", + "nodename" + ], + [ + "surface_unlit", + "", + "surfacematerial", + "surfaceshader", + "nodename" + ], + [ + "NG_toon_sample", + "", + "ND_toon_sample", + "", + "nodedef" + ], + [ + "NG_toon_sample/multiply_color3", + "", + "NG_toon_sample/output_color3", + "", + "nodename" + ], + [ + "NG_toon_sample/unit_normal", + "", + "NG_toon_sample/NdotL", + "in1", + "nodename" + ], + [ + "NG_toon_sample/multiply_vector4", + "", + "NG_toon_sample/NdotL", + "in2", + "nodename" + ], + [ + "NG_toon_sample/light_direction", + "", + "NG_toon_sample/unit_light_direction", + "in", + "interfacename" + ], + [ + "NG_toon_sample/base_color", + "", + "NG_toon_sample/multiply_color3", + "in1", + "interfacename" + ], + [ + "NG_toon_sample/add_color5", + "", + "NG_toon_sample/multiply_color3", + "in2", + "nodename" + ], + [ + "NG_toon_sample/gradient_light", + "", + "NG_toon_sample/add_color3", + "in1", + "nodename" + ], + [ + "NG_toon_sample/ambient_color", + "", + "NG_toon_sample/add_color3", + "in2", + "interfacename" + ], + [ + "NG_toon_sample/NdotL", + "", + "NG_toon_sample/smooth_gradient", + "in", + "nodename" + ], + [ + "NG_toon_sample/viewdirection_vector3", + "", + "NG_toon_sample/unit_viewdirection", + "in", + "nodename" + ], + [ + "NG_toon_sample/smooth_gradient", + "", + "NG_toon_sample/multiply_float", + "in1", + "nodename" + ], + [ + "NG_toon_sample/max_float", + "", + "NG_toon_sample/multiply_float", + "in2", + "nodename" + ], + [ + "NG_toon_sample/multiply_float", + "", + "NG_toon_sample/specular_intensity_power", + "in1", + "nodename" + ], + [ + "NG_toon_sample/glossiness", + "", + "NG_toon_sample/specular_intensity_power", + "in2", + "interfacename" + ], + [ + "NG_toon_sample/specular_remap", + "", + "NG_toon_sample/specular_intensity_color", + "in", + "nodename" + ], + [ + "NG_toon_sample/add_color3", + "", + "NG_toon_sample/add_color4", + "in1", + "nodename" + ], + [ + "NG_toon_sample/specular", + "", + "NG_toon_sample/add_color4", + "in2", + "nodename" + ], + [ + "NG_toon_sample/unit_viewdirection", + "", + "NG_toon_sample/multiply_vector3", + "in1", + "nodename" + ], + [ + "NG_toon_sample/specular_intensity_power", + "", + "NG_toon_sample/specular_remap", + "in", + "nodename" + ], + [ + "NG_toon_sample/specular_intensity_color", + "", + "NG_toon_sample/specular", + "in1", + "nodename" + ], + [ + "NG_toon_sample/specular_color", + "", + "NG_toon_sample/specular", + "in2", + "interfacename" + ], + [ + "NG_toon_sample/unit_normal", + "", + "NG_toon_sample/NdotV", + "in1", + "nodename" + ], + [ + "NG_toon_sample/multiply_vector3", + "", + "NG_toon_sample/NdotV", + "in2", + "nodename" + ], + [ + "NG_toon_sample/NdotV", + "", + "NG_toon_sample/NdotV_invert", + "in", + "nodename" + ], + [ + "NG_toon_sample/add_color4", + "", + "NG_toon_sample/add_color5", + "in1", + "nodename" + ], + [ + "NG_toon_sample/rim", + "", + "NG_toon_sample/add_color5", + "in2", + "nodename" + ], + [ + "NG_toon_sample/rmi_intensity", + "", + "NG_toon_sample/rim_gradient", + "in", + "nodename" + ], + [ + "NG_toon_sample/add_float", + "", + "NG_toon_sample/rim_gradient", + "low", + "nodename" + ], + [ + "NG_toon_sample/subtract_float", + "", + "NG_toon_sample/rim_gradient", + "high", + "nodename" + ], + [ + "NG_toon_sample/rim_amount", + "", + "NG_toon_sample/add_float", + "in1", + "nodename" + ], + [ + "NG_toon_sample/rim_amount", + "", + "NG_toon_sample/subtract_float", + "in1", + "nodename" + ], + [ + "NG_toon_sample/NdotV_invert", + "", + "NG_toon_sample/rmi_intensity", + "in1", + "nodename" + ], + [ + "NG_toon_sample/rim_power", + "", + "NG_toon_sample/rmi_intensity", + "in2", + "nodename" + ], + [ + "NG_toon_sample/NdotL", + "", + "NG_toon_sample/rim_power", + "in1", + "nodename" + ], + [ + "NG_toon_sample/rim_threshold", + "", + "NG_toon_sample/rim_power", + "in2", + "nodename" + ], + [ + "NG_toon_sample/unit_light_direction", + "", + "NG_toon_sample/multiply_vector4", + "in1", + "nodename" + ], + [ + "NG_toon_sample/normal", + "", + "NG_toon_sample/unit_normal", + "in", + "nodename" + ], + [ + "NG_toon_sample/rim_color", + "", + "NG_toon_sample/rim", + "in1", + "interfacename" + ], + [ + "NG_toon_sample/rim_gradient", + "", + "NG_toon_sample/rim", + "in2", + "nodename" + ], + [ + "NG_toon_sample/smooth_gradient", + "", + "NG_toon_sample/gradient_light", + "in2", + "nodename" + ], + [ + "NG_toon_sample/light_color", + "", + "NG_toon_sample/gradient_light", + "in1", + "interfacename" + ], + [ + "NG_toon_sample/unit_viewdirection", + "", + "NG_toon_sample/reflect", + "in", + "nodename" + ], + [ + "NG_toon_sample/unit_normal", + "", + "NG_toon_sample/reflect", + "normal", + "nodename" + ], + [ + "NG_toon_sample/reflect", + "", + "NG_toon_sample/LdotV", + "in2", + "nodename" + ], + [ + "NG_toon_sample/multiply_vector4", + "", + "NG_toon_sample/LdotV", + "in1", + "nodename" + ], + [ + "NG_toon_sample/LdotV", + "", + "NG_toon_sample/max_float", + "in1", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon.md new file mode 100644 index 00000000..7ce28501 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon.md @@ -0,0 +1,86 @@ +```mermaid +graph LR + subgraph nodegraph1 + style nodegraph1_sides fill:#09D, color:#FFF + nodegraph1_sides([sides:5]) + style nodegraph1_width fill:#09D, color:#FFF + nodegraph1_width([width:0.2]) + style nodegraph1_height fill:#09D, color:#FFF + nodegraph1_height([height:0.2]) + style nodegraph1_output_float fill:#0C0, color:#FFF + nodegraph1_output_float([output_float]) + style nodegraph1_PI fill:#500, color:#FFF + nodegraph1_PI([PI:3.14159265359]) + nodegraph1_cos_float[cos_float] + nodegraph1_divide_float[divide_float] + nodegraph1_aWidth[aWidth] + nodegraph1_aHeight[aHeight] + nodegraph1_texcoord_vector2[texcoord_vector2] + nodegraph1_times_2[times_2] + nodegraph1_minus_1[minus_1] + nodegraph1_width_height_vec[width_height_vec] + nodegraph1_uv[uv] + nodegraph1_convert_float_surfaceshader[convert_float_surfaceshader:0] + nodegraph1_multiply_vector2[multiply_vector2] + nodegraph1_pCoord[pCoord] + nodegraph1_convert_vector2_surfaceshader[convert_vector2_surfaceshader:0, 0] + nodegraph1_unity_note[unity_note:https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Polygon-Node.html] + nodegraph1_extract_x[extract_x] + nodegraph1_extract_y[extract_y] + nodegraph1_pi_div_sides[pi_div_sides] + nodegraph1_r[r] + nodegraph1_add_float[add_float] + nodegraph1_divide_float2[divide_float2] + nodegraph1_floor_float[floor_float] + nodegraph1_multiply_float[multiply_float] + nodegraph1_subtract_float[subtract_float] + nodegraph1_cos_float2[cos_float2] + nodegraph1_distance[distance] + nodegraph1_magnitude_vector2[magnitude_vector2] + nodegraph1_clamp_float[clamp_float] + nodegraph1_one_min_distance[one_min_distance] + nodegraph1_divide_float3[divide_float3] + end + surface_unlit[surface_unlit] + style surfacematerial fill:#090, color:#FFF + surfacematerial([surfacematerial]) + nodegraph1_divide_float --"in"--> nodegraph1_cos_float + nodegraph1_PI --"in1"--> nodegraph1_divide_float + nodegraph1_sides --"in2"--> nodegraph1_divide_float + nodegraph1_width --"in2"--> nodegraph1_aWidth + nodegraph1_cos_float --"in1"--> nodegraph1_aWidth + nodegraph1_height --"in2"--> nodegraph1_aHeight + nodegraph1_cos_float --"in1"--> nodegraph1_aHeight + nodegraph1_texcoord_vector2 --"in1"--> nodegraph1_times_2 + nodegraph1_times_2 --"in1"--> nodegraph1_minus_1 + nodegraph1_width --"in1"--> nodegraph1_width_height_vec + nodegraph1_height --"in2"--> nodegraph1_width_height_vec + nodegraph1_width_height_vec --"in2"--> nodegraph1_uv + nodegraph1_minus_1 --"in1"--> nodegraph1_uv + nodegraph1_uv --"in1"--> nodegraph1_multiply_vector2 + nodegraph1_extract_y --"inx"--> nodegraph1_pCoord + nodegraph1_extract_x --"iny"--> nodegraph1_pCoord + nodegraph1_uv --"in"--> nodegraph1_extract_x + nodegraph1_uv --"in"--> nodegraph1_extract_y + nodegraph1_PI --"in1"--> nodegraph1_pi_div_sides + nodegraph1_sides --"in2"--> nodegraph1_pi_div_sides + nodegraph1_pi_div_sides --"in1"--> nodegraph1_r + nodegraph1_pCoord --"in1"--> nodegraph1_add_float + nodegraph1_r --"in2"--> nodegraph1_divide_float2 + nodegraph1_add_float --"in1"--> nodegraph1_divide_float2 + nodegraph1_divide_float2 --"in"--> nodegraph1_floor_float + nodegraph1_r --"in2"--> nodegraph1_multiply_float + nodegraph1_floor_float --"in1"--> nodegraph1_multiply_float + nodegraph1_multiply_float --"in1"--> nodegraph1_subtract_float + nodegraph1_pCoord --"in2"--> nodegraph1_subtract_float + nodegraph1_subtract_float --"in"--> nodegraph1_cos_float2 + nodegraph1_cos_float2 --"in1"--> nodegraph1_distance + nodegraph1_magnitude_vector2 --"in2"--> nodegraph1_distance + nodegraph1_uv --"in"--> nodegraph1_magnitude_vector2 + nodegraph1_divide_float3 --"in"--> nodegraph1_clamp_float + nodegraph1_distance --"in2"--> nodegraph1_one_min_distance + nodegraph1_one_min_distance --"in1"--> nodegraph1_divide_float3 + nodegraph1_clamp_float --> nodegraph1_output_float + nodegraph1_output_float --"emission"--> surface_unlit + surface_unlit --"surfaceshader"--> surfacematerial +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon.mtlx b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon.mtlx new file mode 100644 index 00000000..f06720e3 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon.mtlx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2.md new file mode 100644 index 00000000..99070794 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2.md @@ -0,0 +1,78 @@ +```mermaid +graph LR + subgraph nodegraph1 + style nodegraph1_sides fill:#09D, color:#FFF + nodegraph1_sides([sides:10]) + style nodegraph1_width fill:#09D, color:#FFF + nodegraph1_width([width:1]) + style nodegraph1_height fill:#09D, color:#FFF + nodegraph1_height([height:1]) + style nodegraph1_output_float fill:#0C0, color:#FFF + nodegraph1_output_float([output_float]) + style nodegraph1_PI fill:#500, color:#FFF + nodegraph1_PI([PI:3.141592653589793238462643]) + nodegraph1_cos_float[cos_float] + nodegraph1_aWidth[aWidth] + nodegraph1_aHeight[aHeight] + nodegraph1_texcoord_vector2[texcoord_vector2] + nodegraph1_times_2[times_2] + nodegraph1_minus_1[minus_1] + nodegraph1_width_height_vec[width_height_vec] + nodegraph1_uv[uv] + nodegraph1_convert_float_surfaceshader[convert_float_surfaceshader:0] + nodegraph1_multiply_vector2[multiply_vector2] + nodegraph1_pCoord[pCoord] + nodegraph1_convert_vector2_surfaceshader[convert_vector2_surfaceshader:0, 0] + nodegraph1_unity_note[unity_note:https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Polygon-Node.html] + nodegraph1_extract_x[extract_x] + nodegraph1_extract_y[extract_y] + nodegraph1_pi_div_sides[pi_div_sides] + nodegraph1_r[r] + nodegraph1_pCoord_plus_half[pCoord_plus_half] + nodegraph1_divide_r[divide_r] + nodegraph1_floor_float[floor_float] + nodegraph1_multiply_r[multiply_r] + nodegraph1_subtract_pCoord[subtract_pCoord] + nodegraph1_cos_float2[cos_float2] + nodegraph1_distance[distance] + nodegraph1_length_texcoord[length_texcoord] + nodegraph1_clamp_float[clamp_float] + nodegraph1_one_min_distance[one_min_distance] + nodegraph1_divide_float3[divide_float3] + end + nodegraph1_pi_div_sides --"in"--> nodegraph1_cos_float + nodegraph1_width --"in2"--> nodegraph1_aWidth + nodegraph1_cos_float --"in1"--> nodegraph1_aWidth + nodegraph1_height --"in2"--> nodegraph1_aHeight + nodegraph1_cos_float --"in1"--> nodegraph1_aHeight + nodegraph1_texcoord_vector2 --"in1"--> nodegraph1_times_2 + nodegraph1_times_2 --"in1"--> nodegraph1_minus_1 + nodegraph1_aWidth --"in1"--> nodegraph1_width_height_vec + nodegraph1_aHeight --"in2"--> nodegraph1_width_height_vec + nodegraph1_width_height_vec --"in2"--> nodegraph1_uv + nodegraph1_minus_1 --"in1"--> nodegraph1_uv + nodegraph1_uv --"in1"--> nodegraph1_multiply_vector2 + nodegraph1_extract_x --"inx"--> nodegraph1_pCoord + nodegraph1_extract_y --"iny"--> nodegraph1_pCoord + nodegraph1_multiply_vector2 --"in"--> nodegraph1_extract_x + nodegraph1_multiply_vector2 --"in"--> nodegraph1_extract_y + nodegraph1_PI --"in1"--> nodegraph1_pi_div_sides + nodegraph1_sides --"in2"--> nodegraph1_pi_div_sides + nodegraph1_pi_div_sides --"in1"--> nodegraph1_r + nodegraph1_pCoord --"in1"--> nodegraph1_pCoord_plus_half + nodegraph1_r --"in2"--> nodegraph1_divide_r + nodegraph1_pCoord_plus_half --"in1"--> nodegraph1_divide_r + nodegraph1_divide_r --"in"--> nodegraph1_floor_float + nodegraph1_r --"in2"--> nodegraph1_multiply_r + nodegraph1_floor_float --"in1"--> nodegraph1_multiply_r + nodegraph1_multiply_r --"in1"--> nodegraph1_subtract_pCoord + nodegraph1_pCoord --"in2"--> nodegraph1_subtract_pCoord + nodegraph1_subtract_pCoord --"in"--> nodegraph1_cos_float2 + nodegraph1_cos_float2 --"in1"--> nodegraph1_distance + nodegraph1_length_texcoord --"in2"--> nodegraph1_distance + nodegraph1_multiply_vector2 --"in"--> nodegraph1_length_texcoord + nodegraph1_divide_float3 --"in"--> nodegraph1_clamp_float + nodegraph1_distance --"in2"--> nodegraph1_one_min_distance + nodegraph1_one_min_distance --"in1"--> nodegraph1_divide_float3 + nodegraph1_clamp_float --> nodegraph1_output_float +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2.mtlx b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2.mtlx new file mode 100644 index 00000000..d5b86f5a --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2.mtlx @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2_connections.json new file mode 100644 index 00000000..8d039bd4 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2_connections.json @@ -0,0 +1,453 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\unity_polygon2.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "nodegraph1": [ + [ + "nodegraph1/sides", + "input", + "float", + "10" + ], + [ + "nodegraph1/width", + "input", + "float", + "1" + ], + [ + "nodegraph1/height", + "input", + "float", + "1" + ], + [ + "nodegraph1/output_float", + "output", + "float", + "" + ], + [ + "nodegraph1/PI", + "constant", + "float", + "3.141592653589793238462643" + ], + [ + "nodegraph1/cos_float", + "cos", + "float", + "" + ], + [ + "nodegraph1/aWidth", + "multiply", + "float", + "" + ], + [ + "nodegraph1/aHeight", + "multiply", + "float", + "" + ], + [ + "nodegraph1/texcoord_vector2", + "texcoord", + "vector2", + "" + ], + [ + "nodegraph1/times_2", + "multiply", + "vector2", + "" + ], + [ + "nodegraph1/minus_1", + "subtract", + "vector2", + "" + ], + [ + "nodegraph1/width_height_vec", + "combine2", + "vector2", + "" + ], + [ + "nodegraph1/uv", + "divide", + "vector2", + "" + ], + [ + "nodegraph1/convert_float_surfaceshader", + "convert", + "surfaceshader", + "0" + ], + [ + "nodegraph1/multiply_vector2", + "multiply", + "vector2", + "" + ], + [ + "nodegraph1/pCoord", + "atan2", + "float", + "" + ], + [ + "nodegraph1/convert_vector2_surfaceshader", + "convert", + "surfaceshader", + "0, 0" + ], + [ + "nodegraph1/unity_note", + "dot", + "float", + "https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Polygon-Node.html" + ], + [ + "nodegraph1/extract_x", + "extract", + "float", + "" + ], + [ + "nodegraph1/extract_y", + "extract", + "float", + "" + ], + [ + "nodegraph1/pi_div_sides", + "divide", + "float", + "" + ], + [ + "nodegraph1/r", + "multiply", + "float", + "" + ], + [ + "nodegraph1/pCoord_plus_half", + "add", + "float", + "" + ], + [ + "nodegraph1/divide_r", + "divide", + "float", + "" + ], + [ + "nodegraph1/floor_float", + "floor", + "float", + "" + ], + [ + "nodegraph1/multiply_r", + "multiply", + "float", + "" + ], + [ + "nodegraph1/subtract_pCoord", + "subtract", + "float", + "" + ], + [ + "nodegraph1/cos_float2", + "cos", + "float", + "" + ], + [ + "nodegraph1/distance", + "multiply", + "float", + "" + ], + [ + "nodegraph1/length_texcoord", + "magnitude", + "float", + "" + ], + [ + "nodegraph1/clamp_float", + "clamp", + "float", + "" + ], + [ + "nodegraph1/one_min_distance", + "subtract", + "float", + "" + ], + [ + "nodegraph1/divide_float3", + "divide", + "float", + "" + ] + ] + }, + "connections": [ + [ + "nodegraph1/pi_div_sides", + "", + "nodegraph1/cos_float", + "in", + "nodename" + ], + [ + "nodegraph1/width", + "", + "nodegraph1/aWidth", + "in2", + "interfacename" + ], + [ + "nodegraph1/cos_float", + "", + "nodegraph1/aWidth", + "in1", + "nodename" + ], + [ + "nodegraph1/height", + "", + "nodegraph1/aHeight", + "in2", + "interfacename" + ], + [ + "nodegraph1/cos_float", + "", + "nodegraph1/aHeight", + "in1", + "nodename" + ], + [ + "nodegraph1/texcoord_vector2", + "", + "nodegraph1/times_2", + "in1", + "nodename" + ], + [ + "nodegraph1/times_2", + "", + "nodegraph1/minus_1", + "in1", + "nodename" + ], + [ + "nodegraph1/aWidth", + "", + "nodegraph1/width_height_vec", + "in1", + "nodename" + ], + [ + "nodegraph1/aHeight", + "", + "nodegraph1/width_height_vec", + "in2", + "nodename" + ], + [ + "nodegraph1/width_height_vec", + "", + "nodegraph1/uv", + "in2", + "nodename" + ], + [ + "nodegraph1/minus_1", + "", + "nodegraph1/uv", + "in1", + "nodename" + ], + [ + "nodegraph1/uv", + "", + "nodegraph1/multiply_vector2", + "in1", + "nodename" + ], + [ + "nodegraph1/extract_x", + "", + "nodegraph1/pCoord", + "inx", + "nodename" + ], + [ + "nodegraph1/extract_y", + "", + "nodegraph1/pCoord", + "iny", + "nodename" + ], + [ + "nodegraph1/multiply_vector2", + "", + "nodegraph1/extract_x", + "in", + "nodename" + ], + [ + "nodegraph1/multiply_vector2", + "", + "nodegraph1/extract_y", + "in", + "nodename" + ], + [ + "nodegraph1/PI", + "", + "nodegraph1/pi_div_sides", + "in1", + "nodename" + ], + [ + "nodegraph1/sides", + "", + "nodegraph1/pi_div_sides", + "in2", + "interfacename" + ], + [ + "nodegraph1/pi_div_sides", + "", + "nodegraph1/r", + "in1", + "nodename" + ], + [ + "nodegraph1/pCoord", + "", + "nodegraph1/pCoord_plus_half", + "in1", + "nodename" + ], + [ + "nodegraph1/r", + "", + "nodegraph1/divide_r", + "in2", + "nodename" + ], + [ + "nodegraph1/pCoord_plus_half", + "", + "nodegraph1/divide_r", + "in1", + "nodename" + ], + [ + "nodegraph1/divide_r", + "", + "nodegraph1/floor_float", + "in", + "nodename" + ], + [ + "nodegraph1/r", + "", + "nodegraph1/multiply_r", + "in2", + "nodename" + ], + [ + "nodegraph1/floor_float", + "", + "nodegraph1/multiply_r", + "in1", + "nodename" + ], + [ + "nodegraph1/multiply_r", + "", + "nodegraph1/subtract_pCoord", + "in1", + "nodename" + ], + [ + "nodegraph1/pCoord", + "", + "nodegraph1/subtract_pCoord", + "in2", + "nodename" + ], + [ + "nodegraph1/subtract_pCoord", + "", + "nodegraph1/cos_float2", + "in", + "nodename" + ], + [ + "nodegraph1/cos_float2", + "", + "nodegraph1/distance", + "in1", + "nodename" + ], + [ + "nodegraph1/length_texcoord", + "", + "nodegraph1/distance", + "in2", + "nodename" + ], + [ + "nodegraph1/multiply_vector2", + "", + "nodegraph1/length_texcoord", + "in", + "nodename" + ], + [ + "nodegraph1/divide_float3", + "", + "nodegraph1/clamp_float", + "in", + "nodename" + ], + [ + "nodegraph1/distance", + "", + "nodegraph1/one_min_distance", + "in2", + "nodename" + ], + [ + "nodegraph1/one_min_distance", + "", + "nodegraph1/divide_float3", + "in1", + "nodename" + ], + [ + "nodegraph1/clamp_float", + "", + "nodegraph1/output_float", + "", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2_graph.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2_graph.md new file mode 100644 index 00000000..55f65d11 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon2_graph.md @@ -0,0 +1,78 @@ +```mermaid +graph LR + subgraph nodegraph1 + nodegraph1/sides([sides:10]) + style nodegraph1/sides fill:#09D, color:#111 + nodegraph1/width([width:1]) + style nodegraph1/width fill:#09D, color:#111 + nodegraph1/height([height:1]) + style nodegraph1/height fill:#09D, color:#111 + nodegraph1/output_float([output_float]) + style nodegraph1/output_float fill:#0C0, color:#111 + nodegraph1/PI([PI:3.141592653589793238462643]) + style nodegraph1/PI fill:#500, color:#111 + nodegraph1/cos_float[cos_float] + nodegraph1/aWidth[aWidth] + nodegraph1/aHeight[aHeight] + nodegraph1/texcoord_vector2[texcoord_vector2] + nodegraph1/times_2[times_2] + nodegraph1/minus_1[minus_1] + nodegraph1/width_height_vec[width_height_vec] + nodegraph1/uv[uv] + nodegraph1/convert_float_surfaceshader[convert_float_surfaceshader:0] + nodegraph1/multiply_vector2[multiply_vector2] + nodegraph1/pCoord[pCoord] + nodegraph1/convert_vector2_surfaceshader[convert_vector2_surfaceshader:0, 0] + nodegraph1/unity_note[unity_note:https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Polygon-Node.html] + nodegraph1/extract_x[extract_x] + nodegraph1/extract_y[extract_y] + nodegraph1/pi_div_sides[pi_div_sides] + nodegraph1/r[r] + nodegraph1/pCoord_plus_half[pCoord_plus_half] + nodegraph1/divide_r[divide_r] + nodegraph1/floor_float[floor_float] + nodegraph1/multiply_r[multiply_r] + nodegraph1/subtract_pCoord[subtract_pCoord] + nodegraph1/cos_float2[cos_float2] + nodegraph1/distance[distance] + nodegraph1/length_texcoord[length_texcoord] + nodegraph1/clamp_float[clamp_float] + nodegraph1/one_min_distance[one_min_distance] + nodegraph1/divide_float3[divide_float3] + end + nodegraph1/pi_div_sides --"in"--> nodegraph1/cos_float + nodegraph1/width --"in2"--> nodegraph1/aWidth + nodegraph1/cos_float --"in1"--> nodegraph1/aWidth + nodegraph1/height --"in2"--> nodegraph1/aHeight + nodegraph1/cos_float --"in1"--> nodegraph1/aHeight + nodegraph1/texcoord_vector2 --"in1"--> nodegraph1/times_2 + nodegraph1/times_2 --"in1"--> nodegraph1/minus_1 + nodegraph1/aWidth --"in1"--> nodegraph1/width_height_vec + nodegraph1/aHeight --"in2"--> nodegraph1/width_height_vec + nodegraph1/width_height_vec --"in2"--> nodegraph1/uv + nodegraph1/minus_1 --"in1"--> nodegraph1/uv + nodegraph1/uv --"in1"--> nodegraph1/multiply_vector2 + nodegraph1/extract_x --"inx"--> nodegraph1/pCoord + nodegraph1/extract_y --"iny"--> nodegraph1/pCoord + nodegraph1/multiply_vector2 --"in"--> nodegraph1/extract_x + nodegraph1/multiply_vector2 --"in"--> nodegraph1/extract_y + nodegraph1/PI --"in1"--> nodegraph1/pi_div_sides + nodegraph1/sides --"in2"--> nodegraph1/pi_div_sides + nodegraph1/pi_div_sides --"in1"--> nodegraph1/r + nodegraph1/pCoord --"in1"--> nodegraph1/pCoord_plus_half + nodegraph1/r --"in2"--> nodegraph1/divide_r + nodegraph1/pCoord_plus_half --"in1"--> nodegraph1/divide_r + nodegraph1/divide_r --"in"--> nodegraph1/floor_float + nodegraph1/r --"in2"--> nodegraph1/multiply_r + nodegraph1/floor_float --"in1"--> nodegraph1/multiply_r + nodegraph1/multiply_r --"in1"--> nodegraph1/subtract_pCoord + nodegraph1/pCoord --"in2"--> nodegraph1/subtract_pCoord + nodegraph1/subtract_pCoord --"in"--> nodegraph1/cos_float2 + nodegraph1/cos_float2 --"in1"--> nodegraph1/distance + nodegraph1/length_texcoord --"in2"--> nodegraph1/distance + nodegraph1/multiply_vector2 --"in"--> nodegraph1/length_texcoord + nodegraph1/divide_float3 --"in"--> nodegraph1/clamp_float + nodegraph1/distance --"in2"--> nodegraph1/one_min_distance + nodegraph1/one_min_distance --"in1"--> nodegraph1/divide_float3 + nodegraph1/clamp_float --> nodegraph1/output_float +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon_connections.json new file mode 100644 index 00000000..22e2d4fc --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unity_polygon_connections.json @@ -0,0 +1,501 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\unity_polygon.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "nodegraph1": [ + [ + "nodegraph1/sides", + "input", + "float", + "5" + ], + [ + "nodegraph1/width", + "input", + "float", + "0.2" + ], + [ + "nodegraph1/height", + "input", + "float", + "0.2" + ], + [ + "nodegraph1/output_float", + "output", + "float", + "" + ], + [ + "nodegraph1/PI", + "constant", + "float", + "3.14159265359" + ], + [ + "nodegraph1/cos_float", + "cos", + "float", + "" + ], + [ + "nodegraph1/divide_float", + "divide", + "float", + "" + ], + [ + "nodegraph1/aWidth", + "multiply", + "float", + "" + ], + [ + "nodegraph1/aHeight", + "multiply", + "float", + "" + ], + [ + "nodegraph1/texcoord_vector2", + "texcoord", + "vector2", + "" + ], + [ + "nodegraph1/times_2", + "multiply", + "vector2", + "" + ], + [ + "nodegraph1/minus_1", + "subtract", + "vector2", + "" + ], + [ + "nodegraph1/width_height_vec", + "combine2", + "vector2", + "" + ], + [ + "nodegraph1/uv", + "divide", + "vector2", + "" + ], + [ + "nodegraph1/convert_float_surfaceshader", + "convert", + "surfaceshader", + "0" + ], + [ + "nodegraph1/multiply_vector2", + "multiply", + "vector2", + "" + ], + [ + "nodegraph1/pCoord", + "atan2", + "float", + "" + ], + [ + "nodegraph1/convert_vector2_surfaceshader", + "convert", + "surfaceshader", + "0, 0" + ], + [ + "nodegraph1/unity_note", + "dot", + "float", + "https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Polygon-Node.html" + ], + [ + "nodegraph1/extract_x", + "extract", + "float", + "" + ], + [ + "nodegraph1/extract_y", + "extract", + "float", + "" + ], + [ + "nodegraph1/pi_div_sides", + "divide", + "float", + "" + ], + [ + "nodegraph1/r", + "multiply", + "float", + "" + ], + [ + "nodegraph1/add_float", + "add", + "float", + "" + ], + [ + "nodegraph1/divide_float2", + "divide", + "float", + "" + ], + [ + "nodegraph1/floor_float", + "floor", + "float", + "" + ], + [ + "nodegraph1/multiply_float", + "multiply", + "float", + "" + ], + [ + "nodegraph1/subtract_float", + "subtract", + "float", + "" + ], + [ + "nodegraph1/cos_float2", + "cos", + "float", + "" + ], + [ + "nodegraph1/distance", + "multiply", + "float", + "" + ], + [ + "nodegraph1/magnitude_vector2", + "magnitude", + "float", + "" + ], + [ + "nodegraph1/clamp_float", + "clamp", + "float", + "" + ], + [ + "nodegraph1/one_min_distance", + "subtract", + "float", + "" + ], + [ + "nodegraph1/divide_float3", + "divide", + "float", + "" + ] + ], + "": [ + [ + "surface_unlit", + "surface_unlit", + "surfaceshader", + "" + ], + [ + "surfacematerial", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "nodegraph1/divide_float", + "", + "nodegraph1/cos_float", + "in", + "nodename" + ], + [ + "nodegraph1/PI", + "", + "nodegraph1/divide_float", + "in1", + "nodename" + ], + [ + "nodegraph1/sides", + "", + "nodegraph1/divide_float", + "in2", + "interfacename" + ], + [ + "nodegraph1/width", + "", + "nodegraph1/aWidth", + "in2", + "interfacename" + ], + [ + "nodegraph1/cos_float", + "", + "nodegraph1/aWidth", + "in1", + "nodename" + ], + [ + "nodegraph1/height", + "", + "nodegraph1/aHeight", + "in2", + "interfacename" + ], + [ + "nodegraph1/cos_float", + "", + "nodegraph1/aHeight", + "in1", + "nodename" + ], + [ + "nodegraph1/texcoord_vector2", + "", + "nodegraph1/times_2", + "in1", + "nodename" + ], + [ + "nodegraph1/times_2", + "", + "nodegraph1/minus_1", + "in1", + "nodename" + ], + [ + "nodegraph1/width", + "", + "nodegraph1/width_height_vec", + "in1", + "interfacename" + ], + [ + "nodegraph1/height", + "", + "nodegraph1/width_height_vec", + "in2", + "interfacename" + ], + [ + "nodegraph1/width_height_vec", + "", + "nodegraph1/uv", + "in2", + "nodename" + ], + [ + "nodegraph1/minus_1", + "", + "nodegraph1/uv", + "in1", + "nodename" + ], + [ + "nodegraph1/uv", + "", + "nodegraph1/multiply_vector2", + "in1", + "nodename" + ], + [ + "nodegraph1/extract_y", + "", + "nodegraph1/pCoord", + "inx", + "nodename" + ], + [ + "nodegraph1/extract_x", + "", + "nodegraph1/pCoord", + "iny", + "nodename" + ], + [ + "nodegraph1/uv", + "", + "nodegraph1/extract_x", + "in", + "nodename" + ], + [ + "nodegraph1/uv", + "", + "nodegraph1/extract_y", + "in", + "nodename" + ], + [ + "nodegraph1/PI", + "", + "nodegraph1/pi_div_sides", + "in1", + "nodename" + ], + [ + "nodegraph1/sides", + "", + "nodegraph1/pi_div_sides", + "in2", + "interfacename" + ], + [ + "nodegraph1/pi_div_sides", + "", + "nodegraph1/r", + "in1", + "nodename" + ], + [ + "nodegraph1/pCoord", + "", + "nodegraph1/add_float", + "in1", + "nodename" + ], + [ + "nodegraph1/r", + "", + "nodegraph1/divide_float2", + "in2", + "nodename" + ], + [ + "nodegraph1/add_float", + "", + "nodegraph1/divide_float2", + "in1", + "nodename" + ], + [ + "nodegraph1/divide_float2", + "", + "nodegraph1/floor_float", + "in", + "nodename" + ], + [ + "nodegraph1/r", + "", + "nodegraph1/multiply_float", + "in2", + "nodename" + ], + [ + "nodegraph1/floor_float", + "", + "nodegraph1/multiply_float", + "in1", + "nodename" + ], + [ + "nodegraph1/multiply_float", + "", + "nodegraph1/subtract_float", + "in1", + "nodename" + ], + [ + "nodegraph1/pCoord", + "", + "nodegraph1/subtract_float", + "in2", + "nodename" + ], + [ + "nodegraph1/subtract_float", + "", + "nodegraph1/cos_float2", + "in", + "nodename" + ], + [ + "nodegraph1/cos_float2", + "", + "nodegraph1/distance", + "in1", + "nodename" + ], + [ + "nodegraph1/magnitude_vector2", + "", + "nodegraph1/distance", + "in2", + "nodename" + ], + [ + "nodegraph1/uv", + "", + "nodegraph1/magnitude_vector2", + "in", + "nodename" + ], + [ + "nodegraph1/divide_float3", + "", + "nodegraph1/clamp_float", + "in", + "nodename" + ], + [ + "nodegraph1/distance", + "", + "nodegraph1/one_min_distance", + "in2", + "nodename" + ], + [ + "nodegraph1/one_min_distance", + "", + "nodegraph1/divide_float3", + "in1", + "nodename" + ], + [ + "nodegraph1/clamp_float", + "", + "nodegraph1/output_float", + "", + "nodename" + ], + [ + "nodegraph1/output_float", + "", + "surface_unlit", + "emission", + "nodename" + ], + [ + "surface_unlit", + "", + "surfacematerial", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unlitshader_default.md b/javascript/viewer/dist/Materials/Examples/StandardSurface/unlitshader_default.md new file mode 100644 index 00000000..52440003 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unlitshader_default.md @@ -0,0 +1,9 @@ +```mermaid +graph LR + surface_unlit[surface_unlit] + style surfacematerial fill:#090, color:#FFF + surfacematerial([surfacematerial]) + checkerboard_color3[checkerboard_color3:10, 10] + checkerboard_color3 --"emission_color"--> surface_unlit + surface_unlit --"surfaceshader"--> surfacematerial +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/StandardSurface/unlitshader_default_connections.json b/javascript/viewer/dist/Materials/Examples/StandardSurface/unlitshader_default_connections.json new file mode 100644 index 00000000..1f0a0c1f --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/StandardSurface/unlitshader_default_connections.json @@ -0,0 +1,42 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\StandardSurface\\unlitshader_default.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "surface_unlit", + "surface_unlit", + "surfaceshader", + "" + ], + [ + "surfacematerial", + "surfacematerial", + "material", + "" + ], + [ + "checkerboard_color3", + "checkerboard", + "color3", + "10, 10" + ] + ] + }, + "connections": [ + [ + "checkerboard_color3", + "", + "surface_unlit", + "emission_color", + "nodename" + ], + [ + "surface_unlit", + "", + "surfacematerial", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled.md b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled.md new file mode 100644 index 00000000..44b3eeac --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled.md @@ -0,0 +1,19 @@ +```mermaid +graph LR + subgraph NG_brass1 + style NG_brass1_out_color fill:#0C0, color:#FFF + NG_brass1_out_color([out_color]) + style NG_brass1_out_roughness fill:#0C0, color:#FFF + NG_brass1_out_roughness([out_roughness]) + NG_brass1_image_color[image_color] + NG_brass1_image_roughness[image_roughness] + end + SR_brass1[SR_brass1] + style USD_Tiled_Brass fill:#090, color:#FFF + USD_Tiled_Brass([USD_Tiled_Brass]) + NG_brass1_image_color --> NG_brass1_out_color + NG_brass1_image_roughness --> NG_brass1_out_roughness + NG_brass1_out_color --"diffuseColor"--> SR_brass1 + NG_brass1_out_roughness --"roughness"--> SR_brass1 + SR_brass1 --"surfaceshader"--> USD_Tiled_Brass +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled_connections.json b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled_connections.json new file mode 100644 index 00000000..f1437ae2 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled_connections.json @@ -0,0 +1,83 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_brass_tiled.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "NG_brass1": [ + [ + "NG_brass1/out_color", + "output", + "color3", + "" + ], + [ + "NG_brass1/out_roughness", + "output", + "float", + "" + ], + [ + "NG_brass1/image_color", + "tiledimage", + "color3", + "" + ], + [ + "NG_brass1/image_roughness", + "tiledimage", + "float", + "" + ] + ], + "": [ + [ + "SR_brass1", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Tiled_Brass", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "NG_brass1/image_color", + "", + "NG_brass1/out_color", + "", + "nodename" + ], + [ + "NG_brass1/image_roughness", + "", + "NG_brass1/out_roughness", + "", + "nodename" + ], + [ + "NG_brass1/out_color", + "", + "SR_brass1", + "diffuseColor", + "nodename" + ], + [ + "NG_brass1/out_roughness", + "", + "SR_brass1", + "roughness", + "nodename" + ], + [ + "SR_brass1", + "", + "USD_Tiled_Brass", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint.md b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint.md new file mode 100644 index 00000000..f56962ee --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_carpaint[SR_carpaint] + style USD_Car_Paint fill:#090, color:#FFF + USD_Car_Paint([USD_Car_Paint]) + SR_carpaint --"surfaceshader"--> USD_Car_Paint +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint_connections.json b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint_connections.json new file mode 100644 index 00000000..ff039fd2 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_carpaint.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_carpaint", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Car_Paint", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_carpaint", + "", + "USD_Car_Paint", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default.md b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default.md new file mode 100644 index 00000000..6026d141 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_default[SR_default] + style USD_Default fill:#090, color:#FFF + USD_Default([USD_Default]) + SR_default --"surfaceshader"--> USD_Default +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default_connections.json b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default_connections.json new file mode 100644 index 00000000..56d7321a --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_default.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_default", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Default", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_default", + "", + "USD_Default", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass.md b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass.md new file mode 100644 index 00000000..370b1481 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_glass[SR_glass] + style USD_Glass fill:#090, color:#FFF + USD_Glass([USD_Glass]) + SR_glass --"surfaceshader"--> USD_Glass +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass_connections.json b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass_connections.json new file mode 100644 index 00000000..7aa204bd --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_glass.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_glass", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Glass", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_glass", + "", + "USD_Glass", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold.md b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold.md new file mode 100644 index 00000000..1e188dc8 --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_gold[SR_gold] + style USD_Gold fill:#090, color:#FFF + USD_Gold([USD_Gold]) + SR_gold --"surfaceshader"--> USD_Gold +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold_connections.json b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold_connections.json new file mode 100644 index 00000000..9091f8af --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_gold.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_gold", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Gold", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_gold", + "", + "USD_Gold", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic.md b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic.md new file mode 100644 index 00000000..490b069e --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_plastic[SR_plastic] + style USD_Plastic fill:#090, color:#FFF + USD_Plastic([USD_Plastic]) + SR_plastic --"surfaceshader"--> USD_Plastic +``` \ No newline at end of file diff --git a/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic_connections.json b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic_connections.json new file mode 100644 index 00000000..9083489a --- /dev/null +++ b/javascript/viewer/dist/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_plastic.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_plastic", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Plastic", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_plastic", + "", + "USD_Plastic", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/javascript/viewer/dist/index.html b/javascript/viewer/dist/index.html index aef1f8fd..7421eaa7 100644 --- a/javascript/viewer/dist/index.html +++ b/javascript/viewer/dist/index.html @@ -5,17 +5,23 @@ - + + + + + + + --> + @@ -76,11 +104,22 @@

                            Document Visualization

                            material is rendered in the 3D view. The shader setup is known to be quite slow using ThreeJS raw shaders due to the number of uniforms that are generated via MaterialX code generation.

                            -
                            -
                            + + + +
                            +
                            +
                            +
                            +
                            @@ -112,14 +151,14 @@

                            Document Visualization

                            -
                            - +
                            +
                            + +
                            -

                            - @@ -129,14 +168,21 @@

                            Document Visualization

                            - +
                            +
                            + +
                            @@ -201,9 +247,9 @@

                            Document Visualization

                            vkgenContext = new mmx.GenContext(vkgenerator); mmx.loadStandardLibraries(vkgenContext); - mdlgenerator = new mmx.MdlShaderGenerator(); - mdlgenContext = new mmx.GenContext(mdlgenerator); - mmx.loadStandardLibraries(mdlgenContext); + //mdlgenerator = new mmx.MdlShaderGenerator(); + //mdlgenContext = new mmx.GenContext(mdlgenerator); + //mmx.loadStandardLibraries(mdlgenContext); } @@ -348,20 +394,33 @@

                            Document Visualization

                            } } - const shaderNodes = []; - for (let i = 0; i < shaderNodes.length; ++i) { - let shaderNode = shaderNodes[i]; - let shaderNodePath = shaderNode.getNamePath() - if (!shaderList.includes(shaderNodePath)) { - let assignment = NO_GEOMETRY_SPECIFIER; - if (foundRenderable == false) { - assignment = ALL_GEOMETRY_SPECIFIER; - foundRenderable = true; + /* + const allNodes = mdoc.getNodes(); + console.log('All Nodes:', allNodes.length, allNodes); + for (let i = 0; i < allNodes.length; ++i) { + let node = allNodes[i]; + if (node) { + if (node.getType() == 'surfaceshader') { + let shaderNodePath = node.getNamePath() + if (!shaderList.includes(shaderNodePath)) { + console.log('========================= Node:', node.getNamePath(), node.getCategory(), node.getType()); + let assignment = NO_GEOMETRY_SPECIFIER; + if (foundRenderable == false) { + assignment = ALL_GEOMETRY_SPECIFIER; + foundRenderable = true; + } + shaderList.push(shaderNodePath); + // Create a dummy surface material + let surfaceMaterial = mdoc.addChildOfCategory('surfacematerial', shaderNodePath + '_material'); + let sm_input = surfaceMaterial.addInput('surfaceshader', 'surfaceshader'); + sm_input.setValueString(shaderNodePath, 'surfaceshader'); + renderableItems.push(shaderNodePath); + console.log('Add dummy material:', mmx.prettyPrint(surfaceMaterial)); + } } - shaderList.push(shaderNodePath); - renderableItems.push(shaderNodePath); } - } + + } */ //console.log('----------- Renderable Items:', renderableItems); // Update selection for renderables @@ -390,8 +449,7 @@

                            Document Visualization

                            mode: 'application/xml', lineNumbers: true, dragDrop: true, - theme: 'dracula', - //theme: 'material-darker' // See https://codemirror.net/5/demo/theme.html + theme: 'night', }); // Optional: Set an initial value for the textarea @@ -404,6 +462,12 @@

                            Document Visualization

                            // Copy the content from CodeMirror back to the textarea materialXTextArea.value = editor.getValue(); }); + + var pasteButton = document.getElementById('materialXTextArea_paste'); + if (pasteButton) + { + addPasteHandler(pasteButton, editor); + } } editor.setValue(contents); @@ -590,10 +654,10 @@

                            Document Visualization

                            generator = vkgenerator; genContext = vkgenContext; } - else if (shaderLanguage == 5) { - generator = mdlgenerator; - genContext = mdlgenContext; - } + //else if (shaderLanguage == 5) { + // generator = mdlgenerator; + // genContext = mdlgenContext; + //} console.log('-------------- Use Generator for: %s ---------------', generator.getTarget()) const isTransparent = mmx.isTransparentSurface(elem, generator.getTarget()); @@ -700,6 +764,10 @@

                            Document Visualization

                            showDocument(textArea.value); }); } + + addCopyHandlers(); + addPasteHandlers(); + diff --git a/javascript/viewer/dist/index_out.html b/javascript/viewer/dist/index_out.html index 2673ec0a..a37a29e2 100644 --- a/javascript/viewer/dist/index_out.html +++ b/javascript/viewer/dist/index_out.html @@ -44,17 +44,23 @@ - + + + + + + + --> + @@ -88,7 +116,7 @@ - + @@ -274,11 +302,22 @@

                            Document Visualization

                            material is rendered in the 3D view. The shader setup is known to be quite slow using ThreeJS raw shaders due to the number of uniforms that are generated via MaterialX code generation.

                            -
                            -
                            + + + +
                            +
                            +
                            +
                            +
                            @@ -310,14 +349,14 @@

                            Document Visualization

                            -
                            - +
                            +
                            + +
                            -

                            - @@ -327,14 +366,21 @@

                            Document Visualization

                            - +
                            +
                            + +
                            @@ -399,9 +445,9 @@

                            Document Visualization

                            vkgenContext = new mmx.GenContext(vkgenerator); mmx.loadStandardLibraries(vkgenContext); - mdlgenerator = new mmx.MdlShaderGenerator(); - mdlgenContext = new mmx.GenContext(mdlgenerator); - mmx.loadStandardLibraries(mdlgenContext); + //mdlgenerator = new mmx.MdlShaderGenerator(); + //mdlgenContext = new mmx.GenContext(mdlgenerator); + //mmx.loadStandardLibraries(mdlgenContext); } @@ -546,20 +592,33 @@

                            Document Visualization

                            } } - const shaderNodes = []; - for (let i = 0; i < shaderNodes.length; ++i) { - let shaderNode = shaderNodes[i]; - let shaderNodePath = shaderNode.getNamePath() - if (!shaderList.includes(shaderNodePath)) { - let assignment = NO_GEOMETRY_SPECIFIER; - if (foundRenderable == false) { - assignment = ALL_GEOMETRY_SPECIFIER; - foundRenderable = true; + /* + const allNodes = mdoc.getNodes(); + console.log('All Nodes:', allNodes.length, allNodes); + for (let i = 0; i < allNodes.length; ++i) { + let node = allNodes[i]; + if (node) { + if (node.getType() == 'surfaceshader') { + let shaderNodePath = node.getNamePath() + if (!shaderList.includes(shaderNodePath)) { + console.log('========================= Node:', node.getNamePath(), node.getCategory(), node.getType()); + let assignment = NO_GEOMETRY_SPECIFIER; + if (foundRenderable == false) { + assignment = ALL_GEOMETRY_SPECIFIER; + foundRenderable = true; + } + shaderList.push(shaderNodePath); + // Create a dummy surface material + let surfaceMaterial = mdoc.addChildOfCategory('surfacematerial', shaderNodePath + '_material'); + let sm_input = surfaceMaterial.addInput('surfaceshader', 'surfaceshader'); + sm_input.setValueString(shaderNodePath, 'surfaceshader'); + renderableItems.push(shaderNodePath); + console.log('Add dummy material:', mmx.prettyPrint(surfaceMaterial)); + } } - shaderList.push(shaderNodePath); - renderableItems.push(shaderNodePath); } - } + + } */ //console.log('----------- Renderable Items:', renderableItems); // Update selection for renderables @@ -588,8 +647,7 @@

                            Document Visualization

                            mode: 'application/xml', lineNumbers: true, dragDrop: true, - theme: 'dracula', - //theme: 'material-darker' // See https://codemirror.net/5/demo/theme.html + theme: 'night', }); // Optional: Set an initial value for the textarea @@ -602,6 +660,12 @@

                            Document Visualization

                            // Copy the content from CodeMirror back to the textarea materialXTextArea.value = editor.getValue(); }); + + var pasteButton = document.getElementById('materialXTextArea_paste'); + if (pasteButton) + { + addPasteHandler(pasteButton, editor); + } } editor.setValue(contents); @@ -788,10 +852,10 @@

                            Document Visualization

                            generator = vkgenerator; genContext = vkgenContext; } - else if (shaderLanguage == 5) { - generator = mdlgenerator; - genContext = mdlgenContext; - } + //else if (shaderLanguage == 5) { + // generator = mdlgenerator; + // genContext = mdlgenContext; + //} console.log('-------------- Use Generator for: %s ---------------', generator.getTarget()) const isTransparent = mmx.isTransparentSurface(elem, generator.getTarget()); @@ -898,6 +962,10 @@

                            Document Visualization

                            showDocument(textArea.value); }); } + + addCopyHandlers(); + addPasteHandlers(); +
                            diff --git a/javascript/viewer/dist/main.js b/javascript/viewer/dist/main.js index 0692e140..97275f3f 100644 --- a/javascript/viewer/dist/main.js +++ b/javascript/viewer/dist/main.js @@ -26,7 +26,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \**************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ findLights: () => (/* binding */ findLights),\n/* harmony export */ getLightRotation: () => (/* binding */ getLightRotation),\n/* harmony export */ getUniformValues: () => (/* binding */ getUniformValues),\n/* harmony export */ prepareEnvTexture: () => (/* binding */ prepareEnvTexture),\n/* harmony export */ registerLights: () => (/* binding */ registerLights)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n//\r\n// Copyright Contributors to the MaterialX Project\r\n// SPDX-License-Identifier: Apache-2.0\r\n//\r\n\r\n\r\n\r\n//import { getBufferFromFile } from './dropHandling.js';\r\n\r\nconst IMAGE_PROPERTY_SEPARATOR = \"_\";\r\nconst UADDRESS_MODE_SUFFIX = IMAGE_PROPERTY_SEPARATOR + \"uaddressmode\";\r\nconst VADDRESS_MODE_SUFFIX = IMAGE_PROPERTY_SEPARATOR + \"vaddressmode\";\r\nconst FILTER_TYPE_SUFFIX = IMAGE_PROPERTY_SEPARATOR + \"filtertype\";\r\nconst IMAGE_PATH_SEPARATOR = \"/\";\r\n\r\n/**\r\n * Initialized the environment texture as MaterialX expects it\r\n * @param {THREE.Texture} texture\r\n * @param {Object} capabilities\r\n * @returns {THREE.Texture}\r\n */\r\nfunction prepareEnvTexture(texture, capabilities)\r\n{\r\n let newTexture = new three__WEBPACK_IMPORTED_MODULE_0__.DataTexture(texture.image.data, texture.image.width, texture.image.height, texture.format, texture.type);\r\n newTexture.wrapS = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n newTexture.anisotropy = capabilities.getMaxAnisotropy();\r\n newTexture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapLinearFilter;\r\n newTexture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter;\r\n newTexture.generateMipmaps = true;\r\n newTexture.needsUpdate = true;\r\n\r\n return newTexture;\r\n}\r\n\r\n/**\r\n * Get Three uniform from MaterialX vector\r\n * @param {any} value\r\n * @param {any} dimension\r\n * @returns {THREE.Uniform}\r\n */\r\nfunction fromVector(value, dimension)\r\n{\r\n let outValue;\r\n if (value)\r\n {\r\n outValue = value.data();\r\n }\r\n else\r\n {\r\n outValue = [];\r\n for (let i = 0; i < dimension; ++i)\r\n outValue.push(0.0);\r\n }\r\n\r\n return outValue;\r\n}\r\n\r\n/**\r\n * Get Three uniform from MaterialX matrix\r\n * @param {mx.matrix} matrix\r\n * @param {mx.matrix.size} dimension\r\n */\r\nfunction fromMatrix(matrix, dimension)\r\n{\r\n let vec = [];\r\n if (matrix)\r\n {\r\n for (let i = 0; i < matrix.numRows(); ++i)\r\n {\r\n for (let k = 0; k < matrix.numColumns(); ++k)\r\n {\r\n vec.push(matrix.getItem(i, k));\r\n }\r\n }\r\n } else\r\n {\r\n for (let i = 0; i < dimension; ++i)\r\n vec.push(0.0);\r\n }\r\n\r\n return vec;\r\n}\r\n\r\nfunction loadTextureFile(uri, loader)\r\n{\r\n return new Promise((resolve, reject) =>\r\n {\r\n if (loader) \r\n {\r\n console.log(\"Load image file: \", uri); \r\n loader.load(\r\n uri,\r\n function (texture) {\r\n console.log('- Resolve texture:', texture);\r\n resolve(texture);\r\n },\r\n function (xhr) {\r\n // This function will be called while the texture is loading\r\n console.log((xhr.loaded / xhr.total) * 100 + '% loaded');\r\n },\r\n function (error) {\r\n resolve(null);\r\n // This function will be called if there is an error loading the texture\r\n //reject(new Error('Error loading texture: ' + error));\r\n }\r\n ); \r\n }\r\n });\r\n}\r\n\r\n// Function to load an image file and return a buffer using FileReader.readAsArrayBuffer()\r\nfunction getTextureBufferFromFile(filePath, textureLoader) {\r\n return new Promise((resolve, reject) => {\r\n // Create a FileReader\r\n const fileReader = new FileReader();\r\n\r\n // Event listener for the FileReader's load event\r\n //fileReader.addEventListener('load', function (event) {\r\n fileReader.onloadend = function (e)\r\n {\r\n // Get the result of the FileReader as an ArrayBuffer\r\n const buffer = event.target.result;\r\n\r\n // Convert the ArrayBuffer to a Uint8Array for examination\r\n //const uint8Array = new Uint8Array(buffer);\r\n\r\n console.log('--------- Loaded Buffer:', buffer, filePath, '---------');\r\n\r\n // Handle the obtained buffer\r\n console.log('Add texture buffer to cache:', filePath, ', ', buffer);\r\n\r\n const texture = loadTextureFile(URL.createObjectURL(new Blob([buffer])), textureLoader);\r\n //const texture = textureLoader.load(URL.createObjectURL(new Blob([buffer])));\r\n\r\n //const dataURL = 'data:image/jpeg;base64,' + btoa(String.fromCharCode.apply(null, uint8Array));\r\n //console.log('dataURL:', dataURL)\r\n //const texture = textureLoader.load(dataURL, function () {\r\n // Log the dimensions of the resulting texture\r\n // console.log('Texture dimensions:', texture.image.width, 'x', texture.image.height);\r\n //}); \r\n\r\n //const texture = textureLoader.load(texturePath);\r\n // Set address & filtering mode\r\n if (texture) {\r\n //THREE.Cache.add(filePath, texture);\r\n //setTextureParameters(texture, name, uniforms, flipY);\r\n //outValue = texture;\r\n console.log('Success: texture cached:', filePath, three__WEBPACK_IMPORTED_MODULE_0__.Cache.get(filePath));\r\n //let blah = THREE.Cache.get(texturePath);\r\n //if (blah)\r\n // console.log('blah.image.width:', blah.image.width, ', blah.image.height:', blah.image.height, ', blah.image.data:', blah.image.data, ', blah.image.data.length:', blah.image.data.length, ', blah.image.data.byteLength:', blah.image.data.byteLength, ', blah.image.data.buffer.byteLength:', blah.image.data.buffer.byteLength, ', blah.image.data.buffer:', blah.image.data.buffer);\r\n }\r\n else {\r\n console.error('Error: texture not found in cache:', filePath);\r\n }\r\n\r\n // Resolve the Promise with the obtained buffer\r\n resolve(texture);\r\n };\r\n\r\n // Event listener for errors during file reading\r\n fileReader.addEventListener('error', function (event) {\r\n result(null); // reject(new Error('Error reading file: ' + event.target.error));\r\n });\r\n\r\n // Read the content of the file as an ArrayBuffer\r\n fileReader.readAsArrayBuffer(new Blob([filePath]));\r\n });\r\n}\r\n\r\n\r\n// Function to load an image file and examine the dimensions of the loaded texture\r\nfunction examineImageFile(filePath, textureLoader) {\r\n return new Promise((resolve, reject) => {\r\n // Create a FileReader\r\n const fileReader = new FileReader();\r\n\r\n // Event listener for the FileReader's load event\r\n fileReader.addEventListener('load', function (event) {\r\n // Get the result of the FileReader as a data URL\r\n const dataURL = event.target.result;\r\n console.log('Load URL:', dataURL, filePath, '---------')\r\n\r\n // Create a texture using the data URL\r\n const texture = textureLoader.load(dataURL, function () {\r\n // Log the dimensions of the resulting texture\r\n console.log('Texture dimensions:', texture.image.width, 'x', texture.image.height);\r\n\r\n // Resolve the Promise with the loaded texture\r\n resolve(texture);\r\n });\r\n });\r\n\r\n // Event listener for errors during file reading\r\n fileReader.addEventListener('error', function (event) {\r\n reject(new Error('Error reading file: ' + event.target.error));\r\n });\r\n\r\n // Read the content of the file as a data URL\r\n fileReader.readAsDataURL(new Blob([filePath]));\r\n });\r\n}\r\n\r\n\r\n\r\n/**\r\n * Get Three uniform from MaterialX value\r\n * @param {mx.Uniform.type} type\r\n * @param {mx.Uniform.value} value\r\n * @param {mx.Uniform.name} name\r\n * @param {mx.Uniforms} uniforms\r\n * @param {THREE.textureLoader} textureLoader\r\n */\r\nfunction toThreeUniform(type, value, name, uniforms, textureLoader, searchPath, flipY)\r\n{\r\n let outValue;\r\n switch (type)\r\n {\r\n case 'float':\r\n case 'integer':\r\n case 'boolean':\r\n outValue = value;\r\n break;\r\n case 'vector2':\r\n outValue = fromVector(value, 2);\r\n break;\r\n case 'vector3':\r\n case 'color3':\r\n outValue = fromVector(value, 3);\r\n break;\r\n case 'vector4':\r\n case 'color4':\r\n outValue = fromVector(value, 4);\r\n break;\r\n case 'matrix33':\r\n outValue = fromMatrix(value, 9);\r\n break;\r\n case 'matrix44':\r\n outValue = fromMatrix(value, 16);\r\n break;\r\n case 'filename':\r\n if (value)\r\n {\r\n let texturePath = searchPath + IMAGE_PATH_SEPARATOR + value;\r\n const textureExists = three__WEBPACK_IMPORTED_MODULE_0__.Cache.get(texturePath);\r\n if (!textureExists)\r\n {\r\n \r\n // Call the function to examine the image file\r\n /* examineImageFile(texturePath, textureLoader)\r\n .then(texture => {\r\n console.log('Add texture to cache:', texturePath, texture)\r\n setTextureParameters(texture, name, uniforms, flipY);\r\n outValue = texture; \r\n })\r\n .catch(error => {\r\n // Handle errors\r\n console.error('Error:', error);\r\n });\r\n */\r\n // Call the function to get a buffer from the file\r\n /*\r\n getTextureBufferFromFile(texturePath, textureLoader)\r\n .then(texture => {\r\n if (texture)\r\n setTextureParameters(texture, name, uniforms, flipY);\r\n outValue = texture;\r\n console.log('-- FINISHED loading: ' + texturePath)\r\n })\r\n .catch(error => {\r\n // Handle errors\r\n console.error('Error:', error);\r\n });\r\n */\r\n console.log('Image file not loaded: ', texturePath);\r\n }\r\n else\r\n {\r\n const texture = textureLoader.load(texturePath);\r\n // Set address & filtering mode\r\n if (texture)\r\n {\r\n console.log('Loaded texture: ' + texturePath, ' searchPath: ' + searchPath + ' texture: ', texture)\r\n setTextureParameters(texture, name, uniforms, flipY);\r\n }\r\n outValue = texture;\r\n }\r\n }\r\n break;\r\n case 'samplerCube':\r\n case 'string':\r\n break;\r\n default:\r\n console.log('Value type not supported: ' + type);\r\n // struct\r\n outValue = null;//toThreeUniform(value);\r\n }\r\n\r\n return outValue;\r\n}\r\n\r\n/**\r\n * Get Three wrapping mode\r\n * @param {mx.TextureFilter.wrap} mode\r\n * @returns {THREE.Wrapping}\r\n */\r\nfunction getWrapping(mode)\r\n{\r\n let wrap;\r\n switch (mode)\r\n {\r\n case 1:\r\n wrap = three__WEBPACK_IMPORTED_MODULE_0__.ClampToEdgeWrapping;\r\n break;\r\n case 2:\r\n wrap = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n break;\r\n case 3:\r\n wrap = three__WEBPACK_IMPORTED_MODULE_0__.MirroredRepeatWrapping;\r\n break;\r\n default:\r\n wrap = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n break;\r\n }\r\n return wrap;\r\n}\r\n\r\n/**\r\n * Get Three minification filter\r\n * @param {mx.TextureFilter.minFilter} type\r\n * @param {mx.TextureFilter.generateMipmaps} generateMipmaps\r\n */\r\nfunction getMinFilter(type, generateMipmaps)\r\n{\r\n const filterType = generateMipmaps ? three__WEBPACK_IMPORTED_MODULE_0__.LinearMipMapLinearFilter : three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter;\r\n if (type === 0)\r\n {\r\n filterType = generateMipmaps ? three__WEBPACK_IMPORTED_MODULE_0__.NearestMipMapNearestFilter : three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter;\r\n }\r\n return filterType;\r\n}\r\n\r\n/**\r\n * Set Three texture parameters\r\n * @param {THREE.Texture} texture\r\n * @param {mx.Uniform.name} name\r\n * @param {mx.Uniforms} uniforms\r\n * @param {mx.TextureFilter.generateMipmaps} generateMipmaps\r\n */\r\nfunction setTextureParameters(texture, name, uniforms, flipY = true, generateMipmaps = true)\r\n{\r\n const idx = name.lastIndexOf(IMAGE_PROPERTY_SEPARATOR);\r\n const base = name.substring(0, idx) || name;\r\n\r\n texture.generateMipmaps = generateMipmaps;\r\n texture.wrapS = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n texture.wrapT = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter;\r\n texture.flipY = flipY;\r\n\r\n if (uniforms.find(base + UADDRESS_MODE_SUFFIX))\r\n {\r\n const uaddressmode = uniforms.find(base + UADDRESS_MODE_SUFFIX).getValue().getData();\r\n texture.wrapS = getWrapping(uaddressmode);\r\n }\r\n\r\n if (uniforms.find(base + VADDRESS_MODE_SUFFIX))\r\n {\r\n const vaddressmode = uniforms.find(base + VADDRESS_MODE_SUFFIX).getValue().getData();\r\n texture.wrapT = getWrapping(vaddressmode);\r\n }\r\n\r\n const filterType = uniforms.find(base + FILTER_TYPE_SUFFIX) ? uniforms.get(base + FILTER_TYPE_SUFFIX).value : -1;\r\n texture.minFilter = getMinFilter(filterType, generateMipmaps);\r\n}\r\n\r\n/**\r\n * Return the global light rotation matrix\r\n */\r\nfunction getLightRotation()\r\n{\r\n return new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4().makeRotationY(Math.PI / 2);\r\n}\r\n\r\n/**\r\n * Returns all lights nodes in a MaterialX document\r\n * @param {mx.Document} doc \r\n * @returns {Array.}\r\n */\r\nfunction findLights(doc)\r\n{\r\n let lights = [];\r\n for (let node of doc.getNodes())\r\n {\r\n if (node.getType() === \"lightshader\")\r\n lights.push(node);\r\n }\r\n return lights;\r\n}\r\n\r\n/**\r\n * Register lights in shader generation context\r\n * @param {Object} mx MaterialX Module\r\n * @param {Array.} lights Light nodes\r\n * @param {mx.GenContext} genContext Shader generation context\r\n * @returns {Array.}\r\n */\r\nfunction registerLights(mx, lights, genContext)\r\n{\r\n mx.HwShaderGenerator.unbindLightShaders(genContext);\r\n\r\n const lightTypesBound = {};\r\n const lightData = [];\r\n let lightId = 1;\r\n for (let light of lights)\r\n {\r\n let nodeDef = light.getNodeDef();\r\n let nodeName = nodeDef.getName();\r\n if (!lightTypesBound[nodeName])\r\n {\r\n lightTypesBound[nodeName] = lightId;\r\n mx.HwShaderGenerator.bindLightShader(nodeDef, lightId++, genContext);\r\n }\r\n\r\n const lightDirection = light.getValueElement(\"direction\").getValue().getData().data();\r\n const lightColor = light.getValueElement(\"color\").getValue().getData().data();\r\n const lightIntensity = light.getValueElement(\"intensity\").getValue().getData();\r\n\r\n let rotatedLightDirection = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(...lightDirection)\r\n rotatedLightDirection.transformDirection(getLightRotation())\r\n\r\n lightData.push({\r\n type: lightTypesBound[nodeName],\r\n direction: rotatedLightDirection,\r\n color: new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(...lightColor),\r\n intensity: lightIntensity\r\n });\r\n }\r\n\r\n // Make sure max light count is large enough\r\n genContext.getOptions().hwMaxActiveLightSources = Math.max(genContext.getOptions().hwMaxActiveLightSources, lights.length);\r\n\r\n return lightData;\r\n}\r\n\r\n/**\r\n * Get uniform values for a shader\r\n * @param {mx.shaderStage} shaderStage\r\n * @param {THREE.TextureLoader} textureLoader\r\n */\r\nfunction getUniformValues(shaderStage, textureLoader, searchPath, flipY)\r\n{\r\n let threeUniforms = {};\r\n\r\n const uniformBlocks = Object.values(shaderStage.getUniformBlocks());\r\n uniformBlocks.forEach(uniforms =>\r\n {\r\n if (!uniforms.empty())\r\n {\r\n for (let i = 0; i < uniforms.size(); ++i)\r\n {\r\n const variable = uniforms.get(i);\r\n const value = variable.getValue()?.getData();\r\n const name = variable.getVariable();\r\n threeUniforms[name] = new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(toThreeUniform(variable.getType().getName(), value, name, uniforms,\r\n textureLoader, searchPath, flipY));\r\n }\r\n }\r\n });\r\n\r\n return threeUniforms;\r\n}\r\n\n\n//# sourceURL=webpack://MaterialX-Swatch-Viewer/./source/helper.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ findLights: () => (/* binding */ findLights),\n/* harmony export */ getLightRotation: () => (/* binding */ getLightRotation),\n/* harmony export */ getUniformValues: () => (/* binding */ getUniformValues),\n/* harmony export */ prepareEnvTexture: () => (/* binding */ prepareEnvTexture),\n/* harmony export */ registerLights: () => (/* binding */ registerLights)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n//\r\n// Copyright Contributors to the MaterialX Project\r\n// SPDX-License-Identifier: Apache-2.0\r\n//\r\n\r\n\r\n\r\n//import { getBufferFromFile } from './dropHandling.js';\r\n\r\nconst IMAGE_PROPERTY_SEPARATOR = \"_\";\r\nconst UADDRESS_MODE_SUFFIX = IMAGE_PROPERTY_SEPARATOR + \"uaddressmode\";\r\nconst VADDRESS_MODE_SUFFIX = IMAGE_PROPERTY_SEPARATOR + \"vaddressmode\";\r\nconst FILTER_TYPE_SUFFIX = IMAGE_PROPERTY_SEPARATOR + \"filtertype\";\r\nconst IMAGE_PATH_SEPARATOR = \"/\";\r\n\r\n/**\r\n * Initialized the environment texture as MaterialX expects it\r\n * @param {THREE.Texture} texture\r\n * @param {Object} capabilities\r\n * @returns {THREE.Texture}\r\n */\r\nfunction prepareEnvTexture(texture, capabilities)\r\n{\r\n let newTexture = new three__WEBPACK_IMPORTED_MODULE_0__.DataTexture(texture.image.data, texture.image.width, texture.image.height, texture.format, texture.type);\r\n newTexture.wrapS = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n newTexture.anisotropy = capabilities.getMaxAnisotropy();\r\n newTexture.minFilter = three__WEBPACK_IMPORTED_MODULE_0__.LinearMipmapLinearFilter;\r\n newTexture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter;\r\n newTexture.generateMipmaps = true;\r\n newTexture.needsUpdate = true;\r\n\r\n return newTexture;\r\n}\r\n\r\n/**\r\n * Get Three uniform from MaterialX vector\r\n * @param {any} value\r\n * @param {any} dimension\r\n * @returns {THREE.Uniform}\r\n */\r\nfunction fromVector(value, dimension)\r\n{\r\n let outValue;\r\n if (value)\r\n {\r\n outValue = value.data();\r\n }\r\n else\r\n {\r\n outValue = [];\r\n for (let i = 0; i < dimension; ++i)\r\n outValue.push(0.0);\r\n }\r\n\r\n return outValue;\r\n}\r\n\r\n/**\r\n * Get Three uniform from MaterialX matrix\r\n * @param {mx.matrix} matrix\r\n * @param {mx.matrix.size} dimension\r\n */\r\nfunction fromMatrix(matrix, dimension)\r\n{\r\n let vec = [];\r\n if (matrix)\r\n {\r\n for (let i = 0; i < matrix.numRows(); ++i)\r\n {\r\n for (let k = 0; k < matrix.numColumns(); ++k)\r\n {\r\n vec.push(matrix.getItem(i, k));\r\n }\r\n }\r\n } else\r\n {\r\n for (let i = 0; i < dimension; ++i)\r\n vec.push(0.0);\r\n }\r\n\r\n return vec;\r\n}\r\n\r\nfunction loadTextureFile(uri, loader)\r\n{\r\n return new Promise((resolve, reject) =>\r\n {\r\n if (loader) \r\n {\r\n console.log(\"Load image file: \", uri); \r\n loader.load(\r\n uri,\r\n function (texture) {\r\n console.log('- Resolve texture:', texture);\r\n resolve(texture);\r\n },\r\n function (xhr) {\r\n // This function will be called while the texture is loading\r\n console.log((xhr.loaded / xhr.total) * 100 + '% loaded');\r\n },\r\n function (error) {\r\n resolve(null);\r\n // This function will be called if there is an error loading the texture\r\n //reject(new Error('Error loading texture: ' + error));\r\n }\r\n ); \r\n }\r\n });\r\n}\r\n\r\n// Function to load an image file and return a buffer using FileReader.readAsArrayBuffer()\r\nfunction getTextureBufferFromFile(filePath, textureLoader) {\r\n return new Promise((resolve, reject) => {\r\n // Create a FileReader\r\n const fileReader = new FileReader();\r\n\r\n // Event listener for the FileReader's load event\r\n //fileReader.addEventListener('load', function (event) {\r\n fileReader.onloadend = function (e)\r\n {\r\n // Get the result of the FileReader as an ArrayBuffer\r\n const buffer = event.target.result;\r\n\r\n // Convert the ArrayBuffer to a Uint8Array for examination\r\n //const uint8Array = new Uint8Array(buffer);\r\n\r\n console.log('--------- Loaded Buffer:', buffer, filePath, '---------');\r\n\r\n // Handle the obtained buffer\r\n console.log('Add texture buffer to cache:', filePath, ', ', buffer);\r\n\r\n const texture = loadTextureFile(URL.createObjectURL(new Blob([buffer])), textureLoader);\r\n //const texture = textureLoader.load(URL.createObjectURL(new Blob([buffer])));\r\n\r\n //const dataURL = 'data:image/jpeg;base64,' + btoa(String.fromCharCode.apply(null, uint8Array));\r\n //console.log('dataURL:', dataURL)\r\n //const texture = textureLoader.load(dataURL, function () {\r\n // Log the dimensions of the resulting texture\r\n // console.log('Texture dimensions:', texture.image.width, 'x', texture.image.height);\r\n //}); \r\n\r\n //const texture = textureLoader.load(texturePath);\r\n // Set address & filtering mode\r\n if (texture) {\r\n //THREE.Cache.add(filePath, texture);\r\n //setTextureParameters(texture, name, uniforms, flipY);\r\n //outValue = texture;\r\n console.log('Success: texture cached:', filePath, three__WEBPACK_IMPORTED_MODULE_0__.Cache.get(filePath));\r\n //let blah = THREE.Cache.get(texturePath);\r\n //if (blah)\r\n // console.log('blah.image.width:', blah.image.width, ', blah.image.height:', blah.image.height, ', blah.image.data:', blah.image.data, ', blah.image.data.length:', blah.image.data.length, ', blah.image.data.byteLength:', blah.image.data.byteLength, ', blah.image.data.buffer.byteLength:', blah.image.data.buffer.byteLength, ', blah.image.data.buffer:', blah.image.data.buffer);\r\n }\r\n else {\r\n console.error('Error: texture not found in cache:', filePath);\r\n }\r\n\r\n // Resolve the Promise with the obtained buffer\r\n resolve(texture);\r\n };\r\n\r\n // Event listener for errors during file reading\r\n fileReader.addEventListener('error', function (event) {\r\n result(null); // reject(new Error('Error reading file: ' + event.target.error));\r\n });\r\n\r\n // Read the content of the file as an ArrayBuffer\r\n fileReader.readAsArrayBuffer(new Blob([filePath]));\r\n });\r\n}\r\n\r\n\r\n// Function to load an image file and examine the dimensions of the loaded texture\r\nfunction examineImageFile(filePath, textureLoader) {\r\n return new Promise((resolve, reject) => {\r\n // Create a FileReader\r\n const fileReader = new FileReader();\r\n\r\n // Event listener for the FileReader's load event\r\n fileReader.addEventListener('load', function (event) {\r\n // Get the result of the FileReader as a data URL\r\n const dataURL = event.target.result;\r\n console.log('Load URL:', dataURL, filePath, '---------')\r\n\r\n // Create a texture using the data URL\r\n const texture = textureLoader.load(dataURL, function () {\r\n // Log the dimensions of the resulting texture\r\n console.log('Texture dimensions:', texture.image.width, 'x', texture.image.height);\r\n\r\n // Resolve the Promise with the loaded texture\r\n resolve(texture);\r\n });\r\n });\r\n\r\n // Event listener for errors during file reading\r\n fileReader.addEventListener('error', function (event) {\r\n reject(new Error('Error reading file: ' + event.target.error));\r\n });\r\n\r\n // Read the content of the file as a data URL\r\n fileReader.readAsDataURL(new Blob([filePath]));\r\n });\r\n}\r\n\r\n\r\n\r\n/**\r\n * Get Three uniform from MaterialX value\r\n * @param {mx.Uniform.type} type\r\n * @param {mx.Uniform.value} value\r\n * @param {mx.Uniform.name} name\r\n * @param {mx.Uniforms} uniforms\r\n * @param {THREE.textureLoader} textureLoader\r\n */\r\nfunction toThreeUniform(type, value, name, uniforms, textureLoader, searchPath, flipY)\r\n{\r\n let outValue;\r\n switch (type)\r\n {\r\n case 'float':\r\n case 'integer':\r\n case 'boolean':\r\n outValue = value;\r\n break;\r\n case 'vector2':\r\n outValue = fromVector(value, 2);\r\n break;\r\n case 'vector3':\r\n case 'color3':\r\n outValue = fromVector(value, 3);\r\n break;\r\n case 'vector4':\r\n case 'color4':\r\n outValue = fromVector(value, 4);\r\n break;\r\n case 'matrix33':\r\n outValue = fromMatrix(value, 9);\r\n break;\r\n case 'matrix44':\r\n outValue = fromMatrix(value, 16);\r\n break;\r\n case 'filename':\r\n if (value)\r\n {\r\n let texturePath = searchPath + IMAGE_PATH_SEPARATOR + value;\r\n const textureExists = three__WEBPACK_IMPORTED_MODULE_0__.Cache.get(texturePath);\r\n if (!textureExists)\r\n {\r\n \r\n // Call the function to examine the image file\r\n /* examineImageFile(texturePath, textureLoader)\r\n .then(texture => {\r\n console.log('Add texture to cache:', texturePath, texture)\r\n setTextureParameters(texture, name, uniforms, flipY);\r\n outValue = texture; \r\n })\r\n .catch(error => {\r\n // Handle errors\r\n console.error('Error:', error);\r\n });\r\n */\r\n // Call the function to get a buffer from the file\r\n /*\r\n getTextureBufferFromFile(texturePath, textureLoader)\r\n .then(texture => {\r\n if (texture)\r\n setTextureParameters(texture, name, uniforms, flipY);\r\n outValue = texture;\r\n console.log('-- FINISHED loading: ' + texturePath)\r\n })\r\n .catch(error => {\r\n // Handle errors\r\n console.error('Error:', error);\r\n });\r\n */\r\n console.log('Image file not loaded: ', texturePath);\r\n }\r\n //else\r\n {\r\n const texture = textureLoader.load(texturePath);\r\n // Set address & filtering mode\r\n if (texture)\r\n {\r\n console.log('Loaded texture: ' + texturePath, ' searchPath: ' + searchPath + ' texture: ', texture)\r\n setTextureParameters(texture, name, uniforms, flipY);\r\n }\r\n else\r\n {\r\n console.error('Error: texture not found in cache:', texturePath);\r\n }\r\n outValue = texture;\r\n }\r\n }\r\n break;\r\n case 'samplerCube':\r\n case 'string':\r\n break;\r\n default:\r\n console.log('Value type not supported: ' + type);\r\n // struct\r\n outValue = null;//toThreeUniform(value);\r\n }\r\n\r\n return outValue;\r\n}\r\n\r\n/**\r\n * Get Three wrapping mode\r\n * @param {mx.TextureFilter.wrap} mode\r\n * @returns {THREE.Wrapping}\r\n */\r\nfunction getWrapping(mode)\r\n{\r\n let wrap;\r\n switch (mode)\r\n {\r\n case 1:\r\n wrap = three__WEBPACK_IMPORTED_MODULE_0__.ClampToEdgeWrapping;\r\n break;\r\n case 2:\r\n wrap = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n break;\r\n case 3:\r\n wrap = three__WEBPACK_IMPORTED_MODULE_0__.MirroredRepeatWrapping;\r\n break;\r\n default:\r\n wrap = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n break;\r\n }\r\n return wrap;\r\n}\r\n\r\n/**\r\n * Get Three minification filter\r\n * @param {mx.TextureFilter.minFilter} type\r\n * @param {mx.TextureFilter.generateMipmaps} generateMipmaps\r\n */\r\nfunction getMinFilter(type, generateMipmaps)\r\n{\r\n const filterType = generateMipmaps ? three__WEBPACK_IMPORTED_MODULE_0__.LinearMipMapLinearFilter : three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter;\r\n if (type === 0)\r\n {\r\n filterType = generateMipmaps ? three__WEBPACK_IMPORTED_MODULE_0__.NearestMipMapNearestFilter : three__WEBPACK_IMPORTED_MODULE_0__.NearestFilter;\r\n }\r\n return filterType;\r\n}\r\n\r\n/**\r\n * Set Three texture parameters\r\n * @param {THREE.Texture} texture\r\n * @param {mx.Uniform.name} name\r\n * @param {mx.Uniforms} uniforms\r\n * @param {mx.TextureFilter.generateMipmaps} generateMipmaps\r\n */\r\nfunction setTextureParameters(texture, name, uniforms, flipY = true, generateMipmaps = true)\r\n{\r\n const idx = name.lastIndexOf(IMAGE_PROPERTY_SEPARATOR);\r\n const base = name.substring(0, idx) || name;\r\n\r\n texture.generateMipmaps = generateMipmaps;\r\n texture.wrapS = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n texture.wrapT = three__WEBPACK_IMPORTED_MODULE_0__.RepeatWrapping;\r\n texture.magFilter = three__WEBPACK_IMPORTED_MODULE_0__.LinearFilter;\r\n texture.flipY = flipY;\r\n\r\n if (uniforms.find(base + UADDRESS_MODE_SUFFIX))\r\n {\r\n const uaddressmode = uniforms.find(base + UADDRESS_MODE_SUFFIX).getValue().getData();\r\n texture.wrapS = getWrapping(uaddressmode);\r\n }\r\n\r\n if (uniforms.find(base + VADDRESS_MODE_SUFFIX))\r\n {\r\n const vaddressmode = uniforms.find(base + VADDRESS_MODE_SUFFIX).getValue().getData();\r\n texture.wrapT = getWrapping(vaddressmode);\r\n }\r\n\r\n const filterType = uniforms.find(base + FILTER_TYPE_SUFFIX) ? uniforms.get(base + FILTER_TYPE_SUFFIX).value : -1;\r\n texture.minFilter = getMinFilter(filterType, generateMipmaps);\r\n}\r\n\r\n/**\r\n * Return the global light rotation matrix\r\n */\r\nfunction getLightRotation()\r\n{\r\n return new three__WEBPACK_IMPORTED_MODULE_0__.Matrix4().makeRotationY(Math.PI / 2);\r\n}\r\n\r\n/**\r\n * Returns all lights nodes in a MaterialX document\r\n * @param {mx.Document} doc \r\n * @returns {Array.}\r\n */\r\nfunction findLights(doc)\r\n{\r\n let lights = [];\r\n for (let node of doc.getNodes())\r\n {\r\n if (node.getType() === \"lightshader\")\r\n lights.push(node);\r\n }\r\n return lights;\r\n}\r\n\r\n/**\r\n * Register lights in shader generation context\r\n * @param {Object} mx MaterialX Module\r\n * @param {Array.} lights Light nodes\r\n * @param {mx.GenContext} genContext Shader generation context\r\n * @returns {Array.}\r\n */\r\nfunction registerLights(mx, lights, genContext)\r\n{\r\n mx.HwShaderGenerator.unbindLightShaders(genContext);\r\n\r\n const lightTypesBound = {};\r\n const lightData = [];\r\n let lightId = 1;\r\n for (let light of lights)\r\n {\r\n let nodeDef = light.getNodeDef();\r\n let nodeName = nodeDef.getName();\r\n if (!lightTypesBound[nodeName])\r\n {\r\n lightTypesBound[nodeName] = lightId;\r\n mx.HwShaderGenerator.bindLightShader(nodeDef, lightId++, genContext);\r\n }\r\n\r\n const lightDirection = light.getValueElement(\"direction\").getValue().getData().data();\r\n const lightColor = light.getValueElement(\"color\").getValue().getData().data();\r\n const lightIntensity = light.getValueElement(\"intensity\").getValue().getData();\r\n\r\n let rotatedLightDirection = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(...lightDirection)\r\n rotatedLightDirection.transformDirection(getLightRotation())\r\n\r\n lightData.push({\r\n type: lightTypesBound[nodeName],\r\n direction: rotatedLightDirection,\r\n color: new three__WEBPACK_IMPORTED_MODULE_0__.Vector3(...lightColor),\r\n intensity: lightIntensity\r\n });\r\n }\r\n\r\n // Make sure max light count is large enough\r\n genContext.getOptions().hwMaxActiveLightSources = Math.max(genContext.getOptions().hwMaxActiveLightSources, lights.length);\r\n\r\n return lightData;\r\n}\r\n\r\n/**\r\n * Get uniform values for a shader\r\n * @param {mx.shaderStage} shaderStage\r\n * @param {THREE.TextureLoader} textureLoader\r\n */\r\nfunction getUniformValues(shaderStage, textureLoader, searchPath, flipY)\r\n{\r\n let threeUniforms = {};\r\n\r\n const uniformBlocks = Object.values(shaderStage.getUniformBlocks());\r\n uniformBlocks.forEach(uniforms =>\r\n {\r\n if (!uniforms.empty())\r\n {\r\n for (let i = 0; i < uniforms.size(); ++i)\r\n {\r\n const variable = uniforms.get(i);\r\n const value = variable.getValue()?.getData();\r\n const name = variable.getVariable();\r\n threeUniforms[name] = new three__WEBPACK_IMPORTED_MODULE_0__.Uniform(toThreeUniform(variable.getType().getName(), value, name, uniforms,\r\n textureLoader, searchPath, flipY));\r\n }\r\n }\r\n });\r\n\r\n return threeUniforms;\r\n}\r\n\n\n//# sourceURL=webpack://MaterialX-Swatch-Viewer/./source/helper.js?"); /***/ }), diff --git a/pymaterialx/mtlx_ocio.html b/pymaterialx/mtlx_ocio.html index 0df8a646..a67359ae 100644 --- a/pymaterialx/mtlx_ocio.html +++ b/pymaterialx/mtlx_ocio.html @@ -15214,9 +15214,7 @@

                            Setup

                            OpenC

                            diff --git a/pymaterialx/mtlx_ocio.ipynb b/pymaterialx/mtlx_ocio.ipynb index 5a05c457..cd40474f 100644 --- a/pymaterialx/mtlx_ocio.ipynb +++ b/pymaterialx/mtlx_ocio.ipynb @@ -83,7 +83,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "OCIO version: 2.3.0\n", + "OCIO version: 2.3.2\n", "MaterialX version: 1.39.0\n" ] } diff --git a/pymaterialx/mtlx_validation.html b/pymaterialx/mtlx_validation.html new file mode 100644 index 00000000..503a2444 --- /dev/null +++ b/pymaterialx/mtlx_validation.html @@ -0,0 +1,15233 @@ + + + + + +mtlx_validation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pymaterialx/mtlx_validation.ipynb b/pymaterialx/mtlx_validation.ipynb new file mode 100644 index 00000000..60609025 --- /dev/null +++ b/pymaterialx/mtlx_validation.ipynb @@ -0,0 +1,591 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "XML Schema Creation" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import MaterialX as mx\n", + "\n", + "stdlib = mx.createDocument()\n", + "libFiles = []\n", + "searchPath = mx.getDefaultDataSearchPath()\n", + "libFiles = mx.loadLibraries(mx.getDefaultDataLibraryFolders(), searchPath, stdlib)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " Class: Node\n", + " - Enumerant: CATEGORY, Attribute String: \"node\"\n", + " Class: InterfaceElement\n", + " - Enumerant: NODE_DEF_ATTRIBUTE, Attribute String: \"nodedef\"\n", + " Class: TypedElement\n", + " - Enumerant: TYPE_ATTRIBUTE, Attribute String: \"type\"\n", + " Class: Element\n" + ] + } + ], + "source": [ + "# Inspect the class hierarchy\n", + "# pulling out static attributes\n", + "# Note that Element is missing static attributes !\n", + "# Use getattr() to get the actual value of the attribute\n", + "import inspect\n", + "tab = ' '\n", + "indent = 1\n", + "for base_class in inspect.getmro(mx.Node):\n", + " # Test if class is in MaterialX modules\n", + " if 'MaterialX' in base_class.__module__:\n", + " print(indent * ' ', 'Class: ' + base_class.__name__)\n", + " for key, value in base_class.__dict__.items():\n", + " if not key.startswith('__'):\n", + " # Test if value is not a function\n", + " if not callable(value):\n", + " print(indent * ' ', '- Enumerant: ' + key + ', Attribute String: \\\"' + getattr(base_class, key) + '\\\"')\n", + " indent += 1" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "#from xmlschema import XMLSchema, Element\n", + "from xml.dom import minidom" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "\n", + "\n" + ] + } + ], + "source": [ + "#\n", + "def addTopLevelList(parent):\n", + " # Create complexType\n", + " complexType = root.createElement('xs:complexType')\n", + " parent.appendChild(complexType)\n", + " # Create sequence\n", + " sequence = root.createElement('xs:sequence')\n", + " complexType.appendChild(sequence)\n", + " return sequence\n", + "\n", + "def addDefaultElementAttrib(parent):\n", + " elemAttrib = [\"name\"]\n", + " for a in elemAttrib:\n", + " mtlxAttribute = root.createElement('xs:attribute')\n", + " mtlxAttribute.setAttribute('name', a)\n", + " mtlxAttribute.setAttribute('type', 'xs:string')\n", + " mtlxAttribute.setAttribute('use', 'required' if (a == 'name') else 'optional')\n", + " parent.appendChild(mtlxAttribute)\n", + "\n", + "def addBaseElement(root, parent, mxType):\n", + "\n", + " # Get parent class if any\n", + " extends = ''\n", + " derived = inspect.getmro(mxType)\n", + " if derived and len(derived) > 1:\n", + " if 'MaterialX' in derived[1].__module__:\n", + " #print(derived[0].__name__, 'extends: ', derived[1].__name__)\n", + " extends = derived[1].__name__.lower()\n", + "\n", + " comment = root.createComment(' MaterialX Type Definitios: ' + mxType.__name__ + ' ')\n", + " parent.appendChild(comment) \n", + "\n", + " complexType = root.createElement('xs:complexType')\n", + " complexType.setAttribute('name', mxType.__name__.lower())\n", + " parent.appendChild(complexType)\n", + "\n", + " #sequence = root.createElement('xs:sequence')\n", + " attrParent = None\n", + " if extends:\n", + " # Add extension parent\n", + " complextContent = root.createElement('xs:complexContent')\n", + " complexType.appendChild(complextContent)\n", + "\n", + " extension = root.createElement('xs:extension')\n", + " extension.setAttribute('base', extends)\n", + " complextContent.appendChild(extension)\n", + "\n", + " attrParent = extension \n", + " else:\n", + " attrParent = complexType\n", + "\n", + " # Workaround for Element class which does not\n", + " # declare any attributes statics \n", + " if mxType == mx.Element:\n", + " names = [ 'name', 'fileprefix', 'geomprefix', 'colorspace', 'inherit', 'namespace', 'doc' ]\n", + "\n", + " for name in names: \n", + " mtlxAttribute = root.createElement('xs:attribute')\n", + " mtlxAttribute.setAttribute('name', name)\n", + " mtlxAttribute.setAttribute('type', 'xs:string')\n", + " attrParent.appendChild(mtlxAttribute) \n", + "\n", + " else:\n", + " for key, value in mxType.__dict__.items():\n", + " if not key.startswith('__') and key != 'CATEGORY':\n", + " if not callable(value): \n", + " #print('Check key: ', getattr(mxType, key))\n", + " \n", + " # Add attribute \n", + " mtlxAttribute = root.createElement('xs:attribute')\n", + " mtlxAttribute.setAttribute('name', getattr(mxType, key))\n", + " mtlxAttribute.setAttribute('type', 'xs:string')\n", + " attrParent.appendChild(mtlxAttribute) \n", + "\n", + "# Add Element type\n", + "def addMaterialxElement(root, parent, mxType):\n", + " comment = root.createComment(' MaterialX Element Type: ' + mxType.__name__ + ' ')\n", + " parent.appendChild(comment) \n", + " mtlxElement = root.createElement('xs:element')\n", + " # Get lowercase name \n", + " mtlxElement.setAttribute('name', mxType.__name__.lower())\n", + " parent.appendChild(mtlxElement)\n", + "\n", + " complexType = root.createElement('xs:complexType')\n", + " mtlxElement.appendChild(complexType)\n", + "\n", + " for base_class in inspect.getmro(mxType):\n", + " if 'MaterialX' in base_class.__module__:\n", + "\n", + " if (base_class == mx.Element):\n", + " comment = root.createComment(' Inherted From: Element ')\n", + " mtlxElement.appendChild(comment) \n", + " addDefaultElementAttrib(complexType)\n", + "\n", + " for key, value in base_class.__dict__.items():\n", + " if not key.startswith('__') and key != 'CATEGORY':\n", + " if not callable(value): \n", + "\n", + " if (mxType != base_class):\n", + " comment = root.createComment(' Inherted From: ' + base_class.__name__ + ' ')\n", + " complexType.appendChild(comment) \n", + "\n", + " # Add attribute \n", + " mtlxAttribute = root.createElement('xs:attribute')\n", + " mtlxAttribute.setAttribute('name', getattr(base_class, key))\n", + " mtlxAttribute.setAttribute('type', 'xs:string')\n", + " complexType.appendChild(mtlxAttribute)\n", + "\n", + "root = minidom.Document()\n", + "xml = root.createElement('xs:schema')\n", + "xml.setAttribute('xmlns:xs', 'http://www.w3.org/2001/XMLSchema')\n", + "xml.setAttribute('attributeFormDefault', 'unqualified')\n", + "xml.setAttribute('elementFormDefault', 'qualified')\n", + "#xml.setAttribute('targetNamespace', 'http://www.materialx.org/')\n", + "xml.setAttribute('xmlns:mx', 'http://www.materialx.org/')\n", + "\n", + "all_members = inspect.getmembers(mx, inspect.isclass)\n", + "classes = [member[1] for member in all_members if inspect.isclass(member[1])]\n", + "\n", + "#classes = [member for member in all_members \n", + "# if inspect.isclass(member[1])]\n", + "for c in classes:\n", + " if issubclass(c, getattr(mx, 'Element', object)):\n", + " addBaseElement(root, xml, c)\n", + "#addBaseElement(root, xml, mx.InterfaceElement)\n", + "#addBaseElement(root, xml, mx.TypedElement)\n", + "#addBaseElement(root, xml, mx.TypeDef)\n", + "#addBaseElement(root, xml, mx.Unit)\n", + "#addBaseElement(root, xml, mx.UnitDef)\n", + "#addBaseElement(root, xml, mx.GeomPropDef)\n", + "\n", + "mtlx = root.createElement('xs:element')\n", + "mtlx.setAttribute('name', 'materialx')\n", + "xml.appendChild(mtlx)\n", + "\n", + "seq = addTopLevelList(mtlx)\n", + "#defs = root.createElement('xs:complexType')\n", + "#mtlx.appendChild(defs)\n", + "\n", + "#seq = root.createElement('xs:sequence')\n", + "#defs.appendChild(seq)\n", + "\n", + "maxOccurs = root.createElement('xs:choice')\n", + "maxOccurs.setAttribute('maxOccurs', 'unbounded')\n", + "seq.appendChild(maxOccurs)\n", + "\n", + "defTypes = []\n", + "#[mx.UnitDef, mx.Unit, mx.TypeDef] \n", + "#, mx.Node, mx.NodeGraph, mx.GeomPropDef, mx.Document, mx.NodeDef,\n", + "# mx.Input, mx.Output]\n", + "for defType in defTypes:\n", + " addMaterialxElement(root, seq, defType)\n", + "\n", + "root.appendChild(xml)\n", + "\n", + "data = root.toprettyxml(indent=' ')\n", + "print(data)\n", + "\n", + "with open('./data/materialx_schema.xsd', 'w') as f:\n", + " f.write(data)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [], + "source": [ + "#all_members = inspect.getmembers(mx, inspect.isclass)\n", + "#classes = [member for member in all_members if inspect.isclass(member[1])]\n", + "\n", + "# Print the class names\n", + "#for class_name, _ in classes:\n", + "# print(class_name)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.10" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/pymaterialx/mxgraphio.py b/pymaterialx/mxgraphio.py index b590d25d..75a4158b 100644 --- a/pymaterialx/mxgraphio.py +++ b/pymaterialx/mxgraphio.py @@ -12,6 +12,16 @@ def skipLibraryElement(elem): return not elem.hasSourceUri() +def getFiles(rootPath): + '''''' + filelist = [] + for subdir, dirs, files in os.walk(rootPath): + for file in files: + print('Scan file: ' + file + ' in ' + subdir) + if file.endswith('mtlx'): + filelist.append(os.path.join(subdir, file)) + return filelist + def loadFile(filename): stdlib = mx.createDocument() searchPath = mx.getDefaultDataSearchPath() @@ -28,9 +38,33 @@ def loadFile(filename): mx.readFromXmlFile(doc, filename) return doc + +def loadLibraries(searchPath, libraryFolders): + '''Load MaierialX libraries.''' + status = '' + lib = mx.createDocument() + try: + libFiles = mx.loadLibraries(libraryFolders, searchPath, lib) + status = '- Loaded %d library definitions from %d files' % (len(lib.getNodeDefs()), len(libFiles)) + except mx.Exception as err: + status = '- Failed to load library definitions: "%s"' % err + + return lib, status + +def createWorkingDocument(libraries): + '''Create a working document and import any libraries''' + doc = mx.createDocument() + for lib in libraries: + doc.importLibrary(lib) + + return doc + def main(): parser = argparse.ArgumentParser(description="Create graph diagrams from a MaterialX document.") - parser.add_argument(dest="inputFilename", help="Filename of the input document.") + parser.add_argument(dest="inputPath", help="Path of the input MaterialX document or folder.") + parser.add_argument('--outputPath', dest='outputPath', default='', help='File path to output graphs to.') + parser.add_argument('--library', dest='libraries', action='append', nargs='+', help='An additional relative path to a custom data library folder (e.g. "libraries/custom")') + parser.add_argument('--path', dest='paths', action='append', nargs='+', help='An additional absolute search path location (e.g. "/projects/MaterialX")') parser.add_argument("-o", "--output", dest="outputFilename", help="Filename of the output document.") parser.add_argument('--orientation', dest='orientation', default='LR', help='Orientation of graphs. LR = left to right, TB = top to bottom. RL and BT are the opposite directions. Default is LR.') parser.add_argument('--graphs', dest='graphs', default='', help='Comma separated list of graphs to include in the graph. If empty, all node definitions are included. Example: "image,material"') @@ -39,53 +73,104 @@ def main(): opts = parser.parse_args() - # Check that file exists - if not os.path.exists(opts.inputFilename): - print('File not found:', opts.inputFilename) - exit(-1) - - doc = loadFile(opts.inputFilename) - - if not doc: - print('Failed to load doc:', opts.inputFileName) + # Load standard libraries + libraries = [] + searchPath = mx.getDefaultDataSearchPath() + libraryFolders = mx.getDefaultDataLibraryFolders() + stdlib, status = loadLibraries(searchPath, libraryFolders) + if not stdlib: + print('Error loading standard libraries: "%s"' % status) exit(-1) - - # Build the graph dictionary and connections - graphBuilder = MtlxGraphBuilder(doc) - graphBuilder.setIncludeGraphs(opts.graphs) - graphBuilder.execute() - - if not graphBuilder.getDictionary(): - print('No nodes found.') - if not graphBuilder.getConnections(): - print('No connections found.') - - if opts.outputFilename: - filename = opts.outputFilename + '.json' - else: - filename = mx.FilePath(opts.inputFilename) - filename.removeExtension() - filename = filename.asString() + '_connections.json' - print('Write connections to JSON file:', filename) - graphBuilder.exportToJSON(filename, opts.inputFilename) - - # Export graph to mermaid - graphBuilder2 = MtlxGraphBuilder(None) - graphBuilder2.importFromJSON(filename) - exporter = mermaidGraphExporter(graphBuilder2.getDictionary(), graphBuilder2.getConnections()) - exporter.setOrientation(opts.orientation) - exporter.setEmitCategory(opts.emitCategory) - exporter.setEmitType(opts.emitType) - exporter.execute() - - if opts.outputFilename: - filename = opts.outputFilename + '.md' - else: - filename = mx.FilePath(opts.inputFilename) - filename.removeExtension() - filename = filename.asString() + '_graph.md' - print('Write graph to:' + filename) - exporter.export(filename) + else: + print(status) + libraries.append(stdlib) + + # Check for additional use libraries + userPath = mx.FileSearchPath() + userLibraryFolders = [] + if opts.paths: + for pathList in opts.paths: + for path in pathList: + searchPath.append(path) + userPath.append(path) + if opts.libraries: + for libraryList in opts.libraries: + for library in libraryList: + userLibraryFolders.append(library) + if userLibraryFolders: + userlib, status = loadLibraries(userPath, userLibraryFolders) + if not userlib: + print('Error loading user libraries: "%s"' % status) + exit(-1) + else: + print(status) + libraries.append(userlib) + + rootPath = opts.inputPath + filelist = [] + if os.path.isdir(rootPath): + filelist = getFiles(rootPath) + elif os.path.isfile(rootPath): + filelist = [rootPath] + + print('Found %d MaterialX files' % len(filelist)) + + for inputFilename in filelist: + try: + # Absolute path to inputFilename + baseInputFileName = inputFilename + inputFilename = os.path.abspath(inputFilename) + print('Read document: ' + inputFilename) + doc = createWorkingDocument(libraries) + if not doc: + print('- Error creating working document') + continue + try: + mx.readFromXmlFile(doc, inputFilename) + except mx.ExceptionFileMissing as err: + print('- Error reading file: ', err) + continue + except mx.ExceptionParseError as err: + print('- Error reading file: ', err) + continue + + # Build the graph dictionary and connections + graphBuilder = MtlxGraphBuilder(doc) + graphBuilder.setIncludeGraphs(opts.graphs) + graphBuilder.execute() + + if not graphBuilder.getDictionary(): + print('No nodes found.') + continue + if not graphBuilder.getConnections(): + print('No connections found.') + continue + + # Export connectivity to JSON file + outputFileName = mx.FilePath(inputFilename.replace('.mtlx', '_connections.json')) + if opts.outputPath: + outputFileName = mx.FilePath(opts.outputPath) / outputFileName.getBaseName() + print('- Write connectivity file:', outputFileName.asString()) + graphBuilder.exportToJSON(outputFileName.asString(), baseInputFileName) + + # Export to Mermaid in Markdown file + #graphBuilder2 = MtlxGraphBuilder(None) + #graphBuilder2.importFromJSON(outputFileName) + exporter = mermaidGraphExporter(graphBuilder.getDictionary(), graphBuilder.getConnections()) + exporter.setOrientation(opts.orientation) + exporter.setEmitCategory(opts.emitCategory) + exporter.setEmitType(opts.emitType) + exporter.execute() + + outputFileName = mx.FilePath(inputFilename.replace('.mtlx', '.md')) + if opts.outputPath: + outputFileName = mx.FilePath(opts.outputPath) / outputFileName.getBaseName() + + print('- Write Mermaid graph to file:' + outputFileName.asString()) + exporter.export(outputFileName.asString()) + + except mx.ExceptionFileMissing as err: + print(err) if __name__ == '__main__': main() diff --git a/pymaterialx/python/MaterialX/PyMaterialXCore.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXCore.cp310-win_amd64.pyd index a90dd2e9..66d7b67b 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXCore.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXCore.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXFormat.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXFormat.cp310-win_amd64.pyd index 9b9b557c..dd0dcb02 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXFormat.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXFormat.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXGenGlsl.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXGenGlsl.cp310-win_amd64.pyd index 72501a5b..7707168e 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXGenGlsl.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXGenGlsl.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXGenMdl.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXGenMdl.cp310-win_amd64.pyd index 63b33374..309e9973 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXGenMdl.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXGenMdl.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXGenMsl.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXGenMsl.cp310-win_amd64.pyd index d6584d8d..74c6b363 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXGenMsl.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXGenMsl.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXGenOsl.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXGenOsl.cp310-win_amd64.pyd index 4bcb368a..99c17dbd 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXGenOsl.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXGenOsl.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXGenShader.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXGenShader.cp310-win_amd64.pyd index 226c7735..cb3f615c 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXGenShader.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXGenShader.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXRender.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXRender.cp310-win_amd64.pyd index ac6d5efd..ec8ff307 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXRender.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXRender.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXRenderGlsl.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXRenderGlsl.cp310-win_amd64.pyd index 59a26d73..6b072320 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXRenderGlsl.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXRenderGlsl.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/PyMaterialXRenderOsl.cp310-win_amd64.pyd b/pymaterialx/python/MaterialX/PyMaterialXRenderOsl.cp310-win_amd64.pyd index 8026dba5..cb90e6e6 100644 Binary files a/pymaterialx/python/MaterialX/PyMaterialXRenderOsl.cp310-win_amd64.pyd and b/pymaterialx/python/MaterialX/PyMaterialXRenderOsl.cp310-win_amd64.pyd differ diff --git a/pymaterialx/python/MaterialX/libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx b/pymaterialx/python/MaterialX/libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx index 0ca9fb87..6cb6fcb3 100644 --- a/pymaterialx/python/MaterialX/libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx +++ b/pymaterialx/python/MaterialX/libraries/bxdf/translation/standard_surface_to_gltf_pbr.mtlx @@ -17,7 +17,6 @@ - @@ -30,7 +29,6 @@ - @@ -80,10 +78,6 @@ - - - - @@ -135,7 +129,6 @@ - diff --git a/pymaterialx/python/MaterialX/libraries/nprlib/nprlib_ng.mtlx b/pymaterialx/python/MaterialX/libraries/nprlib/nprlib_ng.mtlx index 3870b852..f3db3f51 100644 --- a/pymaterialx/python/MaterialX/libraries/nprlib/nprlib_ng.mtlx +++ b/pymaterialx/python/MaterialX/libraries/nprlib/nprlib_ng.mtlx @@ -48,8 +48,12 @@ Node: --> - - + + + + + + diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_environment_fis.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_environment_fis.glsl index 85c88c32..0b28f364 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_environment_fis.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_environment_fis.glsl @@ -59,10 +59,11 @@ vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distributio radiance /= G1V * float(envRadianceSamples); // Return the final radiance. - return radiance; + return radiance * $envLightIntensity; } vec3 mx_environment_irradiance(vec3 N) { - return mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + return Li * $envLightIntensity; } diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_environment_prefilter.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_environment_prefilter.glsl index e448ae24..778742c4 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_environment_prefilter.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_environment_prefilter.glsl @@ -1,5 +1,12 @@ #include "mx_microfacet_specular.glsl" +// Return the mip level associated with the given alpha in a prefiltered environment. +float mx_latlong_alpha_to_lod(float alpha) +{ + float lodBias = (alpha < 0.25) ? sqrt(alpha) : 0.5 * alpha + 0.375; + return lodBias * float($envRadianceMips - 1); +} + vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distribution, FresnelData fd) { N = mx_forward_facing_normal(N, V); @@ -13,10 +20,11 @@ vec3 mx_environment_radiance(vec3 N, vec3 V, vec3 X, vec2 alpha, int distributio vec3 FG = fd.refraction ? vec3(1.0) - (F * G) : F * G; vec3 Li = mx_latlong_map_lookup(L, $envMatrix, mx_latlong_alpha_to_lod(avgAlpha), $envRadiance); - return Li * FG; + return Li * FG * $envLightIntensity; } vec3 mx_environment_irradiance(vec3 N) { - return mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + vec3 Li = mx_latlong_map_lookup(N, $envMatrix, 0.0, $envIrradiance); + return Li * $envLightIntensity; } diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_generate_prefilter_env.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_generate_prefilter_env.glsl index e437e886..41bf33aa 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_generate_prefilter_env.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_generate_prefilter_env.glsl @@ -12,6 +12,13 @@ mat3 mx_orthonormal_basis(vec3 N) return mat3(X, Y, N); } +// Return the alpha associated with the given mip level in a prefiltered environment. +float mx_latlong_lod_to_alpha(float lod) +{ + float lodBias = lod / float($envRadianceMips - 1); + return (lodBias < 0.5) ? mx_square(lodBias) : 2.0 * (lodBias - 0.375); +} + // The inverse of mx_latlong_projection. vec3 mx_latlong_map_projection_inverse(vec2 uv) { diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet.glsl index d935798f..e59c3e6b 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet.glsl @@ -6,6 +6,12 @@ float mx_pow5(float x) return mx_square(mx_square(x)) * x; } +float mx_pow6(float x) +{ + float x2 = mx_square(x); + return mx_square(x2) * x2; +} + // Standard Schlick Fresnel float mx_fresnel_schlick(float cosTheta, float F0) { diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet_diffuse.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet_diffuse.glsl index 7a0ed281..83d649ec 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet_diffuse.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet_diffuse.glsl @@ -1,29 +1,88 @@ #include "mx_microfacet.glsl" -// Based on the OSL implementation of Oren-Nayar diffuse, which is in turn -// based on https://mimosa-pudica.net/improved-oren-nayar.html. -float mx_oren_nayar_diffuse(vec3 L, vec3 V, vec3 N, float NdotL, float roughness) +// Based on the implementation of Oren-Nayar diffuse in Open Shading Language. +// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/testrender/shading.cpp +float mx_oren_nayar_diffuse(float NdotV, float NdotL, float LdotV, float roughness) { - float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); float s = LdotV - NdotL * NdotV; float stinv = (s > 0.0f) ? s / max(NdotL, NdotV) : 0.0; - float sigma2 = mx_square(roughness * M_PI); + float sigma2 = mx_square(roughness); float A = 1.0 - 0.5 * (sigma2 / (sigma2 + 0.33)); float B = 0.45 * sigma2 / (sigma2 + 0.09); return A + B * stinv; } +// Rational quadratic fit to Monte Carlo data for Oren-Nayar directional albedo. +float mx_oren_nayar_diffuse_dir_albedo_analytic(float NdotV, float roughness) +{ + vec2 r = vec2(1.0, 1.0) + + vec2(-0.4297, -0.6076) * roughness + + vec2(-0.7632, -0.4993) * NdotV * roughness + + vec2(1.4385, 2.0315) * mx_square(roughness); + return r.x / r.y; +} + +float mx_oren_nayar_diffuse_dir_albedo_table_lookup(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 1 + if (textureSize($albedoTable, 0).x > 1) + { + return texture($albedoTable, vec2(NdotV, roughness)).b; + } +#endif + return 0.0; +} + +float mx_oren_nayar_diffuse_dir_albedo_monte_carlo(float NdotV, float roughness) +{ + NdotV = clamp(NdotV, M_FLOAT_EPS, 1.0); + vec3 V = vec3(sqrt(1.0f - mx_square(NdotV)), 0, NdotV); + + float radiance = 0.0; + const int SAMPLE_COUNT = 64; + for (int i = 0; i < SAMPLE_COUNT; i++) + { + vec2 Xi = mx_spherical_fibonacci(i, SAMPLE_COUNT); + + // Compute the incoming light direction. + vec3 L = mx_uniform_sample_hemisphere(Xi); + + // Compute dot products for this sample. + float NdotL = clamp(L.z, M_FLOAT_EPS, 1.0); + float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); + + // Compute diffuse reflectance. + float reflectance = mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); + + // Add the radiance contribution of this sample. + // uniform_pdf = 1 / (2 * PI) + // radiance = (reflectance * NdotL) / (uniform_pdf * PI); + radiance += reflectance * NdotL; + } + + // Apply global components and normalize. + radiance *= 2.0 / float(SAMPLE_COUNT); + + // Return the final directional albedo. + return radiance; +} + +float mx_oren_nayar_diffuse_dir_albedo(float NdotV, float roughness) +{ +#if DIRECTIONAL_ALBEDO_METHOD == 2 + float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_monte_carlo(NdotV, roughness); +#else + float dirAlbedo = mx_oren_nayar_diffuse_dir_albedo_analytic(NdotV, roughness); +#endif + return clamp(dirAlbedo, 0.0, 1.0); +} + // https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf // Section 5.3 -float mx_burley_diffuse(vec3 L, vec3 V, vec3 N, float NdotL, float roughness) +float mx_burley_diffuse(float NdotV, float NdotL, float LdotH, float roughness) { - vec3 H = normalize(L + V); - float LdotH = clamp(dot(L, H), M_FLOAT_EPS, 1.0); - float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - float F90 = 0.5 + (2.0 * roughness * mx_square(LdotH)); float refL = mx_fresnel_schlick(NdotL, 1.0, F90); float refV = mx_fresnel_schlick(NdotV, 1.0, F90); diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet_specular.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet_specular.glsl index a27f717a..0e77e545 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet_specular.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_microfacet_specular.glsl @@ -1,19 +1,15 @@ #include "mx_microfacet.glsl" -// Fresnel model options. const int FRESNEL_MODEL_DIELECTRIC = 0; const int FRESNEL_MODEL_CONDUCTOR = 1; const int FRESNEL_MODEL_SCHLICK = 2; -const int FRESNEL_MODEL_AIRY = 3; -const int FRESNEL_MODEL_SCHLICK_AIRY = 4; -// XYZ to CIE 1931 RGB color space (using neutral E illuminant) -const mat3 XYZ_TO_RGB = mat3(2.3706743, -0.5138850, 0.0052982, -0.9000405, 1.4253036, -0.0146949, -0.4706338, 0.0885814, 1.0093968); - -// Parameters for Fresnel calculations. +// Parameters for Fresnel calculations struct FresnelData { + // Fresnel model int model; + bool airy; // Physical Fresnel vec3 ior; @@ -21,6 +17,7 @@ struct FresnelData // Generalized Schlick Fresnel vec3 F0; + vec3 F82; vec3 F90; float exponent; @@ -30,26 +27,6 @@ struct FresnelData // Refraction bool refraction; - -#ifdef __METAL__ -FresnelData(int _model = 0, - vec3 _ior = vec3(0.0f), - vec3 _extinction = vec3(0.0f), - vec3 _F0 = vec3(0.0f), - vec3 _F90 = vec3(0.0f), - float _exponent = 0.0f, - float _tf_thickness = 0.0f, - float _tf_ior = 0.0f, - bool _refraction = false) : - model(_model), - ior(_ior), - extinction(_extinction), - F0(_F0), F90(_F90), exponent(_exponent), - tf_thickness(_tf_thickness), - tf_ior(_tf_ior), - refraction(_refraction) {} -#endif - }; // https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf @@ -221,66 +198,61 @@ float mx_f0_to_ior(float F0) float sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); return (1.0 + sqrtF0) / (1.0 - sqrtF0); } - -vec3 mx_f0_to_ior_colored(vec3 F0) +vec3 mx_f0_to_ior(vec3 F0) { vec3 sqrtF0 = sqrt(clamp(F0, 0.01, 0.99)); return (vec3(1.0) + sqrtF0) / (vec3(1.0) - sqrtF0); } +// https://renderwonk.com/publications/wp-generalization-adobe/gen-adobe.pdf +vec3 mx_fresnel_hoffman_schlick(float cosTheta, FresnelData fd) +{ + const float COS_THETA_MAX = 1.0 / 7.0; + const float COS_THETA_FACTOR = 1.0 / (COS_THETA_MAX * pow(1.0 - COS_THETA_MAX, 6.0)); + + float x = clamp(cosTheta, 0.0, 1.0); + vec3 a = mix(fd.F0, fd.F90, pow(1.0 - COS_THETA_MAX, fd.exponent)) * (vec3(1.0) - fd.F82) * COS_THETA_FACTOR; + return mix(fd.F0, fd.F90, pow(1.0 - x, fd.exponent)) - a * x * mx_pow6(1.0 - x); +} + // https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ float mx_fresnel_dielectric(float cosTheta, float ior) { - if (cosTheta < 0.0) - return 1.0; - - float g = ior*ior + cosTheta*cosTheta - 1.0; - // Check for total internal reflection - if (g < 0.0) + float c = cosTheta; + float g2 = ior*ior + c*c - 1.0; + if (g2 < 0.0) + { + // Total internal reflection return 1.0; + } - g = sqrt(g); - float gmc = g - cosTheta; - float gpc = g + cosTheta; - float x = gmc / gpc; - float y = (gpc * cosTheta - 1.0) / (gmc * cosTheta + 1.0); - return 0.5 * x * x * (1.0 + y * y); + float g = sqrt(g2); + return 0.5 * mx_square((g - c) / (g + c)) * + (1.0 + mx_square(((g + c) * c - 1.0) / ((g - c) * c + 1.0))); } -void mx_fresnel_dielectric_polarized(float cosTheta, float n, out float Rp, out float Rs) +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ +vec2 mx_fresnel_dielectric_polarized(float cosTheta, float ior) { - if (cosTheta < 0.0) { - Rp = 1.0; - Rs = 1.0; - return; - } - - float cosTheta2 = cosTheta * cosTheta; + float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); float sinTheta2 = 1.0 - cosTheta2; - float n2 = n * n; - float t0 = n2 - sinTheta2; - float a2plusb2 = sqrt(t0 * t0); - float t1 = a2plusb2 + cosTheta2; - float a = sqrt(max(0.5 * (a2plusb2 + t0), 0.0)); - float t2 = 2.0 * a * cosTheta; - Rs = (t1 - t2) / (t1 + t2); + float t0 = max(ior * ior - sinTheta2, 0.0); + float t1 = t0 + cosTheta2; + float t2 = 2.0 * sqrt(t0) * cosTheta; + float Rs = (t1 - t2) / (t1 + t2); - float t3 = cosTheta2 * a2plusb2 + sinTheta2 * sinTheta2; + float t3 = cosTheta2 * t0 + sinTheta2 * sinTheta2; float t4 = t2 * sinTheta2; - Rp = Rs * (t3 - t4) / (t3 + t4); -} + float Rp = Rs * (t3 - t4) / (t3 + t4); -void mx_fresnel_dielectric_polarized(float cosTheta, float eta1, float eta2, out float Rp, out float Rs) -{ - float n = eta2 / eta1; - mx_fresnel_dielectric_polarized(cosTheta, n, Rp, Rs); + return vec2(Rp, Rs); } +// https://seblagarde.wordpress.com/2013/04/29/memo-on-fresnel-equations/ void mx_fresnel_conductor_polarized(float cosTheta, vec3 n, vec3 k, out vec3 Rp, out vec3 Rs) { - cosTheta = clamp(cosTheta, 0.0, 1.0); - float cosTheta2 = cosTheta * cosTheta; + float cosTheta2 = mx_square(clamp(cosTheta, 0.0, 1.0)); float sinTheta2 = 1.0 - cosTheta2; vec3 n2 = n * n; vec3 k2 = k * k; @@ -297,13 +269,6 @@ void mx_fresnel_conductor_polarized(float cosTheta, vec3 n, vec3 k, out vec3 Rp, Rp = Rs * (t3 - t4) / (t3 + t4); } -void mx_fresnel_conductor_polarized(float cosTheta, float eta1, vec3 eta2, vec3 kappa2, out vec3 Rp, out vec3 Rs) -{ - vec3 n = eta2 / eta1; - vec3 k = kappa2 / eta1; - mx_fresnel_conductor_polarized(cosTheta, n, k, Rp, Rs); -} - vec3 mx_fresnel_conductor(float cosTheta, vec3 n, vec3 k) { vec3 Rp, Rs; @@ -311,30 +276,9 @@ vec3 mx_fresnel_conductor(float cosTheta, vec3 n, vec3 k) return 0.5 * (Rp + Rs); } -// Phase shift due to a dielectric material -void mx_fresnel_dielectric_phase_polarized(float cosTheta, float eta1, float eta2, out float phiP, out float phiS) -{ - float cosB = cos(atan(eta2 / eta1)); // Brewster's angle - if (eta2 > eta1) { - phiP = cosTheta < cosB ? M_PI : 0.0f; - phiS = 0.0f; - } else { - phiP = cosTheta < cosB ? 0.0f : M_PI; - phiS = M_PI; - } -} - -// Phase shift due to a conducting material +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html void mx_fresnel_conductor_phase_polarized(float cosTheta, float eta1, vec3 eta2, vec3 kappa2, out vec3 phiP, out vec3 phiS) { - if (dot(kappa2, kappa2) == 0.0 && eta2.x == eta2.y && eta2.y == eta2.z) { - // Use dielectric formula to increase performance - float phiPx, phiSx; - mx_fresnel_dielectric_phase_polarized(cosTheta, eta1, eta2.x, phiPx, phiSx); - phiP = vec3(phiPx, phiPx, phiPx); - phiS = vec3(phiSx, phiSx, phiSx); - return; - } vec3 k2 = kappa2 / eta2; vec3 sinThetaSqr = vec3(1.0) - cosTheta * cosTheta; vec3 A = eta2*eta2*(vec3(1.0)-k2*k2) - eta1*eta1*sinThetaSqr; @@ -347,7 +291,7 @@ void mx_fresnel_conductor_phase_polarized(float cosTheta, float eta1, vec3 eta2, mx_square(eta2*eta2*(vec3(1.0)+k2*k2)*cosTheta) - eta1*eta1*(U*U+V*V)); } -// Evaluation XYZ sensitivity curves in Fourier space +// https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html vec3 mx_eval_sensitivity(float opd, vec3 shift) { // Use Gaussian fits, given by 3 parameters: val, pos and var @@ -362,114 +306,93 @@ vec3 mx_eval_sensitivity(float opd, vec3 shift) // A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence // https://belcour.github.io/blog/research/publication/2017/05/01/brdf-thin-film.html -vec3 mx_fresnel_airy(float cosTheta, vec3 ior, vec3 extinction, float tf_thickness, float tf_ior, - vec3 f0, vec3 f90, float exponent, bool use_schlick) +vec3 mx_fresnel_airy(float cosTheta, FresnelData fd) { - // Convert nm -> m - float d = tf_thickness * 1.0e-9; + // XYZ to CIE 1931 RGB color space (using neutral E illuminant) + const mat3 XYZ_TO_RGB = mat3(2.3706743, -0.5138850, 0.0052982, -0.9000405, 1.4253036, -0.0146949, -0.4706338, 0.0885814, 1.0093968); // Assume vacuum on the outside float eta1 = 1.0; - float eta2 = max(tf_ior, eta1); - vec3 eta3 = use_schlick ? mx_f0_to_ior_colored(f0) : ior; - vec3 kappa3 = use_schlick ? vec3(0.0) : extinction; + float eta2 = max(fd.tf_ior, eta1); + vec3 eta3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? mx_f0_to_ior(fd.F0) : fd.ior; + vec3 kappa3 = (fd.model == FRESNEL_MODEL_SCHLICK) ? vec3(0.0) : fd.extinction; + float cosThetaT = sqrt(1.0 - (1.0 - mx_square(cosTheta)) * mx_square(eta1 / eta2)); + + // First interface + vec2 R12 = mx_fresnel_dielectric_polarized(cosTheta, eta2 / eta1); + if (cosThetaT <= 0.0) + { + // Total internal reflection + R12 = vec2(1.0); + } + vec2 T121 = vec2(1.0) - R12; - // Compute the Spectral versions of the Fresnel reflectance and - // transmitance for each interface. - float R12p, T121p, R12s, T121s; + // Second interface vec3 R23p, R23s; - - // Reflected and transmitted parts in the thin film - mx_fresnel_dielectric_polarized(cosTheta, eta1, eta2, R12p, R12s); - - // Reflected part by the base - float scale = eta1 / eta2; - float cosThetaTSqr = 1.0 - (1.0-cosTheta*cosTheta) * scale*scale; - float cosTheta2 = sqrt(cosThetaTSqr); - if (use_schlick) + if (fd.model == FRESNEL_MODEL_SCHLICK) { - vec3 f = mx_fresnel_schlick(cosTheta2, f0, f90, exponent); + vec3 f = mx_fresnel_hoffman_schlick(cosThetaT, fd); R23p = 0.5 * f; R23s = 0.5 * f; } else { - mx_fresnel_conductor_polarized(cosTheta2, eta2, eta3, kappa3, R23p, R23s); + mx_fresnel_conductor_polarized(cosThetaT, eta3 / eta2, kappa3 / eta2, R23p, R23s); } - // Check for total internal reflection - if (cosThetaTSqr <= 0.0f) + // Phase shift + float cosB = cos(atan(eta2 / eta1)); + vec2 phi21 = vec2(cosTheta < cosB ? 0.0 : M_PI, M_PI); + vec3 phi23p, phi23s; + if (fd.model == FRESNEL_MODEL_SCHLICK) { - R12s = 1.0; - R12p = 1.0; - } - - // Compute the transmission coefficients - T121p = 1.0 - R12p; - T121s = 1.0 - R12s; - - // Optical path difference - float D = 2.0 * eta2 * d * cosTheta2; - - float phi21p, phi21s; - vec3 phi23p, phi23s, r123s, r123p; - - // Evaluate the phase shift - mx_fresnel_dielectric_phase_polarized(cosTheta, eta1, eta2, phi21p, phi21s); - if (use_schlick) - { - phi23p = vec3( - (eta3[0] < eta2) ? M_PI : 0.0, - (eta3[1] < eta2) ? M_PI : 0.0, - (eta3[2] < eta2) ? M_PI : 0.0); + phi23p = vec3((eta3[0] < eta2) ? M_PI : 0.0, + (eta3[1] < eta2) ? M_PI : 0.0, + (eta3[2] < eta2) ? M_PI : 0.0); phi23s = phi23p; } else { - mx_fresnel_conductor_phase_polarized(cosTheta2, eta2, eta3, kappa3, phi23p, phi23s); + mx_fresnel_conductor_phase_polarized(cosThetaT, eta2, eta3, kappa3, phi23p, phi23s); } + vec3 r123p = max(sqrt(R12.x*R23p), 0.0); + vec3 r123s = max(sqrt(R12.y*R23s), 0.0); - phi21p = M_PI - phi21p; - phi21s = M_PI - phi21s; - - r123p = max(vec3(0.0), sqrt(R12p*R23p)); - r123s = max(vec3(0.0), sqrt(R12s*R23s)); - - // Evaluate iridescence term + // Iridescence term vec3 I = vec3(0.0); - vec3 C0, Cm, Sm; + vec3 Cm, Sm; - // Iridescence term using spectral antialiasing for Parallel polarization + // Optical path difference + float distMeters = fd.tf_thickness * 1.0e-9; + float opd = 2.0 * eta2 * cosThetaT * distMeters; - vec3 S0 = vec3(1.0); + // Iridescence term using spectral antialiasing for Parallel polarization // Reflectance term for m=0 (DC term amplitude) - vec3 Rs = (T121p*T121p*R23p) / (vec3(1.0) - R12p*R23p); - C0 = R12p + Rs; - I += C0 * S0; + vec3 Rs = (mx_square(T121.x) * R23p) / (vec3(1.0) - R12.x*R23p); + I += R12.x + Rs; // Reflectance term for m>0 (pairs of diracs) - Cm = Rs - T121p; - for (int m=1; m<=2; ++m) + Cm = Rs - T121.x; + for (int m=1; m<=2; m++) { Cm *= r123p; - Sm = 2.0 * mx_eval_sensitivity(float(m)*D, float(m)*(phi23p+vec3(phi21p))); + Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23p+vec3(phi21.x))); I += Cm*Sm; } // Iridescence term using spectral antialiasing for Perpendicular polarization // Reflectance term for m=0 (DC term amplitude) - vec3 Rp = (T121s*T121s*R23s) / (vec3(1.0) - R12s*R23s); - C0 = R12s + Rp; - I += C0 * S0; + vec3 Rp = (mx_square(T121.y) * R23s) / (vec3(1.0) - R12.y*R23s); + I += R12.y + Rp; // Reflectance term for m>0 (pairs of diracs) - Cm = Rp - T121s ; - for (int m=1; m<=2; ++m) + Cm = Rp - T121.y; + for (int m=1; m<=2; m++) { Cm *= r123s; - Sm = 2.0 * mx_eval_sensitivity(float(m)*D, float(m)*(phi23s+vec3(phi21s))); + Sm = 2.0 * mx_eval_sensitivity(float(m) * opd, float(m)*(phi23s+vec3(phi21.y))); I += Cm*Sm; } @@ -477,82 +400,69 @@ vec3 mx_fresnel_airy(float cosTheta, vec3 ior, vec3 extinction, float tf_thickne I *= 0.5; // Convert back to RGB reflectance - I = clamp(XYZ_TO_RGB * I, vec3(0.0), vec3(1.0)); + I = clamp(XYZ_TO_RGB * I, 0.0, 1.0); return I; } -FresnelData mx_init_fresnel_data(int model) -{ - return FresnelData(model, vec3(0.0), vec3(0.0), vec3(0.0), vec3(0.0), 0.0, 0.0, 0.0, false); -} - -FresnelData mx_init_fresnel_dielectric(float ior) +FresnelData mx_init_fresnel_dielectric(float ior, float tf_thickness, float tf_ior) { - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_DIELECTRIC); + FresnelData fd; + fd.model = FRESNEL_MODEL_DIELECTRIC; + fd.airy = tf_thickness > 0.0; fd.ior = vec3(ior); + fd.extinction = vec3(0.0); + fd.F0 = vec3(0.0); + fd.F82 = vec3(0.0); + fd.F90 = vec3(0.0); + fd.exponent = 0.0; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; return fd; } -FresnelData mx_init_fresnel_conductor(vec3 ior, vec3 extinction) +FresnelData mx_init_fresnel_conductor(vec3 ior, vec3 extinction, float tf_thickness, float tf_ior) { - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_CONDUCTOR); + FresnelData fd; + fd.model = FRESNEL_MODEL_CONDUCTOR; + fd.airy = tf_thickness > 0.0; fd.ior = ior; fd.extinction = extinction; + fd.F0 = vec3(0.0); + fd.F82 = vec3(0.0); + fd.F90 = vec3(0.0); + fd.exponent = 0.0; + fd.tf_thickness = tf_thickness; + fd.tf_ior = tf_ior; + fd.refraction = false; return fd; } -FresnelData mx_init_fresnel_schlick(vec3 F0) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_SCHLICK); - fd.F0 = F0; - fd.F90 = vec3(1.0); - fd.exponent = 5.0f; - return fd; -} - -FresnelData mx_init_fresnel_schlick(vec3 F0, vec3 F90, float exponent) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_SCHLICK); - fd.F0 = F0; - fd.F90 = F90; - fd.exponent = exponent; - return fd; -} - -FresnelData mx_init_fresnel_schlick_airy(vec3 F0, vec3 F90, float exponent, float tf_thickness, float tf_ior) +FresnelData mx_init_fresnel_schlick(vec3 F0, vec3 F82, vec3 F90, float exponent, float tf_thickness, float tf_ior) { - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_SCHLICK_AIRY); + FresnelData fd; + fd.model = FRESNEL_MODEL_SCHLICK; + fd.airy = tf_thickness > 0.0; + fd.ior = vec3(0.0); + fd.extinction = vec3(0.0); fd.F0 = F0; + fd.F82 = F82; fd.F90 = F90; fd.exponent = exponent; fd.tf_thickness = tf_thickness; fd.tf_ior = tf_ior; - return fd; -} - -FresnelData mx_init_fresnel_dielectric_airy(float ior, float tf_thickness, float tf_ior) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_AIRY); - fd.ior = vec3(ior); - fd.tf_thickness = tf_thickness; - fd.tf_ior = tf_ior; - return fd; -} - -FresnelData mx_init_fresnel_conductor_airy(vec3 ior, vec3 extinction, float tf_thickness, float tf_ior) -{ - FresnelData fd = mx_init_fresnel_data(FRESNEL_MODEL_AIRY); - fd.ior = ior; - fd.extinction = extinction; - fd.tf_thickness = tf_thickness; - fd.tf_ior = tf_ior; + fd.refraction = false; return fd; } vec3 mx_compute_fresnel(float cosTheta, FresnelData fd) { - if (fd.model == FRESNEL_MODEL_DIELECTRIC) + if (fd.airy) + { + return mx_fresnel_airy(cosTheta, fd); + } + else if (fd.model == FRESNEL_MODEL_DIELECTRIC) { return vec3(mx_fresnel_dielectric(cosTheta, fd.ior.x)); } @@ -560,15 +470,9 @@ vec3 mx_compute_fresnel(float cosTheta, FresnelData fd) { return mx_fresnel_conductor(cosTheta, fd.ior, fd.extinction); } - else if (fd.model == FRESNEL_MODEL_SCHLICK) - { - return mx_fresnel_schlick(cosTheta, fd.F0, fd.F90, fd.exponent); - } else { - return mx_fresnel_airy(cosTheta, fd.ior, fd.extinction, fd.tf_thickness, fd.tf_ior, - fd.F0, fd.F90, fd.exponent, - fd.model == FRESNEL_MODEL_SCHLICK_AIRY); + return mx_fresnel_hoffman_schlick(cosTheta, fd); } } @@ -604,17 +508,3 @@ float mx_latlong_compute_lod(vec3 dir, float pdf, float maxMipLevel, int envSamp float distortion = sqrt(1.0 - mx_square(dir.y)); return max(effectiveMaxMipLevel - 0.5 * log2(float(envSamples) * pdf * distortion), 0.0); } - -// Return the mip level associated with the given alpha in a prefiltered environment. -float mx_latlong_alpha_to_lod(float alpha) -{ - float lodBias = (alpha < 0.25) ? sqrt(alpha) : 0.5 * alpha + 0.375; - return lodBias * float($envRadianceMips - 1); -} - -// Return the alpha associated with the given mip level in a prefiltered environment. -float mx_latlong_lod_to_alpha(float lod) -{ - float lodBias = lod / float($envRadianceMips - 1); - return (lodBias < 0.5) ? mx_square(lodBias) : 2.0 * (lodBias - 0.375); -} diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_table.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_table.glsl deleted file mode 100644 index 5d310e90..00000000 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/lib/mx_table.glsl +++ /dev/null @@ -1,10 +0,0 @@ -#include "mx_microfacet_sheen.glsl" -#include "mx_microfacet_specular.glsl" - -vec3 mx_generate_dir_albedo_table() -{ - vec2 uv = gl_FragCoord.xy / $albedoTableSize; - vec2 ggxDirAlbedo = mx_ggx_dir_albedo(uv.x, uv.y, vec3(1, 0, 0), vec3(0, 1, 0)).xy; - float sheenDirAlbedo = mx_imageworks_sheen_dir_albedo(uv.x, uv.y); - return vec3(ggxDirAlbedo, sheenDirAlbedo); -} diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_burley_diffuse_bsdf.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_burley_diffuse_bsdf.glsl index ddf2fe47..d9562d25 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_burley_diffuse_bsdf.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_burley_diffuse_bsdf.glsl @@ -11,10 +11,12 @@ void mx_burley_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, normal = mx_forward_facing_normal(normal, V); + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float LdotH = clamp(dot(L, normalize(L + V)), M_FLOAT_EPS, 1.0); bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; - bsdf.response *= mx_burley_diffuse(L, V, normal, NdotL, roughness); + bsdf.response *= mx_burley_diffuse(NdotV, NdotL, LdotH, roughness); } void mx_burley_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float roughness, vec3 normal, inout BSDF bsdf) diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_conductor_bsdf.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_conductor_bsdf.glsl index 53255055..6b25fd4c 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_conductor_bsdf.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_conductor_bsdf.glsl @@ -1,6 +1,6 @@ #include "lib/mx_microfacet_specular.glsl" -void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) { bsdf.throughput = vec3(0.0); @@ -23,12 +23,7 @@ void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float float avgAlpha = mx_average_alpha(safeAlpha); vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - FresnelData fd; - if (bsdf.thickness > 0.0) - fd = mx_init_fresnel_conductor_airy(ior_n, ior_k, bsdf.thickness, bsdf.ior); - else - fd = mx_init_fresnel_conductor(ior_n, ior_k); - + FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); vec3 F = mx_compute_fresnel(VdotH, fd); float D = mx_ggx_NDF(Ht, safeAlpha); float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); @@ -39,7 +34,7 @@ void mx_conductor_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); } -void mx_conductor_bsdf_indirect(vec3 V, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, vec3 N, vec3 X, int distribution, inout BSDF bsdf) +void mx_conductor_bsdf_indirect(vec3 V, float weight, vec3 ior_n, vec3 ior_k, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, inout BSDF bsdf) { bsdf.throughput = vec3(0.0); @@ -52,12 +47,7 @@ void mx_conductor_bsdf_indirect(vec3 V, float weight, vec3 ior_n, vec3 ior_k, ve float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - FresnelData fd; - if (bsdf.thickness > 0.0) - fd = mx_init_fresnel_conductor_airy(ior_n, ior_k, bsdf.thickness, bsdf.ior); - else - fd = mx_init_fresnel_conductor(ior_n, ior_k); - + FresnelData fd = mx_init_fresnel_conductor(ior_n, ior_k, thinfilm_thickness, thinfilm_ior); vec3 F = mx_compute_fresnel(NdotV, fd); vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_dielectric_bsdf.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_dielectric_bsdf.glsl index d8bc1ba6..0f362ffd 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_dielectric_bsdf.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_dielectric_bsdf.glsl @@ -1,6 +1,6 @@ #include "lib/mx_microfacet_specular.glsl" -void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 tint, float ior, vec2 roughness, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) { if (weight < M_FLOAT_EPS) { @@ -21,16 +21,8 @@ void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, floa float avgAlpha = mx_average_alpha(safeAlpha); vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - FresnelData fd; vec3 safeTint = max(tint, 0.0); - if (bsdf.thickness > 0.0) - { - fd = mx_init_fresnel_dielectric_airy(ior, bsdf.thickness, bsdf.ior); - } - else - { - fd = mx_init_fresnel_dielectric(ior); - } + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); vec3 F = mx_compute_fresnel(VdotH, fd); float D = mx_ggx_NDF(Ht, safeAlpha); float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); @@ -44,7 +36,7 @@ void mx_dielectric_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, floa bsdf.response = D * F * G * comp * safeTint * occlusion * weight / (4.0 * NdotV); } -void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) { if (weight < M_FLOAT_EPS) { @@ -54,16 +46,8 @@ void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, N = mx_forward_facing_normal(N, V); float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - FresnelData fd; vec3 safeTint = max(tint, 0.0); - if (bsdf.thickness > 0.0) - { - fd = mx_init_fresnel_dielectric_airy(ior, bsdf.thickness, bsdf.ior); - } - else - { - fd = mx_init_fresnel_dielectric(ior); - } + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); vec3 F = mx_compute_fresnel(NdotV, fd); vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); @@ -80,7 +64,7 @@ void mx_dielectric_bsdf_transmission(vec3 V, float weight, vec3 tint, float ior, } } -void mx_dielectric_bsdf_indirect(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +void mx_dielectric_bsdf_indirect(vec3 V, float weight, vec3 tint, float ior, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) { if (weight < M_FLOAT_EPS) { @@ -91,16 +75,8 @@ void mx_dielectric_bsdf_indirect(vec3 V, float weight, vec3 tint, float ior, vec float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - FresnelData fd; vec3 safeTint = max(tint, 0.0); - if (bsdf.thickness > 0.0) - { - fd = mx_init_fresnel_dielectric_airy(ior, bsdf.thickness, bsdf.ior); - } - else - { - fd = mx_init_fresnel_dielectric(ior); - } + FresnelData fd = mx_init_fresnel_dielectric(ior, thinfilm_thickness, thinfilm_ior); vec3 F = mx_compute_fresnel(NdotV, fd); vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_generalized_schlick_bsdf.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_generalized_schlick_bsdf.glsl index 544e479f..764412b9 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_generalized_schlick_bsdf.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_generalized_schlick_bsdf.glsl @@ -1,6 +1,6 @@ #include "lib/mx_microfacet_specular.glsl" -void mx_generalized_schlick_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color0, vec3 color90, float exponent, vec2 roughness, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +void mx_generalized_schlick_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusion, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) { if (weight < M_FLOAT_EPS) { @@ -21,17 +21,10 @@ void mx_generalized_schlick_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlus float avgAlpha = mx_average_alpha(safeAlpha); vec3 Ht = vec3(dot(H, X), dot(H, Y), dot(H, N)); - FresnelData fd; vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); vec3 safeColor90 = max(color90, 0.0); - if (bsdf.thickness > 0.0) - { - fd = mx_init_fresnel_schlick_airy(safeColor0, safeColor90, exponent, bsdf.thickness, bsdf.ior); - } - else - { - fd = mx_init_fresnel_schlick(safeColor0, safeColor90, exponent); - } + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); vec3 F = mx_compute_fresnel(VdotH, fd); float D = mx_ggx_NDF(Ht, safeAlpha); float G = mx_ggx_smith_G2(NdotL, NdotV, avgAlpha); @@ -45,7 +38,7 @@ void mx_generalized_schlick_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlus bsdf.response = D * F * G * comp * occlusion * weight / (4.0 * NdotV); } -void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, vec3 color90, float exponent, vec2 roughness, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) { if (weight < M_FLOAT_EPS) { @@ -55,17 +48,10 @@ void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, N = mx_forward_facing_normal(N, V); float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - FresnelData fd; vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); vec3 safeColor90 = max(color90, 0.0); - if (bsdf.thickness > 0.0) - { - fd = mx_init_fresnel_schlick_airy(safeColor0, safeColor90, exponent, bsdf.thickness, bsdf.ior); - } - else - { - fd = mx_init_fresnel_schlick(safeColor0, safeColor90, exponent); - } + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); vec3 F = mx_compute_fresnel(NdotV, fd); vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); @@ -84,7 +70,7 @@ void mx_generalized_schlick_bsdf_transmission(vec3 V, float weight, vec3 color0, } } -void mx_generalized_schlick_bsdf_indirect(vec3 V, float weight, vec3 color0, vec3 color90, float exponent, vec2 roughness, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) +void mx_generalized_schlick_bsdf_indirect(vec3 V, float weight, vec3 color0, vec3 color82, vec3 color90, float exponent, vec2 roughness, float thinfilm_thickness, float thinfilm_ior, vec3 N, vec3 X, int distribution, int scatter_mode, inout BSDF bsdf) { if (weight < M_FLOAT_EPS) { @@ -94,17 +80,10 @@ void mx_generalized_schlick_bsdf_indirect(vec3 V, float weight, vec3 color0, vec N = mx_forward_facing_normal(N, V); float NdotV = clamp(dot(N, V), M_FLOAT_EPS, 1.0); - FresnelData fd; vec3 safeColor0 = max(color0, 0.0); + vec3 safeColor82 = max(color82, 0.0); vec3 safeColor90 = max(color90, 0.0); - if (bsdf.thickness > 0.0) - { - fd = mx_init_fresnel_schlick_airy(safeColor0, safeColor90, exponent, bsdf.thickness, bsdf.ior); - } - else - { - fd = mx_init_fresnel_schlick(safeColor0, safeColor90, exponent); - } + FresnelData fd = mx_init_fresnel_schlick(safeColor0, safeColor82, safeColor90, exponent, thinfilm_thickness, thinfilm_ior); vec3 F = mx_compute_fresnel(NdotV, fd); vec2 safeAlpha = clamp(roughness, M_FLOAT_EPS, 1.0); diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_oren_nayar_diffuse_bsdf.glsl b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_oren_nayar_diffuse_bsdf.glsl index e32590d1..e80c413c 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_oren_nayar_diffuse_bsdf.glsl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/mx_oren_nayar_diffuse_bsdf.glsl @@ -11,12 +11,14 @@ void mx_oren_nayar_diffuse_bsdf_reflection(vec3 L, vec3 V, vec3 P, float occlusi normal = mx_forward_facing_normal(normal, V); + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); float NdotL = clamp(dot(normal, L), M_FLOAT_EPS, 1.0); + float LdotV = clamp(dot(L, V), M_FLOAT_EPS, 1.0); bsdf.response = color * occlusion * weight * NdotL * M_PI_INV; if (roughness > 0.0) { - bsdf.response *= mx_oren_nayar_diffuse(L, V, normal, NdotL, roughness); + bsdf.response *= mx_oren_nayar_diffuse(NdotV, NdotL, LdotV, roughness); } } @@ -31,6 +33,9 @@ void mx_oren_nayar_diffuse_bsdf_indirect(vec3 V, float weight, vec3 color, float normal = mx_forward_facing_normal(normal, V); - vec3 Li = mx_environment_irradiance(normal); + float NdotV = clamp(dot(normal, V), M_FLOAT_EPS, 1.0); + + vec3 Li = mx_environment_irradiance(normal) * + mx_oren_nayar_diffuse_dir_albedo(NdotV, roughness); bsdf.response = Li * color * weight; } diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/pbrlib_genglsl_impl.mtlx b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/pbrlib_genglsl_impl.mtlx index fa461737..5980b1f0 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/pbrlib_genglsl_impl.mtlx +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genglsl/pbrlib_genglsl_impl.mtlx @@ -28,9 +28,6 @@ - - - diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genmdl/pbrlib_genmdl_impl.mtlx b/pymaterialx/python/MaterialX/libraries/pbrlib/genmdl/pbrlib_genmdl_impl.mtlx index a4277bf6..752aa7bf 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genmdl/pbrlib_genmdl_impl.mtlx +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genmdl/pbrlib_genmdl_impl.mtlx @@ -11,13 +11,13 @@ - + - + - + @@ -25,9 +25,6 @@ - - - diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genmsl/pbrlib_genmsl_impl.mtlx b/pymaterialx/python/MaterialX/libraries/pbrlib/genmsl/pbrlib_genmsl_impl.mtlx index 8d1d2a47..51f0ba14 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genmsl/pbrlib_genmsl_impl.mtlx +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genmsl/pbrlib_genmsl_impl.mtlx @@ -28,9 +28,6 @@ - - - diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_conductor_bsdf.osl b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_conductor_bsdf.osl index 850ff58f..82cb6f32 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_conductor_bsdf.osl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_conductor_bsdf.osl @@ -1,6 +1,6 @@ #include "../lib/mx_microfacet_specular.osl" -void mx_conductor_bsdf(float weight, color ior_n, color ior_k, vector2 roughness, normal N, vector U, string distribution, output BSDF bsdf) +void mx_conductor_bsdf(float weight, color ior_n, color ior_k, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, output BSDF bsdf) { bsdf.throughput = color(0.0); diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_dielectric_bsdf.osl b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_dielectric_bsdf.osl index a17fdd40..5e508347 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_dielectric_bsdf.osl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_dielectric_bsdf.osl @@ -1,6 +1,6 @@ #include "../lib/mx_microfacet_specular.osl" -void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { if (scatter_mode == "T") { diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_generalized_schlick_bsdf.osl b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_generalized_schlick_bsdf.osl index ee34727e..cd022f82 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_generalized_schlick_bsdf.osl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/legacy/mx_generalized_schlick_bsdf.osl @@ -1,6 +1,6 @@ #include "../lib/mx_microfacet_specular.osl" -void mx_generalized_schlick_bsdf(float weight, color color0, color color90, float exponent, vector2 roughness, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { float avgF0 = dot(color0, color(1.0 / 3.0)); float ior = mx_f0_to_ior(avgF0); diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/mx_dielectric_bsdf.osl b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/mx_dielectric_bsdf.osl index 69773b3c..fe570e15 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/mx_dielectric_bsdf.osl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/mx_dielectric_bsdf.osl @@ -1,15 +1,15 @@ -void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +void mx_dielectric_bsdf(float weight, color tint, float ior, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { if (scatter_mode == "R") { - bsdf = weight * dielectric_bsdf(N, U, tint, color(0.0), roughness.x, roughness.y, ior, distribution); + bsdf = weight * dielectric_bsdf(N, U, tint, color(0.0), roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); } else if (scatter_mode == "T") { - bsdf = weight * dielectric_bsdf(N, U, color(0.0), tint, roughness.x, roughness.y, ior, distribution); + bsdf = weight * dielectric_bsdf(N, U, color(0.0), tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); } else { - bsdf = weight * dielectric_bsdf(N, U, tint, tint, roughness.x, roughness.y, ior, distribution); + bsdf = weight * dielectric_bsdf(N, U, tint, tint, roughness.x, roughness.y, ior, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); } } diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/mx_generalized_schlick_bsdf.osl b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/mx_generalized_schlick_bsdf.osl index 955de3c1..53919e85 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/mx_generalized_schlick_bsdf.osl +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/mx_generalized_schlick_bsdf.osl @@ -1,15 +1,15 @@ -void mx_generalized_schlick_bsdf(float weight, color color0, color color90, float exponent, vector2 roughness, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) +void mx_generalized_schlick_bsdf(float weight, color color0, color color82, color color90, float exponent, vector2 roughness, float thinfilm_thickness, float thinfilm_ior, normal N, vector U, string distribution, string scatter_mode, output BSDF bsdf) { if (scatter_mode == "R") { - bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(0.0), roughness.x, roughness.y, color0, color90, exponent, distribution); + bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(0.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); } else if (scatter_mode == "T") { - bsdf = weight * generalized_schlick_bsdf(N, U, color(0.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution); + bsdf = weight * generalized_schlick_bsdf(N, U, color(0.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); } else { - bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution); + bsdf = weight * generalized_schlick_bsdf(N, U, color(1.0), color(1.0), roughness.x, roughness.y, color0, color90, exponent, distribution, "thinfilm_thickness", thinfilm_thickness, "thinfilm_ior", thinfilm_ior); } } diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/pbrlib_genosl_impl.mtlx b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/pbrlib_genosl_impl.mtlx index 6ab7cc9e..69e4574e 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/pbrlib_genosl_impl.mtlx +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/genosl/pbrlib_genosl_impl.mtlx @@ -2,37 +2,34 @@ - + - + - + - + - + - + - + - + - - - - + - + @@ -42,21 +39,21 @@ - - + + - - + + - - - - + + + + - + diff --git a/pymaterialx/python/MaterialX/libraries/pbrlib/pbrlib_defs.mtlx b/pymaterialx/python/MaterialX/libraries/pbrlib/pbrlib_defs.mtlx index e63625a4..b90cf377 100644 --- a/pymaterialx/python/MaterialX/libraries/pbrlib/pbrlib_defs.mtlx +++ b/pymaterialx/python/MaterialX/libraries/pbrlib/pbrlib_defs.mtlx @@ -63,6 +63,8 @@ + + @@ -79,6 +81,8 @@ + + @@ -92,9 +96,12 @@ + + + @@ -127,16 +134,6 @@ - - - - - - - diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector2.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector2.glsl deleted file mode 100644 index 59dbbee1..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector2.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_fractal3d_fa_vector2(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec2 result) -{ - vec2 value = mx_fractal_noise_vec2(position, octaves, lacunarity, diminish); - result = value * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector3.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector3.glsl deleted file mode 100644 index d0f30def..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector3.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_fractal3d_fa_vector3(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec3 result) -{ - vec3 value = mx_fractal_noise_vec3(position, octaves, lacunarity, diminish); - result = value * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector4.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector4.glsl deleted file mode 100644 index b9c66c44..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_fractal3d_fa_vector4.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_fractal3d_fa_vector4(float amplitude, int octaves, float lacunarity, float diminish, vec3 position, out vec4 result) -{ - vec4 value = mx_fractal_noise_vec4(position, octaves, lacunarity, diminish); - result = value * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector2.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector2.glsl deleted file mode 100644 index f5a81565..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector2.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_noise2d_fa_vector2(float amplitude, float pivot, vec2 texcoord, out vec2 result) -{ - vec3 value = mx_perlin_noise_vec3(texcoord); - result = value.xy * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector3.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector3.glsl deleted file mode 100644 index 0735965c..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector3.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_noise2d_fa_vector3(float amplitude, float pivot, vec2 texcoord, out vec3 result) -{ - vec3 value = mx_perlin_noise_vec3(texcoord); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector4.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector4.glsl deleted file mode 100644 index 6d51a59e..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise2d_fa_vector4.glsl +++ /dev/null @@ -1,8 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_noise2d_fa_vector4(float amplitude, float pivot, vec2 texcoord, out vec4 result) -{ - vec3 xyz = mx_perlin_noise_vec3(texcoord); - float w = mx_perlin_noise_float(texcoord + vec2(19, 73)); - result = vec4(xyz, w) * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector2.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector2.glsl deleted file mode 100644 index 06d91f91..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector2.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_noise3d_fa_vector2(float amplitude, float pivot, vec3 position, out vec2 result) -{ - vec3 value = mx_perlin_noise_vec3(position); - result = value.xy * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector3.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector3.glsl deleted file mode 100644 index 168bf572..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector3.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_noise3d_fa_vector3(float amplitude, float pivot, vec3 position, out vec3 result) -{ - vec3 value = mx_perlin_noise_vec3(position); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector4.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector4.glsl deleted file mode 100644 index 680410f9..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_noise3d_fa_vector4.glsl +++ /dev/null @@ -1,8 +0,0 @@ -#include "lib/mx_noise.glsl" - -void mx_noise3d_fa_vector4(float amplitude, float pivot, vec3 position, out vec4 result) -{ - vec3 xyz = mx_perlin_noise_vec3(position); - float w = mx_perlin_noise_float(position + vec3(19, 73, 29)); - result = vec4(xyz, w) * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay.glsl deleted file mode 100644 index e1bec8ac..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay.glsl +++ /dev/null @@ -1,25 +0,0 @@ -float mx_overlay(float fg, float bg) -{ - return (fg < 0.5) ? (2.0 * fg * bg) : (1.0 - (1.0 - fg) * (1.0 - bg)); -} - -vec2 mx_overlay(vec2 fg, vec2 bg) -{ - return vec2(mx_overlay(fg.r, bg.r), - mx_overlay(fg.g, bg.g)); -} - -vec3 mx_overlay(vec3 fg, vec3 bg) -{ - return vec3(mx_overlay(fg.r, bg.r), - mx_overlay(fg.g, bg.g), - mx_overlay(fg.b, bg.b)); -} - -vec4 mx_overlay(vec4 fg, vec4 bg) -{ - return vec4(mx_overlay(fg.r, bg.r), - mx_overlay(fg.g, bg.g), - mx_overlay(fg.b, bg.b), - mx_overlay(fg.a, bg.a)); -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay_color3.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay_color3.glsl deleted file mode 100644 index 3b6ae678..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay_color3.glsl +++ /dev/null @@ -1,6 +0,0 @@ -#include "mx_overlay.glsl" - -void mx_overlay_color3(vec3 fg, vec3 bg, float mix, out vec3 result) -{ - result = mix * mx_overlay(fg, bg) + (1.0-mix) * bg; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay_color4.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay_color4.glsl deleted file mode 100644 index 411e0da3..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_overlay_color4.glsl +++ /dev/null @@ -1,6 +0,0 @@ -#include "mx_overlay.glsl" - -void mx_overlay_color4(vec4 fg, vec4 bg, float mix, out vec4 result) -{ - result = mix * mx_overlay(fg, bg) + (1.0-mix) * bg; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec2.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec2.glsl deleted file mode 100644 index c46152e3..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec2.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "mx_smoothstep_float.glsl" - -void mx_smoothstep_vec2(vec2 val, vec2 low, vec2 high, out vec2 result) -{ - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec2FA.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec2FA.glsl deleted file mode 100644 index 0b16d99e..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec2FA.glsl +++ /dev/null @@ -1,7 +0,0 @@ -#include "mx_smoothstep_float.glsl" - -void mx_smoothstep_vec2FA(vec2 val, float low, float high, out vec2 result) -{ - mx_smoothstep_float(val.x, low, high, result.x); - mx_smoothstep_float(val.y, low, high, result.y); -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec3.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec3.glsl deleted file mode 100644 index ce15fcdd..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec3.glsl +++ /dev/null @@ -1,8 +0,0 @@ -#include "mx_smoothstep_float.glsl" - -void mx_smoothstep_vec3(vec3 val, vec3 low, vec3 high, out vec3 result) -{ - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); - mx_smoothstep_float(val.z, low.z, high.z, result.z); -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec3FA.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec3FA.glsl deleted file mode 100644 index ffc913e6..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec3FA.glsl +++ /dev/null @@ -1,8 +0,0 @@ -#include "mx_smoothstep_float.glsl" - -void mx_smoothstep_vec3FA(vec3 val, float low, float high, out vec3 result) -{ - mx_smoothstep_float(val.x, low, high, result.x); - mx_smoothstep_float(val.y, low, high, result.y); - mx_smoothstep_float(val.z, low, high, result.z); -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec4.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec4.glsl deleted file mode 100644 index 04609b60..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec4.glsl +++ /dev/null @@ -1,9 +0,0 @@ -#include "mx_smoothstep_float.glsl" - -void mx_smoothstep_vec4(vec4 val, vec4 low, vec4 high, out vec4 result) -{ - mx_smoothstep_float(val.x, low.x, high.x, result.x); - mx_smoothstep_float(val.y, low.y, high.y, result.y); - mx_smoothstep_float(val.z, low.z, high.z, result.z); - mx_smoothstep_float(val.w, low.w, high.w, result.w); -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec4FA.glsl b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec4FA.glsl deleted file mode 100644 index e001efd8..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/mx_smoothstep_vec4FA.glsl +++ /dev/null @@ -1,9 +0,0 @@ -#include "mx_smoothstep_float.glsl" - -void mx_smoothstep_vec4FA(vec4 val, float low, float high, out vec4 result) -{ - mx_smoothstep_float(val.x, low, high, result.x); - mx_smoothstep_float(val.y, low, high, result.y); - mx_smoothstep_float(val.z, low, high, result.z); - mx_smoothstep_float(val.w, low, high, result.w); -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx index 243a2647..05e99fc1 100644 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx +++ b/pymaterialx/python/MaterialX/libraries/stdlib/genglsl/stdlib_genglsl_impl.mtlx @@ -42,10 +42,9 @@ - + - @@ -188,6 +187,7 @@ + @@ -205,6 +205,7 @@ + @@ -330,25 +331,25 @@ - + - + - + - + @@ -591,51 +592,72 @@ + + + + + + + + + + + + + + + + + + + + + @@ -646,6 +668,8 @@ + + @@ -654,6 +678,8 @@ + + @@ -678,49 +704,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -736,6 +719,13 @@ + + + + + + + diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx b/pymaterialx/python/MaterialX/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx index 7d80ecb4..8dc976c4 100644 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx +++ b/pymaterialx/python/MaterialX/libraries/stdlib/genmdl/stdlib_genmdl_impl.mtlx @@ -44,7 +44,7 @@ - + @@ -190,6 +190,7 @@ + @@ -207,6 +208,7 @@ + @@ -306,8 +308,8 @@ - - + + @@ -332,28 +334,28 @@ - + - + - + - + @@ -600,67 +602,92 @@ + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + - - - - - - + + + + + + + + @@ -685,43 +712,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -741,6 +731,13 @@ + + + + + + + diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec2.metal b/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec2.metal deleted file mode 100644 index 0baa7631..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec2.metal +++ /dev/null @@ -1,8 +0,0 @@ -#include "mx_smoothstep_float.metal" - -void mx_smoothstep_vec2(vec2 val, vec2 low, vec2 high, out vec2 result) -{ - float f; - mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; - mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec2FA.metal b/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec2FA.metal deleted file mode 100644 index a05a10d7..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec2FA.metal +++ /dev/null @@ -1,8 +0,0 @@ -#include "mx_smoothstep_float.metal" - -void mx_smoothstep_vec2FA(vec2 val, float low, float high, out vec2 result) -{ - float f; - mx_smoothstep_float(val.x, low, high, f); result.x = f; - mx_smoothstep_float(val.y, low, high, f); result.y = f; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec3.metal b/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec3.metal deleted file mode 100644 index b0f96975..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec3.metal +++ /dev/null @@ -1,9 +0,0 @@ -#include "mx_smoothstep_float.metal" - -void mx_smoothstep_vec3(vec3 val, vec3 low, vec3 high, thread vec3& result) - { - float f; - mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; - mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; - mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; - } \ No newline at end of file diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec3FA.metal b/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec3FA.metal deleted file mode 100644 index 4a1922d5..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec3FA.metal +++ /dev/null @@ -1,9 +0,0 @@ -#include "mx_smoothstep_float.metal" - -void mx_smoothstep_vec3FA(vec3 val, float low, float high, out vec3 result) -{ - float f; - mx_smoothstep_float(val.x, low, high, f); result.x = f; - mx_smoothstep_float(val.y, low, high, f); result.y = f; - mx_smoothstep_float(val.z, low, high, f); result.z = f; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec4.metal b/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec4.metal deleted file mode 100644 index 8bf2f3d0..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec4.metal +++ /dev/null @@ -1,10 +0,0 @@ -#include "mx_smoothstep_float.metal" - -void mx_smoothstep_vec4(vec4 val, vec4 low, vec4 high, out vec4 result) -{ - float f; - mx_smoothstep_float(val.x, low.x, high.x, f); result.x = f; - mx_smoothstep_float(val.y, low.y, high.y, f); result.y = f; - mx_smoothstep_float(val.z, low.z, high.z, f); result.z = f; - mx_smoothstep_float(val.w, low.w, high.w, f); result.w = f; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec4FA.metal b/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec4FA.metal deleted file mode 100644 index a7c27cb0..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/mx_smoothstep_vec4FA.metal +++ /dev/null @@ -1,10 +0,0 @@ -#include "mx_smoothstep_float.metal" - -void mx_smoothstep_vec4FA(vec4 val, float low, float high, out vec4 result) -{ - float f; - mx_smoothstep_float(val.x, low, high, f); result.x = f; - mx_smoothstep_float(val.y, low, high, f); result.y = f; - mx_smoothstep_float(val.z, low, high, f); result.z = f; - mx_smoothstep_float(val.w, low, high, f); result.w = f; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx b/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx index e8b61108..0e5b03be 100644 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx +++ b/pymaterialx/python/MaterialX/libraries/stdlib/genmsl/stdlib_genmsl_impl.mtlx @@ -42,7 +42,7 @@ - + @@ -188,6 +188,7 @@ + @@ -205,6 +206,7 @@ + @@ -330,25 +332,25 @@ - + - + - + - + @@ -590,51 +592,72 @@ + + + + + + + + + + + + + + + + + + + + + @@ -645,6 +668,8 @@ + + @@ -653,6 +678,8 @@ + + @@ -677,49 +704,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -735,6 +719,13 @@ + + + + + + + diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/include/mx_funcs.h b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/include/mx_funcs.h index 4db654c6..6d371575 100644 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/include/mx_funcs.h +++ b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/include/mx_funcs.h @@ -16,6 +16,7 @@ // float mx_ternary(int expr, float v1, float v2) { if (expr) return v1; else return v2; } +int mx_ternary(int expr, int v1, int v2) { if (expr) return v1; else return v2; } color mx_ternary(int expr, color v1, color v2) { if (expr) return v1; else return v2; } color4 mx_ternary(int expr, color4 v1, color4 v2) { if (expr) return v1; else return v2; } vector mx_ternary(int expr, vector v1, vector v2) { if (expr) return v1; else return v2; } @@ -99,6 +100,39 @@ matrix mx_subtract(matrix a, float b) } +float mx_extract(color in, int index) +{ + return in[index]; +} + +float mx_extract(color4 in, int index) +{ + if (index == 0) return in.rgb.r; + else if (index == 1) return in.rgb.g; + else if (index == 2) return in.rgb.b; + else return in.a; +} + +float mx_extract(vector2 in, int index) +{ + if (index == 0) return in.x; + else return in.y; +} + +float mx_extract(vector in, int index) +{ + return in[index]; +} + +float mx_extract(vector4 in, int index) +{ + if (index == 0) return in.x; + else if (index == 1) return in.y; + else if (index == 2) return in.z; + else return in.w; +} + + float mx_remap(float in, float inLow, float inHigh, float outLow, float outHigh, int doClamp) { float x = (in - inLow)/(inHigh-inLow); diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_color3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_color3.osl deleted file mode 100644 index bf174489..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_color3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_fractal3d_color3(vector amplitude, int octaves, float lacunarity, float diminish, vector position, output color result) -{ - color f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_color4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_color4.osl deleted file mode 100644 index 9943a92d..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_color4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_fractal3d_color4(vector4 amplitude, int octaves, float lacunarity, float diminish, vector position, output color4 result) -{ - color4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * color4(color(amplitude.x, amplitude.y, amplitude.z), amplitude.w); -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_color3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_color3.osl deleted file mode 100644 index 889848c6..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_color3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_fractal3d_fa_color3(float amplitude, int octaves, float lacunarity, float diminish, vector position, output color result) -{ - color f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_color4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_color4.osl deleted file mode 100644 index d2a8f492..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_color4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_fractal3d_fa_color4(float amplitude, int octaves, float lacunarity, float diminish, vector position, output color4 result) -{ - color4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector2.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector2.osl deleted file mode 100644 index c1266d47..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector2.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_fractal3d_fa_vector2(float amplitude, int octaves, float lacunarity, float diminish, vector position, output vector2 result) -{ - vector2 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector3.osl deleted file mode 100644 index 34f6515c..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_fractal3d_fa_vector3(float amplitude, int octaves, float lacunarity, float diminish, vector position, output vector result) -{ - vector f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector4.osl deleted file mode 100644 index fb5a8c73..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_fractal3d_fa_vector4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_fractal3d_fa_vector4(float amplitude, int octaves, float lacunarity, float diminish, vector position, output vector4 result) -{ - vector4 f = mx_fbm(position, octaves, lacunarity, diminish, "snoise"); - result = f * amplitude; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_color3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_color3.osl deleted file mode 100644 index 37421ee8..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_color3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise2d_color3(vector amplitude, float pivot, vector2 texcoord, output color result) -{ - color value = noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_color4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_color4.osl deleted file mode 100644 index ec8064c5..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_color4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise2d_color4(vector4 amplitude, float pivot, vector2 texcoord, output color4 result) -{ - color4 value = mx_noise("snoise", texcoord.x, texcoord.y); - result = value * color4(color(amplitude.x, amplitude.y, amplitude.z), amplitude.w) + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_color3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_color3.osl deleted file mode 100644 index 29c09c1a..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_color3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise2d_fa_color3(float amplitude, float pivot, vector2 texcoord, output color result) -{ - color value = noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_color4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_color4.osl deleted file mode 100644 index 35d3463f..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_color4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise2d_fa_color4(float amplitude, float pivot, vector2 texcoord, output color4 result) -{ - color4 value = mx_noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector2.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector2.osl deleted file mode 100644 index b64dc6de..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector2.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise2d_fa_vector2(float amplitude, float pivot, vector2 texcoord, output vector2 result) -{ - vector2 value = mx_noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector3.osl deleted file mode 100644 index c1f060a2..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise2d_fa_vector3(float amplitude, float pivot, vector2 texcoord, output vector result) -{ - vector value = noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector4.osl deleted file mode 100644 index 9cb9f57c..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise2d_fa_vector4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise2d_fa_vector4(float amplitude, float pivot, vector2 texcoord, output vector4 result) -{ - vector4 value = mx_noise("snoise", texcoord.x, texcoord.y); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_color3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_color3.osl deleted file mode 100644 index f4649a59..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_color3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise3d_color3(vector amplitude, float pivot, vector position, output color result) -{ - color value = noise("snoise", position); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_color4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_color4.osl deleted file mode 100644 index c522f814..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_color4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise3d_color4(vector4 amplitude, float pivot, vector position, output color4 result) -{ - color4 value = mx_noise("snoise", position); - result = value * color4(color(amplitude.x, amplitude.y, amplitude.z), amplitude.w) + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_color3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_color3.osl deleted file mode 100644 index 83b777b2..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_color3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise3d_fa_color3(float amplitude, float pivot, vector position, output color result) -{ - color value = noise("snoise", position); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_color4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_color4.osl deleted file mode 100644 index ee1a48ea..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_color4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise3d_fa_color4(float amplitude, float pivot, vector position, output color4 result) -{ - color4 value = mx_noise("snoise", position); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector2.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector2.osl deleted file mode 100644 index 9317d893..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector2.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise3d_fa_vector2(float amplitude, float pivot, vector position, output vector2 result) -{ - vector2 value = mx_noise("snoise", position); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector3.osl deleted file mode 100644 index 4e235feb..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector3.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise3d_fa_vector3(float amplitude, float pivot, vector position, output vector result) -{ - vector value = noise("snoise", position); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector4.osl deleted file mode 100644 index 177fc3f2..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_noise3d_fa_vector4.osl +++ /dev/null @@ -1,5 +0,0 @@ -void mx_noise3d_fa_vector4(float amplitude, float pivot, vector position, output vector4 result) -{ - vector4 value = mx_noise("snoise", position); - result = value * amplitude + pivot; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_overlay_color3.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_overlay_color3.osl deleted file mode 100644 index 387653fe..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_overlay_color3.osl +++ /dev/null @@ -1,16 +0,0 @@ -float overlay(float fg, float bg) -{ - return (fg < 0.5) ? (2 * fg * bg) : (1 - (1 - fg) * (1 - bg)); -} - -color overlay(color fg, color bg) -{ - return color(overlay(fg[0], bg[0]), - overlay(fg[1], bg[1]), - overlay(fg[2], bg[2])); -} - -void mx_overlay_color3(color fg, color bg, float mix, output color out) -{ - out = mix * overlay(fg, bg) + (1-mix) * bg; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_overlay_color4.osl b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_overlay_color4.osl deleted file mode 100644 index 1ae6a72c..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/mx_overlay_color4.osl +++ /dev/null @@ -1,22 +0,0 @@ -float overlay(float fg, float bg) -{ - return (fg < 0.5) ? (2 * fg * bg) : (1 - (1 - fg) * (1 - bg)); -} - -color overlay(color fg, color bg) -{ - return color(overlay(fg[0], bg[0]), - overlay(fg[1], bg[1]), - overlay(fg[2], bg[2])); -} - -color4 overlay(color4 fg, color4 bg) -{ - return color4(overlay(fg.rgb, bg.rgb), - overlay(fg.a, bg.a)); -} - -void mx_overlay_color4(color4 fg, color4 bg, float mix, output color4 out) -{ - out = mix * overlay(fg, bg) + (1-mix) * bg; -} diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx index c916eb30..3c6e73c9 100644 --- a/pymaterialx/python/MaterialX/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx +++ b/pymaterialx/python/MaterialX/libraries/stdlib/genosl/stdlib_genosl_impl.mtlx @@ -44,7 +44,7 @@ - + @@ -190,6 +190,7 @@ + @@ -207,6 +208,7 @@ + @@ -332,25 +334,25 @@ - + - + - + - + @@ -591,51 +593,72 @@ + + + + + + + + + + + + + + + + + + + + + @@ -645,6 +668,8 @@ + + @@ -652,6 +677,8 @@ + + @@ -676,49 +703,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -738,6 +722,13 @@ + + + + + + + diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_defs.mtlx b/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_defs.mtlx index 7433b0a2..df48c841 100644 --- a/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_defs.mtlx +++ b/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_defs.mtlx @@ -1396,13 +1396,18 @@ + + + + + @@ -1476,13 +1481,18 @@ + + + + + @@ -2093,8 +2103,8 @@ - - + + @@ -2118,8 +2128,8 @@ - - + + @@ -2143,8 +2153,8 @@ - - + + @@ -2168,8 +2178,8 @@ - - + + @@ -2591,7 +2601,7 @@ Node: Transform a normal vector from object or tangent space into "world" space. --> - + @@ -2687,92 +2697,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4231,194 +4418,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_ng.mtlx b/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_ng.mtlx index 046d704b..fcb1a4aa 100644 --- a/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_ng.mtlx +++ b/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_ng.mtlx @@ -3977,10 +3977,10 @@ - + - + @@ -4006,10 +4006,10 @@ - + - + @@ -4147,213 +4147,98 @@ - - - - - - - - - - - - - - - - - - + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - + - - - + + + - - - - - - - - - - - - - - - - - - - - - + + + + - + - - - + + + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - - - + + + - - - + + + - - - + + + - - - - - - + + + + + + diff --git a/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_ng.mtlx.orig b/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_ng.mtlx.orig deleted file mode 100644 index bff41433..00000000 --- a/pymaterialx/python/MaterialX/libraries/stdlib/stdlib_ng.mtlx.orig +++ /dev/null @@ -1,4096 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pymaterialx/python/MaterialX/main.pyc b/pymaterialx/python/MaterialX/main.pyc deleted file mode 100644 index f08e5b4d..00000000 Binary files a/pymaterialx/python/MaterialX/main.pyc and /dev/null differ diff --git a/pymaterialx/python/Scripts/creatematerial.py b/pymaterialx/python/Scripts/creatematerial.py new file mode 100644 index 00000000..f47afd80 --- /dev/null +++ b/pymaterialx/python/Scripts/creatematerial.py @@ -0,0 +1,268 @@ +#!/usr/bin/env python +''' +Construct a MaterialX file from the textures in the given folder, using the standard data libraries +to build a mapping from texture filenames to shader inputs. + +By default the standard_surface shading model is assumed, with the --shadingModel option used to +select any other shading model in the data libraries. +''' + +import os +import re +import argparse +from difflib import SequenceMatcher + +import MaterialX as mx + +UDIM_TOKEN = '..' +UDIM_REGEX = r'\.\d+\.' +TEXTURE_EXTENSIONS = [ "exr", "png", "jpg", "jpeg", "tif", "hdr" ] +INPUT_ALIASES = { "roughness": "specular_roughness" } + +class UdimFilePath(mx.FilePath): + + def __init__(self, pathString): + super().__init__(pathString) + + self._isUdim = False + self._udimFiles = [] + self._udimRegex = re.compile(UDIM_REGEX) + + textureDir = self.getParentPath() + textureName = self.getBaseName() + textureExtension = self.getExtension() + + if not self._udimRegex.search(textureName): + self._udimFiles = [self] + return + + self._isUdim = True + fullNamePattern = self._udimRegex.sub(self._udimRegex.pattern.replace('\\', '\\\\'), + textureName) + + udimFiles = filter( + lambda f: re.search(fullNamePattern, f.asString()), + textureDir.getFilesInDirectory(textureExtension) + ) + self._udimFiles = [textureDir / f for f in udimFiles] + + def __str__(self): + return self.asPattern() + + def asPattern(self): + if not self._isUdim: + return self.asString() + + textureDir = self.getParentPath() + textureName = self.getBaseName() + + pattern = textureDir / mx.FilePath( + self._udimRegex.sub(UDIM_TOKEN, textureName)) + return pattern.asString() + + def isUdim(self): + return self._isUdim + + def getUdimFiles(self): + return self._udimFiles + + def getUdimNumbers(self): + def _extractUdimNumber(_file): + pattern = self._udimRegex.search(_file.getBaseName()) + if pattern: + return re.search(r"\d+", pattern.group()).group() + + return list(map(_extractUdimNumber, self._udimFiles)) + + def getNameWithoutExtension(self): + if self._isUdim: + name = self._udimRegex.split(self.getBaseName())[0] + else: + name = self.getBaseName().rsplit('.', 1)[0] + + return re.sub(r'[^\w\s]+', '_', name) + +def listTextures(textureDir, texturePrefix=None): + ''' + Return a list of texture filenames matching known extensions. + ''' + + texturePrefix = texturePrefix or "" + allTextures = [] + for ext in TEXTURE_EXTENSIONS: + textures = [textureDir / f for f in textureDir.getFilesInDirectory(ext) + if f.asString().lower().startswith(texturePrefix.lower())] + while textures: + textureFile = UdimFilePath(textures[0].asString()) + allTextures.append(textureFile) + for udimFile in textureFile.getUdimFiles(): + textures.remove(udimFile) + return allTextures + +def findBestMatch(textureName, shadingModel): + ''' + Given a texture name and shading model, return the shader input that is the closest match. + ''' + + parts = textureName.rsplit("_") + + baseTexName = parts[-1] + if baseTexName.lower() == 'color': + baseTexName = ''.join(parts[-2:]) + if baseTexName in INPUT_ALIASES: + baseTexName = INPUT_ALIASES.get(baseTexName.lower()) + + shaderInputs = shadingModel.getActiveInputs() + ratios = [] + for shaderInput in shaderInputs: + inputName = shaderInput.getName() + inputName = re.sub(r'[^a-zA-Z0-9\s]', '', inputName).lower() + baseTexName = re.sub(r'[^a-zA-Z0-9\s]', '', baseTexName).lower() + + sequenceScore = SequenceMatcher(None, inputName, baseTexName).ratio() + ratios.append(sequenceScore * 100) + + highscore = max(ratios) + if highscore < 50: + return None + + idx = ratios.index(highscore) + return shaderInputs[idx] + +def buildDocument(textureFiles, mtlxFile, shadingModel, colorspace, useTiledImage): + ''' + Build a MaterialX document from the given textures and shading model. + ''' + + # Find the default library nodedef, if any, for the requested shading model. + stdlib = mx.createDocument() + mx.loadLibraries(mx.getDefaultDataLibraryFolders(), mx.getDefaultDataSearchPath(), stdlib) + matchingNodeDefs = stdlib.getMatchingNodeDefs(shadingModel) + if not matchingNodeDefs: + print('Shading model', shadingModel, 'not found in the MaterialX data libraries') + return None + shadingModelNodeDef = matchingNodeDefs[0] + for nodeDef in matchingNodeDefs: + if nodeDef.getAttribute('isdefaultversion') == 'true': + shadingModelNodeDef = nodeDef + + # Create content document. + doc = mx.createDocument() + materialName = mx.createValidName(mtlxFile.getBaseName().rsplit('.', 1)[0]) + nodeGraph = doc.addNodeGraph('NG_' + materialName) + shaderNode = doc.addNode(shadingModel, 'SR_' + materialName, 'surfaceshader') + doc.addMaterialNode('M_' + materialName, shaderNode) + + # Iterate over texture files. + imageNodeCategory = 'tiledimage' if useTiledImage else 'image' + udimNumbers = set() + for textureFile in textureFiles: + textureName = textureFile.getNameWithoutExtension() + shaderInput = findBestMatch(textureName, shadingModelNodeDef) + + if not shaderInput: + print('Skipping', textureFile.getBaseName(), 'which does not match any', shadingModel, 'input') + continue + + inputName = shaderInput.getName() + inputType = shaderInput.getType() + + # Skip inputs that have already been created, e.g. in multi-UDIM materials. + if shaderNode.getInput(inputName) or nodeGraph.getChild(textureName): + continue + + mtlInput = shaderNode.addInput(inputName) + textureName = nodeGraph.createValidChildName(textureName) + imageNode = nodeGraph.addNode(imageNodeCategory, textureName, inputType) + + # Set color space. + if shaderInput.isColorType(): + imageNode.setColorSpace(colorspace) + + # Set file path. + filePathString = os.path.relpath(textureFile.asPattern(), mtlxFile.getParentPath().asString()) + imageNode.setInputValue('file', filePathString, 'filename') + + # Apply special cases for normal maps. + inputNode = imageNode + connNode = imageNode + inBetweenNodes = [] + if inputName.endswith('normal') and shadingModel == 'standard_surface': + inBetweenNodes = ["normalmap"] + for inNodeName in inBetweenNodes: + connNode = nodeGraph.addNode(inNodeName, textureName + '_' + inNodeName, inputType) + connNode.setConnectedNode('in', inputNode) + inputNode = connNode + + # Create output. + outputNode = nodeGraph.addOutput(textureName + '_output', inputType) + outputNode.setConnectedNode(connNode) + mtlInput.setConnectedOutput(outputNode) + mtlInput.setType(inputType) + + if textureFile.isUdim(): + udimNumbers.update(set(textureFile.getUdimNumbers())) + + # Create udim set + if udimNumbers: + geomInfoName = doc.createValidChildName('GI_' + materialName) + geomInfo = doc.addGeomInfo(geomInfoName) + geomInfo.setGeomPropValue('udimset', list(udimNumbers), "stringarray") + + # Return the new document + return doc + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--outputFilename', dest='outputFilename', type=str, help='Filename of the output MaterialX document.') + parser.add_argument('--shadingModel', dest='shadingModel', type=str, default="standard_surface", help='The shading model used in analyzing input textures.') + parser.add_argument('--colorSpace', dest='colorSpace', type=str, help='The colorspace in which input textures should be interpreted, defaulting to srgb_texture.') + parser.add_argument('--texturePrefix', dest='texturePrefix', type=str, help='Filter input textures by the given prefix.') + parser.add_argument('--tiledImage', dest='tiledImage', action="store_true", help='Request tiledimage nodes instead of image nodes.') + parser.add_argument(dest='inputDirectory', nargs='?', help='Input folder that will be scanned for textures, defaulting to the current working directory.') + + options = parser.parse_args() + + texturePath = mx.FilePath.getCurrentPath() + if options.inputDirectory: + texturePath = mx.FilePath(options.inputDirectory) + if not texturePath.isDirectory(): + print('Input folder not found:', texturePath) + return + + mtlxFile = texturePath / mx.FilePath('material.mtlx') + if options.outputFilename: + mtlxFile = mx.FilePath(options.outputFilename) + + textureFiles = listTextures(texturePath, texturePrefix=options.texturePrefix) + if not textureFiles: + print('No matching textures found in input folder.') + return + + # Get shading model and color space. + shadingModel = 'standard_surface' + colorspace = 'srgb_texture' + if options.shadingModel: + shadingModel = options.shadingModel + if options.colorSpace: + colorspace = options.colorSpace + print('Analyzing textures in the', texturePath.asString(), 'folder for the', shadingModel, 'shading model.') + + # Create the MaterialX document. + doc = buildDocument(textureFiles, mtlxFile, shadingModel, colorspace, options.tiledImage) + if not doc: + return + + if options.outputFilename: + # Write the document to disk. + if not mtlxFile.getParentPath().exists(): + mtlxFile.getParentPath().createDirectory() + mx.writeToXmlFile(doc, mtlxFile.asString()) + print('Wrote MaterialX document to disk:', mtlxFile.asString()) + else: + # Print the document to the standard output. + print('Generated MaterialX document:') + print(mx.writeToXmlString(doc)) + +if __name__ == '__main__': + main() diff --git a/pymaterialx/python/Scripts/generatereference.py b/pymaterialx/python/Scripts/generatereference.py deleted file mode 100644 index 593cfeb2..00000000 --- a/pymaterialx/python/Scripts/generatereference.py +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/env python -''' -Create documents with each definition as a separate material -''' - -import sys, os, argparse -import MaterialX as mx - - -# Find all MaterialX files -def getFiles(rootPath): - filelist = [] - for subdir, dirs, files in os.walk(rootPath): - for file in files: - if file.endswith('mtlx'): - filelist.append(os.path.join(subdir, file)) - return filelist - -# Print the document for node definitions in a file -def createMaterials(doc, opts): - - ignoreNodeList = [ "surfacematerial", "volumematerial", "constant", "arrayappend", "dot_filename" ] - ignoreTypeList = [ "volumeshader", "lightshader" ] - - nodedefs = doc.getNodeDefs() - nodedefCount = str(len(nodedefs)) - if nodedefCount == 0: - print('No definitions to create materials for') - else: - print('Create materials for %s definitions' % nodedefCount) - - for nodedef in nodedefs: - - outdoc = mx.createDocument() - - # Create node - nodeName = nodedef.getName() - functionName = nodeName.removeprefix('ND_') - functionName = outdoc.createValidChildName(functionName) - - node = outdoc.addNodeInstance(nodedef, functionName) - node.removeAttribute('nodedef') - - for input in nodedef.getActiveInputs(): - inputName = input.getName() - inputType = input.getType() - valueElem = node.getInput(inputName) - if (not valueElem): - newElem = node.addInput(inputName, inputType) - newElem.copyContentFrom(input) - newElem.removeAttribute('doc') - # if newElem and input.hasValueString(): - # newElem.setValueString(input.getValueString()) - - # Add outputs if none on node - for output in nodedef.getActiveOutputs(): - outputName = output.getName() - outputType = output.getType() - outputElem = node.getOutput(outputName) - if (not outputElem): - outputElem = node.addOutput(outputName, outputType) - - shaderNodeName = outdoc.createValidChildName('shader_' + node.getName() + '_' + outputName) - materialNodeName = outdoc.createValidChildName('material_' + node.getName() + '_' + outputName) - - isMultiOutput = nodedef.getType() == 'multioutput' - - if outputType == 'EDF': - shaderNode = outdoc.addNode("surface", shaderNodeName, "surfaceshader") - edfInput = shaderNode.addInput('edf', 'EDF') - edfInput.setNodeName(node.getName()) - if isMultiOutput: - edfInput.setAttribute('output', outputName) - materialNode = outdoc.addMaterialNode(materialNodeName, shaderNode) - elif outputType == 'BSDF': - shaderNode = outdoc.addNode("surface", shaderNodeName, "surfaceshader") - edfInput = shaderNode.addInput('bsdf', 'BSDF') - edfInput.setNodeName(node.getName()) - if isMultiOutput: - edfInput.setAttribute('output', outputName) - materialNode = outdoc.addMaterialNode(materialNodeName, shaderNode) - elif outputType == 'surfaceshader': - materialNode = outdoc.addMaterialNode(materialNodeName, node) - elif outputType == 'volumeshader': - materialNode = outdoc.addMaterialNode(materialNodeName, node) - #elif outputType == 'displacementshader': - elif outputType in { 'float', 'vector2', 'vector3', 'color3', 'color4' }: - if outputType == 'float': - shaderNode = outdoc.addNode("surface_unlit", shaderNodeName, "surfaceshader") - newInput = shaderNode.addInput('emission', 'float') - newInput.setNodeName(node.getName()) - if isMultiOutput: - newInput.setAttribute('output', outputName) - else: - - # Input to convert is upstream node - convertNodeName = node.getName() - if outputType != 'color3': - - needExtraConvert = False - - # Add conversion node in between as there is no vec2 -> color3 node type - # Would be nice to have this added to avoid this extra step. - if outputType in { 'vector2'}: - convertName = 'convert_' + outputType + '_vector3' - convertNodeName = outdoc.createValidChildName(convertName) - convertNode = outdoc.addNodeInstance(doc.getNodeDef('ND_' + convertNodeName), convertNodeName) - newInput = convertNode.addInput('in', outputType) - newInput.setNodeName(node.getName()) - if isMultiOutput: - newInput.setAttribute('output', outputName) - needExtraConvert = True - # Set output type to vector3 for next convert - outputType = 'vector3' - - convertName = 'convert_' + outputType + '_color3' - convert2NodeName = outdoc.createValidChildName(convertName) - convertNode = outdoc.addNodeInstance(doc.getNodeDef('ND_' + convert2NodeName), convert2NodeName) - newInput = convertNode.addInput('in', outputType) - newInput.setNodeName(convertNodeName) - if isMultiOutput and not needExtraConvert: - newInput.setAttribute('output', outputName) - convertNodeName = convert2NodeName - - shaderNode = outdoc.addNode("surface_unlit", shaderNodeName, "surfaceshader") - newInput = shaderNode.addInput('emission_color', 'color3') - newInput.setNodeName(convertNodeName) - if isMultiOutput: - newInput.setAttribute('output', outputName) - materialNode = outdoc.addMaterialNode(materialNodeName, shaderNode) - - filename = opts.outputPath + '/' + functionName + ".mtlx" - print("Write defintion file: %s" % filename) - mx.writeToXmlFile(outdoc, filename) - -# Read in a single document or documents in a folder -# Return false if any document cannot be read -def readDocuments(rootPath, doc): - - readDoc = True - - if os.path.isdir(rootPath): - filelist = getFiles(rootPath) - for inputFilename in filelist: - try: - mx.readFromXmlFile(doc, inputFilename) - except mx.ExceptionFileMissing as err: - print(err) - else: - try: - mx.readFromXmlFile(doc, rootPath) - except mx.ExceptionFileMissing as err: - print(err) - readDoc = False - - return readDoc - -def main(): - parser = argparse.ArgumentParser(description="Print documentation for each nodedef in the given document.") - parser.add_argument(dest="libraryPath", help="Path of the input MaterialX document or folder definitions.") - parser.add_argument('--outputPath', dest='outputPath', help='File path to output materials.') - - opts = parser.parse_args() - - # Read library - rootPath = opts.libraryPath; - doc = mx.createDocument() - readDocuments(rootPath, doc) - - # Create output directory - if opts.outputPath: - if not os.path.exists(opts.outputPath): - os.makedirs(opts.outputPath) - - # Create material files - createMaterials(doc, opts) - -if __name__ == '__main__': - main() diff --git a/pymaterialx/python/Scripts/generatereference_shaders.py b/pymaterialx/python/Scripts/generatereference_shaders.py deleted file mode 100644 index ab07cbd7..00000000 --- a/pymaterialx/python/Scripts/generatereference_shaders.py +++ /dev/null @@ -1,229 +0,0 @@ -#!/usr/bin/env python -''' -Utility to generate the shader for materials found in a MaterialX document. One file will be generated -for each material / shader found. The currently supported target languages are GLSL, OSL, MDL and ESSL. -''' - -import sys, os, argparse, subprocess -import MaterialX as mx -import MaterialX.PyMaterialXGenShader as mx_gen_shader -import MaterialX.PyMaterialXGenGlsl as mx_gen_glsl -import MaterialX.PyMaterialXGenOsl as mx_gen_osl -import MaterialX.PyMaterialXGenMdl as mx_gen_mdl - -def validateCode(sourceCodeFile, codevalidator, codevalidatorArgs): - if codevalidator: - cmd = codevalidator + ' ' + sourceCodeFile - if codevalidatorArgs: - cmd += ' ' + codevalidatorArgs - print('----- Run: '+ cmd) - try: - output = subprocess.check_output(cmd, stderr=subprocess.STDOUT) - result = output.decode(encoding='utf-8') - except subprocess.CalledProcessError as out: - return (out.output.decode(encoding='utf-8')) - return "" - -def main(): - parser = argparse.ArgumentParser(description='Generate reference code for definition in a library.') - parser.add_argument('--path', dest='paths', action='append', nargs='+', help='An additional absolute search path location (e.g. "/projects/MaterialX")') - parser.add_argument('--library', dest='libraries', action='append', nargs='+', help='An additional relative path to a custom data library folder (e.g. "libraries/custom")') - parser.add_argument('--target', dest='target', default='glsl', help='Target shader generator to use (e.g. "glsl, osl, mdl, essl, vulkan"). Default is glsl.') - parser.add_argument('--outputPath', dest='outputPath', help='File path to output shaders to. If not specified, is the location of the input document is used.') - parser.add_argument('--validator', dest='validator', nargs='?', const=' ', type=str, help='Name of executable to perform source code validation.') - parser.add_argument('--validatorArgs', dest='validatorArgs', type=str, help='Optional arguments for code validator.') - parser.add_argument('--vulkanGlsl', dest='vulkanCompliantGlsl', default=False, type=bool, help='Set to True to generate Vulkan-compliant GLSL when using the genglsl target.') - parser.add_argument('--setupCMS', dest='setupCMS', default=False, type=bool, help='Set up color management.') - parser.add_argument('--setupUnits', dest='setupUnits', default=False, type=bool, help='Set up unit system.') - opts = parser.parse_args() - - print('*************', opts.validatorArgs) - doc = mx.createDocument() - #try: - # mx.readFromXmlFile(doc, opts.inputFilename) - #except mx.ExceptionFileMissing as err: - # print('Generation failed: "', err, '"') - # sys.exit(-1) - - stdlib = mx.createDocument() - searchPath = mx.FileSearchPath(os.getcwd()) - libraryFolders = [] - if opts.paths: - for pathList in opts.paths: - for path in pathList: - searchPath.append(path) - if opts.libraries: - for libraryList in opts.libraries: - for library in libraryList: - libraryFolders.append(library) - libraryFolders.append("libraries/stdlib") - libraryFolders.append("libraries/pbrlib") - libraryFolders.append("libraries/bxdf") - libraryFolders.append("libraries/targets") - - try: - mx.loadLibraries(libraryFolders, searchPath, stdlib) - doc.importLibrary(stdlib) - except mx.Error: - print('Generation failed: "', mx.Error, '"') - sys.exit(-1) - - valid, msg = doc.validate() - if not valid: - print('Validation warnings for input document:') - print(msg) - sys.exit(-1) - - gentarget = 'glsl' - if opts.target: - gentarget = opts.target - if gentarget == 'osl': - shadergen = mx_gen_osl.OslShaderGenerator.create() - elif gentarget == 'mdl': - shadergen = mx_gen_mdl.MdlShaderGenerator.create() - elif gentarget == 'essl': - shadergen = mx_gen_glsl.EsslShaderGenerator.create() - elif gentarget == 'vulkan': - shadergen = mx_gen_glsl.VkShaderGenerator.create() - else: - shadergen = mx_gen_glsl.GlslShaderGenerator.create() - - context = mx_gen_shader.GenContext(shadergen) - context.registerSourceCodeSearchPath(searchPath) - - # If we're generating Vulkan-compliant GLSL then set the binding context - if opts.vulkanCompliantGlsl: - bindingContext = mx_gen_glsl.GlslResourceBindingContext.create(0,0) - context.pushUserData('udbinding', bindingContext) - - genoptions = context.getOptions() - genoptions.shaderInterfaceType = mx_gen_shader.ShaderInterfaceType.SHADER_INTERFACE_COMPLETE - #genoptions.addUpstreamDependencies = False - genoptions.fileTextureVerticalFlip = True - - if opts.setupCMS: - print('- Set up CMS ...') - cms = mx_gen_shader.DefaultColorManagementSystem.create(shadergen.getTarget()) - cms.loadLibrary(doc) - shadergen.setColorManagementSystem(cms) - - if opts.setupUnits: - print('- Set up Units ...') - unitsystem = mx_gen_shader.UnitSystem.create(shadergen.getTarget()) - registry = mx.UnitConverterRegistry.create() - distanceTypeDef = doc.getUnitTypeDef('distance') - registry.addUnitConverter(distanceTypeDef, mx.LinearUnitConverter.create(distanceTypeDef)) - angleTypeDef = doc.getUnitTypeDef('angle') - registry.addUnitConverter(angleTypeDef, mx.LinearUnitConverter.create(angleTypeDef)) - unitsystem.loadLibrary(stdlib) - unitsystem.setUnitConverterRegistry(registry) - shadergen.setUnitSystem(unitsystem) - genoptions.targetDistanceUnit = 'meter' - - pathPrefix = '' - currenPath = os.getcwd() - if opts.outputPath: - if not os.path.exists(opts.outputPath): - os.makedirs(opts.outputPath) - os.chdir(opts.outputPath) - #pathPrefix = opts.outputPath + os.path.sep - print('- Shader output path: ' + pathPrefix) - - ignoreNodeList = [ 'arrayappend', 'curveadjust', "disney_brdf_2012", "disney_bsdf_2015", - "surfacematerial", "volumematerial", "constant_filename", "dot_filename", - "convert_BSDF_material", "convert_EDF_material"] - #[ "surfacematerial", "volumematerial", "constant", , "dot_filename", - - ignoreTypeList = ["lightshader", "surfaceshader", "volumeshader", "lightshader" ] - missingImplementations = [] - - failedShaders = "" - failedValidationShaders = "" - nodedefs = doc.getNodeDefs() - nodedefCount = str(len(nodedefs)) - print('Nodedef count: ' + nodedefCount) - count = 1 - for nodedef in nodedefs: - - nodeName = nodedef.getName() - - if nodedef.getNodeString() in ignoreNodeList or nodedef.getType() in ignoreTypeList: - print('--- Skip nodedef: ' + nodeName) - continue - - #if nodedef.getNodeString() in ignoreNodeList: - # print('--- Skip nodedef: ' + nodeName) - # continue - - # Strip out the ND_ if it's there - functionName = nodeName.removeprefix('ND_') - functionName = doc.createValidChildName(functionName) - print('-- %s / %s: Generate code for nodedef: ' % (str(count),nodedefCount) + nodeName, ': ', functionName + '()') - count = count + 1 - - nodeinterface = nodedef.getImplementation() - if not nodeinterface: - missingImplementations.append(nodeName) - continue - - node = doc.addNodeInstance(nodedef, functionName) - if not node: - failedShaders += (nodeName + ' ') - continue - - try: - shader = shadergen.generate(functionName, node, context) - except: - failedShaders += (nodeName + ' ') - continue; - - if shader: - # Use extension of .vert and .frag as it's type is - # recognized by glslangValidator - if gentarget in ['glsl', 'essl', 'vulkan']: - pixelSource = shader.getSourceCode(mx_gen_shader.PIXEL_STAGE) - filename = pathPrefix + shader.getName() + "." + gentarget + ".frag" - file = open(filename, 'w+') - file.write(pixelSource) - file.close() - errors = validateCode(filename, opts.validator, opts.validatorArgs) - - else: - pixelSource = shader.getSourceCode(mx_gen_shader.PIXEL_STAGE) - filename = pathPrefix + shader.getName() + "." + gentarget - file = open(filename, 'w+') - file.write(pixelSource) - file.close() - errors = validateCode(filename, opts.validator, opts.validatorArgs) - - if opts.validator: - if errors != "": - print("--- Validation failed for node: ", nodeName) - print("----------------------------") - print('--- Error log: ', errors) - print("----------------------------") - failedValidationShaders += (nodeName + ' ') - else: - print("--- Validation passed for node:", nodeName) - - else: - failedShaders += (nodeName + ' ') - - if len(missingImplementations) > 0: - print("- %d definitions with missing implementations:" % len(missingImplementations)) - print(missingImplementations) - if len(failedShaders) > 0: - print("- Failed shader generation:") - print(failedShaders) - if len(failedValidationShaders) > 0: - print("- Failed shader validation: ") - print(failedValidationShaders) - - if opts.outputPath: - os.chdir(currentPath) - - if failedShaders != "": - sys.exit(-1) - -if __name__ == '__main__': - main() diff --git a/pymaterialx/python/Scripts/genmdl.py b/pymaterialx/python/Scripts/genmdl.py index 24d8b518..2ac5afff 100644 --- a/pymaterialx/python/Scripts/genmdl.py +++ b/pymaterialx/python/Scripts/genmdl.py @@ -45,7 +45,7 @@ def _loadLibraries(doc, searchPath, libraryPath): def _writeHeader(file, version): file.write('mdl ' + version + ';\n') file.write('using core import *;\n') - IMPORT_LIST = { '::anno::*', '::base::*', '.::swizzle::*', '.::cm::*', '::math::*', '::state::*', '::tex::*', '::state::*', '.::vectormatrix::*', '.::hsv::*', '.::noise::*'} + IMPORT_LIST = { '::anno::*', '::base::*', '.::cm::*', '::math::*', '::state::*', '::tex::*', '::state::*', '.::vectormatrix::*', '.::hsv::*', '.::noise::*'} # To verify what are the minimal imports required for i in IMPORT_LIST: file.write('import' + i + ';\n') @@ -66,7 +66,7 @@ def _mapGeomProp(geomprop): outputValue = '' if len(geomprop): if geomprop.find('UV') >= 0: - outputValue = 'swizzle::xy(::state::texture_coordinate(0))' + outputValue = 'mx_swizzle_xy(::state::texture_coordinate(0))' elif geomprop.find('Pobject') >= 0: outputValue = '::state::transform_point(::state::coordinate_internal,::state::coordinate_object,::state::position())' elif geomprop.find('PWorld') >= 0: @@ -167,13 +167,13 @@ def _writeOperatorFunc(file, outputType, arg1, functionName, arg2): else: file.write(INDENT + 'return ' + arg1 + ' ' + functionName + ' ' + arg2 + ';\n') -def _writeTwoArgumentFunc(file, outputType, functionName): +def _writeTwoArgumentFunc(file, outputType, functionName, arg1="mxp_in1", arg2="mxp_in2"): if outputType == 'color4': - file.write(INDENT + 'return mk_color4(' + functionName + '(mk_float4(mxp_in1), mk_float4(mxp_in2)));\n') + file.write(INDENT + 'return mk_color4(' + functionName + '(mk_float4(' + arg1 + '), mk_float4(' + arg2 + ')));\n') elif outputType == 'color': - file.write(INDENT + 'return color(' + functionName + '(float3(mxp_in1), float3(mxp_in2)));\n') + file.write(INDENT + 'return color(' + functionName + '(float3(' + arg1 + '), float3(' + arg2 + ')));\n') else: - file.write(INDENT + 'return ' + functionName + '(mxp_in1, mxp_in2);\n') + file.write(INDENT + 'return ' + functionName + '(' + arg1 + ', ' + arg2 + ');\n') def _writeThreeArgumentFunc(file, outputType, functionName, arg1, arg2, arg3): if outputType == 'color4': @@ -666,7 +666,7 @@ def main(): _writeOneArgumentFunc(file, outputType, '::math::'+nodeCategory) wroteImplementation = True elif nodeCategory == 'atan2': - _writeTwoArgumentFunc(file, outputType, '::math::'+nodeCategory) + _writeTwoArgumentFunc(file, outputType, '::math::'+nodeCategory, arg1=mxp_iny, arg2=mxp_inx) wroteImplementation = True elif nodeCategory == 'sqrt': _writeOneArgumentFunc(file, outputType, '::math::'+nodeCategory) @@ -819,9 +819,6 @@ def main(): elif nodeCategory == 'mix': _writeThreeArgumentFunc(file, outputType, '::math::lerp', 'mxp_bg', 'mxp_fg', 'mxp_mix') wroteImplementation = True - elif nodeCategory == 'swizzle': - _writeOneArgumentFunc(file, outputType, 'swizzle::' + channelString) - wroteImplementation = True elif nodeCategory == 'combine2': _writeTwoArgumentCombine(file, outputType) wroteImplementation = True diff --git a/pymaterialx/python/Scripts/mxdoc.py b/pymaterialx/python/Scripts/mxdoc.py index d00de2df..7c9ba09a 100644 --- a/pymaterialx/python/Scripts/mxdoc.py +++ b/pymaterialx/python/Scripts/mxdoc.py @@ -1,9 +1,11 @@ #!/usr/bin/env python ''' -Print markdown documentation for each nodedef in the given document or documents in a folder +Print markdown documentation for each nodedef in the given document. ''' -import sys, os, argparse +import argparse +import sys + import MaterialX as mx HEADERS = ('Name', 'Type', 'Default Value', @@ -11,96 +13,30 @@ ATTR_NAMES = ('uiname', 'uimin', 'uimax', 'uisoftmin', 'uisoftmax', 'uistep', 'uifolder', 'uiadvanced', 'doc', 'uniform' ) -# Find all MaterialX files -def getFiles(rootPath): - filelist = [] - for subdir, dirs, files in os.walk(rootPath): - for file in files: - if file.endswith('mtlx'): - filelist.append(os.path.join(subdir, file)) - return filelist - -# Create a dictionary with node group as the primary key for a list of associated -# node types -def getNodeDictionary(doc): - nodegroups = { "" } - nodetypes = { "" } - nodegroupdict = {} - for nd in doc.getNodeDefs(): - nodestring = nd.getNodeString() - nodetypes.add( nodestring ) - nodegroup = nd.getNodeGroup() - if not nodegroup: - nodegroup = "no group" - nodegroups.add( nodegroup ) - if not nodegroup in nodegroupdict.keys(): - nodegroupdict[nodegroup] = { nodestring } - else: - nodegroupdict[nodegroup].add(nodestring) - - return nodegroupdict - -# Print out dictionary in Markdown format -def printNodeDictionary(nodegroupdict, opts): - for ng in nodegroupdict: - if opts.documentType == "html": - print('

                            Node Group: ' + ng + '

                            ') - elif opts.documentType == 'md': - print('### Node Group: ' + ng) - else: - print('/// @defgroup ' + ng + " Group: " + ng) - print('///@{') - - groupString = "" - if opts.documentType == "html": - for n in nodegroupdict[ng]: - groupString += '%s ' % (n, n) - print('
                              ') - print('
                            • ' + groupString) - print('
                            ') - elif opts.documentType == 'md': - for n in nodegroupdict[ng]: - groupString += '[' + n + '](#' + n + ') ' - print('* ' + groupString) - else: - for n in nodegroupdict[ng]: - print('/// @brief class ' + n + ' in ' + ng) - print('///@}') - - if opts.documentType == "html": - print('
                            ') - elif opts.documentType == 'md': - print('---------') - else: - print(' ') - -# Print the document for node definitions in a file -def printNodeDefs(doc, opts): - - currentNodeString = "" +def main(): + parser = argparse.ArgumentParser(description="Print documentation for each nodedef in the given document.") + parser.add_argument(dest="inputFilename", help="Filename of the input MaterialX document.") + parser.add_argument('--docType', dest='documentType', default='md', help='Document type. Default is "md" (Markdown). Specify "html" for HTML output') + parser.add_argument('--showInherited', default=False, action='store_true', help='Show inherited inputs. Default is False') + opts = parser.parse_args() - # Crete grapher. Note that we don't need additional subgraphs groupings as the - # implemention is a subgraph. - graphio = mx.MermaidGraphIo.create() - graphOptions = mx.GraphIoGenOptions() - graphOptions.setWriteSubgraphs(False) - graphOptions.setOrientation(mx.GraphOrientation.LEFT_RIGHT) - graphio.setGenOptions(graphOptions) + doc = mx.createDocument() + try: + mx.readFromXmlFile(doc, opts.inputFilename) + except mx.ExceptionFileMissing as err: + print(err) + sys.exit(0) for nd in doc.getNodeDefs(): - # HTML output - if opts.documentType == 'html': - nodeString = nd.getNodeString() - if currentNodeString != nodeString: - print('

                            ' % nodeString) - print('Node: %s' % nodeString) - print('

                            ') - currentNodeString = nodeString - print('
                            %s' % nd.getName()) - print('

                            ') + if opts.documentType == "html": + print('') print('

                              ') - print('
                            • NodeDef: %s' % nd.getName()) + print('
                            • Nodedef: %s' % nd.getName()) print('
                            • Type: %s' % nd.getType()) if len(nd.getNodeGroup()) > 0: print('
                            • Node Group: %s' % nd.getNodeGroup()) @@ -109,27 +45,7 @@ def printNodeDefs(doc, opts): if len(nd.getInheritString()) > 0: print('
                            • Inherits From: %s' % nd.getInheritString()) print('
                            • Doc: %s\n' % nd.getAttribute('doc')) - if opts.nodegraph: - mdoutput = '' - ng = nd.getImplementation() - if ng and ng.isA(mx.NodeGraph): - outputList = [] - for output in ng.getOutputs(): - outputList.append(output.getNamePath()) - mdoutput = graphio.write(ng, outputList) - print('
                            • Nodegraph: %s' % ng.getName()) - if mdoutput: - print('
                              ') - print(mdoutput) - print('\n') - print('
                              \n') - else: - print('None') - else: - print('
                            • Implementation: Non-graph') - print('
                            ') - print('') for h in HEADERS: print('') @@ -149,7 +65,7 @@ def printNodeDefs(doc, opts): infos.append(''+ port.getName() + '') infos.append(port.getType()) val = port.getValue() - if val and port.getType() == "float": + if port.getType() == "float": val = round(val, 6) infos.append(str(val)) for attrname in ATTR_NAMES: @@ -158,49 +74,18 @@ def printNodeDefs(doc, opts): print('') print('') print('
                            ' + h + '' + info + '
                            ') - print('

                            ') # Markdown output - elif opts.documentType == 'md': - nodeString = nd.getNodeString() - if currentNodeString != nodeString: - print('### Node: *%s*' % nodeString) - currentNodeString = nodeString - print('
                            %s' % nd.getName()) - print('

                            ') - print(' ') - print('* *Nodedef*: %s' % nd.getName()) - print('* *Type*: %s' % nd.getType()) + else: + print('- *Nodedef*: %s' % nd.getName()) + print('- *Type*: %s' % nd.getType()) if len(nd.getNodeGroup()) > 0: - print('* *Node Group*: %s' % nd.getNodeGroup()) + print('- *Node Group*: %s' % nd.getNodeGroup()) if len(nd.getVersionString()) > 0: - print('* *Version*: %s. Is default: %s' % (nd.getVersionString(), nd.getDefaultVersion())) + print('- *Version*: %s. Is default: %s' % (nd.getVersionString(), nd.getDefaultVersion())) if len(nd.getInheritString()) > 0: print('- *Inherits From*: %s' % nd.getInheritString()) - docstring = nd.getAttribute('doc') - if not docstring: - docstring = "UNDOCUMENTED" - print('* *Doc*: %s' % docstring) - if opts.nodegraph: - mdoutput = '' - ng = nd.getImplementation() - if ng and ng.isA(mx.NodeGraph): - outputList = [] - for output in ng.getOutputs(): - outputList.append(output.getNamePath()) - mdoutput = graphio.write(ng, outputList) - print('* *Nodegraph*: %s' % ng.getName()) - if mdoutput: - print('\n') - print('```mermaid') - print(mdoutput) - print('```') - else: - print('None') - else: - print('* *Implementation*: Non-graph') - - print(' \n') + print('- *Doc*: %s\n' % nd.getAttribute('doc')) print('| ' + ' | '.join(HEADERS) + ' |') print('|' + ' ---- |' * len(HEADERS) + '') inputList = nd.getActiveInputs() if opts.showInherited else nd.getInputs() @@ -217,82 +102,12 @@ def printNodeDefs(doc, opts): infos.append('**'+ port.getName() + '**') infos.append(port.getType()) val = port.getValue() - if val and port.getType() == "float": + if port.getType() == "float": val = round(val, 6) infos.append(str(val)) for attrname in ATTR_NAMES: infos.append(port.getAttribute(attrname)) print('| ' + " | ".join(infos) + ' |') - print('

                            ') - print(' ') - -# Read in a single document or documents in a folder -# Return false if any document cannot be read -def readDocuments(rootPath, doc): - - readDoc = True - - if os.path.isdir(rootPath): - filelist = getFiles(rootPath) - for inputFilename in filelist: - try: - mx.readFromXmlFile(doc, inputFilename) - except mx.ExceptionFileMissing as err: - print(err) - else: - try: - mx.readFromXmlFile(doc, rootPath) - except mx.ExceptionFileMissing as err: - print(err) - readDoc = False - - return readDoc - - -def printHeader(opts): - if opts.documentType == "html": - print('') - # Add in mermaid support - if opts.nodegraph: - print('') - print('') - print('') - print('') - -def printFooter(opts): - if opts.documentType == "html": - print('') - print('') - -def main(): - parser = argparse.ArgumentParser(description="Print documentation for each nodedef in the given document.") - parser.add_argument(dest="inputFilename", help="Path of the input MaterialX document or folder.") - parser.add_argument('--docType', dest='documentType', default='md', help='Document type. Default is "md" (Markdown). Specify "html" for HTML output') - parser.add_argument('--showInherited', default=False, action='store_true', help='Show inherited inputs. Default is False') - parser.add_argument('--nodegraph', default=False, action='store_true', help='Show nodegraph implementation if any. Default is False') - parser.add_argument('--printIndex', default=False, action='store_true', help="Print nodedef index. Default is False") - - opts = parser.parse_args() - - printHeader(opts) - - rootPath = opts.inputFilename; - doc = mx.createDocument() - readDocuments(rootPath, doc) - - nodedict = getNodeDictionary(doc) - printNodeDictionary(nodedict, opts) - - printNodeDefs(doc, opts) - - printFooter(opts) - if __name__ == '__main__': main() diff --git a/pymaterialx/python/Scripts/mxformat2.py b/pymaterialx/python/Scripts/mxformat2.py deleted file mode 100644 index 46d40343..00000000 --- a/pymaterialx/python/Scripts/mxformat2.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -''' -Format document contents by reading and writing files. -''' - -import os, argparse -import MaterialX as mx - -def getFiles(rootPath): - filelist = [] - for subdir, dirs, files in os.walk(rootPath): - for file in files: - if file.endswith('mtlx'): - filelist.append(os.path.join(subdir, file)) - return filelist - -def main(): - parser = argparse.ArgumentParser(description="Format document by reading the file and writing it back out.") - parser.add_argument(dest="inputFilename", help="Path of file or folder to format") - parser.add_argument('--checkForChanges', dest='checkForChanges', type=mx.stringToBoolean, default=True, help='Check if a file has changed. Default is True') - - opts = parser.parse_args() - - fileList = [] - rootPath = opts.inputFilename - if os.path.isdir(rootPath): - fileList = getFiles(rootPath) - else: - fileList.append(rootPath) - - # Preserve version, comments and newlines - readOptions = mx.XmlReadOptions() - readOptions.readComments = True - readOptions.readNewlines = True - readOptions.upgradeVersion = False - - writeOptions = mx.XmlWriteOptions() - - writeCount = 0 - for file in fileList: - doc = mx.createDocument() - mx.readFromXmlFile(doc, file, mx.FileSearchPath(), readOptions) - - writeFile = True - if opts.checkForChanges: - origString = mx.readFile(file) - docString = mx.writeToXmlString(doc) - if origString == docString: - writeFile = False - - if writeFile: - writeCount = writeCount + 1 - print('- Updated file %s.' % file) - mx.writeToXmlFile(doc, file, writeOptions) - - print('- Updated %d files.' % writeCount) - -if __name__ == '__main__': - main() \ No newline at end of file diff --git a/pymaterialx/python/Scripts/mxupdate.py b/pymaterialx/python/Scripts/mxupdate.py deleted file mode 100644 index 5d808ecc..00000000 --- a/pymaterialx/python/Scripts/mxupdate.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -''' -Update MaterialX files within the given folder to the latest version. -''' - -import sys, os, argparse -import MaterialX as mx - -def main(): - parser = argparse.ArgumentParser(description="Update MaterialX files within the given folder to the latest version.") - parser.add_argument("--yes", dest="yes", action="store_true", help="Proceed without asking for confirmation from the user.") - parser.add_argument(dest="inputFolder", help="An input folder to scan for MaterialX documents.") - opts = parser.parse_args() - - validDocs = dict() - for root, dirs, files in os.walk(opts.inputFolder): - for file in files: - if file.endswith('.mtlx'): - filename = os.path.join(root, file) - doc = mx.createDocument() - try: - readOptions = mx.XmlReadOptions() - readOptions.readComments = True - mx.readFromXmlFile(doc, filename, mx.FileSearchPath(), readOptions) - validDocs[filename] = doc - except mx.Exception: - pass - - if not validDocs: - print('No MaterialX documents were found in %s' % (opts.inputFolder)) - return - - print('Found %s MaterialX files in %s' % (len(validDocs), opts.inputFolder)) - - mxVersion = mx.getVersionIntegers() - - if not opts.yes: - question = 'Would you like to update all %i documents to MaterialX v%i.%i in place (y/n)?' % (len(validDocs), mxVersion[0], mxVersion[1]) - answer = input(question) - if answer != 'y' and answer != 'Y': - return - - for (filename, doc) in validDocs.items(): - mx.writeToXmlFile(doc, filename) - - print('Updated %i documents to MaterialX v%i.%i' % (len(validDocs), mxVersion[0], mxVersion[1])) - -if __name__ == '__main__': - main() diff --git a/pymaterialx/python/docs/html/____init_____8py.html b/pymaterialx/python/docs/html/____init_____8py.html deleted file mode 100644 index 38a455c6..00000000 --- a/pymaterialx/python/docs/html/____init_____8py.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - -My Project: MaterialX/__init__.py File Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            - -
                            -
                            __init__.py File Reference
                            -
                            -
                            - -

                            Go to the source code of this file.

                            - - - - -

                            -Namespaces

                             MaterialX
                             
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/____init_____8py.js b/pymaterialx/python/docs/html/____init_____8py.js deleted file mode 100644 index 674894d8..00000000 --- a/pymaterialx/python/docs/html/____init_____8py.js +++ /dev/null @@ -1,4 +0,0 @@ -var ____init_____8py = -[ - [ "__version__", "____init_____8py.html#a9b9f98a703b0cc5a41e3db10fec2321f", null ] -]; \ No newline at end of file diff --git a/pymaterialx/python/docs/html/____init_____8py_source.html b/pymaterialx/python/docs/html/____init_____8py_source.html deleted file mode 100644 index d28fb9e8..00000000 --- a/pymaterialx/python/docs/html/____init_____8py_source.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - -My Project: MaterialX/__init__.py Source File - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            __init__.py
                            -
                            -
                            -Go to the documentation of this file.
                            1 from .main import *
                            -
                            2 from .colorspace import *
                            -
                            3 
                            -
                            4 try:
                            -
                            5  from .legacy import *
                            -
                            6 except ImportError:
                            -
                            7  pass
                            -
                            8 
                            -
                            9 __version__ = getVersionString()
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/bc_s.png b/pymaterialx/python/docs/html/bc_s.png deleted file mode 100644 index 224b29aa..00000000 Binary files a/pymaterialx/python/docs/html/bc_s.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/bdwn.png b/pymaterialx/python/docs/html/bdwn.png deleted file mode 100644 index 940a0b95..00000000 Binary files a/pymaterialx/python/docs/html/bdwn.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/closed.png b/pymaterialx/python/docs/html/closed.png deleted file mode 100644 index 98cc2c90..00000000 Binary files a/pymaterialx/python/docs/html/closed.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/colorspace_8py.html b/pymaterialx/python/docs/html/colorspace_8py.html deleted file mode 100644 index 004f293d..00000000 --- a/pymaterialx/python/docs/html/colorspace_8py.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - -My Project: MaterialX/colorspace.py File Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            - -
                            -
                            colorspace.py File Reference
                            -
                            -
                            - -

                            Go to the source code of this file.

                            - - - - -

                            -Namespaces

                             MaterialX.colorspace
                             
                            - - - - - - - -

                            -Functions

                            def MaterialX.colorspace.getColorSpaces (cms='ocio', config=None)
                             
                            def MaterialX.colorspace.transformColor (color, sourceColorSpace, destColorSpace, cms='ocio', config=None)
                             
                            def MaterialX.colorspace.getDefaultOCIOConfig ()
                             
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/colorspace_8py.js b/pymaterialx/python/docs/html/colorspace_8py.js deleted file mode 100644 index a0159fc5..00000000 --- a/pymaterialx/python/docs/html/colorspace_8py.js +++ /dev/null @@ -1,9 +0,0 @@ -var colorspace_8py = -[ - [ "getColorSpaces", "colorspace_8py.html#a2f71fb38cdc8e19b41817ce0ebcdcfb5", null ], - [ "getDefaultOCIOConfig", "colorspace_8py.html#adede7502ee5324d77c722a3428e61f9c", null ], - [ "transformColor", "colorspace_8py.html#adcc451cff99e05ef4832c09b86e8f330", null ], - [ "_defaultConfig", "colorspace_8py.html#ae9885342a4f992637c914dc868bd42cb", null ], - [ "_defaultConfigFilename", "colorspace_8py.html#a2602696aadf292640f20a93e8d8dbbca", null ], - [ "_validateDefaultConfig", "colorspace_8py.html#a63e35f993dbd1d88fd8f2889c58c5bd5", null ] -]; \ No newline at end of file diff --git a/pymaterialx/python/docs/html/colorspace_8py_source.html b/pymaterialx/python/docs/html/colorspace_8py_source.html deleted file mode 100644 index 20c170dc..00000000 --- a/pymaterialx/python/docs/html/colorspace_8py_source.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - - - -My Project: MaterialX/colorspace.py Source File - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            colorspace.py
                            -
                            -
                            -Go to the documentation of this file.
                            1 #!/usr/bin/env python
                            -
                            2 '''
                            -
                            3 Native Python wrappers for PyMaterialX and PyOpenColorIO, providing helper
                            -
                            4 functions for transforming MaterialX colors between OpenColorIO color spaces.
                            -
                            5 
                            -
                            6 By default, the OpenColorIO configuration packaged with MaterialX Python will
                            -
                            7 be used, but clients may instead pass their own custom configurations to these
                            -
                            8 methods.
                            -
                            9 '''
                            -
                            10 
                            -
                            11 import os
                            -
                            12 
                            -
                            13 from .PyMaterialXCore import *
                            -
                            14 
                            -
                            15 
                            -
                            16 #--------------------------------------------------------------------------------
                            -
                            17 _defaultConfig = None
                            -
                            18 _defaultConfigFilename = 'config/config.ocio'
                            -
                            19 _validateDefaultConfig = False
                            -
                            20 
                            -
                            21 
                            -
                            22 #--------------------------------------------------------------------------------
                            -
                            23 def getColorSpaces(cms = 'ocio', config = None):
                            -
                            24  """Return a list containing the names of all supported color spaces.
                            -
                            25  By default, the OCIO color management system and default MaterialX
                            -
                            26  config are used."""
                            -
                            27 
                            -
                            28  if cms != 'ocio':
                            -
                            29  raise ValueError('Color management system is unrecognized: ' + cms)
                            -
                            30  if config is None:
                            -
                            31  config = getDefaultOCIOConfig()
                            -
                            32 
                            -
                            33  return [cs.getName() for cs in config.getColorSpaces()]
                            -
                            34 
                            -
                            35 def transformColor(color, sourceColorSpace, destColorSpace, cms = 'ocio', config = None):
                            -
                            36  """Given a MaterialX color and the names of two supported color spaces,
                            -
                            37  transform the color from the source to the destination color space.
                            -
                            38  By default, the OCIO color management system and default MaterialX
                            -
                            39  config are used."""
                            -
                            40 
                            -
                            41  if cms != 'ocio':
                            -
                            42  raise ValueError('Color management system is unrecognized: ' + cms)
                            -
                            43  if config is None:
                            -
                            44  config = getDefaultOCIOConfig()
                            -
                            45 
                            -
                            46  newColor = color
                            -
                            47  processor = config.getProcessor(str(sourceColorSpace), str(destColorSpace))
                            -
                            48  if isinstance(newColor, Color3):
                            -
                            49  newColor = Color3(processor.applyRGB(newColor))
                            -
                            50  elif isinstance(newColor, Color4):
                            -
                            51  newColor = Color4(processor.applyRGBA(newColor))
                            -
                            52 
                            -
                            53  return newColor
                            -
                            54 
                            - -
                            56  """Return the default OCIO config packaged with this Python library.
                            -
                            57  Raises ImportError if the PyOpenColorIO module cannot be imported."""
                            -
                            58  global _defaultConfig
                            -
                            59 
                            -
                            60  if _defaultConfig is None:
                            -
                            61  import PyOpenColorIO
                            -
                            62  scriptDir = os.path.dirname(os.path.abspath(__file__))
                            -
                            63  configFilename = os.path.join(scriptDir, _defaultConfigFilename)
                            -
                            64  _defaultConfig = PyOpenColorIO.Config.CreateFromFile(configFilename)
                            -
                            65  if _validateDefaultConfig:
                            -
                            66  _defaultConfig.sanityCheck()
                            -
                            67 
                            -
                            68  return _defaultConfig
                            -
                            def getColorSpaces(cms='ocio', config=None)
                            Definition: colorspace.py:23
                            -
                            def transformColor(color, sourceColorSpace, destColorSpace, cms='ocio', config=None)
                            Definition: colorspace.py:35
                            -
                            def getDefaultOCIOConfig()
                            Definition: colorspace.py:55
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/datatype_8py.html b/pymaterialx/python/docs/html/datatype_8py.html deleted file mode 100644 index f72ce5fb..00000000 --- a/pymaterialx/python/docs/html/datatype_8py.html +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - -My Project: MaterialX/datatype.py File Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            - -
                            -
                            datatype.py File Reference
                            -
                            -
                            - -

                            Go to the source code of this file.

                            - - - - -

                            -Namespaces

                             MaterialX.datatype
                             
                            - - - - - - - - - - - -

                            -Functions

                            def MaterialX.datatype.getTypeString (value)
                             
                            def MaterialX.datatype.getValueString (value)
                             
                            def MaterialX.datatype.createValueFromStrings (valueString, typeString)
                             
                            def MaterialX.datatype.isColorType (t)
                             
                            def MaterialX.datatype.isColorValue (value)
                             
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/datatype_8py.js b/pymaterialx/python/docs/html/datatype_8py.js deleted file mode 100644 index 6a32ceee..00000000 --- a/pymaterialx/python/docs/html/datatype_8py.js +++ /dev/null @@ -1,9 +0,0 @@ -var datatype_8py = -[ - [ "createValueFromStrings", "datatype_8py.html#a61e5cf2e5bd0aa11262576fee4dc1124", null ], - [ "getTypeString", "datatype_8py.html#afd52a73efed31accf704e3741a20247f", null ], - [ "getValueString", "datatype_8py.html#a9ecfbde2c3f1946b0e179c2d28781f2d", null ], - [ "isColorType", "datatype_8py.html#aecac78e6375a3c7b43682c17c4d24e2a", null ], - [ "isColorValue", "datatype_8py.html#a05458697ccc3f9b626fcf5838d97ce03", null ], - [ "_typeToName", "datatype_8py.html#ab945793feeda80a3935dafae9017a4dd", null ] -]; \ No newline at end of file diff --git a/pymaterialx/python/docs/html/datatype_8py_source.html b/pymaterialx/python/docs/html/datatype_8py_source.html deleted file mode 100644 index 9a13cbd2..00000000 --- a/pymaterialx/python/docs/html/datatype_8py_source.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - -My Project: MaterialX/datatype.py Source File - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            datatype.py
                            -
                            -
                            -Go to the documentation of this file.
                            1 #!/usr/bin/env python
                            -
                            2 '''
                            -
                            3 Native Python helper functions for MaterialX data types.
                            -
                            4 '''
                            -
                            5 
                            -
                            6 import sys
                            -
                            7 
                            -
                            8 from .PyMaterialXCore import *
                            -
                            9 
                            -
                            10 
                            -
                            11 #--------------------------------------------------------------------------------
                            -
                            12 _typeToName = { int : 'integer',
                            -
                            13  float : 'float',
                            -
                            14  bool : 'boolean',
                            -
                            15  Color3 : 'color3',
                            -
                            16  Color4 : 'color4',
                            -
                            17  Vector2 : 'vector2',
                            -
                            18  Vector3 : 'vector3',
                            -
                            19  Vector4 : 'vector4',
                            -
                            20  Matrix33 : 'matrix33',
                            -
                            21  Matrix44 : 'matrix44',
                            -
                            22  str : 'string' }
                            -
                            23 
                            -
                            24 if sys.version_info[0] < 3:
                            -
                            25  _typeToName[long] = 'integer'
                            -
                            26  _typeToName[unicode] = 'string'
                            -
                            27 else:
                            -
                            28  _typeToName[bytes] = 'string'
                            -
                            29 
                            -
                            30 
                            -
                            31 #--------------------------------------------------------------------------------
                            -
                            32 def getTypeString(value):
                            -
                            33  """Return the MaterialX type string associated with the given Python value
                            -
                            34  If the type of the given Python value is not recognized by MaterialX,
                            -
                            35  then None is returned.
                            -
                            36 
                            -
                            37  Examples:
                            -
                            38  getTypeString(1.0) -> 'float'
                            -
                            39  getTypeString(mx.Color3(1)) -> 'color3'"""
                            -
                            40 
                            -
                            41  valueType = type(value)
                            -
                            42  if valueType in _typeToName:
                            -
                            43  return _typeToName[valueType]
                            -
                            44  if valueType in (tuple, list):
                            -
                            45  if len(value):
                            -
                            46  elemType = type(value[0])
                            -
                            47  if elemType in _typeToName:
                            -
                            48  return _typeToName[elemType] + 'array'
                            -
                            49  return 'stringarray'
                            -
                            50  return None
                            -
                            51 
                            -
                            52 def getValueString(value):
                            -
                            53  """Return the MaterialX value string associated with the given Python value
                            -
                            54  If the type of the given Python value is not recognized by MaterialX,
                            -
                            55  then None is returned
                            -
                            56 
                            -
                            57  Examples:
                            -
                            58  getValueString(0.1) -> '0.1'
                            -
                            59  getValueString(mx.Color3(0.1, 0.2, 0.3)) -> '0.1, 0.2, 0.3'"""
                            -
                            60 
                            -
                            61  typeString = getTypeString(value)
                            -
                            62  if not typeString:
                            -
                            63  return None
                            -
                            64  method = globals()['TypedValue_' + typeString].createValue
                            -
                            65  return method(value).getValueString()
                            -
                            66 
                            -
                            67 def createValueFromStrings(valueString, typeString):
                            -
                            68  """Convert a MaterialX value and type strings to the corresponding
                            -
                            69  Python value. If the given conversion cannot be performed, then None
                            -
                            70  is returned.
                            -
                            71 
                            -
                            72  Examples:
                            -
                            73  createValueFromStrings('0.1', 'float') -> 0.1
                            -
                            74  createValueFromStrings('0.1, 0.2, 0.3', 'color3') -> mx.Color3(0.1, 0.2, 0.3)"""
                            -
                            75 
                            -
                            76  valueObj = Value.createValueFromStrings(valueString, typeString)
                            -
                            77  if not valueObj:
                            -
                            78  return None
                            -
                            79  return valueObj.getData()
                            -
                            80 
                            -
                            81 
                            -
                            82 def isColorType(t):
                            -
                            83  "Return True if the given type is a MaterialX color."
                            -
                            84  return t in (Color3, Color4)
                            -
                            85 
                            -
                            86 def isColorValue(value):
                            -
                            87  "Return True if the given value is a MaterialX color."
                            -
                            88  return isColorType(type(value))
                            -
                            def isColorValue(value)
                            Definition: datatype.py:86
                            -
                            def createValueFromStrings(valueString, typeString)
                            Definition: datatype.py:67
                            -
                            def getValueString(value)
                            Definition: datatype.py:52
                            -
                            def isColorType(t)
                            Definition: datatype.py:82
                            -
                            def getTypeString(value)
                            Definition: datatype.py:32
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/dir_b98ce54473cdb5e37ac53ffd76aa9b9c.html b/pymaterialx/python/docs/html/dir_b98ce54473cdb5e37ac53ffd76aa9b9c.html deleted file mode 100644 index 1cdd88e7..00000000 --- a/pymaterialx/python/docs/html/dir_b98ce54473cdb5e37ac53ffd76aa9b9c.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - -My Project: MaterialX Directory Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            MaterialX Directory Reference
                            -
                            -
                            - - - - - - - - - - -

                            -Files

                            file  __init__.py [code]
                             
                            file  colorspace.py [code]
                             
                            file  datatype.py [code]
                             
                            file  main.py [code]
                             
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/dir_b98ce54473cdb5e37ac53ffd76aa9b9c.js b/pymaterialx/python/docs/html/dir_b98ce54473cdb5e37ac53ffd76aa9b9c.js deleted file mode 100644 index a4d45a89..00000000 --- a/pymaterialx/python/docs/html/dir_b98ce54473cdb5e37ac53ffd76aa9b9c.js +++ /dev/null @@ -1,7 +0,0 @@ -var dir_b98ce54473cdb5e37ac53ffd76aa9b9c = -[ - [ "__init__.py", "____init_____8py.html", "____init_____8py" ], - [ "colorspace.py", "colorspace_8py.html", "colorspace_8py" ], - [ "datatype.py", "datatype_8py.html", "datatype_8py" ], - [ "main.py", "main_8py.html", "main_8py" ] -]; \ No newline at end of file diff --git a/pymaterialx/python/docs/html/doc.png b/pymaterialx/python/docs/html/doc.png deleted file mode 100644 index 17edabff..00000000 Binary files a/pymaterialx/python/docs/html/doc.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/doxygen.css b/pymaterialx/python/docs/html/doxygen.css deleted file mode 100644 index ffbff022..00000000 --- a/pymaterialx/python/docs/html/doxygen.css +++ /dev/null @@ -1,1793 +0,0 @@ -/* The standard CSS for doxygen 1.9.1 */ - -body, table, div, p, dl { - font: 400 14px/22px Roboto,sans-serif; -} - -p.reference, p.definition { - font: 400 14px/22px Roboto,sans-serif; -} - -/* @group Heading Levels */ - -h1.groupheader { - font-size: 150%; -} - -.title { - font: 400 14px/28px Roboto,sans-serif; - font-size: 150%; - font-weight: bold; - margin: 10px 2px; -} - -h2.groupheader { - border-bottom: 1px solid #879ECB; - color: #354C7B; - font-size: 150%; - font-weight: normal; - margin-top: 1.75em; - padding-top: 8px; - padding-bottom: 4px; - width: 100%; -} - -h3.groupheader { - font-size: 100%; -} - -h1, h2, h3, h4, h5, h6 { - -webkit-transition: text-shadow 0.5s linear; - -moz-transition: text-shadow 0.5s linear; - -ms-transition: text-shadow 0.5s linear; - -o-transition: text-shadow 0.5s linear; - transition: text-shadow 0.5s linear; - margin-right: 15px; -} - -h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { - text-shadow: 0 0 15px cyan; -} - -dt { - font-weight: bold; -} - -ul.multicol { - -moz-column-gap: 1em; - -webkit-column-gap: 1em; - column-gap: 1em; - -moz-column-count: 3; - -webkit-column-count: 3; - column-count: 3; -} - -p.startli, p.startdd { - margin-top: 2px; -} - -th p.starttd, th p.intertd, th p.endtd { - font-size: 100%; - font-weight: 700; -} - -p.starttd { - margin-top: 0px; -} - -p.endli { - margin-bottom: 0px; -} - -p.enddd { - margin-bottom: 4px; -} - -p.endtd { - margin-bottom: 2px; -} - -p.interli { -} - -p.interdd { -} - -p.intertd { -} - -/* @end */ - -caption { - font-weight: bold; -} - -span.legend { - font-size: 70%; - text-align: center; -} - -h3.version { - font-size: 90%; - text-align: center; -} - -div.navtab { - border-right: 1px solid #A3B4D7; - padding-right: 15px; - text-align: right; - line-height: 110%; -} - -div.navtab table { - border-spacing: 0; -} - -td.navtab { - padding-right: 6px; - padding-left: 6px; -} -td.navtabHL { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - padding-right: 6px; - padding-left: 6px; -} - -td.navtabHL a, td.navtabHL a:visited { - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); -} - -a.navtab { - font-weight: bold; -} - -div.qindex{ - text-align: center; - width: 100%; - line-height: 140%; - font-size: 130%; - color: #A0A0A0; -} - -dt.alphachar{ - font-size: 180%; - font-weight: bold; -} - -.alphachar a{ - color: black; -} - -.alphachar a:hover, .alphachar a:visited{ - text-decoration: none; -} - -.classindex dl { - padding: 25px; - column-count:1 -} - -.classindex dd { - display:inline-block; - margin-left: 50px; - width: 90%; - line-height: 1.15em; -} - -.classindex dl.odd { - background-color: #F8F9FC; -} - -@media(min-width: 1120px) { - .classindex dl { - column-count:2 - } -} - -@media(min-width: 1320px) { - .classindex dl { - column-count:3 - } -} - - -/* @group Link Styling */ - -a { - color: #3D578C; - font-weight: normal; - text-decoration: none; -} - -.contents a:visited { - color: #4665A2; -} - -a:hover { - text-decoration: underline; -} - -.contents a.qindexHL:visited { - color: #FFFFFF; -} - -a.el { - font-weight: bold; -} - -a.elRef { -} - -a.code, a.code:visited, a.line, a.line:visited { - color: #4665A2; -} - -a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { - color: #4665A2; -} - -/* @end */ - -dl.el { - margin-left: -1cm; -} - -ul { - overflow: hidden; /*Fixed: list item bullets overlap floating elements*/ -} - -#side-nav ul { - overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ -} - -#main-nav ul { - overflow: visible; /* reset ul rule for the navigation bar drop down lists */ -} - -.fragment { - text-align: left; - direction: ltr; - overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/ - overflow-y: hidden; -} - -pre.fragment { - border: 1px solid #C4CFE5; - background-color: #FBFCFD; - padding: 4px 6px; - margin: 4px 8px 4px 2px; - overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; - font-family: monospace, fixed; - font-size: 105%; -} - -div.fragment { - padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/ - margin: 4px 8px 4px 2px; - background-color: #FBFCFD; - border: 1px solid #C4CFE5; -} - -div.line { - font-family: monospace, fixed; - font-size: 13px; - min-height: 13px; - line-height: 1.0; - text-wrap: unrestricted; - white-space: -moz-pre-wrap; /* Moz */ - white-space: -pre-wrap; /* Opera 4-6 */ - white-space: -o-pre-wrap; /* Opera 7 */ - white-space: pre-wrap; /* CSS3 */ - word-wrap: break-word; /* IE 5.5+ */ - text-indent: -53px; - padding-left: 53px; - padding-bottom: 0px; - margin: 0px; - -webkit-transition-property: background-color, box-shadow; - -webkit-transition-duration: 0.5s; - -moz-transition-property: background-color, box-shadow; - -moz-transition-duration: 0.5s; - -ms-transition-property: background-color, box-shadow; - -ms-transition-duration: 0.5s; - -o-transition-property: background-color, box-shadow; - -o-transition-duration: 0.5s; - transition-property: background-color, box-shadow; - transition-duration: 0.5s; -} - -div.line:after { - content:"\000A"; - white-space: pre; -} - -div.line.glow { - background-color: cyan; - box-shadow: 0 0 10px cyan; -} - - -span.lineno { - padding-right: 4px; - text-align: right; - border-right: 2px solid #0F0; - background-color: #E8E8E8; - white-space: pre; -} -span.lineno a { - background-color: #D8D8D8; -} - -span.lineno a:hover { - background-color: #C8C8C8; -} - -.lineno { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -div.ah, span.ah { - background-color: black; - font-weight: bold; - color: #FFFFFF; - margin-bottom: 3px; - margin-top: 3px; - padding: 0.2em; - border: solid thin #333; - border-radius: 0.5em; - -webkit-border-radius: .5em; - -moz-border-radius: .5em; - box-shadow: 2px 2px 3px #999; - -webkit-box-shadow: 2px 2px 3px #999; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); - background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000 110%); -} - -div.classindex ul { - list-style: none; - padding-left: 0; -} - -div.classindex span.ai { - display: inline-block; -} - -div.groupHeader { - margin-left: 16px; - margin-top: 12px; - font-weight: bold; -} - -div.groupText { - margin-left: 16px; - font-style: italic; -} - -body { - background-color: white; - color: black; - margin: 0; -} - -div.contents { - margin-top: 10px; - margin-left: 12px; - margin-right: 8px; -} - -td.indexkey { - background-color: #EBEFF6; - font-weight: bold; - border: 1px solid #C4CFE5; - margin: 2px 0px 2px 0; - padding: 2px 10px; - white-space: nowrap; - vertical-align: top; -} - -td.indexvalue { - background-color: #EBEFF6; - border: 1px solid #C4CFE5; - padding: 2px 10px; - margin: 2px 0px; -} - -tr.memlist { - background-color: #EEF1F7; -} - -p.formulaDsp { - text-align: center; -} - -img.formulaDsp { - -} - -img.formulaInl, img.inline { - vertical-align: middle; -} - -div.center { - text-align: center; - margin-top: 0px; - margin-bottom: 0px; - padding: 0px; -} - -div.center img { - border: 0px; -} - -address.footer { - text-align: right; - padding-right: 12px; -} - -img.footer { - border: 0px; - vertical-align: middle; -} - -/* @group Code Colorization */ - -span.keyword { - color: #008000 -} - -span.keywordtype { - color: #604020 -} - -span.keywordflow { - color: #e08000 -} - -span.comment { - color: #800000 -} - -span.preprocessor { - color: #806020 -} - -span.stringliteral { - color: #002080 -} - -span.charliteral { - color: #008080 -} - -span.vhdldigit { - color: #ff00ff -} - -span.vhdlchar { - color: #000000 -} - -span.vhdlkeyword { - color: #700070 -} - -span.vhdllogic { - color: #ff0000 -} - -blockquote { - background-color: #F7F8FB; - border-left: 2px solid #9CAFD4; - margin: 0 24px 0 4px; - padding: 0 12px 0 16px; -} - -blockquote.DocNodeRTL { - border-left: 0; - border-right: 2px solid #9CAFD4; - margin: 0 4px 0 24px; - padding: 0 16px 0 12px; -} - -/* @end */ - -/* -.search { - color: #003399; - font-weight: bold; -} - -form.search { - margin-bottom: 0px; - margin-top: 0px; -} - -input.search { - font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -*/ - -td.tiny { - font-size: 75%; -} - -.dirtab { - padding: 4px; - border-collapse: collapse; - border: 1px solid #A3B4D7; -} - -th.dirtab { - background: #EBEFF6; - font-weight: bold; -} - -hr { - height: 0px; - border: none; - border-top: 1px solid #4A6AAA; -} - -hr.footer { - height: 1px; -} - -/* @group Member Descriptions */ - -table.memberdecls { - border-spacing: 0px; - padding: 0px; -} - -.memberdecls td, .fieldtable tr { - -webkit-transition-property: background-color, box-shadow; - -webkit-transition-duration: 0.5s; - -moz-transition-property: background-color, box-shadow; - -moz-transition-duration: 0.5s; - -ms-transition-property: background-color, box-shadow; - -ms-transition-duration: 0.5s; - -o-transition-property: background-color, box-shadow; - -o-transition-duration: 0.5s; - transition-property: background-color, box-shadow; - transition-duration: 0.5s; -} - -.memberdecls td.glow, .fieldtable tr.glow { - background-color: cyan; - box-shadow: 0 0 15px cyan; -} - -.mdescLeft, .mdescRight, -.memItemLeft, .memItemRight, -.memTemplItemLeft, .memTemplItemRight, .memTemplParams { - background-color: #F9FAFC; - border: none; - margin: 4px; - padding: 1px 0 0 8px; -} - -.mdescLeft, .mdescRight { - padding: 0px 8px 4px 8px; - color: #555; -} - -.memSeparator { - border-bottom: 1px solid #DEE4F0; - line-height: 1px; - margin: 0px; - padding: 0px; -} - -.memItemLeft, .memTemplItemLeft { - white-space: nowrap; -} - -.memItemRight, .memTemplItemRight { - width: 100%; -} - -.memTemplParams { - color: #4665A2; - white-space: nowrap; - font-size: 80%; -} - -/* @end */ - -/* @group Member Details */ - -/* Styles for detailed member documentation */ - -.memtitle { - padding: 8px; - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - border-top-right-radius: 4px; - border-top-left-radius: 4px; - margin-bottom: -1px; - background-image: url('nav_f.png'); - background-repeat: repeat-x; - background-color: #E2E8F2; - line-height: 1.25; - font-weight: 300; - float:left; -} - -.permalink -{ - font-size: 65%; - display: inline-block; - vertical-align: middle; -} - -.memtemplate { - font-size: 80%; - color: #4665A2; - font-weight: normal; - margin-left: 9px; -} - -.memnav { - background-color: #EBEFF6; - border: 1px solid #A3B4D7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} - -.mempage { - width: 100%; -} - -.memitem { - padding: 0; - margin-bottom: 10px; - margin-right: 5px; - -webkit-transition: box-shadow 0.5s linear; - -moz-transition: box-shadow 0.5s linear; - -ms-transition: box-shadow 0.5s linear; - -o-transition: box-shadow 0.5s linear; - transition: box-shadow 0.5s linear; - display: table !important; - width: 100%; -} - -.memitem.glow { - box-shadow: 0 0 15px cyan; -} - -.memname { - font-weight: 400; - margin-left: 6px; -} - -.memname td { - vertical-align: bottom; -} - -.memproto, dl.reflist dt { - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 0px 6px 0px; - color: #253555; - font-weight: bold; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-color: #DFE5F1; - /* opera specific markup */ - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - border-top-right-radius: 4px; - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 4px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 4px; - -} - -.overload { - font-family: "courier new",courier,monospace; - font-size: 65%; -} - -.memdoc, dl.reflist dd { - border-bottom: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - padding: 6px 10px 2px 10px; - background-color: #FBFCFD; - border-top-width: 0; - background-image:url('nav_g.png'); - background-repeat:repeat-x; - background-color: #FFFFFF; - /* opera specific markup */ - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - /* firefox specific markup */ - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-bottomright: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - /* webkit specific markup */ - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -} - -dl.reflist dt { - padding: 5px; -} - -dl.reflist dd { - margin: 0px 0px 10px 0px; - padding: 5px; -} - -.paramkey { - text-align: right; -} - -.paramtype { - white-space: nowrap; -} - -.paramname { - color: #602020; - white-space: nowrap; -} -.paramname em { - font-style: normal; -} -.paramname code { - line-height: 14px; -} - -.params, .retval, .exception, .tparams { - margin-left: 0px; - padding-left: 0px; -} - -.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { - font-weight: bold; - vertical-align: top; -} - -.params .paramtype, .tparams .paramtype { - font-style: italic; - vertical-align: top; -} - -.params .paramdir, .tparams .paramdir { - font-family: "courier new",courier,monospace; - vertical-align: top; -} - -table.mlabels { - border-spacing: 0px; -} - -td.mlabels-left { - width: 100%; - padding: 0px; -} - -td.mlabels-right { - vertical-align: bottom; - padding: 0px; - white-space: nowrap; -} - -span.mlabels { - margin-left: 8px; -} - -span.mlabel { - background-color: #728DC1; - border-top:1px solid #5373B4; - border-left:1px solid #5373B4; - border-right:1px solid #C4CFE5; - border-bottom:1px solid #C4CFE5; - text-shadow: none; - color: white; - margin-right: 4px; - padding: 2px 3px; - border-radius: 3px; - font-size: 7pt; - white-space: nowrap; - vertical-align: middle; -} - - - -/* @end */ - -/* these are for tree view inside a (index) page */ - -div.directory { - margin: 10px 0px; - border-top: 1px solid #9CAFD4; - border-bottom: 1px solid #9CAFD4; - width: 100%; -} - -.directory table { - border-collapse:collapse; -} - -.directory td { - margin: 0px; - padding: 0px; - vertical-align: top; -} - -.directory td.entry { - white-space: nowrap; - padding-right: 6px; - padding-top: 3px; -} - -.directory td.entry a { - outline:none; -} - -.directory td.entry a img { - border: none; -} - -.directory td.desc { - width: 100%; - padding-left: 6px; - padding-right: 6px; - padding-top: 3px; - border-left: 1px solid rgba(0,0,0,0.05); -} - -.directory tr.even { - padding-left: 6px; - background-color: #F7F8FB; -} - -.directory img { - vertical-align: -30%; -} - -.directory .levels { - white-space: nowrap; - width: 100%; - text-align: right; - font-size: 9pt; -} - -.directory .levels span { - cursor: pointer; - padding-left: 2px; - padding-right: 2px; - color: #3D578C; -} - -.arrow { - color: #9CAFD4; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; - font-size: 80%; - display: inline-block; - width: 16px; - height: 22px; -} - -.icon { - font-family: Arial, Helvetica; - font-weight: bold; - font-size: 12px; - height: 14px; - width: 16px; - display: inline-block; - background-color: #728DC1; - color: white; - text-align: center; - border-radius: 4px; - margin-left: 2px; - margin-right: 2px; -} - -.icona { - width: 24px; - height: 22px; - display: inline-block; -} - -.iconfopen { - width: 24px; - height: 18px; - margin-bottom: 4px; - background-image:url('folderopen.png'); - background-position: 0px -4px; - background-repeat: repeat-y; - vertical-align:top; - display: inline-block; -} - -.iconfclosed { - width: 24px; - height: 18px; - margin-bottom: 4px; - background-image:url('folderclosed.png'); - background-position: 0px -4px; - background-repeat: repeat-y; - vertical-align:top; - display: inline-block; -} - -.icondoc { - width: 24px; - height: 18px; - margin-bottom: 4px; - background-image:url('doc.png'); - background-position: 0px -4px; - background-repeat: repeat-y; - vertical-align:top; - display: inline-block; -} - -table.directory { - font: 400 14px Roboto,sans-serif; -} - -/* @end */ - -div.dynheader { - margin-top: 8px; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -address { - font-style: normal; - color: #2A3D61; -} - -table.doxtable caption { - caption-side: top; -} - -table.doxtable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.doxtable td, table.doxtable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.doxtable th { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -table.fieldtable { - /*width: 100%;*/ - margin-bottom: 10px; - border: 1px solid #A8B8D9; - border-spacing: 0px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; - border-radius: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; - -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); - box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); -} - -.fieldtable td, .fieldtable th { - padding: 3px 7px 2px; -} - -.fieldtable td.fieldtype, .fieldtable td.fieldname { - white-space: nowrap; - border-right: 1px solid #A8B8D9; - border-bottom: 1px solid #A8B8D9; - vertical-align: top; -} - -.fieldtable td.fieldname { - padding-top: 3px; -} - -.fieldtable td.fielddoc { - border-bottom: 1px solid #A8B8D9; - /*width: 100%;*/ -} - -.fieldtable td.fielddoc p:first-child { - margin-top: 0px; -} - -.fieldtable td.fielddoc p:last-child { - margin-bottom: 2px; -} - -.fieldtable tr:last-child td { - border-bottom: none; -} - -.fieldtable th { - background-image:url('nav_f.png'); - background-repeat:repeat-x; - background-color: #E2E8F2; - font-size: 90%; - color: #253555; - padding-bottom: 4px; - padding-top: 5px; - text-align:left; - font-weight: 400; - -moz-border-radius-topleft: 4px; - -moz-border-radius-topright: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom: 1px solid #A8B8D9; -} - - -.tabsearch { - top: 0px; - left: 10px; - height: 36px; - background-image: url('tab_b.png'); - z-index: 101; - overflow: hidden; - font-size: 13px; -} - -.navpath ul -{ - font-size: 11px; - background-image:url('tab_b.png'); - background-repeat:repeat-x; - background-position: 0 -5px; - height:30px; - line-height:30px; - color:#8AA0CC; - border:solid 1px #C2CDE4; - overflow:hidden; - margin:0px; - padding:0px; -} - -.navpath li -{ - list-style-type:none; - float:left; - padding-left:10px; - padding-right:15px; - background-image:url('bc_s.png'); - background-repeat:no-repeat; - background-position:right; - color:#364D7C; -} - -.navpath li.navelem a -{ - height:32px; - display:block; - text-decoration: none; - outline: none; - color: #283A5D; - font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; - text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - text-decoration: none; -} - -.navpath li.navelem a:hover -{ - color:#6884BD; -} - -.navpath li.footer -{ - list-style-type:none; - float:right; - padding-left:10px; - padding-right:15px; - background-image:none; - background-repeat:no-repeat; - background-position:right; - color:#364D7C; - font-size: 8pt; -} - - -div.summary -{ - float: right; - font-size: 8pt; - padding-right: 5px; - width: 50%; - text-align: right; -} - -div.summary a -{ - white-space: nowrap; -} - -table.classindex -{ - margin: 10px; - white-space: nowrap; - margin-left: 3%; - margin-right: 3%; - width: 94%; - border: 0; - border-spacing: 0; - padding: 0; -} - -div.ingroups -{ - font-size: 8pt; - width: 50%; - text-align: left; -} - -div.ingroups a -{ - white-space: nowrap; -} - -div.header -{ - background-image:url('nav_h.png'); - background-repeat:repeat-x; - background-color: #F9FAFC; - margin: 0px; - border-bottom: 1px solid #C4CFE5; -} - -div.headertitle -{ - padding: 5px 5px 5px 10px; -} - -.PageDocRTL-title div.headertitle { - text-align: right; - direction: rtl; -} - -dl { - padding: 0 0 0 0; -} - -/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */ -dl.section { - margin-left: 0px; - padding-left: 0px; -} - -dl.section.DocNodeRTL { - margin-right: 0px; - padding-right: 0px; -} - -dl.note { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #D0C000; -} - -dl.note.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #D0C000; -} - -dl.warning, dl.attention { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #FF0000; -} - -dl.warning.DocNodeRTL, dl.attention.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #FF0000; -} - -dl.pre, dl.post, dl.invariant { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #00D000; -} - -dl.pre.DocNodeRTL, dl.post.DocNodeRTL, dl.invariant.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #00D000; -} - -dl.deprecated { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #505050; -} - -dl.deprecated.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #505050; -} - -dl.todo { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #00C0E0; -} - -dl.todo.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #00C0E0; -} - -dl.test { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #3030E0; -} - -dl.test.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #3030E0; -} - -dl.bug { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #C08050; -} - -dl.bug.DocNodeRTL { - margin-left: 0; - padding-left: 0; - border-left: 0; - margin-right: -7px; - padding-right: 3px; - border-right: 4px solid; - border-color: #C08050; -} - -dl.section dd { - margin-bottom: 6px; -} - - -#projectlogo -{ - text-align: center; - vertical-align: bottom; - border-collapse: separate; -} - -#projectlogo img -{ - border: 0px none; -} - -#projectalign -{ - vertical-align: middle; -} - -#projectname -{ - font: 300% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 2px 0px; -} - -#projectbrief -{ - font: 120% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#projectnumber -{ - font: 50% Tahoma, Arial,sans-serif; - margin: 0px; - padding: 0px; -} - -#titlearea -{ - padding: 0px; - margin: 0px; - width: 100%; - border-bottom: 1px solid #5373B4; -} - -.image -{ - text-align: center; -} - -.dotgraph -{ - text-align: center; -} - -.mscgraph -{ - text-align: center; -} - -.plantumlgraph -{ - text-align: center; -} - -.diagraph -{ - text-align: center; -} - -.caption -{ - font-weight: bold; -} - -div.zoom -{ - border: 1px solid #90A5CE; -} - -dl.citelist { - margin-bottom:50px; -} - -dl.citelist dt { - color:#334975; - float:left; - font-weight:bold; - margin-right:10px; - padding:5px; - text-align:right; - width:52px; -} - -dl.citelist dd { - margin:2px 0 2px 72px; - padding:5px 0; -} - -div.toc { - padding: 14px 25px; - background-color: #F4F6FA; - border: 1px solid #D8DFEE; - border-radius: 7px 7px 7px 7px; - float: right; - height: auto; - margin: 0 8px 10px 10px; - width: 200px; -} - -.PageDocRTL-title div.toc { - float: left !important; - text-align: right; -} - -div.toc li { - background: url("bdwn.png") no-repeat scroll 0 5px transparent; - font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; - margin-top: 5px; - padding-left: 10px; - padding-top: 2px; -} - -.PageDocRTL-title div.toc li { - background-position-x: right !important; - padding-left: 0 !important; - padding-right: 10px; -} - -div.toc h3 { - font: bold 12px/1.2 Arial,FreeSans,sans-serif; - color: #4665A2; - border-bottom: 0 none; - margin: 0; -} - -div.toc ul { - list-style: none outside none; - border: medium none; - padding: 0px; -} - -div.toc li.level1 { - margin-left: 0px; -} - -div.toc li.level2 { - margin-left: 15px; -} - -div.toc li.level3 { - margin-left: 30px; -} - -div.toc li.level4 { - margin-left: 45px; -} - -span.emoji { - /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html - * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; - */ -} - -.PageDocRTL-title div.toc li.level1 { - margin-left: 0 !important; - margin-right: 0; -} - -.PageDocRTL-title div.toc li.level2 { - margin-left: 0 !important; - margin-right: 15px; -} - -.PageDocRTL-title div.toc li.level3 { - margin-left: 0 !important; - margin-right: 30px; -} - -.PageDocRTL-title div.toc li.level4 { - margin-left: 0 !important; - margin-right: 45px; -} - -.inherit_header { - font-weight: bold; - color: gray; - cursor: pointer; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.inherit_header td { - padding: 6px 0px 2px 5px; -} - -.inherit { - display: none; -} - -tr.heading h2 { - margin-top: 12px; - margin-bottom: 4px; -} - -/* tooltip related style info */ - -.ttc { - position: absolute; - display: none; -} - -#powerTip { - cursor: default; - white-space: nowrap; - background-color: white; - border: 1px solid gray; - border-radius: 4px 4px 4px 4px; - box-shadow: 1px 1px 7px gray; - display: none; - font-size: smaller; - max-width: 80%; - opacity: 0.9; - padding: 1ex 1em 1em; - position: absolute; - z-index: 2147483647; -} - -#powerTip div.ttdoc { - color: grey; - font-style: italic; -} - -#powerTip div.ttname a { - font-weight: bold; -} - -#powerTip div.ttname { - font-weight: bold; -} - -#powerTip div.ttdeci { - color: #006318; -} - -#powerTip div { - margin: 0px; - padding: 0px; - font: 12px/16px Roboto,sans-serif; -} - -#powerTip:before, #powerTip:after { - content: ""; - position: absolute; - margin: 0px; -} - -#powerTip.n:after, #powerTip.n:before, -#powerTip.s:after, #powerTip.s:before, -#powerTip.w:after, #powerTip.w:before, -#powerTip.e:after, #powerTip.e:before, -#powerTip.ne:after, #powerTip.ne:before, -#powerTip.se:after, #powerTip.se:before, -#powerTip.nw:after, #powerTip.nw:before, -#powerTip.sw:after, #powerTip.sw:before { - border: solid transparent; - content: " "; - height: 0; - width: 0; - position: absolute; -} - -#powerTip.n:after, #powerTip.s:after, -#powerTip.w:after, #powerTip.e:after, -#powerTip.nw:after, #powerTip.ne:after, -#powerTip.sw:after, #powerTip.se:after { - border-color: rgba(255, 255, 255, 0); -} - -#powerTip.n:before, #powerTip.s:before, -#powerTip.w:before, #powerTip.e:before, -#powerTip.nw:before, #powerTip.ne:before, -#powerTip.sw:before, #powerTip.se:before { - border-color: rgba(128, 128, 128, 0); -} - -#powerTip.n:after, #powerTip.n:before, -#powerTip.ne:after, #powerTip.ne:before, -#powerTip.nw:after, #powerTip.nw:before { - top: 100%; -} - -#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { - border-top-color: #FFFFFF; - border-width: 10px; - margin: 0px -10px; -} -#powerTip.n:before { - border-top-color: #808080; - border-width: 11px; - margin: 0px -11px; -} -#powerTip.n:after, #powerTip.n:before { - left: 50%; -} - -#powerTip.nw:after, #powerTip.nw:before { - right: 14px; -} - -#powerTip.ne:after, #powerTip.ne:before { - left: 14px; -} - -#powerTip.s:after, #powerTip.s:before, -#powerTip.se:after, #powerTip.se:before, -#powerTip.sw:after, #powerTip.sw:before { - bottom: 100%; -} - -#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { - border-bottom-color: #FFFFFF; - border-width: 10px; - margin: 0px -10px; -} - -#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { - border-bottom-color: #808080; - border-width: 11px; - margin: 0px -11px; -} - -#powerTip.s:after, #powerTip.s:before { - left: 50%; -} - -#powerTip.sw:after, #powerTip.sw:before { - right: 14px; -} - -#powerTip.se:after, #powerTip.se:before { - left: 14px; -} - -#powerTip.e:after, #powerTip.e:before { - left: 100%; -} -#powerTip.e:after { - border-left-color: #FFFFFF; - border-width: 10px; - top: 50%; - margin-top: -10px; -} -#powerTip.e:before { - border-left-color: #808080; - border-width: 11px; - top: 50%; - margin-top: -11px; -} - -#powerTip.w:after, #powerTip.w:before { - right: 100%; -} -#powerTip.w:after { - border-right-color: #FFFFFF; - border-width: 10px; - top: 50%; - margin-top: -10px; -} -#powerTip.w:before { - border-right-color: #808080; - border-width: 11px; - top: 50%; - margin-top: -11px; -} - -@media print -{ - #top { display: none; } - #side-nav { display: none; } - #nav-path { display: none; } - body { overflow:visible; } - h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } - .summary { display: none; } - .memitem { page-break-inside: avoid; } - #doc-content - { - margin-left:0 !important; - height:auto !important; - width:auto !important; - overflow:inherit; - display:inline; - } -} - -/* @group Markdown */ - -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.markdownTable tr { -} - -th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -th.markdownTableHeadLeft, td.markdownTableBodyLeft { - text-align: left -} - -th.markdownTableHeadRight, td.markdownTableBodyRight { - text-align: right -} - -th.markdownTableHeadCenter, td.markdownTableBodyCenter { - text-align: center -} - -.DocNodeRTL { - text-align: right; - direction: rtl; -} - -.DocNodeLTR { - text-align: left; - direction: ltr; -} - -table.DocNodeRTL { - width: auto; - margin-right: 0; - margin-left: auto; -} - -table.DocNodeLTR { - width: auto; - margin-right: auto; - margin-left: 0; -} - -tt, code, kbd, samp -{ - display: inline-block; - direction:ltr; -} -/* @end */ - -u { - text-decoration: underline; -} - diff --git a/pymaterialx/python/docs/html/doxygen.svg b/pymaterialx/python/docs/html/doxygen.svg deleted file mode 100644 index d42dad52..00000000 --- a/pymaterialx/python/docs/html/doxygen.svg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pymaterialx/python/docs/html/dynsections.js b/pymaterialx/python/docs/html/dynsections.js deleted file mode 100644 index 88f2c27e..00000000 --- a/pymaterialx/python/docs/html/dynsections.js +++ /dev/null @@ -1,128 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - - The MIT License (MIT) - - Copyright (C) 1997-2020 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice for the JavaScript code in this file - */ -function toggleVisibility(linkObj) -{ - var base = $(linkObj).attr('id'); - var summary = $('#'+base+'-summary'); - var content = $('#'+base+'-content'); - var trigger = $('#'+base+'-trigger'); - var src=$(trigger).attr('src'); - if (content.is(':visible')===true) { - content.hide(); - summary.show(); - $(linkObj).addClass('closed').removeClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); - } else { - content.show(); - summary.hide(); - $(linkObj).removeClass('closed').addClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); - } - return false; -} - -function updateStripes() -{ - $('table.directory tr'). - removeClass('even').filter(':visible:even').addClass('even'); -} - -function toggleLevel(level) -{ - $('table.directory tr').each(function() { - var l = this.id.split('_').length-1; - var i = $('#img'+this.id.substring(3)); - var a = $('#arr'+this.id.substring(3)); - if (l - - - - - - -My Project: File List - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            File List
                            -
                            -
                            -
                            Here is a list of all files with brief descriptions:
                            -
                            [detail level 12]
                            - - - - - -
                              MaterialX
                             __init__.py
                             colorspace.py
                             datatype.py
                             main.py
                            -
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/files_dup.js b/pymaterialx/python/docs/html/files_dup.js deleted file mode 100644 index e0fbc776..00000000 --- a/pymaterialx/python/docs/html/files_dup.js +++ /dev/null @@ -1,4 +0,0 @@ -var files_dup = -[ - [ "MaterialX", "dir_b98ce54473cdb5e37ac53ffd76aa9b9c.html", "dir_b98ce54473cdb5e37ac53ffd76aa9b9c" ] -]; \ No newline at end of file diff --git a/pymaterialx/python/docs/html/folderclosed.png b/pymaterialx/python/docs/html/folderclosed.png deleted file mode 100644 index bb8ab35e..00000000 Binary files a/pymaterialx/python/docs/html/folderclosed.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/folderopen.png b/pymaterialx/python/docs/html/folderopen.png deleted file mode 100644 index d6c7f676..00000000 Binary files a/pymaterialx/python/docs/html/folderopen.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/index.html b/pymaterialx/python/docs/html/index.html deleted file mode 100644 index d60b6e27..00000000 --- a/pymaterialx/python/docs/html/index.html +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - -My Project: Main Page - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            My Project Documentation
                            -
                            -
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/jquery.js b/pymaterialx/python/docs/html/jquery.js deleted file mode 100644 index 103c32d7..00000000 --- a/pymaterialx/python/docs/html/jquery.js +++ /dev/null @@ -1,35 +0,0 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
                            "],col:[2,"","
                            "],tr:[2,"","
                            "],td:[3,"","
                            "],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
                            ",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0a;a++)for(i in o[a])n=o[a][i],o[a].hasOwnProperty(i)&&void 0!==n&&(e[i]=t.isPlainObject(n)?t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(o){var a="string"==typeof o,r=s.call(arguments,1),h=this;return a?this.length||"instance"!==o?this.each(function(){var i,s=t.data(this,n);return"instance"===o?(h=s,!1):s?t.isFunction(s[o])&&"_"!==o.charAt(0)?(i=s[o].apply(s,r),i!==s&&void 0!==i?(h=i&&i.jquery?h.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+o+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+o+"'")}):h=void 0:(r.length&&(o=t.widget.extend.apply(null,[o].concat(r))),this.each(function(){var e=t.data(this,n);e?(e.option(o||{}),e._init&&e._init()):t.data(this,n,new i(o,this))})),h}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
                            ",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
                            "),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,(i>0||u>a(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var n=!1;t(document).on("mouseup",function(){n=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,o="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!o&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("
                            ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("
                            "),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
                            "),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element -},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0};t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,m=s.maxWidth&&p>s.maxWidth,g=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),m&&(p-=l),g&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable});/** - * Copyright (c) 2007 Ariel Flesler - aflesler ○ gmail • com | https://github.com/flesler - * Licensed under MIT - * @author Ariel Flesler - * @version 2.1.2 - */ -;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1=f[g]?0:Math.min(f[g],n));!a&&1-1){targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if(session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)}closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if(session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE,function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList,finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight()));return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")}function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(),elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight,viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 - * http://www.smartmenus.org/ - * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)),mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend($.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy(this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
                            ').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?(this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for(var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if((!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&(this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]")||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"),a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i,downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2))&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0),canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}},rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})}return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1,bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); \ No newline at end of file diff --git a/pymaterialx/python/docs/html/main_8py.html b/pymaterialx/python/docs/html/main_8py.html deleted file mode 100644 index 6f6f3429..00000000 --- a/pymaterialx/python/docs/html/main_8py.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - -My Project: MaterialX/main.py File Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            - -
                            -
                            main.py File Reference
                            -
                            -
                            - -

                            Go to the source code of this file.

                            - - - - -

                            -Namespaces

                             MaterialX.main
                             
                            - - - - - - - - - -

                            -Variables

                            def MaterialX.main.typeToName = _typeToName
                             
                            def MaterialX.main.valueToString = _valueToString
                             
                            def MaterialX.main.stringToValue = _stringToValue
                             
                             MaterialX.main.readFromXmlFile = readFromXmlFileBase
                             
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/main_8py.js b/pymaterialx/python/docs/html/main_8py.js deleted file mode 100644 index b0f0d466..00000000 --- a/pymaterialx/python/docs/html/main_8py.js +++ /dev/null @@ -1,43 +0,0 @@ -var main_8py = -[ - [ "_addBindInput", "main_8py.html#ac103da94b3406fba5996d14400051b53", null ], - [ "_addBindParam", "main_8py.html#a0bec7b2027129de6e435eb01b74dd61e", null ], - [ "_addChild", "main_8py.html#a6c811df86f3ab1cd08cc162a59c6a0b9", null ], - [ "_addGeomAttr", "main_8py.html#aeb0884486118155075a8afecc3eb0b95", null ], - [ "_addMaterial", "main_8py.html#ab951dfc4fd0e4b7b6982a8ee8976776a", null ], - [ "_addParameter", "main_8py.html#a636b36ce20338fe70c24ea496010a470", null ], - [ "_addShaderRef", "main_8py.html#a3aa609669ac79a0b1343767d266e02ca", null ], - [ "_getActiveParameters", "main_8py.html#ab8cb2e2648457d04b53724e208904de8", null ], - [ "_getActiveShaderRefs", "main_8py.html#a6092a6cb111bf1b96faa76ae0faf59ff", null ], - [ "_getBindInputs", "main_8py.html#a5eba039690816b04c54d9321a29cef77", null ], - [ "_getBindParams", "main_8py.html#a2529dcb5718c2c496f5cea5509e2e617", null ], - [ "_getBindTokens", "main_8py.html#aa028123d097edf17abd127d96776e387", null ], - [ "_getChild", "main_8py.html#acd3a31339fb64e12ed16bd7177118b4d", null ], - [ "_getChildOfType", "main_8py.html#a1bc006b783ce291000d5273a44acfd75", null ], - [ "_getChildrenOfType", "main_8py.html#a048d2193eb002ca33d3809c99f503136", null ], - [ "_getDefaultValue", "main_8py.html#a615cafcfb99b3dd4a20226fc240d4a6a", null ], - [ "_getInputValue", "main_8py.html#a148a7df6ecfa4b437e5b8848d67d0c0e", null ], - [ "_getMaterials", "main_8py.html#a08b74b228ab4ca2babd3291f10074d84", null ], - [ "_getParameters", "main_8py.html#aff064ae3f4f379a545702786eaa23bbf", null ], - [ "_getParameterValue", "main_8py.html#aba5b47b649cafc05741a214c4446d9af", null ], - [ "_getParameterValueString", "main_8py.html#a367830a25906dbf37da986ee60d57d05", null ], - [ "_getPropertyValue", "main_8py.html#a3826c25ad041ab5d73ec86def2e6e0ad", null ], - [ "_getReferencedNodeDef", "main_8py.html#a918ef70f2260e4907534993c05e40b94", null ], - [ "_getShaderRefs", "main_8py.html#ae3699001af4ddaaa44933afe5f5a51a6", null ], - [ "_getValue", "main_8py.html#adb4487caaff0293ee8b5d493290b255f", null ], - [ "_isA", "main_8py.html#a1ee9a49705c0497caaf314099a0b8730", null ], - [ "_removeChildOfType", "main_8py.html#a0b77b871d0f5b039d1982145f109b300", null ], - [ "_setGeomAttrValue", "main_8py.html#ae219cd55ef2255245523d5cfe5288d72", null ], - [ "_setGeomPropValue", "main_8py.html#a62f8a8f3cb57c84a4e5682b413112007", null ], - [ "_setInputValue", "main_8py.html#ac7ed072446b692d44397eb8e8f74043b", null ], - [ "_setParameterValue", "main_8py.html#a19e10745b388a99585cf71ae86ec12f0", null ], - [ "_setPropertyValue", "main_8py.html#a96f210ac5a15b5971244dcb308c7f590", null ], - [ "_setValue", "main_8py.html#a8231cd1385d22d0deb69d8395e459427", null ], - [ "_stringToValue", "main_8py.html#a9d4259bb892c61ecf2ad9cf1e7abc0f4", null ], - [ "_typeToName", "main_8py.html#a97adda143354215bfae8471cd6591276", null ], - [ "_valueToString", "main_8py.html#a80f6cb590736c103e6e812dc2856fc29", null ], - [ "readFromXmlFile", "main_8py.html#a6a5f6ea0c68c5ad65ca394d8a03b70a2", null ], - [ "stringToValue", "main_8py.html#a346e741dda2260842f721c65cd57773b", null ], - [ "typeToName", "main_8py.html#a79331c2433656921d4c9c993a63a266c", null ], - [ "valueToString", "main_8py.html#adb290066e496754c807e8c4ed87c5113", null ] -]; \ No newline at end of file diff --git a/pymaterialx/python/docs/html/main_8py_source.html b/pymaterialx/python/docs/html/main_8py_source.html deleted file mode 100644 index 7d9e301b..00000000 --- a/pymaterialx/python/docs/html/main_8py_source.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - - -My Project: MaterialX/main.py Source File - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            main.py
                            -
                            -
                            -Go to the documentation of this file.
                            1 #!/usr/bin/env python
                            -
                            2 '''
                            -
                            3 Native Python wrappers for PyMaterialX, providing a more Pythonic interface
                            -
                            4 for Elements and Values.
                            -
                            5 '''
                            -
                            6 
                            -
                            7 import warnings
                            -
                            8 
                            -
                            9 from .PyMaterialXCore import *
                            -
                            10 from .PyMaterialXFormat import *
                            -
                            11 from .datatype import *
                            -
                            12 
                            -
                            13 
                            -
                            14 #
                            -
                            15 # Element
                            -
                            16 #
                            -
                            17 
                            -
                            18 def _isA(self, elementClass, category = ''):
                            -
                            19  """Return True if this element is an instance of the given subclass.
                            -
                            20  If a category string is specified, then both subclass and category
                            -
                            21  matches are required."""
                            -
                            22  if not isinstance(self, elementClass):
                            -
                            23  return False
                            -
                            24  if category and self.getCategory() != category:
                            -
                            25  return False
                            -
                            26  return True
                            -
                            27 
                            -
                            28 def _addChild(self, elementClass, name, typeString = ''):
                            -
                            29  "Add a child element of the given subclass, name, and optional type string."
                            -
                            30  method = getattr(self.__class__, "_addChild" + elementClass.__name__)
                            -
                            31  return method(self, name, typeString)
                            -
                            32 
                            -
                            33 def _getChild(self, name):
                            -
                            34  "Return the child element, if any, with the given name."
                            -
                            35  if (name == None):
                            -
                            36  return None
                            -
                            37  return self._getChild(name)
                            -
                            38 
                            -
                            39 def _getChildOfType(self, elementClass, name):
                            -
                            40  "Return the child element, if any, with the given name and subclass."
                            -
                            41  method = getattr(self.__class__, "_getChildOfType" + elementClass.__name__)
                            -
                            42  return method(self, name)
                            -
                            43 
                            -
                            44 def _getChildrenOfType(self, elementClass):
                            -
                            45  """Return a list of all child elements that are instances of the given type.
                            -
                            46  The returned list maintains the order in which children were added."""
                            -
                            47  method = getattr(self.__class__, "_getChildrenOfType" + elementClass.__name__)
                            -
                            48  return method(self)
                            -
                            49 
                            -
                            50 def _removeChildOfType(self, elementClass, name):
                            -
                            51  "Remove the typed child element, if any, with the given name."
                            -
                            52  method = getattr(self.__class__, "_removeChildOfType" + elementClass.__name__)
                            -
                            53  method(self, name)
                            -
                            54 
                            -
                            55 Element.isA = _isA
                            -
                            56 Element.addChild = _addChild
                            -
                            57 Element.getChild = _getChild
                            -
                            58 Element.getChildOfType = _getChildOfType
                            -
                            59 Element.getChildrenOfType = _getChildrenOfType
                            -
                            60 Element.removeChildOfType = _removeChildOfType
                            -
                            61 
                            -
                            62 
                            -
                            63 #
                            -
                            64 # ValueElement
                            -
                            65 #
                            -
                            66 
                            -
                            67 def _setValue(self, value, typeString = ''):
                            -
                            68  "Set the typed value of an element."
                            -
                            69  method = getattr(self.__class__, "_setValue" + getTypeString(value))
                            -
                            70  method(self, value, typeString)
                            -
                            71 
                            -
                            72 def _getValue(self):
                            -
                            73  "Return the typed value of an element."
                            -
                            74  value = self._getValue()
                            -
                            75  return value.getData() if value else None
                            -
                            76 
                            -
                            77 def _getDefaultValue(self):
                            -
                            78  """Return the default value for this element."""
                            -
                            79  value = self._getDefaultValue()
                            -
                            80  return value.getData() if value else None
                            -
                            81 
                            -
                            82 ValueElement.setValue = _setValue
                            -
                            83 ValueElement.getValue = _getValue
                            -
                            84 ValueElement.getDefaultValue = _getDefaultValue
                            -
                            85 
                            -
                            86 
                            -
                            87 #
                            -
                            88 # InterfaceElement
                            -
                            89 #
                            -
                            90 
                            -
                            91 def _setInputValue(self, name, value, typeString = ''):
                            -
                            92  """Set the typed value of an input by its name, creating a child element
                            -
                            93  to hold the input if needed."""
                            -
                            94  method = getattr(self.__class__, "_setInputValue" + getTypeString(value))
                            -
                            95  return method(self, name, value, typeString)
                            -
                            96 
                            -
                            97 def _getInputValue(self, name, target = ''):
                            -
                            98  """Return the typed value of an input by its name, taking both the
                            -
                            99  calling element and its declaration into account. If the given
                            -
                            100  input is not found, then None is returned."""
                            -
                            101  value = self._getInputValue(name, target)
                            -
                            102  return value.getData() if value else None
                            -
                            103 
                            -
                            104 def _addParameter(self, name):
                            -
                            105  """(Deprecated) Add a Parameter to this interface."""
                            -
                            106  warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            107  return self.addInput(name)
                            -
                            108 
                            -
                            109 def _getParameters(self):
                            -
                            110  """(Deprecated) Return a vector of all Parameter elements."""
                            -
                            111  warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            112  return list()
                            -
                            113 
                            -
                            114 def _getActiveParameters(self):
                            -
                            115  """(Deprecated) Return a vector of all parameters belonging to this interface, taking inheritance into account."""
                            -
                            116  warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            117  return list()
                            -
                            118 
                            -
                            119 def _setParameterValue(self, name, value, typeString = ''):
                            -
                            120  """(Deprecated) Set the typed value of a parameter by its name."""
                            -
                            121  warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            122 
                            -
                            123 def _getParameterValue(self, name, target = ''):
                            -
                            124  """(Deprecated) Return the typed value of a parameter by its name."""
                            -
                            125  warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            126  return None
                            -
                            127 
                            -
                            128 def _getParameterValueString(self, name):
                            -
                            129  """(Deprecated) Return the value string of a parameter by its name."""
                            -
                            130  warnings.warn("This function is deprecated; parameters have been replaced with uniform inputs in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            131  return ""
                            -
                            132 
                            -
                            133 def _addBindInput(self, name, type = DEFAULT_TYPE_STRING):
                            -
                            134  """(Deprecated) Add a BindInput to this shader reference."""
                            -
                            135  warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            136  return self.addInput(name, type)
                            -
                            137 
                            -
                            138 def _getBindInputs(self):
                            -
                            139  """(Deprecated) Return a vector of all BindInput elements in this shader reference."""
                            -
                            140  warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            141  return self.getInputs()
                            -
                            142 
                            -
                            143 def _addBindParam(self, name, type = DEFAULT_TYPE_STRING):
                            -
                            144  """(Deprecated) Add a BindParam to this shader reference."""
                            -
                            145  warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            146  return self.addInput(name, type)
                            -
                            147 
                            -
                            148 def _getBindParams(self):
                            -
                            149  """(Deprecated) Return a vector of all BindParam elements in this shader reference."""
                            -
                            150  warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            151  return list()
                            -
                            152 
                            -
                            153 def _getBindTokens(self):
                            -
                            154  """(Deprecated) Return a vector of all BindToken elements in this shader reference."""
                            -
                            155  warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            156  return list()
                            -
                            157 
                            -
                            158 InterfaceElement.setInputValue = _setInputValue
                            -
                            159 InterfaceElement.getInputValue = _getInputValue
                            -
                            160 InterfaceElement.addParameter = _addParameter
                            -
                            161 InterfaceElement.getParameters = _getParameters
                            -
                            162 InterfaceElement.getActiveParameters = _getActiveParameters
                            -
                            163 InterfaceElement.setParameterValue = _setParameterValue
                            -
                            164 InterfaceElement.getParameterValue = _getParameterValue
                            -
                            165 InterfaceElement.getParameterValueString = _getParameterValueString
                            -
                            166 InterfaceElement.addBindInput = _addBindInput
                            -
                            167 InterfaceElement.getBindInputs = _getBindInputs
                            -
                            168 InterfaceElement.addBindParam = _addBindParam
                            -
                            169 InterfaceElement.getBindParams = _getBindParams
                            -
                            170 InterfaceElement.getBindTokens = _getBindTokens
                            -
                            171 
                            -
                            172 
                            -
                            173 #
                            -
                            174 # Node
                            -
                            175 #
                            -
                            176 
                            -
                            177 def _getReferencedNodeDef(self):
                            -
                            178  "(Deprecated) Return the first NodeDef that declares this node."
                            -
                            179  warnings.warn("This function is deprecated; call Node.getNodeDef instead.", DeprecationWarning, stacklevel = 2)
                            -
                            180  return self.getNodeDef()
                            -
                            181 
                            -
                            182 def _addShaderRef(self, name, nodeName):
                            -
                            183  "(Deprecated) Add a shader reference to this material element."
                            -
                            184  warnings.warn("This function is deprecated; material elements have been replaced with material nodes in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            185  return self.getParent().addNode(nodeName, name)
                            -
                            186 
                            -
                            187 def _getShaderRefs(self):
                            -
                            188  """(Deprecated) Return a vector of all shader references in this material element."""
                            -
                            189  warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            190  return getShaderNodes(self)
                            -
                            191 
                            -
                            192 def _getActiveShaderRefs(self):
                            -
                            193  """(Deprecated) Return a vector of all shader references in this material element, taking material inheritance into account."""
                            -
                            194  warnings.warn("This function is deprecated; shader references have been replaced with shader nodes in 1.38.", DeprecationWarning, stacklevel = 2)
                            -
                            195  return getShaderNodes(self)
                            -
                            196 
                            -
                            197 Node.getReferencedNodeDef = _getReferencedNodeDef
                            -
                            198 Node.addShaderRef = _addShaderRef
                            -
                            199 Node.getShaderRefs = _getShaderRefs
                            -
                            200 Node.getActiveShaderRefs = _getActiveShaderRefs
                            -
                            201 
                            -
                            202 
                            -
                            203 #
                            -
                            204 # PropertySet
                            -
                            205 #
                            -
                            206 
                            -
                            207 def _setPropertyValue(self, name, value, typeString = ''):
                            -
                            208  """Set the typed value of a property by its name, creating a child element
                            -
                            209  to hold the property if needed."""
                            -
                            210  method = getattr(self.__class__, "_setPropertyValue" + getTypeString(value))
                            -
                            211  return method(self, name, value, typeString)
                            -
                            212 
                            -
                            213 def _getPropertyValue(self, name, target = ''):
                            -
                            214  """Return the typed value of a property by its name. If the given property
                            -
                            215  is not found, then None is returned."""
                            -
                            216  value = self._getPropertyValue(name)
                            -
                            217  return value.getData() if value else None
                            -
                            218 
                            -
                            219 PropertySet.setPropertyValue = _setPropertyValue
                            -
                            220 PropertySet.getPropertyValue = _getPropertyValue
                            -
                            221 
                            -
                            222 
                            -
                            223 #
                            -
                            224 # GeomInfo
                            -
                            225 #
                            -
                            226 
                            -
                            227 def _setGeomPropValue(self, name, value, typeString = ''):
                            -
                            228  """Set the value of a geomprop by its name, creating a child element
                            -
                            229  to hold the geomprop if needed."""
                            -
                            230  method = getattr(self.__class__, "_setGeomPropValue" + getTypeString(value))
                            -
                            231  return method(self, name, value, typeString)
                            -
                            232 
                            -
                            233 def _addGeomAttr(self, name):
                            -
                            234  "(Deprecated) Add a geomprop to this element."
                            -
                            235  warnings.warn("This function is deprecated; call GeomInfo.addGeomProp() instead", DeprecationWarning, stacklevel = 2)
                            -
                            236  return self.addGeomProp(name)
                            -
                            237 
                            -
                            238 def _setGeomAttrValue(self, name, value, typeString = ''):
                            -
                            239  "(Deprecated) Set the value of a geomattr by its name."
                            -
                            240  warnings.warn("This function is deprecated; call GeomInfo.setGeomPropValue() instead", DeprecationWarning, stacklevel = 2)
                            -
                            241  return self.setGeomPropValue(name, value, typeString)
                            -
                            242 
                            -
                            243 GeomInfo.setGeomPropValue = _setGeomPropValue
                            -
                            244 GeomInfo.addGeomAttr = _addGeomAttr
                            -
                            245 GeomInfo.setGeomAttrValue = _setGeomAttrValue
                            -
                            246 
                            -
                            247 
                            -
                            248 #
                            -
                            249 # Document
                            -
                            250 #
                            -
                            251 
                            -
                            252 def _addMaterial(self, name):
                            -
                            253  """(Deprecated) Add a material element to the document."""
                            -
                            254  warnings.warn("This function is deprecated; call Document.addMaterialNode() instead.", DeprecationWarning, stacklevel = 2)
                            -
                            255  return self.addMaterialNode(name)
                            -
                            256 
                            -
                            257 def _getMaterials(self):
                            -
                            258  """(Deprecated) Return a vector of all materials in the document."""
                            -
                            259  warnings.warn("This function is deprecated; call Document.getMaterialNodes() instead.", DeprecationWarning, stacklevel = 2)
                            -
                            260  return self.getMaterialNodes()
                            -
                            261 
                            -
                            262 Document.addMaterial = _addMaterial
                            -
                            263 Document.getMaterials = _getMaterials
                            -
                            264 
                            -
                            265 
                            -
                            266 #
                            -
                            267 # Value
                            -
                            268 #
                            -
                            269 
                            -
                            270 def _typeToName(t):
                            -
                            271  "(Deprecated) Return the MaterialX type string associated with the given Python type."
                            -
                            272  warnings.warn("This function is deprecated; call MaterialX.getTypeString instead.", DeprecationWarning, stacklevel = 2)
                            -
                            273  return getTypeString(t())
                            -
                            274 
                            -
                            275 def _valueToString(value):
                            -
                            276  "(Deprecated) Convert a Python value to its correponding MaterialX value string."
                            -
                            277  warnings.warn("This function is deprecated; call MaterialX.getValueString instead.", DeprecationWarning, stacklevel = 2)
                            -
                            278  return getValueString(value)
                            -
                            279 
                            -
                            280 def _stringToValue(string, t):
                            -
                            281  "(Deprecated) Convert a MaterialX value string and Python type to the corresponding Python value."
                            -
                            282  warnings.warn("This function is deprecated; call MaterialX.createValueFromStrings instead.", DeprecationWarning, stacklevel = 2)
                            -
                            283  return createValueFromStrings(string, getTypeString(t()))
                            -
                            284 
                            -
                            285 typeToName = _typeToName
                            -
                            286 valueToString = _valueToString
                            -
                            287 stringToValue = _stringToValue
                            -
                            288 
                            -
                            289 
                            -
                            290 #
                            -
                            291 # XmlIo
                            -
                            292 #
                            -
                            293 
                            -
                            294 readFromXmlFile = readFromXmlFileBase
                            -
                            def createValueFromStrings(valueString, typeString)
                            Definition: datatype.py:67
                            -
                            def getValueString(value)
                            Definition: datatype.py:52
                            -
                            def getTypeString(value)
                            Definition: datatype.py:32
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/menu.js b/pymaterialx/python/docs/html/menu.js deleted file mode 100644 index 1839243c..00000000 --- a/pymaterialx/python/docs/html/menu.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - - The MIT License (MIT) - - Copyright (C) 1997-2020 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice for the JavaScript code in this file - */ -function initMenu(relPath,searchEnabled,serverSide,searchPage,search) { - function makeTree(data,relPath) { - var result=''; - if ('children' in data) { - result+=''; - } - return result; - } - - $('#main-nav').append(makeTree(menudata,relPath)); - $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); - if (searchEnabled) { - if (serverSide) { - $('#main-menu').append('
                          • '); - } else { - $('#main-menu').append('
                          • '); - } - } - $('#main-menu').smartmenus(); -} -/* @license-end */ diff --git a/pymaterialx/python/docs/html/menudata.js b/pymaterialx/python/docs/html/menudata.js deleted file mode 100644 index 3351ded5..00000000 --- a/pymaterialx/python/docs/html/menudata.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - - The MIT License (MIT) - - Copyright (C) 1997-2020 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice for the JavaScript code in this file -*/ -var menudata={children:[ -{text:"Main Page",url:"index.html"}, -{text:"Packages",url:"namespaces.html",children:[ -{text:"Packages",url:"namespaces.html"}, -{text:"Package Functions",url:"namespacemembers.html",children:[ -{text:"All",url:"namespacemembers.html"}, -{text:"Functions",url:"namespacemembers_func.html"}, -{text:"Variables",url:"namespacemembers_vars.html"}]}]}, -{text:"Files",url:"files.html",children:[ -{text:"File List",url:"files.html"}]}]} diff --git a/pymaterialx/python/docs/html/namespace_material_x.html b/pymaterialx/python/docs/html/namespace_material_x.html deleted file mode 100644 index f93ee4e2..00000000 --- a/pymaterialx/python/docs/html/namespace_material_x.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - -My Project: MaterialX Namespace Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            - -
                            -
                            MaterialX Namespace Reference
                            -
                            -
                            - - - - - - - - -

                            -Namespaces

                             colorspace
                             
                             datatype
                             
                             main
                             
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/namespace_material_x.js b/pymaterialx/python/docs/html/namespace_material_x.js deleted file mode 100644 index d64b2671..00000000 --- a/pymaterialx/python/docs/html/namespace_material_x.js +++ /dev/null @@ -1,62 +0,0 @@ -var namespace_material_x = -[ - [ "colorspace", "namespace_material_x_1_1colorspace.html", [ - [ "getColorSpaces", "namespace_material_x_1_1colorspace.html#a2f71fb38cdc8e19b41817ce0ebcdcfb5", null ], - [ "getDefaultOCIOConfig", "namespace_material_x_1_1colorspace.html#adede7502ee5324d77c722a3428e61f9c", null ], - [ "transformColor", "namespace_material_x_1_1colorspace.html#adcc451cff99e05ef4832c09b86e8f330", null ], - [ "_defaultConfig", "namespace_material_x_1_1colorspace.html#ae9885342a4f992637c914dc868bd42cb", null ], - [ "_defaultConfigFilename", "namespace_material_x_1_1colorspace.html#a2602696aadf292640f20a93e8d8dbbca", null ], - [ "_validateDefaultConfig", "namespace_material_x_1_1colorspace.html#a63e35f993dbd1d88fd8f2889c58c5bd5", null ] - ] ], - [ "datatype", "namespace_material_x_1_1datatype.html", [ - [ "createValueFromStrings", "namespace_material_x_1_1datatype.html#a61e5cf2e5bd0aa11262576fee4dc1124", null ], - [ "getTypeString", "namespace_material_x_1_1datatype.html#afd52a73efed31accf704e3741a20247f", null ], - [ "getValueString", "namespace_material_x_1_1datatype.html#a9ecfbde2c3f1946b0e179c2d28781f2d", null ], - [ "isColorType", "namespace_material_x_1_1datatype.html#aecac78e6375a3c7b43682c17c4d24e2a", null ], - [ "isColorValue", "namespace_material_x_1_1datatype.html#a05458697ccc3f9b626fcf5838d97ce03", null ], - [ "_typeToName", "namespace_material_x_1_1datatype.html#ab945793feeda80a3935dafae9017a4dd", null ] - ] ], - [ "main", "namespace_material_x_1_1main.html", [ - [ "_addBindInput", "namespace_material_x_1_1main.html#ac103da94b3406fba5996d14400051b53", null ], - [ "_addBindParam", "namespace_material_x_1_1main.html#a0bec7b2027129de6e435eb01b74dd61e", null ], - [ "_addChild", "namespace_material_x_1_1main.html#a6c811df86f3ab1cd08cc162a59c6a0b9", null ], - [ "_addGeomAttr", "namespace_material_x_1_1main.html#aeb0884486118155075a8afecc3eb0b95", null ], - [ "_addMaterial", "namespace_material_x_1_1main.html#ab951dfc4fd0e4b7b6982a8ee8976776a", null ], - [ "_addParameter", "namespace_material_x_1_1main.html#a636b36ce20338fe70c24ea496010a470", null ], - [ "_addShaderRef", "namespace_material_x_1_1main.html#a3aa609669ac79a0b1343767d266e02ca", null ], - [ "_getActiveParameters", "namespace_material_x_1_1main.html#ab8cb2e2648457d04b53724e208904de8", null ], - [ "_getActiveShaderRefs", "namespace_material_x_1_1main.html#a6092a6cb111bf1b96faa76ae0faf59ff", null ], - [ "_getBindInputs", "namespace_material_x_1_1main.html#a5eba039690816b04c54d9321a29cef77", null ], - [ "_getBindParams", "namespace_material_x_1_1main.html#a2529dcb5718c2c496f5cea5509e2e617", null ], - [ "_getBindTokens", "namespace_material_x_1_1main.html#aa028123d097edf17abd127d96776e387", null ], - [ "_getChild", "namespace_material_x_1_1main.html#acd3a31339fb64e12ed16bd7177118b4d", null ], - [ "_getChildOfType", "namespace_material_x_1_1main.html#a1bc006b783ce291000d5273a44acfd75", null ], - [ "_getChildrenOfType", "namespace_material_x_1_1main.html#a048d2193eb002ca33d3809c99f503136", null ], - [ "_getDefaultValue", "namespace_material_x_1_1main.html#a615cafcfb99b3dd4a20226fc240d4a6a", null ], - [ "_getInputValue", "namespace_material_x_1_1main.html#a148a7df6ecfa4b437e5b8848d67d0c0e", null ], - [ "_getMaterials", "namespace_material_x_1_1main.html#a08b74b228ab4ca2babd3291f10074d84", null ], - [ "_getParameters", "namespace_material_x_1_1main.html#aff064ae3f4f379a545702786eaa23bbf", null ], - [ "_getParameterValue", "namespace_material_x_1_1main.html#aba5b47b649cafc05741a214c4446d9af", null ], - [ "_getParameterValueString", "namespace_material_x_1_1main.html#a367830a25906dbf37da986ee60d57d05", null ], - [ "_getPropertyValue", "namespace_material_x_1_1main.html#a3826c25ad041ab5d73ec86def2e6e0ad", null ], - [ "_getReferencedNodeDef", "namespace_material_x_1_1main.html#a918ef70f2260e4907534993c05e40b94", null ], - [ "_getShaderRefs", "namespace_material_x_1_1main.html#ae3699001af4ddaaa44933afe5f5a51a6", null ], - [ "_getValue", "namespace_material_x_1_1main.html#adb4487caaff0293ee8b5d493290b255f", null ], - [ "_isA", "namespace_material_x_1_1main.html#a1ee9a49705c0497caaf314099a0b8730", null ], - [ "_removeChildOfType", "namespace_material_x_1_1main.html#a0b77b871d0f5b039d1982145f109b300", null ], - [ "_setGeomAttrValue", "namespace_material_x_1_1main.html#ae219cd55ef2255245523d5cfe5288d72", null ], - [ "_setGeomPropValue", "namespace_material_x_1_1main.html#a62f8a8f3cb57c84a4e5682b413112007", null ], - [ "_setInputValue", "namespace_material_x_1_1main.html#ac7ed072446b692d44397eb8e8f74043b", null ], - [ "_setParameterValue", "namespace_material_x_1_1main.html#a19e10745b388a99585cf71ae86ec12f0", null ], - [ "_setPropertyValue", "namespace_material_x_1_1main.html#a96f210ac5a15b5971244dcb308c7f590", null ], - [ "_setValue", "namespace_material_x_1_1main.html#a8231cd1385d22d0deb69d8395e459427", null ], - [ "_stringToValue", "namespace_material_x_1_1main.html#a9d4259bb892c61ecf2ad9cf1e7abc0f4", null ], - [ "_typeToName", "namespace_material_x_1_1main.html#a97adda143354215bfae8471cd6591276", null ], - [ "_valueToString", "namespace_material_x_1_1main.html#a80f6cb590736c103e6e812dc2856fc29", null ], - [ "readFromXmlFile", "namespace_material_x_1_1main.html#a6a5f6ea0c68c5ad65ca394d8a03b70a2", null ], - [ "stringToValue", "namespace_material_x_1_1main.html#a346e741dda2260842f721c65cd57773b", null ], - [ "typeToName", "namespace_material_x_1_1main.html#a79331c2433656921d4c9c993a63a266c", null ], - [ "valueToString", "namespace_material_x_1_1main.html#adb290066e496754c807e8c4ed87c5113", null ] - ] ], - [ "__version__", "namespace_material_x.html#a9b9f98a703b0cc5a41e3db10fec2321f", null ] -]; \ No newline at end of file diff --git a/pymaterialx/python/docs/html/namespace_material_x_1_1colorspace.html b/pymaterialx/python/docs/html/namespace_material_x_1_1colorspace.html deleted file mode 100644 index 2ab388a9..00000000 --- a/pymaterialx/python/docs/html/namespace_material_x_1_1colorspace.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - -My Project: MaterialX.colorspace Namespace Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            - -
                            -
                            MaterialX.colorspace Namespace Reference
                            -
                            -
                            - - - - - - - - -

                            -Functions

                            def getColorSpaces (cms='ocio', config=None)
                             
                            def transformColor (color, sourceColorSpace, destColorSpace, cms='ocio', config=None)
                             
                            def getDefaultOCIOConfig ()
                             
                            -

                            Detailed Description

                            -
                            Native Python wrappers for PyMaterialX and PyOpenColorIO, providing helper
                            -functions for transforming MaterialX colors between OpenColorIO color spaces.
                            -
                            -By default, the OpenColorIO configuration packaged with MaterialX Python will
                            -be used, but clients may instead pass their own custom configurations to these
                            -methods.
                            -

                            Function Documentation

                            - -

                            ◆ getColorSpaces()

                            - -
                            -
                            - - - - - - - - - - - - - - - - - - -
                            def MaterialX.colorspace.getColorSpaces ( cms = 'ocio',
                             config = None 
                            )
                            -
                            -
                            Return a list containing the names of all supported color spaces.
                            -   By default, the OCIO color management system and default MaterialX
                            -   config are used.
                            -

                            Definition at line 23 of file colorspace.py.

                            - -
                            -
                            - -

                            ◆ getDefaultOCIOConfig()

                            - -
                            -
                            - - - - - - - -
                            def MaterialX.colorspace.getDefaultOCIOConfig ()
                            -
                            -
                            Return the default OCIO config packaged with this Python library.
                            -   Raises ImportError if the PyOpenColorIO module cannot be imported.
                            -

                            Definition at line 55 of file colorspace.py.

                            - -
                            -
                            - -

                            ◆ transformColor()

                            - -
                            -
                            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                            def MaterialX.colorspace.transformColor ( color,
                             sourceColorSpace,
                             destColorSpace,
                             cms = 'ocio',
                             config = None 
                            )
                            -
                            -
                            Given a MaterialX color and the names of two supported color spaces,
                            -   transform the color from the source to the destination color space.
                            -   By default, the OCIO color management system and default MaterialX
                            -   config are used.
                            -

                            Definition at line 35 of file colorspace.py.

                            - -
                            -
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/namespace_material_x_1_1datatype.html b/pymaterialx/python/docs/html/namespace_material_x_1_1datatype.html deleted file mode 100644 index cd5dd685..00000000 --- a/pymaterialx/python/docs/html/namespace_material_x_1_1datatype.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - -My Project: MaterialX.datatype Namespace Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            - -
                            -
                            MaterialX.datatype Namespace Reference
                            -
                            -
                            - - - - - - - - - - - - -

                            -Functions

                            def getTypeString (value)
                             
                            def getValueString (value)
                             
                            def createValueFromStrings (valueString, typeString)
                             
                            def isColorType (t)
                             
                            def isColorValue (value)
                             
                            -

                            Detailed Description

                            -
                            Native Python helper functions for MaterialX data types.
                            -

                            Function Documentation

                            - -

                            ◆ createValueFromStrings()

                            - -
                            -
                            - - - - - - - - - - - - - - - - - - -
                            def MaterialX.datatype.createValueFromStrings ( valueString,
                             typeString 
                            )
                            -
                            -
                            Convert a MaterialX value and type strings to the corresponding
                            -   Python value.  If the given conversion cannot be performed, then None
                            -   is returned.
                            -
                            -   Examples:
                            -       createValueFromStrings('0.1', 'float') -> 0.1
                            -       createValueFromStrings('0.1, 0.2, 0.3', 'color3') -> mx.Color3(0.1, 0.2, 0.3)
                            -

                            Definition at line 67 of file datatype.py.

                            - -
                            -
                            - -

                            ◆ getTypeString()

                            - -
                            -
                            - - - - - - - - -
                            def MaterialX.datatype.getTypeString ( value)
                            -
                            -
                            Return the MaterialX type string associated with the given Python value
                            -   If the type of the given Python value is not recognized by MaterialX,
                            -   then None is returned.
                            -
                            -   Examples:
                            -       getTypeString(1.0) -> 'float'
                            -       getTypeString(mx.Color3(1)) -> 'color3'
                            -

                            Definition at line 32 of file datatype.py.

                            - -
                            -
                            - -

                            ◆ getValueString()

                            - -
                            -
                            - - - - - - - - -
                            def MaterialX.datatype.getValueString ( value)
                            -
                            -
                            Return the MaterialX value string associated with the given Python value
                            -   If the type of the given Python value is not recognized by MaterialX,
                            -   then None is returned
                            -
                            -   Examples:
                            -       getValueString(0.1) -> '0.1'
                            -       getValueString(mx.Color3(0.1, 0.2, 0.3)) -> '0.1, 0.2, 0.3'
                            -

                            Definition at line 52 of file datatype.py.

                            - -
                            -
                            - -

                            ◆ isColorType()

                            - -
                            -
                            - - - - - - - - -
                            def MaterialX.datatype.isColorType ( t)
                            -
                            - -

                            Definition at line 82 of file datatype.py.

                            - -
                            -
                            - -

                            ◆ isColorValue()

                            - -
                            -
                            - - - - - - - - -
                            def MaterialX.datatype.isColorValue ( value)
                            -
                            - -

                            Definition at line 86 of file datatype.py.

                            - -
                            -
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/namespace_material_x_1_1main.html b/pymaterialx/python/docs/html/namespace_material_x_1_1main.html deleted file mode 100644 index 8e153215..00000000 --- a/pymaterialx/python/docs/html/namespace_material_x_1_1main.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - -My Project: MaterialX.main Namespace Reference - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            - -
                            -
                            MaterialX.main Namespace Reference
                            -
                            -
                            - - - - - - - - - - -

                            -Variables

                            def typeToName = _typeToName
                             
                            def valueToString = _valueToString
                             
                            def stringToValue = _stringToValue
                             
                             readFromXmlFile = readFromXmlFileBase
                             
                            -

                            Detailed Description

                            -
                            Native Python wrappers for PyMaterialX, providing a more Pythonic interface
                            -for Elements and Values.
                            -

                            Variable Documentation

                            - -

                            ◆ readFromXmlFile

                            - -
                            -
                            - - - - -
                            MaterialX.main.readFromXmlFile = readFromXmlFileBase
                            -
                            - -

                            Definition at line 294 of file main.py.

                            - -
                            -
                            - -

                            ◆ stringToValue

                            - -
                            -
                            - - - - -
                            def MaterialX.main.stringToValue = _stringToValue
                            -
                            - -

                            Definition at line 287 of file main.py.

                            - -
                            -
                            - -

                            ◆ typeToName

                            - -
                            -
                            - - - - -
                            def MaterialX.main.typeToName = _typeToName
                            -
                            - -

                            Definition at line 285 of file main.py.

                            - -
                            -
                            - -

                            ◆ valueToString

                            - -
                            -
                            - - - - -
                            def MaterialX.main.valueToString = _valueToString
                            -
                            - -

                            Definition at line 286 of file main.py.

                            - -
                            -
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/namespacemembers.html b/pymaterialx/python/docs/html/namespacemembers.html deleted file mode 100644 index af7a1b4f..00000000 --- a/pymaterialx/python/docs/html/namespacemembers.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - -My Project: Package Functions - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            Here is a list of all namespace members with links to the namespace documentation for each member:
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/namespacemembers_func.html b/pymaterialx/python/docs/html/namespacemembers_func.html deleted file mode 100644 index 70861fb4..00000000 --- a/pymaterialx/python/docs/html/namespacemembers_func.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - -My Project: Package Functions - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/namespacemembers_vars.html b/pymaterialx/python/docs/html/namespacemembers_vars.html deleted file mode 100644 index e6a251c8..00000000 --- a/pymaterialx/python/docs/html/namespacemembers_vars.html +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - -My Project: Package Functions - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/namespaces.html b/pymaterialx/python/docs/html/namespaces.html deleted file mode 100644 index 86210afb..00000000 --- a/pymaterialx/python/docs/html/namespaces.html +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - -My Project: Packages - - - - - - - - - - - - - -
                            -
                            - - - - - - -
                            -
                            My Project -
                            -
                            -
                            - - - - - - - -
                            -
                            - -
                            -
                            -
                            - -
                            - -
                            -
                            - - -
                            - -
                            - -
                            -
                            -
                            Packages
                            -
                            -
                            -
                            Here are the packages with brief descriptions (if available):
                            -
                            [detail level 12]
                            - - - - -
                             NMaterialX
                             Ncolorspace
                             Ndatatype
                             Nmain
                            -
                            -
                            -
                            - - - - diff --git a/pymaterialx/python/docs/html/namespaces_dup.js b/pymaterialx/python/docs/html/namespaces_dup.js deleted file mode 100644 index a403ce7e..00000000 --- a/pymaterialx/python/docs/html/namespaces_dup.js +++ /dev/null @@ -1,4 +0,0 @@ -var namespaces_dup = -[ - [ "MaterialX", "namespace_material_x.html", "namespace_material_x" ] -]; \ No newline at end of file diff --git a/pymaterialx/python/docs/html/nav_f.png b/pymaterialx/python/docs/html/nav_f.png deleted file mode 100644 index 72a58a52..00000000 Binary files a/pymaterialx/python/docs/html/nav_f.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/nav_g.png b/pymaterialx/python/docs/html/nav_g.png deleted file mode 100644 index 2093a237..00000000 Binary files a/pymaterialx/python/docs/html/nav_g.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/nav_h.png b/pymaterialx/python/docs/html/nav_h.png deleted file mode 100644 index 33389b10..00000000 Binary files a/pymaterialx/python/docs/html/nav_h.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/navtree.css b/pymaterialx/python/docs/html/navtree.css deleted file mode 100644 index 33341a67..00000000 --- a/pymaterialx/python/docs/html/navtree.css +++ /dev/null @@ -1,146 +0,0 @@ -#nav-tree .children_ul { - margin:0; - padding:4px; -} - -#nav-tree ul { - list-style:none outside none; - margin:0px; - padding:0px; -} - -#nav-tree li { - white-space:nowrap; - margin:0px; - padding:0px; -} - -#nav-tree .plus { - margin:0px; -} - -#nav-tree .selected { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: #fff; - text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); -} - -#nav-tree img { - margin:0px; - padding:0px; - border:0px; - vertical-align: middle; -} - -#nav-tree a { - text-decoration:none; - padding:0px; - margin:0px; - outline:none; -} - -#nav-tree .label { - margin:0px; - padding:0px; - font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; -} - -#nav-tree .label a { - padding:2px; -} - -#nav-tree .selected a { - text-decoration:none; - color:#fff; -} - -#nav-tree .children_ul { - margin:0px; - padding:0px; -} - -#nav-tree .item { - margin:0px; - padding:0px; -} - -#nav-tree { - padding: 0px 0px; - background-color: #FAFAFF; - font-size:14px; - overflow:auto; -} - -#doc-content { - overflow:auto; - display:block; - padding:0px; - margin:0px; - -webkit-overflow-scrolling : touch; /* iOS 5+ */ -} - -#side-nav { - padding:0 6px 0 0; - margin: 0px; - display:block; - position: absolute; - left: 0px; - width: 250px; -} - -.ui-resizable .ui-resizable-handle { - display:block; -} - -.ui-resizable-e { - background-image:url("splitbar.png"); - background-size:100%; - background-repeat:repeat-y; - background-attachment: scroll; - cursor:ew-resize; - height:100%; - right:0; - top:0; - width:6px; -} - -.ui-resizable-handle { - display:none; - font-size:0.1px; - position:absolute; - z-index:1; -} - -#nav-tree-contents { - margin: 6px 0px 0px 0px; -} - -#nav-tree { - background-image:url('nav_h.png'); - background-repeat:repeat-x; - background-color: #F9FAFC; - -webkit-overflow-scrolling : touch; /* iOS 5+ */ -} - -#nav-sync { - position:absolute; - top:5px; - right:24px; - z-index:0; -} - -#nav-sync img { - opacity:0.3; -} - -#nav-sync img:hover { - opacity:0.9; -} - -@media print -{ - #nav-tree { display: none; } - div.ui-resizable-handle { display: none; position: relative; } -} - diff --git a/pymaterialx/python/docs/html/navtree.js b/pymaterialx/python/docs/html/navtree.js deleted file mode 100644 index 3308a3f8..00000000 --- a/pymaterialx/python/docs/html/navtree.js +++ /dev/null @@ -1,546 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - - The MIT License (MIT) - - Copyright (C) 1997-2020 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice for the JavaScript code in this file - */ -var navTreeSubIndices = new Array(); -var arrowDown = '▼'; -var arrowRight = '►'; - -function getData(varName) -{ - var i = varName.lastIndexOf('/'); - var n = i>=0 ? varName.substring(i+1) : varName; - return eval(n.replace(/\-/g,'_')); -} - -function stripPath(uri) -{ - return uri.substring(uri.lastIndexOf('/')+1); -} - -function stripPath2(uri) -{ - var i = uri.lastIndexOf('/'); - var s = uri.substring(i+1); - var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); - return m ? uri.substring(i-6) : s; -} - -function hashValue() -{ - return $(location).attr('hash').substring(1).replace(/[^\w\-]/g,''); -} - -function hashUrl() -{ - return '#'+hashValue(); -} - -function pathName() -{ - return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;\(\)]/g, ''); -} - -function localStorageSupported() -{ - try { - return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; - } - catch(e) { - return false; - } -} - -function storeLink(link) -{ - if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { - window.localStorage.setItem('navpath',link); - } -} - -function deleteLink() -{ - if (localStorageSupported()) { - window.localStorage.setItem('navpath',''); - } -} - -function cachedLink() -{ - if (localStorageSupported()) { - return window.localStorage.getItem('navpath'); - } else { - return ''; - } -} - -function getScript(scriptName,func,show) -{ - var head = document.getElementsByTagName("head")[0]; - var script = document.createElement('script'); - script.id = scriptName; - script.type = 'text/javascript'; - script.onload = func; - script.src = scriptName+'.js'; - head.appendChild(script); -} - -function createIndent(o,domNode,node,level) -{ - var level=-1; - var n = node; - while (n.parentNode) { level++; n=n.parentNode; } - if (node.childrenData) { - var imgNode = document.createElement("span"); - imgNode.className = 'arrow'; - imgNode.style.paddingLeft=(16*level).toString()+'px'; - imgNode.innerHTML=arrowRight; - node.plus_img = imgNode; - node.expandToggle = document.createElement("a"); - node.expandToggle.href = "javascript:void(0)"; - node.expandToggle.onclick = function() { - if (node.expanded) { - $(node.getChildrenUL()).slideUp("fast"); - node.plus_img.innerHTML=arrowRight; - node.expanded = false; - } else { - expandNode(o, node, false, false); - } - } - node.expandToggle.appendChild(imgNode); - domNode.appendChild(node.expandToggle); - } else { - var span = document.createElement("span"); - span.className = 'arrow'; - span.style.width = 16*(level+1)+'px'; - span.innerHTML = ' '; - domNode.appendChild(span); - } -} - -var animationInProgress = false; - -function gotoAnchor(anchor,aname,updateLocation) -{ - var pos, docContent = $('#doc-content'); - var ancParent = $(anchor.parent()); - if (ancParent.hasClass('memItemLeft') || - ancParent.hasClass('memtitle') || - ancParent.hasClass('fieldname') || - ancParent.hasClass('fieldtype') || - ancParent.is(':header')) - { - pos = ancParent.position().top; - } else if (anchor.position()) { - pos = anchor.position().top; - } - if (pos) { - var dist = Math.abs(Math.min( - pos-docContent.offset().top, - docContent[0].scrollHeight- - docContent.height()-docContent.scrollTop())); - animationInProgress=true; - docContent.animate({ - scrollTop: pos + docContent.scrollTop() - docContent.offset().top - },Math.max(50,Math.min(500,dist)),function(){ - if (updateLocation) window.location.href=aname; - animationInProgress=false; - }); - } -} - -function newNode(o, po, text, link, childrenData, lastNode) -{ - var node = new Object(); - node.children = Array(); - node.childrenData = childrenData; - node.depth = po.depth + 1; - node.relpath = po.relpath; - node.isLast = lastNode; - - node.li = document.createElement("li"); - po.getChildrenUL().appendChild(node.li); - node.parentNode = po; - - node.itemDiv = document.createElement("div"); - node.itemDiv.className = "item"; - - node.labelSpan = document.createElement("span"); - node.labelSpan.className = "label"; - - createIndent(o,node.itemDiv,node,0); - node.itemDiv.appendChild(node.labelSpan); - node.li.appendChild(node.itemDiv); - - var a = document.createElement("a"); - node.labelSpan.appendChild(a); - node.label = document.createTextNode(text); - node.expanded = false; - a.appendChild(node.label); - if (link) { - var url; - if (link.substring(0,1)=='^') { - url = link.substring(1); - link = url; - } else { - url = node.relpath+link; - } - a.className = stripPath(link.replace('#',':')); - if (link.indexOf('#')!=-1) { - var aname = '#'+link.split('#')[1]; - var srcPage = stripPath(pathName()); - var targetPage = stripPath(link.split('#')[0]); - a.href = srcPage!=targetPage ? url : "javascript:void(0)"; - a.onclick = function(){ - storeLink(link); - if (!$(a).parent().parent().hasClass('selected')) - { - $('.item').removeClass('selected'); - $('.item').removeAttr('id'); - $(a).parent().parent().addClass('selected'); - $(a).parent().parent().attr('id','selected'); - } - var anchor = $(aname); - gotoAnchor(anchor,aname,true); - }; - } else { - a.href = url; - a.onclick = function() { storeLink(link); } - } - } else { - if (childrenData != null) - { - a.className = "nolink"; - a.href = "javascript:void(0)"; - a.onclick = node.expandToggle.onclick; - } - } - - node.childrenUL = null; - node.getChildrenUL = function() { - if (!node.childrenUL) { - node.childrenUL = document.createElement("ul"); - node.childrenUL.className = "children_ul"; - node.childrenUL.style.display = "none"; - node.li.appendChild(node.childrenUL); - } - return node.childrenUL; - }; - - return node; -} - -function showRoot() -{ - var headerHeight = $("#top").height(); - var footerHeight = $("#nav-path").height(); - var windowHeight = $(window).height() - headerHeight - footerHeight; - (function (){ // retry until we can scroll to the selected item - try { - var navtree=$('#nav-tree'); - navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); - } catch (err) { - setTimeout(arguments.callee, 0); - } - })(); -} - -function expandNode(o, node, imm, showRoot) -{ - if (node.childrenData && !node.expanded) { - if (typeof(node.childrenData)==='string') { - var varName = node.childrenData; - getScript(node.relpath+varName,function(){ - node.childrenData = getData(varName); - expandNode(o, node, imm, showRoot); - }, showRoot); - } else { - if (!node.childrenVisited) { - getNode(o, node); - } - $(node.getChildrenUL()).slideDown("fast"); - node.plus_img.innerHTML = arrowDown; - node.expanded = true; - } - } -} - -function glowEffect(n,duration) -{ - n.addClass('glow').delay(duration).queue(function(next){ - $(this).removeClass('glow');next(); - }); -} - -function highlightAnchor() -{ - var aname = hashUrl(); - var anchor = $(aname); - if (anchor.parent().attr('class')=='memItemLeft'){ - var rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); - glowEffect(rows.children(),300); // member without details - } else if (anchor.parent().attr('class')=='fieldname'){ - glowEffect(anchor.parent().parent(),1000); // enum value - } else if (anchor.parent().attr('class')=='fieldtype'){ - glowEffect(anchor.parent().parent(),1000); // struct field - } else if (anchor.parent().is(":header")) { - glowEffect(anchor.parent(),1000); // section header - } else { - glowEffect(anchor.next(),1000); // normal member - } -} - -function selectAndHighlight(hash,n) -{ - var a; - if (hash) { - var link=stripPath(pathName())+':'+hash.substring(1); - a=$('.item a[class$="'+link+'"]'); - } - if (a && a.length) { - a.parent().parent().addClass('selected'); - a.parent().parent().attr('id','selected'); - highlightAnchor(); - } else if (n) { - $(n.itemDiv).addClass('selected'); - $(n.itemDiv).attr('id','selected'); - } - if ($('#nav-tree-contents .item:first').hasClass('selected')) { - $('#nav-sync').css('top','30px'); - } else { - $('#nav-sync').css('top','5px'); - } - showRoot(); -} - -function showNode(o, node, index, hash) -{ - if (node && node.childrenData) { - if (typeof(node.childrenData)==='string') { - var varName = node.childrenData; - getScript(node.relpath+varName,function(){ - node.childrenData = getData(varName); - showNode(o,node,index,hash); - },true); - } else { - if (!node.childrenVisited) { - getNode(o, node); - } - $(node.getChildrenUL()).css({'display':'block'}); - node.plus_img.innerHTML = arrowDown; - node.expanded = true; - var n = node.children[o.breadcrumbs[index]]; - if (index+11) hash = '#'+parts[1].replace(/[^\w\-]/g,''); - else hash=''; - } - if (hash.match(/^#l\d+$/)) { - var anchor=$('a[name='+hash.substring(1)+']'); - glowEffect(anchor.parent(),1000); // line number - hash=''; // strip line number anchors - } - var url=root+hash; - var i=-1; - while (NAVTREEINDEX[i+1]<=url) i++; - if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index - if (navTreeSubIndices[i]) { - gotoNode(o,i,root,hash,relpath) - } else { - getScript(relpath+'navtreeindex'+i,function(){ - navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); - if (navTreeSubIndices[i]) { - gotoNode(o,i,root,hash,relpath); - } - },true); - } -} - -function showSyncOff(n,relpath) -{ - n.html(''); -} - -function showSyncOn(n,relpath) -{ - n.html(''); -} - -function toggleSyncButton(relpath) -{ - var navSync = $('#nav-sync'); - if (navSync.hasClass('sync')) { - navSync.removeClass('sync'); - showSyncOff(navSync,relpath); - storeLink(stripPath2(pathName())+hashUrl()); - } else { - navSync.addClass('sync'); - showSyncOn(navSync,relpath); - deleteLink(); - } -} - -var loadTriggered = false; -var readyTriggered = false; -var loadObject,loadToRoot,loadUrl,loadRelPath; - -$(window).on('load',function(){ - if (readyTriggered) { // ready first - navTo(loadObject,loadToRoot,loadUrl,loadRelPath); - showRoot(); - } - loadTriggered=true; -}); - -function initNavTree(toroot,relpath) -{ - var o = new Object(); - o.toroot = toroot; - o.node = new Object(); - o.node.li = document.getElementById("nav-tree-contents"); - o.node.childrenData = NAVTREE; - o.node.children = new Array(); - o.node.childrenUL = document.createElement("ul"); - o.node.getChildrenUL = function() { return o.node.childrenUL; }; - o.node.li.appendChild(o.node.childrenUL); - o.node.depth = 0; - o.node.relpath = relpath; - o.node.expanded = false; - o.node.isLast = true; - o.node.plus_img = document.createElement("span"); - o.node.plus_img.className = 'arrow'; - o.node.plus_img.innerHTML = arrowRight; - - if (localStorageSupported()) { - var navSync = $('#nav-sync'); - if (cachedLink()) { - showSyncOff(navSync,relpath); - navSync.removeClass('sync'); - } else { - showSyncOn(navSync,relpath); - } - navSync.click(function(){ toggleSyncButton(relpath); }); - } - - if (loadTriggered) { // load before ready - navTo(o,toroot,hashUrl(),relpath); - showRoot(); - } else { // ready before load - loadObject = o; - loadToRoot = toroot; - loadUrl = hashUrl(); - loadRelPath = relpath; - readyTriggered=true; - } - - $(window).bind('hashchange', function(){ - if (window.location.hash && window.location.hash.length>1){ - var a; - if ($(location).attr('hash')){ - var clslink=stripPath(pathName())+':'+hashValue(); - a=$('.item a[class$="'+clslink.replace(/=desktop_vp) { - if (!collapsed) { - collapseExpand(); - } - } else if (width>desktop_vp && collapsedWidth0) { - restoreWidth(0); - collapsed=true; - } - else { - var width = readCookie('width'); - if (width>200 && width<$(window).width()) { restoreWidth(width); } else { restoreWidth(200); } - collapsed=false; - } - } - - header = $("#top"); - sidenav = $("#side-nav"); - content = $("#doc-content"); - navtree = $("#nav-tree"); - footer = $("#nav-path"); - $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); - $(sidenav).resizable({ minWidth: 0 }); - $(window).resize(function() { resizeHeight(); }); - var device = navigator.userAgent.toLowerCase(); - var touch_device = device.match(/(iphone|ipod|ipad|android)/); - if (touch_device) { /* wider split bar for touch only devices */ - $(sidenav).css({ paddingRight:'20px' }); - $('.ui-resizable-e').css({ width:'20px' }); - $('#nav-sync').css({ right:'34px' }); - barWidth=20; - } - var width = readCookie('width'); - if (width) { restoreWidth(width); } else { resizeWidth(); } - resizeHeight(); - var url = location.href; - var i=url.indexOf("#"); - if (i>=0) window.location.hash=url.substr(i); - var _preventDefault = function(evt) { evt.preventDefault(); }; - $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); - $(".ui-resizable-handle").dblclick(collapseExpand); - $(window).on('load',resizeHeight); -} -/* @license-end */ diff --git a/pymaterialx/python/docs/html/search/all_0.html b/pymaterialx/python/docs/html/search/all_0.html deleted file mode 100644 index 1ec5b2d5..00000000 --- a/pymaterialx/python/docs/html/search/all_0.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_0.js b/pymaterialx/python/docs/html/search/all_0.js deleted file mode 100644 index 574bf546..00000000 --- a/pymaterialx/python/docs/html/search/all_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['_5f_5finit_5f_5f_2epy_0',['__init__.py',['../____init_____8py.html',1,'']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_1.html b/pymaterialx/python/docs/html/search/all_1.html deleted file mode 100644 index 9f80e904..00000000 --- a/pymaterialx/python/docs/html/search/all_1.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_1.js b/pymaterialx/python/docs/html/search/all_1.js deleted file mode 100644 index 5674f5f4..00000000 --- a/pymaterialx/python/docs/html/search/all_1.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['colorspace_2epy_1',['colorspace.py',['../colorspace_8py.html',1,'']]], - ['createvaluefromstrings_2',['createValueFromStrings',['../namespace_material_x_1_1datatype.html#a61e5cf2e5bd0aa11262576fee4dc1124',1,'MaterialX::datatype']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_2.html b/pymaterialx/python/docs/html/search/all_2.html deleted file mode 100644 index 02cfffc2..00000000 --- a/pymaterialx/python/docs/html/search/all_2.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_2.js b/pymaterialx/python/docs/html/search/all_2.js deleted file mode 100644 index 22c1e53a..00000000 --- a/pymaterialx/python/docs/html/search/all_2.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['datatype_2epy_3',['datatype.py',['../datatype_8py.html',1,'']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_3.html b/pymaterialx/python/docs/html/search/all_3.html deleted file mode 100644 index 39767b85..00000000 --- a/pymaterialx/python/docs/html/search/all_3.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_3.js b/pymaterialx/python/docs/html/search/all_3.js deleted file mode 100644 index 2d1f02bb..00000000 --- a/pymaterialx/python/docs/html/search/all_3.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['getcolorspaces_4',['getColorSpaces',['../namespace_material_x_1_1colorspace.html#a2f71fb38cdc8e19b41817ce0ebcdcfb5',1,'MaterialX::colorspace']]], - ['getdefaultocioconfig_5',['getDefaultOCIOConfig',['../namespace_material_x_1_1colorspace.html#adede7502ee5324d77c722a3428e61f9c',1,'MaterialX::colorspace']]], - ['gettypestring_6',['getTypeString',['../namespace_material_x_1_1datatype.html#afd52a73efed31accf704e3741a20247f',1,'MaterialX::datatype']]], - ['getvaluestring_7',['getValueString',['../namespace_material_x_1_1datatype.html#a9ecfbde2c3f1946b0e179c2d28781f2d',1,'MaterialX::datatype']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_4.html b/pymaterialx/python/docs/html/search/all_4.html deleted file mode 100644 index fc40463c..00000000 --- a/pymaterialx/python/docs/html/search/all_4.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_4.js b/pymaterialx/python/docs/html/search/all_4.js deleted file mode 100644 index 6d9b3fa8..00000000 --- a/pymaterialx/python/docs/html/search/all_4.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['iscolortype_8',['isColorType',['../namespace_material_x_1_1datatype.html#aecac78e6375a3c7b43682c17c4d24e2a',1,'MaterialX::datatype']]], - ['iscolorvalue_9',['isColorValue',['../namespace_material_x_1_1datatype.html#a05458697ccc3f9b626fcf5838d97ce03',1,'MaterialX::datatype']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_5.html b/pymaterialx/python/docs/html/search/all_5.html deleted file mode 100644 index 9dd9344b..00000000 --- a/pymaterialx/python/docs/html/search/all_5.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_5.js b/pymaterialx/python/docs/html/search/all_5.js deleted file mode 100644 index adbc74eb..00000000 --- a/pymaterialx/python/docs/html/search/all_5.js +++ /dev/null @@ -1,8 +0,0 @@ -var searchData= -[ - ['colorspace_10',['colorspace',['../namespace_material_x_1_1colorspace.html',1,'MaterialX']]], - ['datatype_11',['datatype',['../namespace_material_x_1_1datatype.html',1,'MaterialX']]], - ['main_12',['main',['../namespace_material_x_1_1main.html',1,'MaterialX']]], - ['main_2epy_13',['main.py',['../main_8py.html',1,'']]], - ['materialx_14',['MaterialX',['../namespace_material_x.html',1,'']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_6.html b/pymaterialx/python/docs/html/search/all_6.html deleted file mode 100644 index f1e516d7..00000000 --- a/pymaterialx/python/docs/html/search/all_6.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_6.js b/pymaterialx/python/docs/html/search/all_6.js deleted file mode 100644 index 826ba777..00000000 --- a/pymaterialx/python/docs/html/search/all_6.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['readfromxmlfile_15',['readFromXmlFile',['../namespace_material_x_1_1main.html#a6a5f6ea0c68c5ad65ca394d8a03b70a2',1,'MaterialX::main']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_7.html b/pymaterialx/python/docs/html/search/all_7.html deleted file mode 100644 index 8ddbf6c8..00000000 --- a/pymaterialx/python/docs/html/search/all_7.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_7.js b/pymaterialx/python/docs/html/search/all_7.js deleted file mode 100644 index 92e0b728..00000000 --- a/pymaterialx/python/docs/html/search/all_7.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['stringtovalue_16',['stringToValue',['../namespace_material_x_1_1main.html#a346e741dda2260842f721c65cd57773b',1,'MaterialX::main']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_8.html b/pymaterialx/python/docs/html/search/all_8.html deleted file mode 100644 index 83c55ae2..00000000 --- a/pymaterialx/python/docs/html/search/all_8.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_8.js b/pymaterialx/python/docs/html/search/all_8.js deleted file mode 100644 index 3d776b61..00000000 --- a/pymaterialx/python/docs/html/search/all_8.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['transformcolor_17',['transformColor',['../namespace_material_x_1_1colorspace.html#adcc451cff99e05ef4832c09b86e8f330',1,'MaterialX::colorspace']]], - ['typetoname_18',['typeToName',['../namespace_material_x_1_1main.html#a79331c2433656921d4c9c993a63a266c',1,'MaterialX::main']]] -]; diff --git a/pymaterialx/python/docs/html/search/all_9.html b/pymaterialx/python/docs/html/search/all_9.html deleted file mode 100644 index 1e263c13..00000000 --- a/pymaterialx/python/docs/html/search/all_9.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/all_9.js b/pymaterialx/python/docs/html/search/all_9.js deleted file mode 100644 index 77db316e..00000000 --- a/pymaterialx/python/docs/html/search/all_9.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['valuetostring_19',['valueToString',['../namespace_material_x_1_1main.html#adb290066e496754c807e8c4ed87c5113',1,'MaterialX::main']]] -]; diff --git a/pymaterialx/python/docs/html/search/close.svg b/pymaterialx/python/docs/html/search/close.svg deleted file mode 100644 index a933eea1..00000000 --- a/pymaterialx/python/docs/html/search/close.svg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - image/svg+xml - - - - - - - - diff --git a/pymaterialx/python/docs/html/search/files_0.html b/pymaterialx/python/docs/html/search/files_0.html deleted file mode 100644 index 9498842a..00000000 --- a/pymaterialx/python/docs/html/search/files_0.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/files_0.js b/pymaterialx/python/docs/html/search/files_0.js deleted file mode 100644 index 591410c7..00000000 --- a/pymaterialx/python/docs/html/search/files_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['_5f_5finit_5f_5f_2epy_24',['__init__.py',['../____init_____8py.html',1,'']]] -]; diff --git a/pymaterialx/python/docs/html/search/files_1.html b/pymaterialx/python/docs/html/search/files_1.html deleted file mode 100644 index 7050ef48..00000000 --- a/pymaterialx/python/docs/html/search/files_1.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/files_1.js b/pymaterialx/python/docs/html/search/files_1.js deleted file mode 100644 index 60eb14bc..00000000 --- a/pymaterialx/python/docs/html/search/files_1.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['colorspace_2epy_25',['colorspace.py',['../colorspace_8py.html',1,'']]] -]; diff --git a/pymaterialx/python/docs/html/search/files_2.html b/pymaterialx/python/docs/html/search/files_2.html deleted file mode 100644 index 497cdf5c..00000000 --- a/pymaterialx/python/docs/html/search/files_2.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/files_2.js b/pymaterialx/python/docs/html/search/files_2.js deleted file mode 100644 index 05f887f2..00000000 --- a/pymaterialx/python/docs/html/search/files_2.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['datatype_2epy_26',['datatype.py',['../datatype_8py.html',1,'']]] -]; diff --git a/pymaterialx/python/docs/html/search/files_3.html b/pymaterialx/python/docs/html/search/files_3.html deleted file mode 100644 index 1ba106b2..00000000 --- a/pymaterialx/python/docs/html/search/files_3.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/files_3.js b/pymaterialx/python/docs/html/search/files_3.js deleted file mode 100644 index 57f06bcf..00000000 --- a/pymaterialx/python/docs/html/search/files_3.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['main_2epy_27',['main.py',['../main_8py.html',1,'']]] -]; diff --git a/pymaterialx/python/docs/html/search/functions_0.html b/pymaterialx/python/docs/html/search/functions_0.html deleted file mode 100644 index eb4c5014..00000000 --- a/pymaterialx/python/docs/html/search/functions_0.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/functions_0.js b/pymaterialx/python/docs/html/search/functions_0.js deleted file mode 100644 index ceda7738..00000000 --- a/pymaterialx/python/docs/html/search/functions_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['createvaluefromstrings_28',['createValueFromStrings',['../namespace_material_x_1_1datatype.html#a61e5cf2e5bd0aa11262576fee4dc1124',1,'MaterialX::datatype']]] -]; diff --git a/pymaterialx/python/docs/html/search/functions_1.html b/pymaterialx/python/docs/html/search/functions_1.html deleted file mode 100644 index ef4088b8..00000000 --- a/pymaterialx/python/docs/html/search/functions_1.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/functions_1.js b/pymaterialx/python/docs/html/search/functions_1.js deleted file mode 100644 index 8c993097..00000000 --- a/pymaterialx/python/docs/html/search/functions_1.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['getcolorspaces_29',['getColorSpaces',['../namespace_material_x_1_1colorspace.html#a2f71fb38cdc8e19b41817ce0ebcdcfb5',1,'MaterialX::colorspace']]], - ['getdefaultocioconfig_30',['getDefaultOCIOConfig',['../namespace_material_x_1_1colorspace.html#adede7502ee5324d77c722a3428e61f9c',1,'MaterialX::colorspace']]], - ['gettypestring_31',['getTypeString',['../namespace_material_x_1_1datatype.html#afd52a73efed31accf704e3741a20247f',1,'MaterialX::datatype']]], - ['getvaluestring_32',['getValueString',['../namespace_material_x_1_1datatype.html#a9ecfbde2c3f1946b0e179c2d28781f2d',1,'MaterialX::datatype']]] -]; diff --git a/pymaterialx/python/docs/html/search/functions_2.html b/pymaterialx/python/docs/html/search/functions_2.html deleted file mode 100644 index ca5aa10e..00000000 --- a/pymaterialx/python/docs/html/search/functions_2.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/functions_2.js b/pymaterialx/python/docs/html/search/functions_2.js deleted file mode 100644 index ec57ff88..00000000 --- a/pymaterialx/python/docs/html/search/functions_2.js +++ /dev/null @@ -1,5 +0,0 @@ -var searchData= -[ - ['iscolortype_33',['isColorType',['../namespace_material_x_1_1datatype.html#aecac78e6375a3c7b43682c17c4d24e2a',1,'MaterialX::datatype']]], - ['iscolorvalue_34',['isColorValue',['../namespace_material_x_1_1datatype.html#a05458697ccc3f9b626fcf5838d97ce03',1,'MaterialX::datatype']]] -]; diff --git a/pymaterialx/python/docs/html/search/functions_3.html b/pymaterialx/python/docs/html/search/functions_3.html deleted file mode 100644 index d79f55b8..00000000 --- a/pymaterialx/python/docs/html/search/functions_3.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/functions_3.js b/pymaterialx/python/docs/html/search/functions_3.js deleted file mode 100644 index eb939990..00000000 --- a/pymaterialx/python/docs/html/search/functions_3.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['transformcolor_35',['transformColor',['../namespace_material_x_1_1colorspace.html#adcc451cff99e05ef4832c09b86e8f330',1,'MaterialX::colorspace']]] -]; diff --git a/pymaterialx/python/docs/html/search/mag_sel.svg b/pymaterialx/python/docs/html/search/mag_sel.svg deleted file mode 100644 index 03626f64..00000000 --- a/pymaterialx/python/docs/html/search/mag_sel.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - diff --git a/pymaterialx/python/docs/html/search/namespaces_0.html b/pymaterialx/python/docs/html/search/namespaces_0.html deleted file mode 100644 index 21db2c3a..00000000 --- a/pymaterialx/python/docs/html/search/namespaces_0.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/namespaces_0.js b/pymaterialx/python/docs/html/search/namespaces_0.js deleted file mode 100644 index 853fc08d..00000000 --- a/pymaterialx/python/docs/html/search/namespaces_0.js +++ /dev/null @@ -1,7 +0,0 @@ -var searchData= -[ - ['colorspace_20',['colorspace',['../namespace_material_x_1_1colorspace.html',1,'MaterialX']]], - ['datatype_21',['datatype',['../namespace_material_x_1_1datatype.html',1,'MaterialX']]], - ['main_22',['main',['../namespace_material_x_1_1main.html',1,'MaterialX']]], - ['materialx_23',['MaterialX',['../namespace_material_x.html',1,'']]] -]; diff --git a/pymaterialx/python/docs/html/search/nomatches.html b/pymaterialx/python/docs/html/search/nomatches.html deleted file mode 100644 index 2b9360b6..00000000 --- a/pymaterialx/python/docs/html/search/nomatches.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - -
                            -
                            No Matches
                            -
                            - - diff --git a/pymaterialx/python/docs/html/search/search.css b/pymaterialx/python/docs/html/search/search.css deleted file mode 100644 index 9074198f..00000000 --- a/pymaterialx/python/docs/html/search/search.css +++ /dev/null @@ -1,257 +0,0 @@ -/*---------------- Search Box */ - -#MSearchBox { - white-space : nowrap; - background: white; - border-radius: 0.65em; - box-shadow: inset 0.5px 0.5px 3px 0px #555; - z-index: 102; -} - -#MSearchBox .left { - display: inline-block; - vertical-align: middle; - height: 1.4em; -} - -#MSearchSelect { - display: inline-block; - vertical-align: middle; - height: 1.4em; - padding: 0 0 0 0.3em; - margin: 0; -} - -#MSearchField { - display: inline-block; - vertical-align: middle; - width: 7.5em; - height: 1.1em; - margin: 0 0.15em; - padding: 0; - line-height: 1em; - border:none; - color: #909090; - outline: none; - font-family: Arial, Verdana, sans-serif; - -webkit-border-radius: 0px; - border-radius: 0px; - background: none; -} - - -#MSearchBox .right { - display: inline-block; - vertical-align: middle; - width: 1.4em; - height: 1.4em; -} - -#MSearchClose { - display: none; - font-size: inherit; - background : none; - border: none; - margin: 0; - padding: 0; - outline: none; - -} - -#MSearchCloseImg { - height: 1.4em; - padding: 0.3em; - margin: 0; -} - -.MSearchBoxActive #MSearchField { - color: #000000; -} - -#main-menu > li:last-child { - /* This
                          • object is the parent of the search bar */ - display: flex; - justify-content: center; - align-items: center; - height: 36px; - margin-right: 1em; -} - -/*---------------- Search filter selection */ - -#MSearchSelectWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid #90A5CE; - background-color: #F9FAFC; - z-index: 10001; - padding-top: 4px; - padding-bottom: 4px; - -moz-border-radius: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -} - -.SelectItem { - font: 8pt Arial, Verdana, sans-serif; - padding-left: 2px; - padding-right: 12px; - border: 0px; -} - -span.SelectionMark { - margin-right: 4px; - font-family: monospace; - outline-style: none; - text-decoration: none; -} - -a.SelectItem { - display: block; - outline-style: none; - color: #000000; - text-decoration: none; - padding-left: 6px; - padding-right: 12px; -} - -a.SelectItem:focus, -a.SelectItem:active { - color: #000000; - outline-style: none; - text-decoration: none; -} - -a.SelectItem:hover { - color: #FFFFFF; - background-color: #3D578C; - outline-style: none; - text-decoration: none; - cursor: pointer; - display: block; -} - -/*---------------- Search results window */ - -iframe#MSearchResults { - width: 60ex; - height: 15em; -} - -#MSearchResultsWindow { - display: none; - position: absolute; - left: 0; top: 0; - border: 1px solid #000; - background-color: #EEF1F7; - z-index:10000; -} - -/* ----------------------------------- */ - - -#SRIndex { - clear:both; - padding-bottom: 15px; -} - -.SREntry { - font-size: 10pt; - padding-left: 1ex; -} - -.SRPage .SREntry { - font-size: 8pt; - padding: 1px 5px; -} - -body.SRPage { - margin: 5px 2px; -} - -.SRChildren { - padding-left: 3ex; padding-bottom: .5em -} - -.SRPage .SRChildren { - display: none; -} - -.SRSymbol { - font-weight: bold; - color: #425E97; - font-family: Arial, Verdana, sans-serif; - text-decoration: none; - outline: none; -} - -a.SRScope { - display: block; - color: #425E97; - font-family: Arial, Verdana, sans-serif; - text-decoration: none; - outline: none; -} - -a.SRSymbol:focus, a.SRSymbol:active, -a.SRScope:focus, a.SRScope:active { - text-decoration: underline; -} - -span.SRScope { - padding-left: 4px; - font-family: Arial, Verdana, sans-serif; -} - -.SRPage .SRStatus { - padding: 2px 5px; - font-size: 8pt; - font-style: italic; - font-family: Arial, Verdana, sans-serif; -} - -.SRResult { - display: none; -} - -div.searchresults { - margin-left: 10px; - margin-right: 10px; -} - -/*---------------- External search page results */ - -.searchresult { - background-color: #F0F3F8; -} - -.pages b { - color: white; - padding: 5px 5px 3px 5px; - background-image: url("../tab_a.png"); - background-repeat: repeat-x; - text-shadow: 0 1px 1px #000000; -} - -.pages { - line-height: 17px; - margin-left: 4px; - text-decoration: none; -} - -.hl { - font-weight: bold; -} - -#searchresults { - margin-bottom: 20px; -} - -.searchpages { - margin-top: 10px; -} - diff --git a/pymaterialx/python/docs/html/search/search.js b/pymaterialx/python/docs/html/search/search.js deleted file mode 100644 index fb226f73..00000000 --- a/pymaterialx/python/docs/html/search/search.js +++ /dev/null @@ -1,816 +0,0 @@ -/* - @licstart The following is the entire license notice for the JavaScript code in this file. - - The MIT License (MIT) - - Copyright (C) 1997-2020 by Dimitri van Heesch - - Permission is hereby granted, free of charge, to any person obtaining a copy of this software - and associated documentation files (the "Software"), to deal in the Software without restriction, - including without limitation the rights to use, copy, modify, merge, publish, distribute, - sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all copies or - substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, - DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - @licend The above is the entire license notice for the JavaScript code in this file - */ -function convertToId(search) -{ - var result = ''; - for (i=0;i do a search - { - this.Search(); - } - } - - this.OnSearchSelectKey = function(evt) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==40 && this.searchIndex0) // Up - { - this.searchIndex--; - this.OnSelectItem(this.searchIndex); - } - else if (e.keyCode==13 || e.keyCode==27) - { - this.OnSelectItem(this.searchIndex); - this.CloseSelectionWindow(); - this.DOMSearchField().focus(); - } - return false; - } - - // --------- Actions - - // Closes the results window. - this.CloseResultsWindow = function() - { - this.DOMPopupSearchResultsWindow().style.display = 'none'; - this.DOMSearchClose().style.display = 'none'; - this.Activate(false); - } - - this.CloseSelectionWindow = function() - { - this.DOMSearchSelectWindow().style.display = 'none'; - } - - // Performs a search. - this.Search = function() - { - this.keyTimeout = 0; - - // strip leading whitespace - var searchValue = this.DOMSearchField().value.replace(/^ +/, ""); - - var code = searchValue.toLowerCase().charCodeAt(0); - var idxChar = searchValue.substr(0, 1).toLowerCase(); - if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair - { - idxChar = searchValue.substr(0, 2); - } - - var resultsPage; - var resultsPageWithSearch; - var hasResultsPage; - - var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); - if (idx!=-1) - { - var hexCode=idx.toString(16); - resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + this.extension; - resultsPageWithSearch = resultsPage+'?'+escape(searchValue); - hasResultsPage = true; - } - else // nothing available for this search term - { - resultsPage = this.resultsPath + '/nomatches' + this.extension; - resultsPageWithSearch = resultsPage; - hasResultsPage = false; - } - - window.frames.MSearchResults.location = resultsPageWithSearch; - var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); - - if (domPopupSearchResultsWindow.style.display!='block') - { - var domSearchBox = this.DOMSearchBox(); - this.DOMSearchClose().style.display = 'inline-block'; - if (this.insideFrame) - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - domPopupSearchResultsWindow.style.position = 'relative'; - domPopupSearchResultsWindow.style.display = 'block'; - var width = document.body.clientWidth - 8; // the -8 is for IE :-( - domPopupSearchResultsWindow.style.width = width + 'px'; - domPopupSearchResults.style.width = width + 'px'; - } - else - { - var domPopupSearchResults = this.DOMPopupSearchResults(); - var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth; - var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1; - domPopupSearchResultsWindow.style.display = 'block'; - left -= domPopupSearchResults.offsetWidth; - domPopupSearchResultsWindow.style.top = top + 'px'; - domPopupSearchResultsWindow.style.left = left + 'px'; - } - } - - this.lastSearchValue = searchValue; - this.lastResultsPage = resultsPage; - } - - // -------- Activation Functions - - // Activates or deactivates the search panel, resetting things to - // their default values if necessary. - this.Activate = function(isActive) - { - if (isActive || // open it - this.DOMPopupSearchResultsWindow().style.display == 'block' - ) - { - this.DOMSearchBox().className = 'MSearchBoxActive'; - - var searchField = this.DOMSearchField(); - - if (searchField.value == this.searchLabel) // clear "Search" term upon entry - { - searchField.value = ''; - this.searchActive = true; - } - } - else if (!isActive) // directly remove the panel - { - this.DOMSearchBox().className = 'MSearchBoxInactive'; - this.DOMSearchField().value = this.searchLabel; - this.searchActive = false; - this.lastSearchValue = '' - this.lastResultsPage = ''; - } - } -} - -// ----------------------------------------------------------------------- - -// The class that handles everything on the search results page. -function SearchResults(name) -{ - // The number of matches from the last run of . - this.lastMatchCount = 0; - this.lastKey = 0; - this.repeatOn = false; - - // Toggles the visibility of the passed element ID. - this.FindChildElement = function(id) - { - var parentElement = document.getElementById(id); - var element = parentElement.firstChild; - - while (element && element!=parentElement) - { - if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') - { - return element; - } - - if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) - { - element = element.firstChild; - } - else if (element.nextSibling) - { - element = element.nextSibling; - } - else - { - do - { - element = element.parentNode; - } - while (element && element!=parentElement && !element.nextSibling); - - if (element && element!=parentElement) - { - element = element.nextSibling; - } - } - } - } - - this.Toggle = function(id) - { - var element = this.FindChildElement(id); - if (element) - { - if (element.style.display == 'block') - { - element.style.display = 'none'; - } - else - { - element.style.display = 'block'; - } - } - } - - // Searches for the passed string. If there is no parameter, - // it takes it from the URL query. - // - // Always returns true, since other documents may try to call it - // and that may or may not be possible. - this.Search = function(search) - { - if (!search) // get search word from URL - { - search = window.location.search; - search = search.substring(1); // Remove the leading '?' - search = unescape(search); - } - - search = search.replace(/^ +/, ""); // strip leading spaces - search = search.replace(/ +$/, ""); // strip trailing spaces - search = search.toLowerCase(); - search = convertToId(search); - - var resultRows = document.getElementsByTagName("div"); - var matches = 0; - - var i = 0; - while (i < resultRows.length) - { - var row = resultRows.item(i); - if (row.className == "SRResult") - { - var rowMatchName = row.id.toLowerCase(); - rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' - - if (search.length<=rowMatchName.length && - rowMatchName.substr(0, search.length)==search) - { - row.style.display = 'block'; - matches++; - } - else - { - row.style.display = 'none'; - } - } - i++; - } - document.getElementById("Searching").style.display='none'; - if (matches == 0) // no results - { - document.getElementById("NoMatches").style.display='block'; - } - else // at least one result - { - document.getElementById("NoMatches").style.display='none'; - } - this.lastMatchCount = matches; - return true; - } - - // return the first item with index index or higher that is visible - this.NavNext = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index++; - } - return focusItem; - } - - this.NavPrev = function(index) - { - var focusItem; - while (1) - { - var focusName = 'Item'+index; - focusItem = document.getElementById(focusName); - if (focusItem && focusItem.parentNode.parentNode.style.display=='block') - { - break; - } - else if (!focusItem) // last element - { - break; - } - focusItem=null; - index--; - } - return focusItem; - } - - this.ProcessKeys = function(e) - { - if (e.type == "keydown") - { - this.repeatOn = false; - this.lastKey = e.keyCode; - } - else if (e.type == "keypress") - { - if (!this.repeatOn) - { - if (this.lastKey) this.repeatOn = true; - return false; // ignore first keypress after keydown - } - } - else if (e.type == "keyup") - { - this.lastKey = 0; - this.repeatOn = false; - } - return this.lastKey!=0; - } - - this.Nav = function(evt,itemIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - var newIndex = itemIndex-1; - var focusItem = this.NavPrev(newIndex); - if (focusItem) - { - var child = this.FindChildElement(focusItem.parentNode.parentNode.id); - if (child && child.style.display == 'block') // children visible - { - var n=0; - var tmpElem; - while (1) // search for last child - { - tmpElem = document.getElementById('Item'+newIndex+'_c'+n); - if (tmpElem) - { - focusItem = tmpElem; - } - else // found it! - { - break; - } - n++; - } - } - } - if (focusItem) - { - focusItem.focus(); - } - else // return focus to search field - { - parent.document.getElementById("MSearchField").focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = itemIndex+1; - var focusItem; - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem && elem.style.display == 'block') // children visible - { - focusItem = document.getElementById('Item'+itemIndex+'_c0'); - } - if (!focusItem) focusItem = this.NavNext(newIndex); - if (focusItem) focusItem.focus(); - } - else if (this.lastKey==39) // Right - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'block'; - } - else if (this.lastKey==37) // Left - { - var item = document.getElementById('Item'+itemIndex); - var elem = this.FindChildElement(item.parentNode.parentNode.id); - if (elem) elem.style.display = 'none'; - } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } - - this.NavChild = function(evt,itemIndex,childIndex) - { - var e = (evt) ? evt : window.event; // for IE - if (e.keyCode==13) return true; - if (!this.ProcessKeys(e)) return false; - - if (this.lastKey==38) // Up - { - if (childIndex>0) - { - var newIndex = childIndex-1; - document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); - } - else // already at first child, jump to parent - { - document.getElementById('Item'+itemIndex).focus(); - } - } - else if (this.lastKey==40) // Down - { - var newIndex = childIndex+1; - var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); - if (!elem) // last child, jump to parent next parent - { - elem = this.NavNext(itemIndex+1); - } - if (elem) - { - elem.focus(); - } - } - else if (this.lastKey==27) // Escape - { - parent.searchBox.CloseResultsWindow(); - parent.document.getElementById("MSearchField").focus(); - } - else if (this.lastKey==13) // Enter - { - return true; - } - return false; - } -} - -function setKeyActions(elem,action) -{ - elem.setAttribute('onkeydown',action); - elem.setAttribute('onkeypress',action); - elem.setAttribute('onkeyup',action); -} - -function setClassAttr(elem,attr) -{ - elem.setAttribute('class',attr); - elem.setAttribute('className',attr); -} - -function createResults() -{ - var results = document.getElementById("SRResults"); - for (var e=0; e - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/variables_0.js b/pymaterialx/python/docs/html/search/variables_0.js deleted file mode 100644 index f531a1be..00000000 --- a/pymaterialx/python/docs/html/search/variables_0.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['readfromxmlfile_36',['readFromXmlFile',['../namespace_material_x_1_1main.html#a6a5f6ea0c68c5ad65ca394d8a03b70a2',1,'MaterialX::main']]] -]; diff --git a/pymaterialx/python/docs/html/search/variables_1.html b/pymaterialx/python/docs/html/search/variables_1.html deleted file mode 100644 index ea73d9a4..00000000 --- a/pymaterialx/python/docs/html/search/variables_1.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/variables_1.js b/pymaterialx/python/docs/html/search/variables_1.js deleted file mode 100644 index 7c1fede0..00000000 --- a/pymaterialx/python/docs/html/search/variables_1.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['stringtovalue_37',['stringToValue',['../namespace_material_x_1_1main.html#a346e741dda2260842f721c65cd57773b',1,'MaterialX::main']]] -]; diff --git a/pymaterialx/python/docs/html/search/variables_2.html b/pymaterialx/python/docs/html/search/variables_2.html deleted file mode 100644 index 0580462e..00000000 --- a/pymaterialx/python/docs/html/search/variables_2.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/variables_2.js b/pymaterialx/python/docs/html/search/variables_2.js deleted file mode 100644 index 3d2f610f..00000000 --- a/pymaterialx/python/docs/html/search/variables_2.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['typetoname_38',['typeToName',['../namespace_material_x_1_1main.html#a79331c2433656921d4c9c993a63a266c',1,'MaterialX::main']]] -]; diff --git a/pymaterialx/python/docs/html/search/variables_3.html b/pymaterialx/python/docs/html/search/variables_3.html deleted file mode 100644 index 0d69e761..00000000 --- a/pymaterialx/python/docs/html/search/variables_3.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - -
                            -
                            Loading...
                            -
                            - -
                            Searching...
                            -
                            No Matches
                            - -
                            - - diff --git a/pymaterialx/python/docs/html/search/variables_3.js b/pymaterialx/python/docs/html/search/variables_3.js deleted file mode 100644 index cb022619..00000000 --- a/pymaterialx/python/docs/html/search/variables_3.js +++ /dev/null @@ -1,4 +0,0 @@ -var searchData= -[ - ['valuetostring_39',['valueToString',['../namespace_material_x_1_1main.html#adb290066e496754c807e8c4ed87c5113',1,'MaterialX::main']]] -]; diff --git a/pymaterialx/python/docs/html/splitbar.png b/pymaterialx/python/docs/html/splitbar.png deleted file mode 100644 index fe895f2c..00000000 Binary files a/pymaterialx/python/docs/html/splitbar.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/sync_off.png b/pymaterialx/python/docs/html/sync_off.png deleted file mode 100644 index 3b443fc6..00000000 Binary files a/pymaterialx/python/docs/html/sync_off.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/sync_on.png b/pymaterialx/python/docs/html/sync_on.png deleted file mode 100644 index e08320fb..00000000 Binary files a/pymaterialx/python/docs/html/sync_on.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/tab_a.png b/pymaterialx/python/docs/html/tab_a.png deleted file mode 100644 index 3b725c41..00000000 Binary files a/pymaterialx/python/docs/html/tab_a.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/tab_b.png b/pymaterialx/python/docs/html/tab_b.png deleted file mode 100644 index e2b4a863..00000000 Binary files a/pymaterialx/python/docs/html/tab_b.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/tab_h.png b/pymaterialx/python/docs/html/tab_h.png deleted file mode 100644 index fd5cb705..00000000 Binary files a/pymaterialx/python/docs/html/tab_h.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/tab_s.png b/pymaterialx/python/docs/html/tab_s.png deleted file mode 100644 index ab478c95..00000000 Binary files a/pymaterialx/python/docs/html/tab_s.png and /dev/null differ diff --git a/pymaterialx/python/docs/html/tabs.css b/pymaterialx/python/docs/html/tabs.css deleted file mode 100644 index 85a0cd5b..00000000 --- a/pymaterialx/python/docs/html/tabs.css +++ /dev/null @@ -1 +0,0 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0 1px 1px rgba(255,255,255,0.9);color:#283a5d;outline:0}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace!important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283a5d transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;-moz-border-radius:0!important;-webkit-border-radius:0;border-radius:0!important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;-moz-border-radius:5px!important;-webkit-border-radius:5px;border-radius:5px!important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0!important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px!important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} \ No newline at end of file diff --git a/resources/Geometry/cloth.glb b/resources/Geometry/cloth.glb new file mode 100644 index 00000000..e87b65b2 Binary files /dev/null and b/resources/Geometry/cloth.glb differ diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_boombox.md b/resources/Materials/Examples/GltfPbr/gltf_pbr_boombox.md new file mode 100644 index 00000000..ffb0de9a --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_boombox.md @@ -0,0 +1,18 @@ +```mermaid +graph LR + image_basecolor[image_basecolor:BoomBox_baseColor.png] + image_orm[image_orm:BoomBox_occlusionRoughnessMetallic.png] + image_normal[image_normal:BoomBox_normal.png] + image_emission[image_emission:BoomBox_emissive.png] + SR_boombox[SR_boombox] + style Material_boombox fill:#090, color:#FFF + Material_boombox([Material_boombox]) + image_basecolor --"outcolor-->base_color"--> SR_boombox + image_basecolor --"outa-->alpha"--> SR_boombox + image_orm --"metallic"--> SR_boombox + image_orm --"roughness"--> SR_boombox + image_orm --"occlusion"--> SR_boombox + image_normal --"normal"--> SR_boombox + image_emission --"emissive"--> SR_boombox + SR_boombox --"surfaceshader"--> Material_boombox +``` \ No newline at end of file diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_boombox_connections.json b/resources/Materials/Examples/GltfPbr/gltf_pbr_boombox_connections.json new file mode 100644 index 00000000..f37e489e --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_boombox_connections.json @@ -0,0 +1,102 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_boombox.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "image_basecolor", + "gltf_colorimage", + "multioutput", + "BoomBox_baseColor.png" + ], + [ + "image_orm", + "gltf_image", + "vector3", + "BoomBox_occlusionRoughnessMetallic.png" + ], + [ + "image_normal", + "gltf_normalmap", + "vector3", + "BoomBox_normal.png" + ], + [ + "image_emission", + "gltf_image", + "color3", + "BoomBox_emissive.png" + ], + [ + "SR_boombox", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "Material_boombox", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "image_basecolor", + "outcolor", + "SR_boombox", + "base_color", + "nodename" + ], + [ + "image_basecolor", + "outa", + "SR_boombox", + "alpha", + "nodename" + ], + [ + "image_orm", + "", + "SR_boombox", + "metallic", + "nodename" + ], + [ + "image_orm", + "", + "SR_boombox", + "roughness", + "nodename" + ], + [ + "image_orm", + "", + "SR_boombox", + "occlusion", + "nodename" + ], + [ + "image_normal", + "", + "SR_boombox", + "normal", + "nodename" + ], + [ + "image_emission", + "", + "SR_boombox", + "emissive", + "nodename" + ], + [ + "SR_boombox", + "", + "Material_boombox", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_carpaint.md b/resources/Materials/Examples/GltfPbr/gltf_pbr_carpaint.md new file mode 100644 index 00000000..a0e6ec8b --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_carpaint.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_carpaint[SR_carpaint] + style PBR_Car_Paint fill:#090, color:#FFF + PBR_Car_Paint([PBR_Car_Paint]) + SR_carpaint --"surfaceshader"--> PBR_Car_Paint +``` \ No newline at end of file diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_carpaint_connections.json b/resources/Materials/Examples/GltfPbr/gltf_pbr_carpaint_connections.json new file mode 100644 index 00000000..63fbae55 --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_carpaint_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_carpaint.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_carpaint", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "PBR_Car_Paint", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_carpaint", + "", + "PBR_Car_Paint", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_default.md b/resources/Materials/Examples/GltfPbr/gltf_pbr_default.md new file mode 100644 index 00000000..3c7985c6 --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_default.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_default[SR_default] + style Default fill:#090, color:#FFF + Default([Default]) + SR_default --"surfaceshader"--> Default +``` \ No newline at end of file diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_default_connections.json b/resources/Materials/Examples/GltfPbr/gltf_pbr_default_connections.json new file mode 100644 index 00000000..87728cbe --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_default_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_default.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_default", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "Default", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_default", + "", + "Default", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_glass.md b/resources/Materials/Examples/GltfPbr/gltf_pbr_glass.md new file mode 100644 index 00000000..a7661de1 --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_glass.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_glass[SR_glass] + style PBR_Glass fill:#090, color:#FFF + PBR_Glass([PBR_Glass]) + SR_glass --"surfaceshader"--> PBR_Glass +``` \ No newline at end of file diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_glass_connections.json b/resources/Materials/Examples/GltfPbr/gltf_pbr_glass_connections.json new file mode 100644 index 00000000..2882dd49 --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_glass_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_glass.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_glass", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "PBR_Glass", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_glass", + "", + "PBR_Glass", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_gold.md b/resources/Materials/Examples/GltfPbr/gltf_pbr_gold.md new file mode 100644 index 00000000..74b99d82 --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_gold.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_gold[SR_gold] + style PBR_Gold fill:#090, color:#FFF + PBR_Gold([PBR_Gold]) + SR_gold --"surfaceshader"--> PBR_Gold +``` \ No newline at end of file diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_gold_connections.json b/resources/Materials/Examples/GltfPbr/gltf_pbr_gold_connections.json new file mode 100644 index 00000000..0ff9563c --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_gold_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_gold.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_gold", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "PBR_Gold", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_gold", + "", + "PBR_Gold", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_plastic.md b/resources/Materials/Examples/GltfPbr/gltf_pbr_plastic.md new file mode 100644 index 00000000..b1f729f1 --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_plastic.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_plastic[SR_plastic] + style PBR_Plastic fill:#090, color:#FFF + PBR_Plastic([PBR_Plastic]) + SR_plastic --"surfaceshader"--> PBR_Plastic +``` \ No newline at end of file diff --git a/resources/Materials/Examples/GltfPbr/gltf_pbr_plastic_connections.json b/resources/Materials/Examples/GltfPbr/gltf_pbr_plastic_connections.json new file mode 100644 index 00000000..66656a33 --- /dev/null +++ b/resources/Materials/Examples/GltfPbr/gltf_pbr_plastic_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\GltfPbr\\gltf_pbr_plastic.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_plastic", + "gltf_pbr", + "surfaceshader", + "" + ], + [ + "PBR_Plastic", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_plastic", + "", + "PBR_Plastic", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_aluminum_brushed.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_aluminum_brushed.mtlx new file mode 100644 index 00000000..7f7072d4 --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_aluminum_brushed.mtlx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_carpaint.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_carpaint.mtlx new file mode 100644 index 00000000..fd42fdf4 --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_carpaint.mtlx @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_default.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_default.mtlx new file mode 100644 index 00000000..85c53791 --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_default.mtlx @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_glass.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_glass.mtlx new file mode 100644 index 00000000..a661b9d1 --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_glass.mtlx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_honey.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_honey.mtlx new file mode 100644 index 00000000..41e076d2 --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_honey.mtlx @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_ketchup.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_ketchup.mtlx new file mode 100644 index 00000000..cda2ebdf --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_ketchup.mtlx @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_lightbulb.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_lightbulb.mtlx new file mode 100644 index 00000000..a915f842 --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_lightbulb.mtlx @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_pearl.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_pearl.mtlx new file mode 100644 index 00000000..83db774b --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_pearl.mtlx @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_soapbubble.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_soapbubble.mtlx new file mode 100644 index 00000000..af0faccb --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_soapbubble.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/OpenPBR/open_pbr_velvet.mtlx b/resources/Materials/Examples/OpenPBR/open_pbr_velvet.mtlx new file mode 100644 index 00000000..bf81e082 --- /dev/null +++ b/resources/Materials/Examples/OpenPBR/open_pbr_velvet.mtlx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/StandardSurface/gooch_shade.md b/resources/Materials/Examples/StandardSurface/gooch_shade.md new file mode 100644 index 00000000..304c1c2b --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/gooch_shade.md @@ -0,0 +1,15 @@ +```mermaid +graph LR + default_gooch[default_gooch] + unlit_surface[unlit_surface] + style default_gooch_material fill:#090, color:#FFF + default_gooch_material([default_gooch_material]) + red_blue_gooch[red_blue_gooch] + redblue_gooch_surface[redblue_gooch_surface] + style redblue_gooch_material fill:#090, color:#FFF + redblue_gooch_material([redblue_gooch_material]) + default_gooch --"emission_color"--> unlit_surface + unlit_surface --"surfaceshader"--> default_gooch_material + red_blue_gooch --"emission_color"--> redblue_gooch_surface + redblue_gooch_surface --"surfaceshader"--> redblue_gooch_material +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_brass_tiled.md b/resources/Materials/Examples/StandardSurface/standard_surface_brass_tiled.md new file mode 100644 index 00000000..bcf6abd8 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_brass_tiled.md @@ -0,0 +1,20 @@ +```mermaid +graph LR + subgraph NG_brass1 + style NG_brass1_out_color fill:#0C0, color:#FFF + NG_brass1_out_color([out_color]) + style NG_brass1_out_roughness fill:#0C0, color:#FFF + NG_brass1_out_roughness([out_roughness]) + NG_brass1_image_color[image_color] + NG_brass1_image_roughness[image_roughness] + end + SR_brass1[SR_brass1] + style Tiled_Brass fill:#090, color:#FFF + Tiled_Brass([Tiled_Brass]) + NG_brass1_image_color --> NG_brass1_out_color + NG_brass1_image_roughness --> NG_brass1_out_roughness + NG_brass1_out_roughness --"specular_roughness"--> SR_brass1 + NG_brass1_out_color --"coat_color"--> SR_brass1 + NG_brass1_out_roughness --"coat_roughness"--> SR_brass1 + SR_brass1 --"surfaceshader"--> Tiled_Brass +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_brick_procedural.md b/resources/Materials/Examples/StandardSurface/standard_surface_brick_procedural.md new file mode 100644 index 00000000..18bfd0ff --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_brick_procedural.md @@ -0,0 +1,107 @@ +```mermaid +graph LR + subgraph NG_BrickPattern + style NG_BrickPattern_brick_color fill:#09D, color:#FFF + NG_BrickPattern_brick_color([brick_color:0.661876, 0.19088, 0]) + style NG_BrickPattern_hue_variation fill:#09D, color:#FFF + NG_BrickPattern_hue_variation([hue_variation:0.083]) + style NG_BrickPattern_value_variation fill:#09D, color:#FFF + NG_BrickPattern_value_variation([value_variation:0.787]) + style NG_BrickPattern_roughness_amount fill:#09D, color:#FFF + NG_BrickPattern_roughness_amount([roughness_amount:0.853]) + style NG_BrickPattern_dirt_color fill:#09D, color:#FFF + NG_BrickPattern_dirt_color([dirt_color:0.56372, 0.56372, 0.56372]) + style NG_BrickPattern_dirt_amount fill:#09D, color:#FFF + NG_BrickPattern_dirt_amount([dirt_amount:0.248]) + style NG_BrickPattern_uvtiling fill:#09D, color:#FFF + NG_BrickPattern_uvtiling([uvtiling:3]) + style NG_BrickPattern_base_color_output fill:#0C0, color:#FFF + NG_BrickPattern_base_color_output([base_color_output]) + style NG_BrickPattern_specular_roughness_output fill:#0C0, color:#FFF + NG_BrickPattern_specular_roughness_output([specular_roughness_output]) + style NG_BrickPattern_normal_output fill:#0C0, color:#FFF + NG_BrickPattern_normal_output([normal_output]) + NG_BrickPattern_node_multiply_5[node_multiply_5] + NG_BrickPattern_node_mix_8[node_mix_8] + style NG_BrickPattern_node_color_11 fill:#500, color:#FFF + NG_BrickPattern_node_color_11([node_color_11:0.263273, 0.263273, 0.263273]) + NG_BrickPattern_node_multiply_9[node_multiply_9] + NG_BrickPattern_node_rgbtohsv_12[node_rgbtohsv_12] + NG_BrickPattern_node_combine3_color3_13[node_combine3_color3_13] + NG_BrickPattern_node_add_16[node_add_16] + NG_BrickPattern_node_hsvtorgb_17[node_hsvtorgb_17] + NG_BrickPattern_node_subtract_18[node_subtract_18] + NG_BrickPattern_node_multiply_14[node_multiply_14] + NG_BrickPattern_node_multiply_15[node_multiply_15] + NG_BrickPattern_node_clamp_0[node_clamp_0] + NG_BrickPattern_node_multiply_1[node_multiply_1] + NG_BrickPattern_node_max_1[node_max_1] + NG_BrickPattern_node_divide_21[node_divide_21] + NG_BrickPattern_node_mix_6[node_mix_6] + NG_BrickPattern_node_multiply_23[node_multiply_23] + NG_BrickPattern_node_multiply_25[node_multiply_25] + NG_BrickPattern_node_add_19[node_add_19] + NG_BrickPattern_node_multiply_20[node_multiply_20] + NG_BrickPattern_node_normalmap_3[node_normalmap_3] + NG_BrickPattern_node_convert_1[node_convert_1] + NG_BrickPattern_node_tiledimage_vector3_27[node_tiledimage_vector3_27] + NG_BrickPattern_node_tiledimage_float_22[node_tiledimage_float_22] + NG_BrickPattern_node_tiledimage_float_10[node_tiledimage_float_10] + NG_BrickPattern_node_tiledimage_float_7[node_tiledimage_float_7] + NG_BrickPattern_node_tiledimage_float_26[node_tiledimage_float_26] + NG_BrickPattern_node_tiledimage_float_24[node_tiledimage_float_24] + end + N_StandardSurface[N_StandardSurface] + style M_BrickPattern fill:#090, color:#FFF + M_BrickPattern([M_BrickPattern]) + NG_BrickPattern_node_mix_6 --"in1"--> NG_BrickPattern_node_multiply_5 + NG_BrickPattern_node_tiledimage_float_7 --"in2"--> NG_BrickPattern_node_multiply_5 + NG_BrickPattern_node_multiply_5 --"fg"--> NG_BrickPattern_node_mix_8 + NG_BrickPattern_node_multiply_9 --"bg"--> NG_BrickPattern_node_mix_8 + NG_BrickPattern_node_tiledimage_float_10 --"mix"--> NG_BrickPattern_node_mix_8 + NG_BrickPattern_node_color_11 --"in1"--> NG_BrickPattern_node_multiply_9 + NG_BrickPattern_node_tiledimage_float_7 --"in2"--> NG_BrickPattern_node_multiply_9 + NG_BrickPattern_brick_color --"in"--> NG_BrickPattern_node_rgbtohsv_12 + NG_BrickPattern_node_multiply_14 --"in1"--> NG_BrickPattern_node_combine3_color3_13 + NG_BrickPattern_node_multiply_15 --"in3"--> NG_BrickPattern_node_combine3_color3_13 + NG_BrickPattern_node_combine3_color3_13 --"in1"--> NG_BrickPattern_node_add_16 + NG_BrickPattern_node_rgbtohsv_12 --"in2"--> NG_BrickPattern_node_add_16 + NG_BrickPattern_node_add_16 --"in"--> NG_BrickPattern_node_hsvtorgb_17 + NG_BrickPattern_node_add_19 --"in1"--> NG_BrickPattern_node_subtract_18 + NG_BrickPattern_node_subtract_18 --"in1"--> NG_BrickPattern_node_multiply_14 + NG_BrickPattern_hue_variation --"in2"--> NG_BrickPattern_node_multiply_14 + NG_BrickPattern_node_add_19 --"in1"--> NG_BrickPattern_node_multiply_15 + NG_BrickPattern_node_multiply_20 --"in2"--> NG_BrickPattern_node_multiply_15 + NG_BrickPattern_node_mix_8 --"in"--> NG_BrickPattern_node_clamp_0 + NG_BrickPattern_node_divide_21 --"in1"--> NG_BrickPattern_node_multiply_1 + NG_BrickPattern_node_tiledimage_float_22 --"in2"--> NG_BrickPattern_node_multiply_1 + NG_BrickPattern_node_tiledimage_float_10 --"in1"--> NG_BrickPattern_node_max_1 + NG_BrickPattern_roughness_amount --"in1"--> NG_BrickPattern_node_divide_21 + NG_BrickPattern_node_max_1 --"in2"--> NG_BrickPattern_node_divide_21 + NG_BrickPattern_dirt_color --"fg"--> NG_BrickPattern_node_mix_6 + NG_BrickPattern_node_hsvtorgb_17 --"bg"--> NG_BrickPattern_node_mix_6 + NG_BrickPattern_node_multiply_23 --"mix"--> NG_BrickPattern_node_mix_6 + NG_BrickPattern_dirt_amount --"in1"--> NG_BrickPattern_node_multiply_23 + NG_BrickPattern_node_tiledimage_float_24 --"in2"--> NG_BrickPattern_node_multiply_23 + NG_BrickPattern_hue_variation --"in1"--> NG_BrickPattern_node_multiply_25 + NG_BrickPattern_node_tiledimage_float_26 --"in2"--> NG_BrickPattern_node_multiply_25 + NG_BrickPattern_node_multiply_25 --"in1"--> NG_BrickPattern_node_add_19 + NG_BrickPattern_node_tiledimage_float_7 --"in2"--> NG_BrickPattern_node_add_19 + NG_BrickPattern_value_variation --"in1"--> NG_BrickPattern_node_multiply_20 + NG_BrickPattern_node_tiledimage_float_26 --"in2"--> NG_BrickPattern_node_multiply_20 + NG_BrickPattern_node_tiledimage_vector3_27 --"in"--> NG_BrickPattern_node_normalmap_3 + NG_BrickPattern_uvtiling --"in"--> NG_BrickPattern_node_convert_1 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_vector3_27 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_22 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_10 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_7 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_26 + NG_BrickPattern_node_convert_1 --"uvtiling"--> NG_BrickPattern_node_tiledimage_float_24 + NG_BrickPattern_node_clamp_0 --> NG_BrickPattern_base_color_output + NG_BrickPattern_node_multiply_1 --> NG_BrickPattern_specular_roughness_output + NG_BrickPattern_node_normalmap_3 --> NG_BrickPattern_normal_output + NG_BrickPattern_base_color_output --"base_color"--> N_StandardSurface + NG_BrickPattern_specular_roughness_output --"specular_roughness"--> N_StandardSurface + NG_BrickPattern_normal_output --"normal"--> N_StandardSurface + N_StandardSurface --"surfaceshader"--> M_BrickPattern +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_carpaint.md b/resources/Materials/Examples/StandardSurface/standard_surface_carpaint.md new file mode 100644 index 00000000..c186e416 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_carpaint.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_carpaint[SR_carpaint] + style Car_Paint fill:#090, color:#FFF + Car_Paint([Car_Paint]) + SR_carpaint --"surfaceshader"--> Car_Paint +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_chess_set.md b/resources/Materials/Examples/StandardSurface/standard_surface_chess_set.md new file mode 100644 index 00000000..e449681e --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_chess_set.md @@ -0,0 +1,439 @@ +```mermaid +graph LR + subgraph NG_BishopBlack + style NG_BishopBlack_base_color_output fill:#0C0, color:#FFF + NG_BishopBlack_base_color_output([base_color_output]) + style NG_BishopBlack_metalness_output fill:#0C0, color:#FFF + NG_BishopBlack_metalness_output([metalness_output]) + style NG_BishopBlack_roughness_output fill:#0C0, color:#FFF + NG_BishopBlack_roughness_output([roughness_output]) + style NG_BishopBlack_normal_output fill:#0C0, color:#FFF + NG_BishopBlack_normal_output([normal_output]) + NG_BishopBlack_diffuse2[diffuse2:chess_set/bishop_black_base_color.jpg] + NG_BishopBlack_metallic2[metallic2:chess_set/bishop_shared_metallic.jpg] + NG_BishopBlack_roughness2[roughness2:chess_set/bishop_black_roughness.jpg] + NG_BishopBlack_normal2[normal2:chess_set/bishop_black_normal.jpg] + NG_BishopBlack_mtlxnormalmap4[mtlxnormalmap4] + end + Bishop_B[Bishop_B] + style M_Bishop_B fill:#090, color:#FFF + M_Bishop_B([M_Bishop_B]) + Bishop_W[Bishop_W] + style M_Bishop_W fill:#090, color:#FFF + M_Bishop_W([M_Bishop_W]) + Castle_B[Castle_B] + style M_Castle_B fill:#090, color:#FFF + M_Castle_B([M_Castle_B]) + Castle_W[Castle_W] + style M_Castle_W fill:#090, color:#FFF + M_Castle_W([M_Castle_W]) + Chessboard[Chessboard] + style M_Chessboard fill:#090, color:#FFF + M_Chessboard([M_Chessboard]) + King_B[King_B] + style M_King_B fill:#090, color:#FFF + M_King_B([M_King_B]) + King_W[King_W] + style M_King_W fill:#090, color:#FFF + M_King_W([M_King_W]) + Knight_B[Knight_B] + style M_Knight_B fill:#090, color:#FFF + M_Knight_B([M_Knight_B]) + Knight_W[Knight_W] + style M_Knight_W fill:#090, color:#FFF + M_Knight_W([M_Knight_W]) + Pawn_Body_B[Pawn_Body_B] + style M_Pawn_Body_B fill:#090, color:#FFF + M_Pawn_Body_B([M_Pawn_Body_B]) + Pawn_Body_W[Pawn_Body_W] + style M_Pawn_Body_W fill:#090, color:#FFF + M_Pawn_Body_W([M_Pawn_Body_W]) + Pawn_Top_B[Pawn_Top_B] + style M_Pawn_Top_B fill:#090, color:#FFF + M_Pawn_Top_B([M_Pawn_Top_B]) + Pawn_Top_W[Pawn_Top_W] + style M_Pawn_Top_W fill:#090, color:#FFF + M_Pawn_Top_W([M_Pawn_Top_W]) + Queen_B[Queen_B] + style M_Queen_B fill:#090, color:#FFF + M_Queen_B([M_Queen_B]) + Queen_W[Queen_W] + style M_Queen_W fill:#090, color:#FFF + M_Queen_W([M_Queen_W]) + subgraph NG_BishopWhite + style NG_BishopWhite_base_color_output fill:#0C0, color:#FFF + NG_BishopWhite_base_color_output([base_color_output]) + style NG_BishopWhite_metalness_output fill:#0C0, color:#FFF + NG_BishopWhite_metalness_output([metalness_output]) + style NG_BishopWhite_roughness_output fill:#0C0, color:#FFF + NG_BishopWhite_roughness_output([roughness_output]) + style NG_BishopWhite_normal_output fill:#0C0, color:#FFF + NG_BishopWhite_normal_output([normal_output]) + NG_BishopWhite_diffuse3[diffuse3:chess_set/bishop_white_base_color.jpg] + NG_BishopWhite_metallic3[metallic3:chess_set/bishop_shared_metallic.jpg] + NG_BishopWhite_roughness3[roughness3:chess_set/bishop_white_roughness.jpg] + NG_BishopWhite_normal3[normal3:chess_set/bishop_white_normal.jpg] + NG_BishopWhite_mtlxnormalmap5[mtlxnormalmap5] + end + subgraph NG_CastleBlack + style NG_CastleBlack_base_color_output fill:#0C0, color:#FFF + NG_CastleBlack_base_color_output([base_color_output]) + style NG_CastleBlack_metalness_output fill:#0C0, color:#FFF + NG_CastleBlack_metalness_output([metalness_output]) + style NG_CastleBlack_roughness_output fill:#0C0, color:#FFF + NG_CastleBlack_roughness_output([roughness_output]) + style NG_CastleBlack_normal_output fill:#0C0, color:#FFF + NG_CastleBlack_normal_output([normal_output]) + NG_CastleBlack_diffuse6[diffuse6:chess_set/castle_black_base_color.jpg] + NG_CastleBlack_metallic6[metallic6:chess_set/castle_shared_metallic.jpg] + NG_CastleBlack_roughness6[roughness6:chess_set/castle_shared_roughness.jpg] + NG_CastleBlack_normal6[normal6:chess_set/castle_shared_normal.jpg] + NG_CastleBlack_mtlxnormalmap8[mtlxnormalmap8] + end + subgraph NG_CastleWhite + style NG_CastleWhite_base_color_output fill:#0C0, color:#FFF + NG_CastleWhite_base_color_output([base_color_output]) + style NG_CastleWhite_metalness_output fill:#0C0, color:#FFF + NG_CastleWhite_metalness_output([metalness_output]) + style NG_CastleWhite_roughness_output fill:#0C0, color:#FFF + NG_CastleWhite_roughness_output([roughness_output]) + style NG_CastleWhite_normal_output fill:#0C0, color:#FFF + NG_CastleWhite_normal_output([normal_output]) + NG_CastleWhite_diffuse7[diffuse7:chess_set/castle_white_base_color.jpg] + NG_CastleWhite_metallic7[metallic7:chess_set/castle_shared_metallic.jpg] + NG_CastleWhite_roughness7[roughness7:chess_set/castle_shared_roughness.jpg] + NG_CastleWhite_normal7[normal7:chess_set/castle_shared_normal.jpg] + NG_CastleWhite_mtlxnormalmap9[mtlxnormalmap9] + end + subgraph NG_ChessBoard + style NG_ChessBoard_base_color_output fill:#0C0, color:#FFF + NG_ChessBoard_base_color_output([base_color_output]) + style NG_ChessBoard_metalness_output fill:#0C0, color:#FFF + NG_ChessBoard_metalness_output([metalness_output]) + style NG_ChessBoard_roughness_output fill:#0C0, color:#FFF + NG_ChessBoard_roughness_output([roughness_output]) + style NG_ChessBoard_normal_output fill:#0C0, color:#FFF + NG_ChessBoard_normal_output([normal_output]) + NG_ChessBoard_mtlximage13[mtlximage13:chess_set/chessboard_base_color.jpg] + NG_ChessBoard_mtlximage16[mtlximage16:chess_set/chessboard_metallic.jpg] + NG_ChessBoard_mtlximage17[mtlximage17:chess_set/chessboard_roughness.jpg] + NG_ChessBoard_mtlximage15[mtlximage15:chess_set/chessboard_normal.jpg] + NG_ChessBoard_mtlxnormalmap12[mtlxnormalmap12] + end + subgraph NG_KingBlack + style NG_KingBlack_base_color_output fill:#0C0, color:#FFF + NG_KingBlack_base_color_output([base_color_output]) + style NG_KingBlack_metalness_output fill:#0C0, color:#FFF + NG_KingBlack_metalness_output([metalness_output]) + style NG_KingBlack_roughness_output fill:#0C0, color:#FFF + NG_KingBlack_roughness_output([roughness_output]) + style NG_KingBlack_subsurface_output fill:#0C0, color:#FFF + NG_KingBlack_subsurface_output([subsurface_output]) + style NG_KingBlack_normal_output fill:#0C0, color:#FFF + NG_KingBlack_normal_output([normal_output]) + NG_KingBlack_mtlximage1[mtlximage1:chess_set/king_black_base_color.jpg] + NG_KingBlack_mtlximage2[mtlximage2:chess_set/king_shared_metallic.jpg] + NG_KingBlack_mtlximage4[mtlximage4:chess_set/king_black_roughness.jpg] + NG_KingBlack_mtlximage3[mtlximage3:chess_set/king_shared_scattering.jpg] + NG_KingBlack_mtlximage6[mtlximage6:chess_set/king_black_normal.jpg] + NG_KingBlack_mtlxnormalmap1[mtlxnormalmap1] + end + subgraph NG_KingWhite + style NG_KingWhite_base_color_output fill:#0C0, color:#FFF + NG_KingWhite_base_color_output([base_color_output]) + style NG_KingWhite_metalness_output fill:#0C0, color:#FFF + NG_KingWhite_metalness_output([metalness_output]) + style NG_KingWhite_roughness_output fill:#0C0, color:#FFF + NG_KingWhite_roughness_output([roughness_output]) + style NG_KingWhite_subsurface_output fill:#0C0, color:#FFF + NG_KingWhite_subsurface_output([subsurface_output]) + style NG_KingWhite_normal_output fill:#0C0, color:#FFF + NG_KingWhite_normal_output([normal_output]) + NG_KingWhite_mtlximage7[mtlximage7:chess_set/king_white_base_color.jpg] + NG_KingWhite_mtlximage10[mtlximage10:chess_set/king_shared_metallic.jpg] + NG_KingWhite_mtlximage11[mtlximage11:chess_set/king_white_roughness.jpg] + NG_KingWhite_mtlximage8[mtlximage8:chess_set/king_shared_scattering.jpg] + NG_KingWhite_mtlximage9[mtlximage9:chess_set/king_white_normal.jpg] + NG_KingWhite_mtlxnormalmap11[mtlxnormalmap11] + end + subgraph NG_KnightBlack + style NG_KnightBlack_base_color_output fill:#0C0, color:#FFF + NG_KnightBlack_base_color_output([base_color_output]) + style NG_KnightBlack_roughness_output fill:#0C0, color:#FFF + NG_KnightBlack_roughness_output([roughness_output]) + style NG_KnightBlack_normal_output fill:#0C0, color:#FFF + NG_KnightBlack_normal_output([normal_output]) + NG_KnightBlack_diffuse4[diffuse4:chess_set/knight_black_base_color.jpg] + NG_KnightBlack_roughness4[roughness4:chess_set/knight_black_roughness.jpg] + NG_KnightBlack_normal4[normal4:chess_set/knight_black_normal.jpg] + NG_KnightBlack_mtlxnormalmap6[mtlxnormalmap6] + end + subgraph NG_KnightWhite + style NG_KnightWhite_base_color_output fill:#0C0, color:#FFF + NG_KnightWhite_base_color_output([base_color_output]) + style NG_KnightWhite_roughness_output fill:#0C0, color:#FFF + NG_KnightWhite_roughness_output([roughness_output]) + style NG_KnightWhite_normal_output fill:#0C0, color:#FFF + NG_KnightWhite_normal_output([normal_output]) + NG_KnightWhite_diffuse5[diffuse5:chess_set/knight_white_base_color.jpg] + NG_KnightWhite_roughness5[roughness5:chess_set/knight_white_roughness.jpg] + NG_KnightWhite_normal5[normal5:chess_set/knight_white_normal.jpg] + NG_KnightWhite_mtlxnormalmap7[mtlxnormalmap7] + end + subgraph NG_PawnBodyBlack + style NG_PawnBodyBlack_base_color_output fill:#0C0, color:#FFF + NG_PawnBodyBlack_base_color_output([base_color_output]) + style NG_PawnBodyBlack_metalness_output fill:#0C0, color:#FFF + NG_PawnBodyBlack_metalness_output([metalness_output]) + style NG_PawnBodyBlack_roughness_output fill:#0C0, color:#FFF + NG_PawnBodyBlack_roughness_output([roughness_output]) + style NG_PawnBodyBlack_normal_output fill:#0C0, color:#FFF + NG_PawnBodyBlack_normal_output([normal_output]) + NG_PawnBodyBlack_diffuse9[diffuse9:chess_set/pawn_black_base_color.jpg] + NG_PawnBodyBlack_metallic9[metallic9:chess_set/pawn_shared_metallic.jpg] + NG_PawnBodyBlack_roughness9[roughness9:chess_set/pawn_shared_roughness.jpg] + NG_PawnBodyBlack_normal9[normal9:chess_set/pawn_shared_normal.jpg] + NG_PawnBodyBlack_mtlxnormalmap13[mtlxnormalmap13] + end + subgraph NG_PawnBodyWhite + style NG_PawnBodyWhite_base_color_output fill:#0C0, color:#FFF + NG_PawnBodyWhite_base_color_output([base_color_output]) + style NG_PawnBodyWhite_metalness_output fill:#0C0, color:#FFF + NG_PawnBodyWhite_metalness_output([metalness_output]) + style NG_PawnBodyWhite_roughness_output fill:#0C0, color:#FFF + NG_PawnBodyWhite_roughness_output([roughness_output]) + style NG_PawnBodyWhite_normal_output fill:#0C0, color:#FFF + NG_PawnBodyWhite_normal_output([normal_output]) + NG_PawnBodyWhite_diffuse8[diffuse8:chess_set/pawn_white_base_color.jpg] + NG_PawnBodyWhite_metallic8[metallic8:chess_set/pawn_shared_metallic.jpg] + NG_PawnBodyWhite_roughness8[roughness8:chess_set/pawn_shared_roughness.jpg] + NG_PawnBodyWhite_normal8[normal8:chess_set/pawn_shared_normal.jpg] + NG_PawnBodyWhite_mtlxnormalmap10[mtlxnormalmap10] + end + subgraph NG_PawnTopBlack + style NG_PawnTopBlack_roughness_output fill:#0C0, color:#FFF + NG_PawnTopBlack_roughness_output([roughness_output]) + style NG_PawnTopBlack_normal_output fill:#0C0, color:#FFF + NG_PawnTopBlack_normal_output([normal_output]) + NG_PawnTopBlack_mtlximage19[mtlximage19:chess_set/pawn_shared_roughness.jpg] + NG_PawnTopBlack_mtlximage18[mtlximage18:chess_set/pawn_shared_normal.jpg] + NG_PawnTopBlack_mtlxnormalmap14[mtlxnormalmap14] + end + subgraph NG_PawnTopWhite + style NG_PawnTopWhite_roughness_output fill:#0C0, color:#FFF + NG_PawnTopWhite_roughness_output([roughness_output]) + style NG_PawnTopWhite_normal_output fill:#0C0, color:#FFF + NG_PawnTopWhite_normal_output([normal_output]) + NG_PawnTopWhite_mtlximage21[mtlximage21:chess_set/pawn_shared_roughness.jpg] + NG_PawnTopWhite_mtlximage20[mtlximage20:chess_set/pawn_shared_normal.jpg] + NG_PawnTopWhite_mtlxnormalmap15[mtlxnormalmap15] + end + subgraph NG_QueenBlack + style NG_QueenBlack_base_color_output fill:#0C0, color:#FFF + NG_QueenBlack_base_color_output([base_color_output]) + style NG_QueenBlack_metalness_output fill:#0C0, color:#FFF + NG_QueenBlack_metalness_output([metalness_output]) + style NG_QueenBlack_roughness_output fill:#0C0, color:#FFF + NG_QueenBlack_roughness_output([roughness_output]) + style NG_QueenBlack_subsurface_output fill:#0C0, color:#FFF + NG_QueenBlack_subsurface_output([subsurface_output]) + style NG_QueenBlack_normal_output fill:#0C0, color:#FFF + NG_QueenBlack_normal_output([normal_output]) + NG_QueenBlack_diffuse[diffuse:chess_set/queen_black_base_color.jpg] + NG_QueenBlack_metallic[metallic:chess_set/queen_shared_metallic.jpg] + NG_QueenBlack_roughness[roughness:chess_set/queen_black_roughness.jpg] + NG_QueenBlack_sss[sss:chess_set/queen_shared_scattering.jpg] + NG_QueenBlack_normal[normal:chess_set/queen_black_normal.jpg] + NG_QueenBlack_mtlxnormalmap2[mtlxnormalmap2] + end + subgraph NG_QueenWhite + style NG_QueenWhite_base_color_output fill:#0C0, color:#FFF + NG_QueenWhite_base_color_output([base_color_output]) + style NG_QueenWhite_metalness_output fill:#0C0, color:#FFF + NG_QueenWhite_metalness_output([metalness_output]) + style NG_QueenWhite_roughness_output fill:#0C0, color:#FFF + NG_QueenWhite_roughness_output([roughness_output]) + style NG_QueenWhite_subsurface_output fill:#0C0, color:#FFF + NG_QueenWhite_subsurface_output([subsurface_output]) + style NG_QueenWhite_normal_output fill:#0C0, color:#FFF + NG_QueenWhite_normal_output([normal_output]) + NG_QueenWhite_diffuse1[diffuse1:chess_set/queen_white_base_color.jpg] + NG_QueenWhite_metallic1[metallic1:chess_set/queen_shared_metallic.jpg] + NG_QueenWhite_roughness1[roughness1:chess_set/queen_white_roughness.jpg] + NG_QueenWhite_sss1[sss1:chess_set/queen_shared_scattering.jpg] + NG_QueenWhite_normal1[normal1:chess_set/queen_white_normal.jpg] + NG_QueenWhite_mtlxnormalmap3[mtlxnormalmap3] + end + NG_BishopBlack_normal2 --"in"--> NG_BishopBlack_mtlxnormalmap4 + NG_BishopBlack_diffuse2 --> NG_BishopBlack_base_color_output + NG_BishopBlack_metallic2 --> NG_BishopBlack_metalness_output + NG_BishopBlack_roughness2 --> NG_BishopBlack_roughness_output + NG_BishopBlack_mtlxnormalmap4 --> NG_BishopBlack_normal_output + NG_BishopBlack_base_color_output --"base_color"--> Bishop_B + NG_BishopBlack_metalness_output --"metalness"--> Bishop_B + NG_BishopBlack_roughness_output --"specular_roughness"--> Bishop_B + NG_BishopBlack_base_color_output --"subsurface_color"--> Bishop_B + NG_BishopBlack_base_color_output --"subsurface_radius"--> Bishop_B + NG_BishopBlack_normal_output --"normal"--> Bishop_B + Bishop_B --"surfaceshader"--> M_Bishop_B + NG_BishopWhite_normal3 --"in"--> NG_BishopWhite_mtlxnormalmap5 + NG_BishopWhite_diffuse3 --> NG_BishopWhite_base_color_output + NG_BishopWhite_metallic3 --> NG_BishopWhite_metalness_output + NG_BishopWhite_roughness3 --> NG_BishopWhite_roughness_output + NG_BishopWhite_mtlxnormalmap5 --> NG_BishopWhite_normal_output + NG_BishopWhite_base_color_output --"base_color"--> Bishop_W + NG_BishopWhite_metalness_output --"metalness"--> Bishop_W + NG_BishopWhite_roughness_output --"specular_roughness"--> Bishop_W + NG_BishopWhite_base_color_output --"subsurface_color"--> Bishop_W + NG_BishopWhite_base_color_output --"subsurface_radius"--> Bishop_W + NG_BishopWhite_normal_output --"normal"--> Bishop_W + Bishop_W --"surfaceshader"--> M_Bishop_W + NG_CastleBlack_normal6 --"in"--> NG_CastleBlack_mtlxnormalmap8 + NG_CastleBlack_diffuse6 --> NG_CastleBlack_base_color_output + NG_CastleBlack_metallic6 --> NG_CastleBlack_metalness_output + NG_CastleBlack_roughness6 --> NG_CastleBlack_roughness_output + NG_CastleBlack_mtlxnormalmap8 --> NG_CastleBlack_normal_output + NG_CastleBlack_base_color_output --"base_color"--> Castle_B + NG_CastleBlack_metalness_output --"metalness"--> Castle_B + NG_CastleBlack_roughness_output --"specular_roughness"--> Castle_B + NG_CastleBlack_base_color_output --"subsurface_color"--> Castle_B + NG_CastleBlack_base_color_output --"subsurface_radius"--> Castle_B + NG_CastleBlack_normal_output --"normal"--> Castle_B + Castle_B --"surfaceshader"--> M_Castle_B + NG_CastleWhite_normal7 --"in"--> NG_CastleWhite_mtlxnormalmap9 + NG_CastleWhite_diffuse7 --> NG_CastleWhite_base_color_output + NG_CastleWhite_metallic7 --> NG_CastleWhite_metalness_output + NG_CastleWhite_roughness7 --> NG_CastleWhite_roughness_output + NG_CastleWhite_mtlxnormalmap9 --> NG_CastleWhite_normal_output + NG_CastleWhite_base_color_output --"base_color"--> Castle_W + NG_CastleWhite_metalness_output --"metalness"--> Castle_W + NG_CastleWhite_roughness_output --"specular_roughness"--> Castle_W + NG_CastleWhite_base_color_output --"subsurface_color"--> Castle_W + NG_CastleWhite_base_color_output --"subsurface_radius"--> Castle_W + NG_CastleWhite_normal_output --"normal"--> Castle_W + Castle_W --"surfaceshader"--> M_Castle_W + NG_ChessBoard_mtlximage15 --"in"--> NG_ChessBoard_mtlxnormalmap12 + NG_ChessBoard_mtlximage13 --> NG_ChessBoard_base_color_output + NG_ChessBoard_mtlximage16 --> NG_ChessBoard_metalness_output + NG_ChessBoard_mtlximage17 --> NG_ChessBoard_roughness_output + NG_ChessBoard_mtlxnormalmap12 --> NG_ChessBoard_normal_output + NG_ChessBoard_base_color_output --"base_color"--> Chessboard + NG_ChessBoard_metalness_output --"metalness"--> Chessboard + NG_ChessBoard_roughness_output --"specular_roughness"--> Chessboard + NG_ChessBoard_base_color_output --"subsurface_color"--> Chessboard + NG_ChessBoard_base_color_output --"subsurface_radius"--> Chessboard + NG_ChessBoard_normal_output --"normal"--> Chessboard + Chessboard --"surfaceshader"--> M_Chessboard + NG_KingBlack_mtlximage6 --"in"--> NG_KingBlack_mtlxnormalmap1 + NG_KingBlack_mtlximage1 --> NG_KingBlack_base_color_output + NG_KingBlack_mtlximage2 --> NG_KingBlack_metalness_output + NG_KingBlack_mtlximage4 --> NG_KingBlack_roughness_output + NG_KingBlack_mtlximage3 --> NG_KingBlack_subsurface_output + NG_KingBlack_mtlxnormalmap1 --> NG_KingBlack_normal_output + NG_KingBlack_base_color_output --"base_color"--> King_B + NG_KingBlack_metalness_output --"metalness"--> King_B + NG_KingBlack_roughness_output --"specular_roughness"--> King_B + NG_KingBlack_subsurface_output --"subsurface"--> King_B + NG_KingBlack_base_color_output --"subsurface_color"--> King_B + NG_KingBlack_base_color_output --"subsurface_radius"--> King_B + NG_KingBlack_normal_output --"normal"--> King_B + King_B --"surfaceshader"--> M_King_B + NG_KingWhite_mtlximage9 --"in"--> NG_KingWhite_mtlxnormalmap11 + NG_KingWhite_mtlximage7 --> NG_KingWhite_base_color_output + NG_KingWhite_mtlximage10 --> NG_KingWhite_metalness_output + NG_KingWhite_mtlximage11 --> NG_KingWhite_roughness_output + NG_KingWhite_mtlximage8 --> NG_KingWhite_subsurface_output + NG_KingWhite_mtlxnormalmap11 --> NG_KingWhite_normal_output + NG_KingWhite_base_color_output --"base_color"--> King_W + NG_KingWhite_metalness_output --"metalness"--> King_W + NG_KingWhite_roughness_output --"specular_roughness"--> King_W + NG_KingWhite_subsurface_output --"subsurface"--> King_W + NG_KingWhite_base_color_output --"subsurface_color"--> King_W + NG_KingWhite_base_color_output --"subsurface_radius"--> King_W + NG_KingWhite_normal_output --"normal"--> King_W + King_W --"surfaceshader"--> M_King_W + NG_KnightBlack_normal4 --"in"--> NG_KnightBlack_mtlxnormalmap6 + NG_KnightBlack_diffuse4 --> NG_KnightBlack_base_color_output + NG_KnightBlack_roughness4 --> NG_KnightBlack_roughness_output + NG_KnightBlack_mtlxnormalmap6 --> NG_KnightBlack_normal_output + NG_KnightBlack_base_color_output --"base_color"--> Knight_B + NG_KnightBlack_roughness_output --"specular_roughness"--> Knight_B + NG_KnightBlack_base_color_output --"subsurface_color"--> Knight_B + NG_KnightBlack_base_color_output --"subsurface_radius"--> Knight_B + NG_KnightBlack_normal_output --"normal"--> Knight_B + Knight_B --"surfaceshader"--> M_Knight_B + NG_KnightWhite_normal5 --"in"--> NG_KnightWhite_mtlxnormalmap7 + NG_KnightWhite_diffuse5 --> NG_KnightWhite_base_color_output + NG_KnightWhite_roughness5 --> NG_KnightWhite_roughness_output + NG_KnightWhite_mtlxnormalmap7 --> NG_KnightWhite_normal_output + NG_KnightWhite_base_color_output --"base_color"--> Knight_W + NG_KnightWhite_roughness_output --"specular_roughness"--> Knight_W + NG_KnightWhite_base_color_output --"subsurface_color"--> Knight_W + NG_KnightWhite_base_color_output --"subsurface_radius"--> Knight_W + NG_KnightWhite_normal_output --"normal"--> Knight_W + Knight_W --"surfaceshader"--> M_Knight_W + NG_PawnBodyBlack_normal9 --"in"--> NG_PawnBodyBlack_mtlxnormalmap13 + NG_PawnBodyBlack_diffuse9 --> NG_PawnBodyBlack_base_color_output + NG_PawnBodyBlack_metallic9 --> NG_PawnBodyBlack_metalness_output + NG_PawnBodyBlack_roughness9 --> NG_PawnBodyBlack_roughness_output + NG_PawnBodyBlack_mtlxnormalmap13 --> NG_PawnBodyBlack_normal_output + NG_PawnBodyBlack_base_color_output --"base_color"--> Pawn_Body_B + NG_PawnBodyBlack_metalness_output --"metalness"--> Pawn_Body_B + NG_PawnBodyBlack_roughness_output --"specular_roughness"--> Pawn_Body_B + NG_PawnBodyBlack_base_color_output --"subsurface_color"--> Pawn_Body_B + NG_PawnBodyBlack_base_color_output --"subsurface_radius"--> Pawn_Body_B + NG_PawnBodyBlack_normal_output --"normal"--> Pawn_Body_B + Pawn_Body_B --"surfaceshader"--> M_Pawn_Body_B + NG_PawnBodyWhite_normal8 --"in"--> NG_PawnBodyWhite_mtlxnormalmap10 + NG_PawnBodyWhite_diffuse8 --> NG_PawnBodyWhite_base_color_output + NG_PawnBodyWhite_metallic8 --> NG_PawnBodyWhite_metalness_output + NG_PawnBodyWhite_roughness8 --> NG_PawnBodyWhite_roughness_output + NG_PawnBodyWhite_mtlxnormalmap10 --> NG_PawnBodyWhite_normal_output + NG_PawnBodyWhite_base_color_output --"base_color"--> Pawn_Body_W + NG_PawnBodyWhite_metalness_output --"metalness"--> Pawn_Body_W + NG_PawnBodyWhite_roughness_output --"specular_roughness"--> Pawn_Body_W + NG_PawnBodyWhite_base_color_output --"subsurface_color"--> Pawn_Body_W + NG_PawnBodyWhite_base_color_output --"subsurface_radius"--> Pawn_Body_W + NG_PawnBodyWhite_normal_output --"normal"--> Pawn_Body_W + Pawn_Body_W --"surfaceshader"--> M_Pawn_Body_W + NG_PawnTopBlack_mtlximage18 --"in"--> NG_PawnTopBlack_mtlxnormalmap14 + NG_PawnTopBlack_mtlximage19 --> NG_PawnTopBlack_roughness_output + NG_PawnTopBlack_mtlxnormalmap14 --> NG_PawnTopBlack_normal_output + NG_PawnTopBlack_roughness_output --"specular_roughness"--> Pawn_Top_B + NG_PawnTopBlack_normal_output --"normal"--> Pawn_Top_B + Pawn_Top_B --"surfaceshader"--> M_Pawn_Top_B + NG_PawnTopWhite_mtlximage20 --"in"--> NG_PawnTopWhite_mtlxnormalmap15 + NG_PawnTopWhite_mtlximage21 --> NG_PawnTopWhite_roughness_output + NG_PawnTopWhite_mtlxnormalmap15 --> NG_PawnTopWhite_normal_output + NG_PawnTopWhite_roughness_output --"specular_roughness"--> Pawn_Top_W + NG_PawnTopWhite_normal_output --"normal"--> Pawn_Top_W + Pawn_Top_W --"surfaceshader"--> M_Pawn_Top_W + NG_QueenBlack_normal --"in"--> NG_QueenBlack_mtlxnormalmap2 + NG_QueenBlack_diffuse --> NG_QueenBlack_base_color_output + NG_QueenBlack_metallic --> NG_QueenBlack_metalness_output + NG_QueenBlack_roughness --> NG_QueenBlack_roughness_output + NG_QueenBlack_sss --> NG_QueenBlack_subsurface_output + NG_QueenBlack_mtlxnormalmap2 --> NG_QueenBlack_normal_output + NG_QueenBlack_base_color_output --"base_color"--> Queen_B + NG_QueenBlack_metalness_output --"metalness"--> Queen_B + NG_QueenBlack_roughness_output --"specular_roughness"--> Queen_B + NG_QueenBlack_subsurface_output --"subsurface"--> Queen_B + NG_QueenBlack_base_color_output --"subsurface_color"--> Queen_B + NG_QueenBlack_base_color_output --"subsurface_radius"--> Queen_B + NG_QueenBlack_normal_output --"normal"--> Queen_B + Queen_B --"surfaceshader"--> M_Queen_B + NG_QueenWhite_normal1 --"in"--> NG_QueenWhite_mtlxnormalmap3 + NG_QueenWhite_diffuse1 --> NG_QueenWhite_base_color_output + NG_QueenWhite_metallic1 --> NG_QueenWhite_metalness_output + NG_QueenWhite_roughness1 --> NG_QueenWhite_roughness_output + NG_QueenWhite_sss1 --> NG_QueenWhite_subsurface_output + NG_QueenWhite_mtlxnormalmap3 --> NG_QueenWhite_normal_output + NG_QueenWhite_base_color_output --"base_color"--> Queen_W + NG_QueenWhite_metalness_output --"metalness"--> Queen_W + NG_QueenWhite_roughness_output --"specular_roughness"--> Queen_W + NG_QueenWhite_subsurface_output --"subsurface"--> Queen_W + NG_QueenWhite_base_color_output --"subsurface_color"--> Queen_W + NG_QueenWhite_base_color_output --"subsurface_radius"--> Queen_W + NG_QueenWhite_normal_output --"normal"--> Queen_W + Queen_W --"surfaceshader"--> M_Queen_W +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_chrome.md b/resources/Materials/Examples/StandardSurface/standard_surface_chrome.md new file mode 100644 index 00000000..b284944a --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_chrome.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_chrome[SR_chrome] + style Chrome fill:#090, color:#FFF + Chrome([Chrome]) + SR_chrome --"surfaceshader"--> Chrome +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_copper.md b/resources/Materials/Examples/StandardSurface/standard_surface_copper.md new file mode 100644 index 00000000..1054d1f4 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_copper.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_copper[SR_copper] + style Copper fill:#090, color:#FFF + Copper([Copper]) + SR_copper --"surfaceshader"--> Copper +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_default.md b/resources/Materials/Examples/StandardSurface/standard_surface_default.md new file mode 100644 index 00000000..3c7985c6 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_default.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_default[SR_default] + style Default fill:#090, color:#FFF + Default([Default]) + SR_default --"surfaceshader"--> Default +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_glass.md b/resources/Materials/Examples/StandardSurface/standard_surface_glass.md new file mode 100644 index 00000000..f136d0b2 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_glass.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_glass[SR_glass] + style Glass fill:#090, color:#FFF + Glass([Glass]) + SR_glass --"surfaceshader"--> Glass +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_glass_tinted.md b/resources/Materials/Examples/StandardSurface/standard_surface_glass_tinted.md new file mode 100644 index 00000000..efe2e778 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_glass_tinted.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_glass_tinted[SR_glass_tinted] + style GlassTinted fill:#090, color:#FFF + GlassTinted([GlassTinted]) + SR_glass_tinted --"surfaceshader"--> GlassTinted +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_gold.md b/resources/Materials/Examples/StandardSurface/standard_surface_gold.md new file mode 100644 index 00000000..0e112dfb --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_gold.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_gold[SR_gold] + style Gold fill:#090, color:#FFF + Gold([Gold]) + SR_gold --"surfaceshader"--> Gold +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_greysphere.md b/resources/Materials/Examples/StandardSurface/standard_surface_greysphere.md new file mode 100644 index 00000000..82d1daf9 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_greysphere.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_greysphere[SR_greysphere] + style Greysphere fill:#090, color:#FFF + Greysphere([Greysphere]) + SR_greysphere --"surfaceshader"--> Greysphere +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.md b/resources/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.md new file mode 100644 index 00000000..d7121f73 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_greysphere_calibration.md @@ -0,0 +1,18 @@ +```mermaid +graph LR + subgraph NG_Greysphere_Calibration + style NG_Greysphere_Calibration_out1 fill:#0C0, color:#FFF + NG_Greysphere_Calibration_out1([out1]) + NG_Greysphere_Calibration_texcoord1[texcoord1] + NG_Greysphere_Calibration_place2d[place2d] + NG_Greysphere_Calibration_image1[image1] + end + SR_Greysphere_Calibration[SR_Greysphere_Calibration] + style Greysphere_Calibration fill:#090, color:#FFF + Greysphere_Calibration([Greysphere_Calibration]) + NG_Greysphere_Calibration_texcoord1 --"texcoord"--> NG_Greysphere_Calibration_place2d + NG_Greysphere_Calibration_place2d --"texcoord"--> NG_Greysphere_Calibration_image1 + NG_Greysphere_Calibration_image1 --> NG_Greysphere_Calibration_out1 + NG_Greysphere_Calibration_out1 --"base_color"--> SR_Greysphere_Calibration + SR_Greysphere_Calibration --"surfaceshader"--> Greysphere_Calibration +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_jade.md b/resources/Materials/Examples/StandardSurface/standard_surface_jade.md new file mode 100644 index 00000000..b9396a08 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_jade.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_jade[SR_jade] + style Jade fill:#090, color:#FFF + Jade([Jade]) + SR_jade --"surfaceshader"--> Jade +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_look_brass_tiled.mtlx b/resources/Materials/Examples/StandardSurface/standard_surface_look_brass_tiled.mtlx new file mode 100644 index 00000000..8c3a181a --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_look_brass_tiled.mtlx @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_look_wood_tiled.mtlx b/resources/Materials/Examples/StandardSurface/standard_surface_look_wood_tiled.mtlx new file mode 100644 index 00000000..89979932 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_look_wood_tiled.mtlx @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_marble_solid.md b/resources/Materials/Examples/StandardSurface/standard_surface_marble_solid.md new file mode 100644 index 00000000..48267dcd --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_marble_solid.md @@ -0,0 +1,56 @@ +```mermaid +graph LR + subgraph NG_marble1 + style NG_marble1_base_color_1 fill:#09D, color:#FFF + NG_marble1_base_color_1([base_color_1:0.8, 0.8, 0.8]) + style NG_marble1_base_color_2 fill:#09D, color:#FFF + NG_marble1_base_color_2([base_color_2:0.1, 0.1, 0.3]) + style NG_marble1_noise_scale_1 fill:#09D, color:#FFF + NG_marble1_noise_scale_1([noise_scale_1:6.0]) + style NG_marble1_noise_scale_2 fill:#09D, color:#FFF + NG_marble1_noise_scale_2([noise_scale_2:4.0]) + style NG_marble1_noise_power fill:#09D, color:#FFF + NG_marble1_noise_power([noise_power:3.0]) + style NG_marble1_noise_octaves fill:#09D, color:#FFF + NG_marble1_noise_octaves([noise_octaves:3]) + style NG_marble1_out fill:#0C0, color:#FFF + NG_marble1_out([out]) + NG_marble1_obj_pos[obj_pos] + NG_marble1_add_xyz[add_xyz] + NG_marble1_scale_xyz[scale_xyz] + NG_marble1_scale_pos[scale_pos] + NG_marble1_noise[noise] + NG_marble1_scale_noise[scale_noise] + NG_marble1_sum[sum] + NG_marble1_sin[sin] + NG_marble1_scale[scale] + NG_marble1_bias[bias] + NG_marble1_power[power] + NG_marble1_color_mix[color_mix] + end + SR_marble1[SR_marble1] + style Marble_3D fill:#090, color:#FFF + Marble_3D([Marble_3D]) + NG_marble1_obj_pos --"in1"--> NG_marble1_add_xyz + NG_marble1_add_xyz --"in1"--> NG_marble1_scale_xyz + NG_marble1_noise_scale_1 --"in2"--> NG_marble1_scale_xyz + NG_marble1_obj_pos --"in1"--> NG_marble1_scale_pos + NG_marble1_noise_scale_2 --"in2"--> NG_marble1_scale_pos + NG_marble1_noise_octaves --"octaves"--> NG_marble1_noise + NG_marble1_scale_pos --"position"--> NG_marble1_noise + NG_marble1_noise --"in1"--> NG_marble1_scale_noise + NG_marble1_scale_xyz --"in1"--> NG_marble1_sum + NG_marble1_scale_noise --"in2"--> NG_marble1_sum + NG_marble1_sum --"in"--> NG_marble1_sin + NG_marble1_sin --"in1"--> NG_marble1_scale + NG_marble1_scale --"in1"--> NG_marble1_bias + NG_marble1_bias --"in1"--> NG_marble1_power + NG_marble1_noise_power --"in2"--> NG_marble1_power + NG_marble1_base_color_1 --"bg"--> NG_marble1_color_mix + NG_marble1_base_color_2 --"fg"--> NG_marble1_color_mix + NG_marble1_power --"mix"--> NG_marble1_color_mix + NG_marble1_color_mix --> NG_marble1_out + NG_marble1_out --"base_color"--> SR_marble1 + NG_marble1_out --"subsurface_color"--> SR_marble1 + SR_marble1 --"surfaceshader"--> Marble_3D +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_metal_brushed.md b/resources/Materials/Examples/StandardSurface/standard_surface_metal_brushed.md new file mode 100644 index 00000000..a0f081d4 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_metal_brushed.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_metal_brushed[SR_metal_brushed] + style Metal_Brushed fill:#090, color:#FFF + Metal_Brushed([Metal_Brushed]) + SR_metal_brushed --"surfaceshader"--> Metal_Brushed +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_plastic.md b/resources/Materials/Examples/StandardSurface/standard_surface_plastic.md new file mode 100644 index 00000000..a110b556 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_plastic.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_plastic[SR_plastic] + style Plastic fill:#090, color:#FFF + Plastic([Plastic]) + SR_plastic --"surfaceshader"--> Plastic +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_thin_film.md b/resources/Materials/Examples/StandardSurface/standard_surface_thin_film.md new file mode 100644 index 00000000..b9402528 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_thin_film.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_thin_film[SR_thin_film] + style ThinFilm fill:#090, color:#FFF + ThinFilm([ThinFilm]) + SR_thin_film --"surfaceshader"--> ThinFilm +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_velvet.md b/resources/Materials/Examples/StandardSurface/standard_surface_velvet.md new file mode 100644 index 00000000..0227ac68 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_velvet.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_velvet[SR_velvet] + style Velvet fill:#090, color:#FFF + Velvet([Velvet]) + SR_velvet --"surfaceshader"--> Velvet +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/standard_surface_wood_tiled.md b/resources/Materials/Examples/StandardSurface/standard_surface_wood_tiled.md new file mode 100644 index 00000000..53716320 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/standard_surface_wood_tiled.md @@ -0,0 +1,19 @@ +```mermaid +graph LR + subgraph NG_wood1 + style NG_wood1_out_color fill:#0C0, color:#FFF + NG_wood1_out_color([out_color]) + style NG_wood1_out_roughness fill:#0C0, color:#FFF + NG_wood1_out_roughness([out_roughness]) + NG_wood1_image_color[image_color] + NG_wood1_image_roughness[image_roughness] + end + SR_wood1[SR_wood1] + style Tiled_Wood fill:#090, color:#FFF + Tiled_Wood([Tiled_Wood]) + NG_wood1_image_color --> NG_wood1_out_color + NG_wood1_image_roughness --> NG_wood1_out_roughness + NG_wood1_out_color --"base_color"--> SR_wood1 + NG_wood1_out_roughness --"specular_roughness"--> SR_wood1 + SR_wood1 --"surfaceshader"--> Tiled_Wood +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/toon_shade.md b/resources/Materials/Examples/StandardSurface/toon_shade.md new file mode 100644 index 00000000..9d042204 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/toon_shade.md @@ -0,0 +1,110 @@ +```mermaid +graph LR + surface_unlit[surface_unlit] + style surfacematerial fill:#090, color:#FFF + surfacematerial([surfacematerial]) + style ND_toon_sample fill:#00C, color:#FFF + ND_toon_sample[[ND_toon_sample]] + toon_shade1[toon_shade1] + subgraph NG_toon_sample + style NG_toon_sample_base_color fill:#09D, color:#FFF + NG_toon_sample_base_color([base_color:0.0156384, 0.632771, 0.799511]) + style NG_toon_sample_ambient_color fill:#09D, color:#FFF + NG_toon_sample_ambient_color([ambient_color:0.574572, 0.207914, 0.207914]) + style NG_toon_sample_specular_color fill:#09D, color:#FFF + NG_toon_sample_specular_color([specular_color:0.726161, 0.726161, 0.726161]) + style NG_toon_sample_glossiness fill:#09D, color:#FFF + NG_toon_sample_glossiness([glossiness:16]) + style NG_toon_sample_rim_color fill:#09D, color:#FFF + NG_toon_sample_rim_color([rim_color:0.775061, 0.775061, 0.775061]) + style NG_toon_sample_light_direction fill:#09D, color:#FFF + NG_toon_sample_light_direction([light_direction:1.0, -0.5, -0.5]) + style NG_toon_sample_light_color fill:#09D, color:#FFF + NG_toon_sample_light_color([light_color:0.885086, 0.885086, 0.885086]) + style NG_toon_sample_output_color3 fill:#0C0, color:#FFF + NG_toon_sample_output_color3([output_color3]) + NG_toon_sample_normal[normal:world] + NG_toon_sample_NdotL[NdotL] + NG_toon_sample_unit_light_direction[unit_light_direction] + NG_toon_sample_multiply_color3[multiply_color3] + NG_toon_sample_add_color3[add_color3] + NG_toon_sample_smooth_gradient[smooth_gradient] + NG_toon_sample_viewdirection_vector3[viewdirection_vector3:world] + NG_toon_sample_unit_viewdirection[unit_viewdirection] + NG_toon_sample_multiply_float[multiply_float] + NG_toon_sample_specular_intensity_power[specular_intensity_power] + NG_toon_sample_specular_intensity_color[specular_intensity_color] + NG_toon_sample_add_color4[add_color4] + NG_toon_sample_multiply_vector3[multiply_vector3] + NG_toon_sample_specular_remap[specular_remap] + NG_toon_sample_specular[specular] + NG_toon_sample_NdotV[NdotV] + NG_toon_sample_NdotV_invert[NdotV_invert] + NG_toon_sample_add_color5[add_color5] + NG_toon_sample_rim_gradient[rim_gradient] + style NG_toon_sample_rim_amount fill:#500, color:#FFF + NG_toon_sample_rim_amount([rim_amount:0.7]) + NG_toon_sample_add_float[add_float] + NG_toon_sample_subtract_float[subtract_float] + NG_toon_sample_rmi_intensity[rmi_intensity] + style NG_toon_sample_rim_threshold fill:#500, color:#FFF + NG_toon_sample_rim_threshold([rim_threshold:0.1]) + NG_toon_sample_rim_power[rim_power] + NG_toon_sample_multiply_vector4[multiply_vector4] + NG_toon_sample_unit_normal[unit_normal] + NG_toon_sample_rim[rim] + NG_toon_sample_gradient_light[gradient_light] + NG_toon_sample_reflect[reflect] + NG_toon_sample_LdotV[LdotV] + NG_toon_sample_max_float[max_float] + end + toon_shade1 --"emission_color"--> surface_unlit + surface_unlit --"surfaceshader"--> surfacematerial + NG_toon_sample --> ND_toon_sample + NG_toon_sample_multiply_color3 --> NG_toon_sample_output_color3 + NG_toon_sample_unit_normal --"in1"--> NG_toon_sample_NdotL + NG_toon_sample_multiply_vector4 --"in2"--> NG_toon_sample_NdotL + NG_toon_sample_light_direction --"in"--> NG_toon_sample_unit_light_direction + NG_toon_sample_base_color --"in1"--> NG_toon_sample_multiply_color3 + NG_toon_sample_add_color5 --"in2"--> NG_toon_sample_multiply_color3 + NG_toon_sample_gradient_light --"in1"--> NG_toon_sample_add_color3 + NG_toon_sample_ambient_color --"in2"--> NG_toon_sample_add_color3 + NG_toon_sample_NdotL --"in"--> NG_toon_sample_smooth_gradient + NG_toon_sample_viewdirection_vector3 --"in"--> NG_toon_sample_unit_viewdirection + NG_toon_sample_smooth_gradient --"in1"--> NG_toon_sample_multiply_float + NG_toon_sample_max_float --"in2"--> NG_toon_sample_multiply_float + NG_toon_sample_multiply_float --"in1"--> NG_toon_sample_specular_intensity_power + NG_toon_sample_glossiness --"in2"--> NG_toon_sample_specular_intensity_power + NG_toon_sample_specular_remap --"in"--> NG_toon_sample_specular_intensity_color + NG_toon_sample_add_color3 --"in1"--> NG_toon_sample_add_color4 + NG_toon_sample_specular --"in2"--> NG_toon_sample_add_color4 + NG_toon_sample_unit_viewdirection --"in1"--> NG_toon_sample_multiply_vector3 + NG_toon_sample_specular_intensity_power --"in"--> NG_toon_sample_specular_remap + NG_toon_sample_specular_intensity_color --"in1"--> NG_toon_sample_specular + NG_toon_sample_specular_color --"in2"--> NG_toon_sample_specular + NG_toon_sample_unit_normal --"in1"--> NG_toon_sample_NdotV + NG_toon_sample_multiply_vector3 --"in2"--> NG_toon_sample_NdotV + NG_toon_sample_NdotV --"in"--> NG_toon_sample_NdotV_invert + NG_toon_sample_add_color4 --"in1"--> NG_toon_sample_add_color5 + NG_toon_sample_rim --"in2"--> NG_toon_sample_add_color5 + NG_toon_sample_rmi_intensity --"in"--> NG_toon_sample_rim_gradient + NG_toon_sample_add_float --"low"--> NG_toon_sample_rim_gradient + NG_toon_sample_subtract_float --"high"--> NG_toon_sample_rim_gradient + NG_toon_sample_rim_amount --"in1"--> NG_toon_sample_add_float + NG_toon_sample_rim_amount --"in1"--> NG_toon_sample_subtract_float + NG_toon_sample_NdotV_invert --"in1"--> NG_toon_sample_rmi_intensity + NG_toon_sample_rim_power --"in2"--> NG_toon_sample_rmi_intensity + NG_toon_sample_NdotL --"in1"--> NG_toon_sample_rim_power + NG_toon_sample_rim_threshold --"in2"--> NG_toon_sample_rim_power + NG_toon_sample_unit_light_direction --"in1"--> NG_toon_sample_multiply_vector4 + NG_toon_sample_normal --"in"--> NG_toon_sample_unit_normal + NG_toon_sample_rim_color --"in1"--> NG_toon_sample_rim + NG_toon_sample_rim_gradient --"in2"--> NG_toon_sample_rim + NG_toon_sample_smooth_gradient --"in2"--> NG_toon_sample_gradient_light + NG_toon_sample_light_color --"in1"--> NG_toon_sample_gradient_light + NG_toon_sample_unit_viewdirection --"in"--> NG_toon_sample_reflect + NG_toon_sample_unit_normal --"normal"--> NG_toon_sample_reflect + NG_toon_sample_reflect --"in2"--> NG_toon_sample_LdotV + NG_toon_sample_multiply_vector4 --"in1"--> NG_toon_sample_LdotV + NG_toon_sample_LdotV --"in1"--> NG_toon_sample_max_float +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/unity_polygon.md b/resources/Materials/Examples/StandardSurface/unity_polygon.md new file mode 100644 index 00000000..7ce28501 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/unity_polygon.md @@ -0,0 +1,86 @@ +```mermaid +graph LR + subgraph nodegraph1 + style nodegraph1_sides fill:#09D, color:#FFF + nodegraph1_sides([sides:5]) + style nodegraph1_width fill:#09D, color:#FFF + nodegraph1_width([width:0.2]) + style nodegraph1_height fill:#09D, color:#FFF + nodegraph1_height([height:0.2]) + style nodegraph1_output_float fill:#0C0, color:#FFF + nodegraph1_output_float([output_float]) + style nodegraph1_PI fill:#500, color:#FFF + nodegraph1_PI([PI:3.14159265359]) + nodegraph1_cos_float[cos_float] + nodegraph1_divide_float[divide_float] + nodegraph1_aWidth[aWidth] + nodegraph1_aHeight[aHeight] + nodegraph1_texcoord_vector2[texcoord_vector2] + nodegraph1_times_2[times_2] + nodegraph1_minus_1[minus_1] + nodegraph1_width_height_vec[width_height_vec] + nodegraph1_uv[uv] + nodegraph1_convert_float_surfaceshader[convert_float_surfaceshader:0] + nodegraph1_multiply_vector2[multiply_vector2] + nodegraph1_pCoord[pCoord] + nodegraph1_convert_vector2_surfaceshader[convert_vector2_surfaceshader:0, 0] + nodegraph1_unity_note[unity_note:https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Polygon-Node.html] + nodegraph1_extract_x[extract_x] + nodegraph1_extract_y[extract_y] + nodegraph1_pi_div_sides[pi_div_sides] + nodegraph1_r[r] + nodegraph1_add_float[add_float] + nodegraph1_divide_float2[divide_float2] + nodegraph1_floor_float[floor_float] + nodegraph1_multiply_float[multiply_float] + nodegraph1_subtract_float[subtract_float] + nodegraph1_cos_float2[cos_float2] + nodegraph1_distance[distance] + nodegraph1_magnitude_vector2[magnitude_vector2] + nodegraph1_clamp_float[clamp_float] + nodegraph1_one_min_distance[one_min_distance] + nodegraph1_divide_float3[divide_float3] + end + surface_unlit[surface_unlit] + style surfacematerial fill:#090, color:#FFF + surfacematerial([surfacematerial]) + nodegraph1_divide_float --"in"--> nodegraph1_cos_float + nodegraph1_PI --"in1"--> nodegraph1_divide_float + nodegraph1_sides --"in2"--> nodegraph1_divide_float + nodegraph1_width --"in2"--> nodegraph1_aWidth + nodegraph1_cos_float --"in1"--> nodegraph1_aWidth + nodegraph1_height --"in2"--> nodegraph1_aHeight + nodegraph1_cos_float --"in1"--> nodegraph1_aHeight + nodegraph1_texcoord_vector2 --"in1"--> nodegraph1_times_2 + nodegraph1_times_2 --"in1"--> nodegraph1_minus_1 + nodegraph1_width --"in1"--> nodegraph1_width_height_vec + nodegraph1_height --"in2"--> nodegraph1_width_height_vec + nodegraph1_width_height_vec --"in2"--> nodegraph1_uv + nodegraph1_minus_1 --"in1"--> nodegraph1_uv + nodegraph1_uv --"in1"--> nodegraph1_multiply_vector2 + nodegraph1_extract_y --"inx"--> nodegraph1_pCoord + nodegraph1_extract_x --"iny"--> nodegraph1_pCoord + nodegraph1_uv --"in"--> nodegraph1_extract_x + nodegraph1_uv --"in"--> nodegraph1_extract_y + nodegraph1_PI --"in1"--> nodegraph1_pi_div_sides + nodegraph1_sides --"in2"--> nodegraph1_pi_div_sides + nodegraph1_pi_div_sides --"in1"--> nodegraph1_r + nodegraph1_pCoord --"in1"--> nodegraph1_add_float + nodegraph1_r --"in2"--> nodegraph1_divide_float2 + nodegraph1_add_float --"in1"--> nodegraph1_divide_float2 + nodegraph1_divide_float2 --"in"--> nodegraph1_floor_float + nodegraph1_r --"in2"--> nodegraph1_multiply_float + nodegraph1_floor_float --"in1"--> nodegraph1_multiply_float + nodegraph1_multiply_float --"in1"--> nodegraph1_subtract_float + nodegraph1_pCoord --"in2"--> nodegraph1_subtract_float + nodegraph1_subtract_float --"in"--> nodegraph1_cos_float2 + nodegraph1_cos_float2 --"in1"--> nodegraph1_distance + nodegraph1_magnitude_vector2 --"in2"--> nodegraph1_distance + nodegraph1_uv --"in"--> nodegraph1_magnitude_vector2 + nodegraph1_divide_float3 --"in"--> nodegraph1_clamp_float + nodegraph1_distance --"in2"--> nodegraph1_one_min_distance + nodegraph1_one_min_distance --"in1"--> nodegraph1_divide_float3 + nodegraph1_clamp_float --> nodegraph1_output_float + nodegraph1_output_float --"emission"--> surface_unlit + surface_unlit --"surfaceshader"--> surfacematerial +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/unity_polygon.mtlx b/resources/Materials/Examples/StandardSurface/unity_polygon.mtlx new file mode 100644 index 00000000..f06720e3 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/unity_polygon.mtlx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/StandardSurface/unity_polygon2.md b/resources/Materials/Examples/StandardSurface/unity_polygon2.md new file mode 100644 index 00000000..99070794 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/unity_polygon2.md @@ -0,0 +1,78 @@ +```mermaid +graph LR + subgraph nodegraph1 + style nodegraph1_sides fill:#09D, color:#FFF + nodegraph1_sides([sides:10]) + style nodegraph1_width fill:#09D, color:#FFF + nodegraph1_width([width:1]) + style nodegraph1_height fill:#09D, color:#FFF + nodegraph1_height([height:1]) + style nodegraph1_output_float fill:#0C0, color:#FFF + nodegraph1_output_float([output_float]) + style nodegraph1_PI fill:#500, color:#FFF + nodegraph1_PI([PI:3.141592653589793238462643]) + nodegraph1_cos_float[cos_float] + nodegraph1_aWidth[aWidth] + nodegraph1_aHeight[aHeight] + nodegraph1_texcoord_vector2[texcoord_vector2] + nodegraph1_times_2[times_2] + nodegraph1_minus_1[minus_1] + nodegraph1_width_height_vec[width_height_vec] + nodegraph1_uv[uv] + nodegraph1_convert_float_surfaceshader[convert_float_surfaceshader:0] + nodegraph1_multiply_vector2[multiply_vector2] + nodegraph1_pCoord[pCoord] + nodegraph1_convert_vector2_surfaceshader[convert_vector2_surfaceshader:0, 0] + nodegraph1_unity_note[unity_note:https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Polygon-Node.html] + nodegraph1_extract_x[extract_x] + nodegraph1_extract_y[extract_y] + nodegraph1_pi_div_sides[pi_div_sides] + nodegraph1_r[r] + nodegraph1_pCoord_plus_half[pCoord_plus_half] + nodegraph1_divide_r[divide_r] + nodegraph1_floor_float[floor_float] + nodegraph1_multiply_r[multiply_r] + nodegraph1_subtract_pCoord[subtract_pCoord] + nodegraph1_cos_float2[cos_float2] + nodegraph1_distance[distance] + nodegraph1_length_texcoord[length_texcoord] + nodegraph1_clamp_float[clamp_float] + nodegraph1_one_min_distance[one_min_distance] + nodegraph1_divide_float3[divide_float3] + end + nodegraph1_pi_div_sides --"in"--> nodegraph1_cos_float + nodegraph1_width --"in2"--> nodegraph1_aWidth + nodegraph1_cos_float --"in1"--> nodegraph1_aWidth + nodegraph1_height --"in2"--> nodegraph1_aHeight + nodegraph1_cos_float --"in1"--> nodegraph1_aHeight + nodegraph1_texcoord_vector2 --"in1"--> nodegraph1_times_2 + nodegraph1_times_2 --"in1"--> nodegraph1_minus_1 + nodegraph1_aWidth --"in1"--> nodegraph1_width_height_vec + nodegraph1_aHeight --"in2"--> nodegraph1_width_height_vec + nodegraph1_width_height_vec --"in2"--> nodegraph1_uv + nodegraph1_minus_1 --"in1"--> nodegraph1_uv + nodegraph1_uv --"in1"--> nodegraph1_multiply_vector2 + nodegraph1_extract_x --"inx"--> nodegraph1_pCoord + nodegraph1_extract_y --"iny"--> nodegraph1_pCoord + nodegraph1_multiply_vector2 --"in"--> nodegraph1_extract_x + nodegraph1_multiply_vector2 --"in"--> nodegraph1_extract_y + nodegraph1_PI --"in1"--> nodegraph1_pi_div_sides + nodegraph1_sides --"in2"--> nodegraph1_pi_div_sides + nodegraph1_pi_div_sides --"in1"--> nodegraph1_r + nodegraph1_pCoord --"in1"--> nodegraph1_pCoord_plus_half + nodegraph1_r --"in2"--> nodegraph1_divide_r + nodegraph1_pCoord_plus_half --"in1"--> nodegraph1_divide_r + nodegraph1_divide_r --"in"--> nodegraph1_floor_float + nodegraph1_r --"in2"--> nodegraph1_multiply_r + nodegraph1_floor_float --"in1"--> nodegraph1_multiply_r + nodegraph1_multiply_r --"in1"--> nodegraph1_subtract_pCoord + nodegraph1_pCoord --"in2"--> nodegraph1_subtract_pCoord + nodegraph1_subtract_pCoord --"in"--> nodegraph1_cos_float2 + nodegraph1_cos_float2 --"in1"--> nodegraph1_distance + nodegraph1_length_texcoord --"in2"--> nodegraph1_distance + nodegraph1_multiply_vector2 --"in"--> nodegraph1_length_texcoord + nodegraph1_divide_float3 --"in"--> nodegraph1_clamp_float + nodegraph1_distance --"in2"--> nodegraph1_one_min_distance + nodegraph1_one_min_distance --"in1"--> nodegraph1_divide_float3 + nodegraph1_clamp_float --> nodegraph1_output_float +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/unity_polygon2.mtlx b/resources/Materials/Examples/StandardSurface/unity_polygon2.mtlx new file mode 100644 index 00000000..d5b86f5a --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/unity_polygon2.mtlx @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/Materials/Examples/StandardSurface/unity_polygon2_graph.md b/resources/Materials/Examples/StandardSurface/unity_polygon2_graph.md new file mode 100644 index 00000000..55f65d11 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/unity_polygon2_graph.md @@ -0,0 +1,78 @@ +```mermaid +graph LR + subgraph nodegraph1 + nodegraph1/sides([sides:10]) + style nodegraph1/sides fill:#09D, color:#111 + nodegraph1/width([width:1]) + style nodegraph1/width fill:#09D, color:#111 + nodegraph1/height([height:1]) + style nodegraph1/height fill:#09D, color:#111 + nodegraph1/output_float([output_float]) + style nodegraph1/output_float fill:#0C0, color:#111 + nodegraph1/PI([PI:3.141592653589793238462643]) + style nodegraph1/PI fill:#500, color:#111 + nodegraph1/cos_float[cos_float] + nodegraph1/aWidth[aWidth] + nodegraph1/aHeight[aHeight] + nodegraph1/texcoord_vector2[texcoord_vector2] + nodegraph1/times_2[times_2] + nodegraph1/minus_1[minus_1] + nodegraph1/width_height_vec[width_height_vec] + nodegraph1/uv[uv] + nodegraph1/convert_float_surfaceshader[convert_float_surfaceshader:0] + nodegraph1/multiply_vector2[multiply_vector2] + nodegraph1/pCoord[pCoord] + nodegraph1/convert_vector2_surfaceshader[convert_vector2_surfaceshader:0, 0] + nodegraph1/unity_note[unity_note:https://docs.unity3d.com/Packages/com.unity.shadergraph@6.9/manual/Polygon-Node.html] + nodegraph1/extract_x[extract_x] + nodegraph1/extract_y[extract_y] + nodegraph1/pi_div_sides[pi_div_sides] + nodegraph1/r[r] + nodegraph1/pCoord_plus_half[pCoord_plus_half] + nodegraph1/divide_r[divide_r] + nodegraph1/floor_float[floor_float] + nodegraph1/multiply_r[multiply_r] + nodegraph1/subtract_pCoord[subtract_pCoord] + nodegraph1/cos_float2[cos_float2] + nodegraph1/distance[distance] + nodegraph1/length_texcoord[length_texcoord] + nodegraph1/clamp_float[clamp_float] + nodegraph1/one_min_distance[one_min_distance] + nodegraph1/divide_float3[divide_float3] + end + nodegraph1/pi_div_sides --"in"--> nodegraph1/cos_float + nodegraph1/width --"in2"--> nodegraph1/aWidth + nodegraph1/cos_float --"in1"--> nodegraph1/aWidth + nodegraph1/height --"in2"--> nodegraph1/aHeight + nodegraph1/cos_float --"in1"--> nodegraph1/aHeight + nodegraph1/texcoord_vector2 --"in1"--> nodegraph1/times_2 + nodegraph1/times_2 --"in1"--> nodegraph1/minus_1 + nodegraph1/aWidth --"in1"--> nodegraph1/width_height_vec + nodegraph1/aHeight --"in2"--> nodegraph1/width_height_vec + nodegraph1/width_height_vec --"in2"--> nodegraph1/uv + nodegraph1/minus_1 --"in1"--> nodegraph1/uv + nodegraph1/uv --"in1"--> nodegraph1/multiply_vector2 + nodegraph1/extract_x --"inx"--> nodegraph1/pCoord + nodegraph1/extract_y --"iny"--> nodegraph1/pCoord + nodegraph1/multiply_vector2 --"in"--> nodegraph1/extract_x + nodegraph1/multiply_vector2 --"in"--> nodegraph1/extract_y + nodegraph1/PI --"in1"--> nodegraph1/pi_div_sides + nodegraph1/sides --"in2"--> nodegraph1/pi_div_sides + nodegraph1/pi_div_sides --"in1"--> nodegraph1/r + nodegraph1/pCoord --"in1"--> nodegraph1/pCoord_plus_half + nodegraph1/r --"in2"--> nodegraph1/divide_r + nodegraph1/pCoord_plus_half --"in1"--> nodegraph1/divide_r + nodegraph1/divide_r --"in"--> nodegraph1/floor_float + nodegraph1/r --"in2"--> nodegraph1/multiply_r + nodegraph1/floor_float --"in1"--> nodegraph1/multiply_r + nodegraph1/multiply_r --"in1"--> nodegraph1/subtract_pCoord + nodegraph1/pCoord --"in2"--> nodegraph1/subtract_pCoord + nodegraph1/subtract_pCoord --"in"--> nodegraph1/cos_float2 + nodegraph1/cos_float2 --"in1"--> nodegraph1/distance + nodegraph1/length_texcoord --"in2"--> nodegraph1/distance + nodegraph1/multiply_vector2 --"in"--> nodegraph1/length_texcoord + nodegraph1/divide_float3 --"in"--> nodegraph1/clamp_float + nodegraph1/distance --"in2"--> nodegraph1/one_min_distance + nodegraph1/one_min_distance --"in1"--> nodegraph1/divide_float3 + nodegraph1/clamp_float --> nodegraph1/output_float +``` \ No newline at end of file diff --git a/resources/Materials/Examples/StandardSurface/unlitshader_default.md b/resources/Materials/Examples/StandardSurface/unlitshader_default.md new file mode 100644 index 00000000..52440003 --- /dev/null +++ b/resources/Materials/Examples/StandardSurface/unlitshader_default.md @@ -0,0 +1,9 @@ +```mermaid +graph LR + surface_unlit[surface_unlit] + style surfacematerial fill:#090, color:#FFF + surfacematerial([surfacematerial]) + checkerboard_color3[checkerboard_color3:10, 10] + checkerboard_color3 --"emission_color"--> surface_unlit + surface_unlit --"surfaceshader"--> surfacematerial +``` \ No newline at end of file diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled.md b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled.md new file mode 100644 index 00000000..44b3eeac --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled.md @@ -0,0 +1,19 @@ +```mermaid +graph LR + subgraph NG_brass1 + style NG_brass1_out_color fill:#0C0, color:#FFF + NG_brass1_out_color([out_color]) + style NG_brass1_out_roughness fill:#0C0, color:#FFF + NG_brass1_out_roughness([out_roughness]) + NG_brass1_image_color[image_color] + NG_brass1_image_roughness[image_roughness] + end + SR_brass1[SR_brass1] + style USD_Tiled_Brass fill:#090, color:#FFF + USD_Tiled_Brass([USD_Tiled_Brass]) + NG_brass1_image_color --> NG_brass1_out_color + NG_brass1_image_roughness --> NG_brass1_out_roughness + NG_brass1_out_color --"diffuseColor"--> SR_brass1 + NG_brass1_out_roughness --"roughness"--> SR_brass1 + SR_brass1 --"surfaceshader"--> USD_Tiled_Brass +``` \ No newline at end of file diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled_connections.json b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled_connections.json new file mode 100644 index 00000000..f1437ae2 --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_brass_tiled_connections.json @@ -0,0 +1,83 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_brass_tiled.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "NG_brass1": [ + [ + "NG_brass1/out_color", + "output", + "color3", + "" + ], + [ + "NG_brass1/out_roughness", + "output", + "float", + "" + ], + [ + "NG_brass1/image_color", + "tiledimage", + "color3", + "" + ], + [ + "NG_brass1/image_roughness", + "tiledimage", + "float", + "" + ] + ], + "": [ + [ + "SR_brass1", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Tiled_Brass", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "NG_brass1/image_color", + "", + "NG_brass1/out_color", + "", + "nodename" + ], + [ + "NG_brass1/image_roughness", + "", + "NG_brass1/out_roughness", + "", + "nodename" + ], + [ + "NG_brass1/out_color", + "", + "SR_brass1", + "diffuseColor", + "nodename" + ], + [ + "NG_brass1/out_roughness", + "", + "SR_brass1", + "roughness", + "nodename" + ], + [ + "SR_brass1", + "", + "USD_Tiled_Brass", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint.md b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint.md new file mode 100644 index 00000000..f56962ee --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_carpaint[SR_carpaint] + style USD_Car_Paint fill:#090, color:#FFF + USD_Car_Paint([USD_Car_Paint]) + SR_carpaint --"surfaceshader"--> USD_Car_Paint +``` \ No newline at end of file diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint_connections.json b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint_connections.json new file mode 100644 index 00000000..ff039fd2 --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_carpaint_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_carpaint.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_carpaint", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Car_Paint", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_carpaint", + "", + "USD_Car_Paint", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default.md b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default.md new file mode 100644 index 00000000..6026d141 --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_default[SR_default] + style USD_Default fill:#090, color:#FFF + USD_Default([USD_Default]) + SR_default --"surfaceshader"--> USD_Default +``` \ No newline at end of file diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default_connections.json b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default_connections.json new file mode 100644 index 00000000..56d7321a --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_default_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_default.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_default", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Default", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_default", + "", + "USD_Default", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass.md b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass.md new file mode 100644 index 00000000..370b1481 --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_glass[SR_glass] + style USD_Glass fill:#090, color:#FFF + USD_Glass([USD_Glass]) + SR_glass --"surfaceshader"--> USD_Glass +``` \ No newline at end of file diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass_connections.json b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass_connections.json new file mode 100644 index 00000000..7aa204bd --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_glass_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_glass.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_glass", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Glass", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_glass", + "", + "USD_Glass", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold.md b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold.md new file mode 100644 index 00000000..1e188dc8 --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_gold[SR_gold] + style USD_Gold fill:#090, color:#FFF + USD_Gold([USD_Gold]) + SR_gold --"surfaceshader"--> USD_Gold +``` \ No newline at end of file diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold_connections.json b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold_connections.json new file mode 100644 index 00000000..9091f8af --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_gold_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_gold.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_gold", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Gold", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_gold", + "", + "USD_Gold", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic.md b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic.md new file mode 100644 index 00000000..490b069e --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic.md @@ -0,0 +1,7 @@ +```mermaid +graph LR + SR_plastic[SR_plastic] + style USD_Plastic fill:#090, color:#FFF + USD_Plastic([USD_Plastic]) + SR_plastic --"surfaceshader"--> USD_Plastic +``` \ No newline at end of file diff --git a/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic_connections.json b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic_connections.json new file mode 100644 index 00000000..9083489a --- /dev/null +++ b/resources/Materials/Examples/UsdPreviewSurface/usd_preview_surface_plastic_connections.json @@ -0,0 +1,29 @@ +{ + "doc": "Graph connections for: ..\\resources\\Materials\\Examples\\UsdPreviewSurface\\usd_preview_surface_plastic.mtlx", + "copyright": "Copyright 2024, NanMu Consulting. kwokcb@gmail.com", + "graph": { + "": [ + [ + "SR_plastic", + "UsdPreviewSurface", + "surfaceshader", + "" + ], + [ + "USD_Plastic", + "surfacematerial", + "material", + "" + ] + ] + }, + "connections": [ + [ + "SR_plastic", + "", + "USD_Plastic", + "surfaceshader", + "nodename" + ] + ] +} diff --git a/resources/mtlx/nodedef_materials/add_integer.mtlx b/resources/mtlx/nodedef_materials/add_integer.mtlx new file mode 100644 index 00000000..72490d0d --- /dev/null +++ b/resources/mtlx/nodedef_materials/add_integer.mtlx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/atan2_float.mtlx b/resources/mtlx/nodedef_materials/atan2_float.mtlx index 985526a0..6046ef41 100644 --- a/resources/mtlx/nodedef_materials/atan2_float.mtlx +++ b/resources/mtlx/nodedef_materials/atan2_float.mtlx @@ -1,8 +1,8 @@ - - + + diff --git a/resources/mtlx/nodedef_materials/atan2_vector2.mtlx b/resources/mtlx/nodedef_materials/atan2_vector2.mtlx index 39f154e0..5873f16a 100644 --- a/resources/mtlx/nodedef_materials/atan2_vector2.mtlx +++ b/resources/mtlx/nodedef_materials/atan2_vector2.mtlx @@ -1,8 +1,8 @@ - - + + diff --git a/resources/mtlx/nodedef_materials/atan2_vector3.mtlx b/resources/mtlx/nodedef_materials/atan2_vector3.mtlx index 7d62fbdb..726f55ad 100644 --- a/resources/mtlx/nodedef_materials/atan2_vector3.mtlx +++ b/resources/mtlx/nodedef_materials/atan2_vector3.mtlx @@ -1,8 +1,8 @@ - - + + diff --git a/resources/mtlx/nodedef_materials/atan2_vector4.mtlx b/resources/mtlx/nodedef_materials/atan2_vector4.mtlx index 6720309f..2c661aba 100644 --- a/resources/mtlx/nodedef_materials/atan2_vector4.mtlx +++ b/resources/mtlx/nodedef_materials/atan2_vector4.mtlx @@ -1,8 +1,8 @@ - - + + diff --git a/resources/mtlx/nodedef_materials/conductor_bsdf.mtlx b/resources/mtlx/nodedef_materials/conductor_bsdf.mtlx index 22e761f3..faebb056 100644 --- a/resources/mtlx/nodedef_materials/conductor_bsdf.mtlx +++ b/resources/mtlx/nodedef_materials/conductor_bsdf.mtlx @@ -5,6 +5,8 @@ + + diff --git a/resources/mtlx/nodedef_materials/dielectric_bsdf.mtlx b/resources/mtlx/nodedef_materials/dielectric_bsdf.mtlx index 02fa2b07..7931f339 100644 --- a/resources/mtlx/nodedef_materials/dielectric_bsdf.mtlx +++ b/resources/mtlx/nodedef_materials/dielectric_bsdf.mtlx @@ -5,6 +5,8 @@ + + diff --git a/resources/mtlx/nodedef_materials/generalized_schlick_bsdf.mtlx b/resources/mtlx/nodedef_materials/generalized_schlick_bsdf.mtlx index 88d354e5..a745e9e2 100644 --- a/resources/mtlx/nodedef_materials/generalized_schlick_bsdf.mtlx +++ b/resources/mtlx/nodedef_materials/generalized_schlick_bsdf.mtlx @@ -3,9 +3,12 @@ + + + diff --git a/resources/mtlx/nodedef_materials/ifequal_integer.mtlx b/resources/mtlx/nodedef_materials/ifequal_integer.mtlx new file mode 100644 index 00000000..1e60c624 --- /dev/null +++ b/resources/mtlx/nodedef_materials/ifequal_integer.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/ifequal_integerB.mtlx b/resources/mtlx/nodedef_materials/ifequal_integerB.mtlx new file mode 100644 index 00000000..2971eee4 --- /dev/null +++ b/resources/mtlx/nodedef_materials/ifequal_integerB.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/ifequal_integerI.mtlx b/resources/mtlx/nodedef_materials/ifequal_integerI.mtlx new file mode 100644 index 00000000..7f6822fc --- /dev/null +++ b/resources/mtlx/nodedef_materials/ifequal_integerI.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/ifgreater_integer.mtlx b/resources/mtlx/nodedef_materials/ifgreater_integer.mtlx new file mode 100644 index 00000000..79f53a82 --- /dev/null +++ b/resources/mtlx/nodedef_materials/ifgreater_integer.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/ifgreater_integerI.mtlx b/resources/mtlx/nodedef_materials/ifgreater_integerI.mtlx new file mode 100644 index 00000000..47775996 --- /dev/null +++ b/resources/mtlx/nodedef_materials/ifgreater_integerI.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/ifgreatereq_integer.mtlx b/resources/mtlx/nodedef_materials/ifgreatereq_integer.mtlx new file mode 100644 index 00000000..cc068e83 --- /dev/null +++ b/resources/mtlx/nodedef_materials/ifgreatereq_integer.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/ifgreatereq_integerI.mtlx b/resources/mtlx/nodedef_materials/ifgreatereq_integerI.mtlx new file mode 100644 index 00000000..a260be47 --- /dev/null +++ b/resources/mtlx/nodedef_materials/ifgreatereq_integerI.mtlx @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/material_absval_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_absval_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_absval_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_absval_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_absval_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_absval_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_absval_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_absval_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_add_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_add_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_add_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_add_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_add_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_add_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_add_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_add_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_add_integer_out_genglsl.png b/resources/mtlx/nodedef_materials/material_add_integer_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_add_integer_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_add_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_add_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_add_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_add_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_add_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_add_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_add_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_add_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_asin_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_asin_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_asin_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_asin_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_blur_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_blur_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_blur_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_blur_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_blur_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_blur_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_blur_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_blur_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_burn_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_burn_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_burn_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_burn_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ceil_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ceil_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ceil_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ceil_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ceil_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ceil_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ceil_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ceil_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_clamp_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_clamp_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_clamp_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_clamp_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_clamp_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_clamp_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_clamp_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_clamp_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_clamp_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_clamp_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_clamp_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_clamp_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_clamp_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_clamp_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_clamp_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_clamp_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_colorcorrect_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_colorcorrect_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_colorcorrect_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_colorcorrect_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_combine2_color4CF_out_genglsl.png b/resources/mtlx/nodedef_materials/material_combine2_color4CF_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_combine2_color4CF_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_combine2_color4CF_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_combine2_vector4VF_out_genglsl.png b/resources/mtlx/nodedef_materials/material_combine2_vector4VF_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_combine2_vector4VF_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_combine2_vector4VF_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_combine2_vector4VV_out_genglsl.png b/resources/mtlx/nodedef_materials/material_combine2_vector4VV_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_combine2_vector4VV_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_combine2_vector4VV_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_combine4_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_combine4_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_combine4_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_combine4_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_combine4_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_combine4_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_combine4_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_combine4_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_constant_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_constant_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_constant_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_constant_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_constant_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_constant_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_constant_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_constant_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_contrast_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_contrast_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_contrast_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_contrast_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_contrast_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_contrast_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_contrast_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_contrast_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_contrast_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_contrast_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_contrast_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_contrast_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_contrast_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_contrast_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_contrast_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_contrast_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_convert_color4_surfaceshader_out_genglsl.png b/resources/mtlx/nodedef_materials/material_convert_color4_surfaceshader_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_convert_color4_surfaceshader_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_convert_color4_surfaceshader_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_convert_color4_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_convert_color4_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_convert_color4_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_convert_color4_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_convert_float_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_convert_float_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_convert_float_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_convert_float_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_convert_float_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_convert_float_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_convert_float_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_convert_float_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_convert_vector4_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_convert_vector4_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_convert_vector4_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_convert_vector4_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_convert_vector4_surfaceshader_out_genglsl.png b/resources/mtlx/nodedef_materials/material_convert_vector4_surfaceshader_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_convert_vector4_surfaceshader_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_convert_vector4_surfaceshader_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_difference_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_difference_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_difference_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_difference_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_disjointover_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_disjointover_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_disjointover_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_disjointover_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_divide_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_divide_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_divide_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_divide_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_divide_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_divide_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_divide_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_divide_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_divide_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_divide_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_divide_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_divide_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_divide_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_divide_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_divide_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_divide_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_dodge_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_dodge_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_dodge_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_dodge_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_dot_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_dot_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_dot_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_dot_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_dot_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_dot_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_dot_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_dot_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_floor_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_floor_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_floor_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_floor_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_floor_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_floor_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_floor_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_floor_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_fractal3d_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_fractal3d_color4FA_out_genglsl.png index 1d853379..d2be13c0 100644 Binary files a/resources/mtlx/nodedef_materials/material_fractal3d_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_fractal3d_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_fractal3d_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_fractal3d_color4_out_genglsl.png index 1d853379..d2be13c0 100644 Binary files a/resources/mtlx/nodedef_materials/material_fractal3d_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_fractal3d_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_fractal3d_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_fractal3d_vector4FA_out_genglsl.png index 1d853379..d2be13c0 100644 Binary files a/resources/mtlx/nodedef_materials/material_fractal3d_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_fractal3d_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_fractal3d_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_fractal3d_vector4_out_genglsl.png index 1d853379..d2be13c0 100644 Binary files a/resources/mtlx/nodedef_materials/material_fractal3d_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_fractal3d_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_color4B_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_color4B_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifequal_color4B_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifequal_color4B_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_color4I_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_color4I_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifequal_color4I_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifequal_color4I_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifequal_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifequal_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_integerB_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_integerB_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_ifequal_integerB_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_integerI_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_integerI_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_ifequal_integerI_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_integer_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_integer_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_ifequal_integer_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_vector4B_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_vector4B_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifequal_vector4B_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifequal_vector4B_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_vector4I_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_vector4I_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifequal_vector4I_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifequal_vector4I_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifequal_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifequal_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifequal_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifequal_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreater_color4I_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreater_color4I_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifgreater_color4I_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifgreater_color4I_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreater_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreater_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifgreater_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifgreater_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreater_integerI_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreater_integerI_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_ifgreater_integerI_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreater_integer_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreater_integer_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_ifgreater_integer_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreater_vector4I_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreater_vector4I_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifgreater_vector4I_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifgreater_vector4I_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreater_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreater_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifgreater_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifgreater_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreatereq_color4I_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreatereq_color4I_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifgreatereq_color4I_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifgreatereq_color4I_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreatereq_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreatereq_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifgreatereq_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifgreatereq_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreatereq_integerI_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreatereq_integerI_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_ifgreatereq_integerI_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreatereq_integer_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreatereq_integer_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_ifgreatereq_integer_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4I_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4I_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4I_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4I_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ifgreatereq_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_in_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_in_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_in_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_in_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_inside_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_inside_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_inside_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_inside_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ln_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ln_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ln_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ln_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_luminance_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_luminance_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_luminance_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_luminance_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_mask_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_mask_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_mask_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_mask_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_matte_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_matte_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_matte_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_matte_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_max_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_max_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_max_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_max_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_max_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_max_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_max_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_max_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_max_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_max_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_max_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_max_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_max_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_max_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_max_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_max_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_min_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_min_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_min_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_min_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_min_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_min_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_min_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_min_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_min_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_min_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_min_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_min_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_min_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_min_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_min_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_min_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_minus_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_minus_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_minus_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_minus_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_mix_color4_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_mix_color4_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_mix_color4_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_mix_color4_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_mix_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_mix_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_mix_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_mix_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_mix_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_mix_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_mix_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_mix_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_mix_vector4_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_mix_vector4_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_mix_vector4_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_mix_vector4_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_modulo_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_modulo_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_modulo_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_modulo_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_modulo_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_modulo_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_modulo_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_modulo_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_modulo_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_modulo_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_modulo_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_modulo_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_modulo_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_modulo_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_modulo_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_modulo_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_multiply_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_multiply_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_multiply_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_multiply_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_multiply_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_multiply_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_multiply_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_multiply_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_multiply_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_multiply_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_multiply_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_multiply_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_multiply_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_multiply_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_multiply_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_multiply_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_noise2d_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_noise2d_color4FA_out_genglsl.png index bad30f42..17a3849e 100644 Binary files a/resources/mtlx/nodedef_materials/material_noise2d_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_noise2d_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_noise2d_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_noise2d_color4_out_genglsl.png index bad30f42..17a3849e 100644 Binary files a/resources/mtlx/nodedef_materials/material_noise2d_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_noise2d_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_noise2d_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_noise2d_vector4FA_out_genglsl.png index bad30f42..17a3849e 100644 Binary files a/resources/mtlx/nodedef_materials/material_noise2d_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_noise2d_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_noise2d_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_noise2d_vector4_out_genglsl.png index bad30f42..17a3849e 100644 Binary files a/resources/mtlx/nodedef_materials/material_noise2d_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_noise2d_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_noise3d_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_noise3d_color4FA_out_genglsl.png index b8dde453..98d59a02 100644 Binary files a/resources/mtlx/nodedef_materials/material_noise3d_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_noise3d_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_noise3d_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_noise3d_color4_out_genglsl.png index b8dde453..98d59a02 100644 Binary files a/resources/mtlx/nodedef_materials/material_noise3d_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_noise3d_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_noise3d_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_noise3d_vector4FA_out_genglsl.png index b8dde453..98d59a02 100644 Binary files a/resources/mtlx/nodedef_materials/material_noise3d_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_noise3d_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_noise3d_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_noise3d_vector4_out_genglsl.png index b8dde453..98d59a02 100644 Binary files a/resources/mtlx/nodedef_materials/material_noise3d_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_noise3d_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_normalize_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_normalize_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_normalize_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_normalize_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_normalmap_float_out_genglsl.png b/resources/mtlx/nodedef_materials/material_normalmap_float_out_genglsl.png new file mode 100644 index 00000000..d92e6569 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_normalmap_float_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_out_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_out_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_out_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_out_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_outside_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_outside_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_outside_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_outside_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_over_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_over_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_over_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_over_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_overlay_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_overlay_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_overlay_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_overlay_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_plus_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_plus_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_plus_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_plus_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_power_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_power_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_power_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_power_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_power_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_power_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_power_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_power_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_power_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_power_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_power_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_power_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_power_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_power_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_power_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_power_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ramp4_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ramp4_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ramp4_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ramp4_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ramp4_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ramp4_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ramp4_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ramp4_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ramplr_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ramplr_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ramplr_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ramplr_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ramplr_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ramplr_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ramplr_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ramplr_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ramptb_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ramptb_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ramptb_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ramptb_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_ramptb_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_ramptb_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_ramptb_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_ramptb_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_range_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_range_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_range_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_range_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_range_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_range_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_range_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_range_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_range_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_range_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_range_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_range_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_range_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_range_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_range_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_range_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_remap_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_remap_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_remap_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_remap_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_remap_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_remap_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_remap_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_remap_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_remap_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_remap_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_remap_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_remap_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_remap_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_remap_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_remap_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_remap_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_round_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_round_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_round_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_round_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_round_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_round_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_round_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_round_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_safepower_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_safepower_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_safepower_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_safepower_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_safepower_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_safepower_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_safepower_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_safepower_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_safepower_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_safepower_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_safepower_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_safepower_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_safepower_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_safepower_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_safepower_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_safepower_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_saturate_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_saturate_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_saturate_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_saturate_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_screen_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_screen_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_screen_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_screen_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_sign_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_sign_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_sign_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_sign_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_sign_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_sign_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_sign_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_sign_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_sin_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_sin_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_sin_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_sin_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_smoothstep_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_smoothstep_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_smoothstep_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_smoothstep_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_smoothstep_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_smoothstep_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_smoothstep_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_smoothstep_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_smoothstep_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_smoothstep_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_smoothstep_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_smoothstep_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_smoothstep_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_smoothstep_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_smoothstep_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_smoothstep_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_splitlr_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_splitlr_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_splitlr_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_splitlr_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_splitlr_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_splitlr_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_splitlr_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_splitlr_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_splittb_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_splittb_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_splittb_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_splittb_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_splittb_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_splittb_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_splittb_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_splittb_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_sqrt_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_sqrt_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_sqrt_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_sqrt_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_subtract_color4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_subtract_color4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_subtract_color4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_subtract_color4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_subtract_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_subtract_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_subtract_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_subtract_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_subtract_integer_out_genglsl.png b/resources/mtlx/nodedef_materials/material_subtract_integer_out_genglsl.png new file mode 100644 index 00000000..bd5d6033 Binary files /dev/null and b/resources/mtlx/nodedef_materials/material_subtract_integer_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_subtract_vector4FA_out_genglsl.png b/resources/mtlx/nodedef_materials/material_subtract_vector4FA_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_subtract_vector4FA_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_subtract_vector4FA_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_subtract_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_subtract_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_subtract_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_subtract_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_switch_color4I_out_genglsl.png b/resources/mtlx/nodedef_materials/material_switch_color4I_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_switch_color4I_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_switch_color4I_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_switch_color4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_switch_color4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_switch_color4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_switch_color4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_switch_vector4I_out_genglsl.png b/resources/mtlx/nodedef_materials/material_switch_vector4I_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_switch_vector4I_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_switch_vector4I_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_switch_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_switch_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_switch_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_switch_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_tan_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_tan_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_tan_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_tan_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/material_transformmatrix_vector4_out_genglsl.png b/resources/mtlx/nodedef_materials/material_transformmatrix_vector4_out_genglsl.png index 015cbe38..bd5d6033 100644 Binary files a/resources/mtlx/nodedef_materials/material_transformmatrix_vector4_out_genglsl.png and b/resources/mtlx/nodedef_materials/material_transformmatrix_vector4_out_genglsl.png differ diff --git a/resources/mtlx/nodedef_materials/normalmap.mtlx b/resources/mtlx/nodedef_materials/normalmap_float.mtlx similarity index 57% rename from resources/mtlx/nodedef_materials/normalmap.mtlx rename to resources/mtlx/nodedef_materials/normalmap_float.mtlx index 0404ebf9..4a27c642 100644 --- a/resources/mtlx/nodedef_materials/normalmap.mtlx +++ b/resources/mtlx/nodedef_materials/normalmap_float.mtlx @@ -1,14 +1,14 @@ - + - - + + - - + + diff --git a/resources/mtlx/nodedef_materials/standard_surface_to_gltf_pbr.mtlx b/resources/mtlx/nodedef_materials/standard_surface_to_gltf_pbr.mtlx index d4d57564..fc013887 100644 --- a/resources/mtlx/nodedef_materials/standard_surface_to_gltf_pbr.mtlx +++ b/resources/mtlx/nodedef_materials/standard_surface_to_gltf_pbr.mtlx @@ -16,7 +16,6 @@ - @@ -84,10 +83,4 @@ - - - - - - diff --git a/resources/mtlx/nodedef_materials/subtract_integer.mtlx b/resources/mtlx/nodedef_materials/subtract_integer.mtlx new file mode 100644 index 00000000..cedbbd9d --- /dev/null +++ b/resources/mtlx/nodedef_materials/subtract_integer.mtlx @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_color3.mtlx b/resources/mtlx/nodedef_materials/switch_color3.mtlx index e0f6be6b..73f7e6c0 100644 --- a/resources/mtlx/nodedef_materials/switch_color3.mtlx +++ b/resources/mtlx/nodedef_materials/switch_color3.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_color3I.mtlx b/resources/mtlx/nodedef_materials/switch_color3I.mtlx index a68ecdad..544d3e50 100644 --- a/resources/mtlx/nodedef_materials/switch_color3I.mtlx +++ b/resources/mtlx/nodedef_materials/switch_color3I.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_color4.mtlx b/resources/mtlx/nodedef_materials/switch_color4.mtlx index bc1f57bf..b1baffdd 100644 --- a/resources/mtlx/nodedef_materials/switch_color4.mtlx +++ b/resources/mtlx/nodedef_materials/switch_color4.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_color4I.mtlx b/resources/mtlx/nodedef_materials/switch_color4I.mtlx index adce4aab..08285618 100644 --- a/resources/mtlx/nodedef_materials/switch_color4I.mtlx +++ b/resources/mtlx/nodedef_materials/switch_color4I.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_float.mtlx b/resources/mtlx/nodedef_materials/switch_float.mtlx index d65e066d..4ea74db5 100644 --- a/resources/mtlx/nodedef_materials/switch_float.mtlx +++ b/resources/mtlx/nodedef_materials/switch_float.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_floatI.mtlx b/resources/mtlx/nodedef_materials/switch_floatI.mtlx index 6b06ff29..fd65f418 100644 --- a/resources/mtlx/nodedef_materials/switch_floatI.mtlx +++ b/resources/mtlx/nodedef_materials/switch_floatI.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_vector2.mtlx b/resources/mtlx/nodedef_materials/switch_vector2.mtlx index a5aa24af..480defc3 100644 --- a/resources/mtlx/nodedef_materials/switch_vector2.mtlx +++ b/resources/mtlx/nodedef_materials/switch_vector2.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_vector2I.mtlx b/resources/mtlx/nodedef_materials/switch_vector2I.mtlx index 6e3e9650..92e3481d 100644 --- a/resources/mtlx/nodedef_materials/switch_vector2I.mtlx +++ b/resources/mtlx/nodedef_materials/switch_vector2I.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_vector3.mtlx b/resources/mtlx/nodedef_materials/switch_vector3.mtlx index 71ed9c0d..8782e794 100644 --- a/resources/mtlx/nodedef_materials/switch_vector3.mtlx +++ b/resources/mtlx/nodedef_materials/switch_vector3.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_vector3I.mtlx b/resources/mtlx/nodedef_materials/switch_vector3I.mtlx index 9ef14097..f0ffc4eb 100644 --- a/resources/mtlx/nodedef_materials/switch_vector3I.mtlx +++ b/resources/mtlx/nodedef_materials/switch_vector3I.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_vector4.mtlx b/resources/mtlx/nodedef_materials/switch_vector4.mtlx index 455daea5..0a049c74 100644 --- a/resources/mtlx/nodedef_materials/switch_vector4.mtlx +++ b/resources/mtlx/nodedef_materials/switch_vector4.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/switch_vector4I.mtlx b/resources/mtlx/nodedef_materials/switch_vector4I.mtlx index 3a3f4f14..44326184 100644 --- a/resources/mtlx/nodedef_materials/switch_vector4I.mtlx +++ b/resources/mtlx/nodedef_materials/switch_vector4I.mtlx @@ -6,6 +6,11 @@ + + + + + diff --git a/resources/mtlx/nodedef_materials/swizzle_color3_color3.mtlx b/resources/mtlx/nodedef_materials/swizzle_color3_color3.mtlx deleted file mode 100644 index 4d56f3d1..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color3_color3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color3_color4.mtlx b/resources/mtlx/nodedef_materials/swizzle_color3_color4.mtlx deleted file mode 100644 index a91dda35..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color3_color4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color3_float.mtlx b/resources/mtlx/nodedef_materials/swizzle_color3_float.mtlx deleted file mode 100644 index a3fa8339..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color3_float.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color3_vector2.mtlx b/resources/mtlx/nodedef_materials/swizzle_color3_vector2.mtlx deleted file mode 100644 index 2d929888..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color3_vector2.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color3_vector3.mtlx b/resources/mtlx/nodedef_materials/swizzle_color3_vector3.mtlx deleted file mode 100644 index f81f011b..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color3_vector3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color3_vector4.mtlx b/resources/mtlx/nodedef_materials/swizzle_color3_vector4.mtlx deleted file mode 100644 index c2b57ebc..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color3_vector4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color4_color3.mtlx b/resources/mtlx/nodedef_materials/swizzle_color4_color3.mtlx deleted file mode 100644 index 8a21d6b6..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color4_color3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color4_color4.mtlx b/resources/mtlx/nodedef_materials/swizzle_color4_color4.mtlx deleted file mode 100644 index 2177c7ac..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color4_color4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color4_float.mtlx b/resources/mtlx/nodedef_materials/swizzle_color4_float.mtlx deleted file mode 100644 index 4a028541..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color4_float.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color4_vector2.mtlx b/resources/mtlx/nodedef_materials/swizzle_color4_vector2.mtlx deleted file mode 100644 index a1169ef8..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color4_vector2.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color4_vector3.mtlx b/resources/mtlx/nodedef_materials/swizzle_color4_vector3.mtlx deleted file mode 100644 index f66ed538..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color4_vector3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_color4_vector4.mtlx b/resources/mtlx/nodedef_materials/swizzle_color4_vector4.mtlx deleted file mode 100644 index 3d5388f0..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_color4_vector4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_float_color3.mtlx b/resources/mtlx/nodedef_materials/swizzle_float_color3.mtlx deleted file mode 100644 index 8c40c2e0..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_float_color3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_float_color4.mtlx b/resources/mtlx/nodedef_materials/swizzle_float_color4.mtlx deleted file mode 100644 index 88eede44..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_float_color4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_float_vector2.mtlx b/resources/mtlx/nodedef_materials/swizzle_float_vector2.mtlx deleted file mode 100644 index 2aed5e0f..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_float_vector2.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_float_vector3.mtlx b/resources/mtlx/nodedef_materials/swizzle_float_vector3.mtlx deleted file mode 100644 index 30607423..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_float_vector3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_float_vector4.mtlx b/resources/mtlx/nodedef_materials/swizzle_float_vector4.mtlx deleted file mode 100644 index cc8ed74e..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_float_vector4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector2_color3.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector2_color3.mtlx deleted file mode 100644 index 21257cdc..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector2_color3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector2_color4.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector2_color4.mtlx deleted file mode 100644 index 7ac89879..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector2_color4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector2_float.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector2_float.mtlx deleted file mode 100644 index 6e28323d..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector2_float.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector2_vector2.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector2_vector2.mtlx deleted file mode 100644 index 4a109912..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector2_vector2.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector2_vector3.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector2_vector3.mtlx deleted file mode 100644 index 8fea9f8c..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector2_vector3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector2_vector4.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector2_vector4.mtlx deleted file mode 100644 index 86b9310e..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector2_vector4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector3_color3.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector3_color3.mtlx deleted file mode 100644 index ff5c541f..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector3_color3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector3_color4.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector3_color4.mtlx deleted file mode 100644 index ae95d36c..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector3_color4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector3_float.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector3_float.mtlx deleted file mode 100644 index 322b0b71..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector3_float.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector3_vector2.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector3_vector2.mtlx deleted file mode 100644 index e7c7fd01..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector3_vector2.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector3_vector3.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector3_vector3.mtlx deleted file mode 100644 index 888bcac2..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector3_vector3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector3_vector4.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector3_vector4.mtlx deleted file mode 100644 index a3263602..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector3_vector4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector4_color3.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector4_color3.mtlx deleted file mode 100644 index b383eec2..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector4_color3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector4_color4.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector4_color4.mtlx deleted file mode 100644 index e9285a28..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector4_color4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector4_float.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector4_float.mtlx deleted file mode 100644 index 6b86ba22..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector4_float.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector4_vector2.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector4_vector2.mtlx deleted file mode 100644 index c9999174..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector4_vector2.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector4_vector3.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector4_vector3.mtlx deleted file mode 100644 index fc296ce4..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector4_vector3.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx/nodedef_materials/swizzle_vector4_vector4.mtlx b/resources/mtlx/nodedef_materials/swizzle_vector4_vector4.mtlx deleted file mode 100644 index 34c61c14..00000000 --- a/resources/mtlx/nodedef_materials/swizzle_vector4_vector4.mtlx +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/resources/mtlx_1380_vs_1381.md b/resources/mtlx_1380_vs_1381.md index 4b06de24..7c97bda6 100644 --- a/resources/mtlx_1380_vs_1381.md +++ b/resources/mtlx_1380_vs_1381.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 662 first library definitions from 26 files. Version 1.39.0 +- Loaded 663 first library definitions from 26 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.1']. Search path: "" -- Loaded 662 second library definitions from 26 files. Version 1.39 +- Loaded 663 second library definitions from 26 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.0']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 662 nodedefs. -* Second library has 662 nodedefs +* First library has 663 nodedefs. +* Second library has 663 nodedefs
                            0 definitions modified @@ -36,7 +36,7 @@ * Second library shader targets: *['genglsl', 'genmdl', 'genosl']* ##### First Library Definitions / Implementations -
                            541 shaders: genglsl +
                            542 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -49,6 +49,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
                            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -584,7 +585,7 @@ -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -594,6 +595,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1140,7 +1142,7 @@ -
                            540 shaders: genosl +
                            541 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1150,6 +1152,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
                            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -1793,7 +1796,7 @@ ##### Second Library Definitions / Implementations -
                            541 shaders: genglsl +
                            542 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -1806,6 +1809,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
                            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -2341,7 +2345,7 @@ -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -2351,6 +2355,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -2897,7 +2902,7 @@ -
                            540 shaders: genosl +
                            541 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2907,6 +2912,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
                            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -3552,14 +3558,14 @@ ### Implementation Comparison -First library implementation count: 2169 -Second library implementation count: 2169 +First library implementation count: 2172 +Second library implementation count: 2172
                            1 implementations modified - +
                            Name Change
                            IMPL_standard_surface_surfaceshader - Number of children on: IMPL_standard_surface_surfaceshader changed from ( 51 ) to ( 50 )
                            - swizzle /opacity_luminance_r removed from IMPL_standard_surface_surfaceshader
                            - attribute: channels=( r ) added to: opacity
                            - attribute: nodename changed on opacity from ( opacity_luminance_r ) to ( opacity_luminance )
                            IMPL_standard_surface_surfaceshader - extract /opacity_luminance_r removed from IMPL_standard_surface_surfaceshader
                            - extract /swizzle add to IMPL_standard_surface_surfaceshader
                            - attribute: nodename changed on opacity from ( opacity_luminance_r ) to ( swizzle )
                            diff --git a/resources/mtlx_1380_vs_1390.md b/resources/mtlx_1380_vs_1390.md index faa21b28..181e51cb 100644 --- a/resources/mtlx_1380_vs_1390.md +++ b/resources/mtlx_1380_vs_1390.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 766 first library definitions from 46 files. Version 1.39.0 +- Loaded 742 first library definitions from 46 files. Version 1.39.0 - First library location: ['../../pymaterialx/python/MaterialX/libraries']. Search path: "" -- Loaded 662 second library definitions from 26 files. Version 1.39 +- Loaded 663 second library definitions from 26 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.0']. Search path: "" @@ -14,26 +14,79 @@ ### Node Definition Comparison -* First library has 766 nodedefs. -* Second library has 662 nodedefs -
                            9 node definitions removed +* First library has 742 nodedefs. +* Second library has 663 nodedefs +
                            62 node definitions removed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            Name Category
                            ND_add_displacementshader add
                            ND_add_surfaceshader add
                            ND_add_volumeshader add
                            ND_arrayappend_color3_color3array arrayappend
                            ND_arrayappend_color3array_color3array arrayappend
                            ND_arrayappend_color4_color4array arrayappend
                            ND_arrayappend_color4array_color4array arrayappend
                            ND_arrayappend_float_floatarray arrayappend
                            ND_arrayappend_floatarray_floatarray arrayappend
                            ND_arrayappend_integer_integerarray arrayappend
                            ND_arrayappend_integerarray_integerarray arrayappend
                            ND_arrayappend_string_stringarray arrayappend
                            ND_arrayappend_stringarray_stringarray arrayappend
                            ND_arrayappend_vector2_vector2array arrayappend
                            ND_arrayappend_vector2array_vector2array arrayappend
                            ND_arrayappend_vector3_vector3array arrayappend
                            ND_arrayappend_vector3array_vector3array arrayappend
                            ND_arrayappend_vector4_vector4array arrayappend
                            ND_arrayappend_vector4array_vector4array arrayappend
                            ND_multiply_displacementshaderF multiply
                            ND_multiply_displacementshaderV multiply
                            ND_multiply_surfaceshaderC multiply
                            ND_multiply_surfaceshaderF multiply
                            ND_multiply_volumeshaderC multiply
                            ND_multiply_volumeshaderF multiply
                            ND_normalmap normalmap
                            ND_swizzle_color3_color3 swizzle
                            ND_swizzle_color3_color4 swizzle
                            ND_swizzle_color3_float swizzle
                            ND_swizzle_color3_vector2 swizzle
                            ND_swizzle_color3_vector3 swizzle
                            ND_swizzle_color3_vector4 swizzle
                            ND_swizzle_color4_color3 swizzle
                            ND_swizzle_color4_color4 swizzle
                            ND_swizzle_color4_float swizzle
                            ND_swizzle_color4_vector2 swizzle
                            ND_swizzle_color4_vector3 swizzle
                            ND_swizzle_color4_vector4 swizzle
                            ND_swizzle_float_color3 swizzle
                            ND_swizzle_float_color4 swizzle
                            ND_swizzle_float_vector2 swizzle
                            ND_swizzle_float_vector3 swizzle
                            ND_swizzle_float_vector4 swizzle
                            ND_swizzle_vector2_color3 swizzle
                            ND_swizzle_vector2_color4 swizzle
                            ND_swizzle_vector2_float swizzle
                            ND_swizzle_vector2_vector2 swizzle
                            ND_swizzle_vector2_vector3 swizzle
                            ND_swizzle_vector2_vector4 swizzle
                            ND_swizzle_vector3_color3 swizzle
                            ND_swizzle_vector3_color4 swizzle
                            ND_swizzle_vector3_float swizzle
                            ND_swizzle_vector3_vector2 swizzle
                            ND_swizzle_vector3_vector3 swizzle
                            ND_swizzle_vector3_vector4 swizzle
                            ND_swizzle_vector4_color3 swizzle
                            ND_swizzle_vector4_color4 swizzle
                            ND_swizzle_vector4_float swizzle
                            ND_swizzle_vector4_vector2 swizzle
                            ND_swizzle_vector4_vector3 swizzle
                            ND_swizzle_vector4_vector4 swizzle
                            ND_thin_film_bsdf thin_film_bsdf
                            -
                            113 node definitions added. (Sorted by category) +
                            141 node definitions added. (Sorted by category) @@ -52,6 +105,7 @@ + @@ -96,6 +150,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -107,6 +182,7 @@ + @@ -142,7 +218,12 @@ + + + + + @@ -220,7 +301,7 @@ -
                            36 definitions modified +
                            54 definitions modified
                            Name Category NodeGroup
                            ND_UsdUVTexture_23 UsdUVTexture texture2d
                            ND_acescg_to_lin_rec709_color3 acescg_to_lin_rec709 colortransform
                            ND_acescg_to_lin_rec709_color4 acescg_to_lin_rec709 colortransform
                            ND_add_integer add math
                            ND_adobergb_to_lin_rec709_color3 adobergb_to_lin_rec709 colortransform
                            ND_adobergb_to_lin_rec709_color4 adobergb_to_lin_rec709 colortransform
                            ND_bump_vector3 bump geometric
                            ND_gooch_shade gooch_shade npr
                            ND_grid_color3 grid procedural2d
                            ND_hexagon_float hexagon procedural2d
                            ND_ifequal_integer ifequal conditional
                            ND_ifequal_matrix33 ifequal conditional
                            ND_ifequal_matrix44 ifequal conditional
                            ND_ifequal_integerI ifequal conditional
                            ND_ifequal_matrix33I ifequal conditional
                            ND_ifequal_matrix44I ifequal conditional
                            ND_ifequal_integerB ifequal conditional
                            ND_ifequal_matrix33B ifequal conditional
                            ND_ifequal_matrix44B ifequal conditional
                            ND_ifgreater_integer ifgreater conditional
                            ND_ifgreater_matrix33 ifgreater conditional
                            ND_ifgreater_matrix44 ifgreater conditional
                            ND_ifgreater_integerI ifgreater conditional
                            ND_ifgreater_matrix33I ifgreater conditional
                            ND_ifgreater_matrix44I ifgreater conditional
                            ND_ifgreatereq_integer ifgreatereq conditional
                            ND_ifgreatereq_matrix33 ifgreatereq conditional
                            ND_ifgreatereq_matrix44 ifgreatereq conditional
                            ND_ifgreatereq_integerI ifgreatereq conditional
                            ND_ifgreatereq_matrix33I ifgreatereq conditional
                            ND_ifgreatereq_matrix44I ifgreatereq conditional
                            ND_layer_vdf layer pbr
                            ND_lin_adobergb_to_lin_rec709_color3 lin_adobergb_to_lin_rec709 colortransform
                            ND_lin_adobergb_to_lin_rec709_color4 lin_adobergb_to_lin_rec709 colortransform
                            ND_mix_vector2_vector2 mix compositing
                            ND_mix_vector3_vector3 mix compositing
                            ND_mix_vector4_vector4 mix compositing
                            ND_normalmap_float normalmap math
                            ND_normalmap_vector2 normalmap math
                            ND_open_pbr_surface_surfaceshader open_pbr_surface pbr
                            ND_randomcolor_float randomcolor procedural3d
                            ND_standard_surface_surfaceshader_100 standard_surface pbr
                            ND_standard_surface_to_UsdPreviewSurface standard_surface_to_UsdPreviewSurface translation
                            ND_standard_surface_to_gltf_pbr standard_surface_to_gltf_pbr translation
                            ND_subtract_integer subtract math
                            ND_surface_unlit surface_unlit shader
                            ND_switch_matrix33 switch conditional
                            ND_switch_matrix44 switch conditional
                            ND_switch_matrix33I switch conditional
                            ND_switch_matrix44I switch conditional
                            ND_tiledcircles_color3 tiledcircles procedural2d
                            ND_tiledcloverleafs_color3 tiledcloverleafs procedural2d
                            ND_tiledhexagons_color3 tiledhexagons procedural2d
                            @@ -263,9 +344,15 @@ + + - Number of children on: ND_conductor_bsdf changed from ( 8 ) to ( 10 )
                            - input /thinfilm_thickness added to ND_conductor_bsdf. Value=( 0 )
                            - input /thinfilm_ior added to ND_conductor_bsdf. Value=( 1.5 )
                            - attribute: value changed on ior from ( 0.271, 0.677, 1.316 ) to ( 0.183, 0.421, 1.373 )
                            - attribute: value changed on extinction from ( 3.609, 2.625, 2.292 ) to ( 3.424, 2.346, 1.770 )
                            + @@ -299,6 +386,18 @@ + + + + @@ -329,6 +428,42 @@ + + + + + + + + + + + + @@ -347,7 +482,7 @@ * Shader targets added: ['essl', 'genmsl'] ##### First Library Definitions / Implementations -
                            540 shaders: genglsl +
                            537 shaders: genglsl
                            Name Change
                            ND_UsdTransform2d - attribute: nodegroup=( math ) added to: ND_UsdTransform2d
                            - attribute: value=( 0, 0 ) added to: in
                            ND_dielectric_bsdf + + - Number of children on: ND_dielectric_bsdf changed from ( 9 ) to ( 11 )
                            - input /thinfilm_thickness added to ND_dielectric_bsdf. Value=( 0 )
                            - input /thinfilm_ior added to ND_dielectric_bsdf. Value=( 1.5 )
                            ND_conductor_bsdf - - attribute: value changed on ior from ( 0.271, 0.677, 1.316 ) to ( 0.183, 0.421, 1.373 )
                            - attribute: value changed on extinction from ( 3.609, 2.625, 2.292 ) to ( 3.424, 2.346, 1.770 )
                            ND_generalized_schlick_bsdf + + - Number of children on: ND_generalized_schlick_bsdf changed from ( 10 ) to ( 13 )
                            - input /color82 added to ND_generalized_schlick_bsdf. Value=( 1.0, 1.0, 1.0 )
                            - input /thinfilm_thickness added to ND_generalized_schlick_bsdf. Value=( 0 )
                            - input /thinfilm_ior added to ND_generalized_schlick_bsdf. Value=( 1.5 )
                            ND_mix_bsdf - attribute: value changed on mix from ( 1.0 ) to ( 0.0 )
                            ND_geompropvalue_integer - attribute: uniform=( true ) removed from: default
                            ND_atan2_float + + - input /in1 removed from ND_atan2_float. Value=( 0.0 )
                            - input /in2 removed from ND_atan2_float. Value=( 1.0 )
                            - input /iny added to ND_atan2_float. Value=( 0.0 )
                            - input /inx added to ND_atan2_float. Value=( 1.0 )
                            ND_atan2_vector2 + + - input /in1 removed from ND_atan2_vector2. Value=( 1.0, 1.0 )
                            - input /in2 removed from ND_atan2_vector2. Value=( 0.0, 0.0 )
                            - input /iny added to ND_atan2_vector2. Value=( 1.0, 1.0 )
                            - input /inx added to ND_atan2_vector2. Value=( 0.0, 0.0 )
                            ND_atan2_vector3 + + - input /in1 removed from ND_atan2_vector3. Value=( 1.0, 1.0, 1.0 )
                            - input /in2 removed from ND_atan2_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /iny added to ND_atan2_vector3. Value=( 1.0, 1.0, 1.0 )
                            - input /inx added to ND_atan2_vector3. Value=( 0.0, 0.0, 0.0 )
                            ND_atan2_vector4 + + - input /in1 removed from ND_atan2_vector4. Value=( 1.0, 1.0, 1.0, 1.0 )
                            - input /in2 removed from ND_atan2_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /iny added to ND_atan2_vector4. Value=( 1.0, 1.0, 1.0, 1.0 )
                            - input /inx added to ND_atan2_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_place2d_vector2 - Number of children on: ND_place2d_vector2 changed from ( 6 ) to ( 7 )
                            - input /operationorder added to ND_place2d_vector2. Value=( 0 )
                            ND_mix_volumeshader - attribute: uisoftmin=( 0.0 ) added to: mix
                            - attribute: uisoftmax=( 1.0 ) added to: mix
                            ND_switch_float + + - Number of children on: ND_switch_float changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_float. Value=( 0.0 )
                            - input /in7 added to ND_switch_float. Value=( 0.0 )
                            - input /in8 added to ND_switch_float. Value=( 0.0 )
                            - input /in9 added to ND_switch_float. Value=( 0.0 )
                            - input /in10 added to ND_switch_float. Value=( 0.0 )
                            ND_switch_color3 + + - Number of children on: ND_switch_color3 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            ND_switch_color4 + + - Number of children on: ND_switch_color4 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_switch_vector2 + + - Number of children on: ND_switch_vector2 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            ND_switch_vector3 + + - Number of children on: ND_switch_vector3 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            ND_switch_vector4 + + - Number of children on: ND_switch_vector4 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_switch_floatI + + - Number of children on: ND_switch_floatI changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_floatI. Value=( 0.0 )
                            - input /in7 added to ND_switch_floatI. Value=( 0.0 )
                            - input /in8 added to ND_switch_floatI. Value=( 0.0 )
                            - input /in9 added to ND_switch_floatI. Value=( 0.0 )
                            - input /in10 added to ND_switch_floatI. Value=( 0.0 )
                            ND_switch_color3I + + - Number of children on: ND_switch_color3I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            ND_switch_color4I + + - Number of children on: ND_switch_color4I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_switch_vector2I + + - Number of children on: ND_switch_vector2I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            ND_switch_vector3I + + - Number of children on: ND_switch_vector3I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            ND_switch_vector4I + + - Number of children on: ND_switch_vector4I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_heighttonormal_vector3 - attribute: default changed on out from ( 0.0, 1.0, 0.0 ) to ( 0.5, 0.5, 1.0 )
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -467,6 +602,7 @@
                            ND_frame_floatIM_frame_float_genglslstdlib_genglsl_impl.mtlx
                            ND_time_floatIM_time_float_genglslstdlib_genglsl_impl.mtlx
                            ND_add_floatIM_add_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_add_integerIM_add_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color3IM_add_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color4IM_add_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genglslstdlib_genglsl_impl.mtlx @@ -482,6 +618,7 @@
                            ND_add_matrix33FAIM_add_matrix33FA_genglslstdlib_genglsl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genglslstdlib_genglsl_impl.mtlx @@ -674,7 +811,7 @@
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genglslstdlib_genglsl_impl.mtlx @@ -750,59 +887,84 @@
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIM_switch_float_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genglslstdlib_genglsl_impl.mtlx @@ -820,41 +982,6 @@
                            ND_convert_color4_color3IM_convert_color4_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genglslstdlib_genglsl_impl.mtlx @@ -866,6 +993,11 @@
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_floatIM_blur_float_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genglslstdlib_genglsl_impl.mtlx @@ -894,7 +1026,7 @@ -
                            549 shaders: genmdl +
                            546 shaders: genmdl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genmdlnprlib_genmdl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1021,6 +1153,7 @@
                            ND_frame_floatIM_frame_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_time_floatIM_time_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_floatIM_add_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_add_integerIM_add_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_color3IM_add_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_color4IM_add_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1036,6 +1169,7 @@
                            ND_add_matrix33FAIM_add_matrix33FA_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1228,7 +1362,7 @@
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genmdlstdlib_genmdl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genmdlstdlib_genmdl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genmdlstdlib_genmdl_impl.mtlx @@ -1306,59 +1440,84 @@
                            ND_mix_displacementshaderIM_mix_displacementshader_genmdlstdlib_genmdl_impl.mtlx
                            ND_mix_volumeshaderIM_mix_volumeshader_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_floatIM_switch_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1376,41 +1535,6 @@
                            ND_convert_color4_color3IM_convert_color4_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genmdlstdlib_genmdl_impl.mtlx @@ -1422,6 +1546,11 @@
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genmdlstdlib_genmdl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_floatIM_blur_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genmdlstdlib_genmdl_impl.mtlx @@ -1450,7 +1579,7 @@ -
                            537 shaders: genosl +
                            534 shaders: genosl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genoslnprlib_genosl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1567,6 +1696,7 @@
                            ND_frame_floatIM_frame_float_genoslstdlib_genosl_impl.mtlx
                            ND_time_floatIM_time_float_genoslstdlib_genosl_impl.mtlx
                            ND_add_floatIM_add_float_genoslstdlib_genosl_impl.mtlx +
                            ND_add_integerIM_add_integer_genoslstdlib_genosl_impl.mtlx
                            ND_add_color3IM_add_color3_genoslstdlib_genosl_impl.mtlx
                            ND_add_color4IM_add_color4_genoslstdlib_genosl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genoslstdlib_genosl_impl.mtlx @@ -1582,6 +1712,7 @@
                            ND_add_matrix33FAIM_add_matrix33FA_genoslstdlib_genosl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genoslstdlib_genosl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genoslstdlib_genosl_impl.mtlx @@ -1774,7 +1905,7 @@
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genoslstdlib_genosl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genoslstdlib_genosl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genoslstdlib_genosl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genoslstdlib_genosl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genoslstdlib_genosl_impl.mtlx @@ -1850,59 +1981,84 @@
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genoslstdlib_genosl_impl.mtlx
                            ND_switch_floatIM_switch_float_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genoslstdlib_genosl_impl.mtlx @@ -1920,41 +2076,6 @@
                            ND_convert_color4_color3IM_convert_color4_color3_genoslstdlib_genosl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genoslstdlib_genosl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genoslstdlib_genosl_impl.mtlx @@ -1966,6 +2087,11 @@
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genoslstdlib_genosl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_blur_floatIM_blur_float_genoslstdlib_genosl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genoslstdlib_genosl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genoslstdlib_genosl_impl.mtlx @@ -1994,7 +2120,7 @@ -
                            190 node graphs +
                            185 node graphs
                            DefinitionNodeGraphFile
                            ND_disney_brdf_2012_surfaceIM_disney_brdf_2012_surface_brdf_explorerdisney_brdf_2012.mtlx
                            ND_disney_bsdf_2015_surfaceIM_disney_bsdf_2015_surface_pbrtdisney_brdf_2015.mtlx @@ -2176,11 +2302,6 @@
                            ND_convert_vector4_surfaceshaderNG_convert_vector4_surfaceshaderstdlib_ng.mtlx
                            ND_convert_integer_surfaceshaderNG_convert_integer_surfaceshaderstdlib_ng.mtlx
                            ND_convert_boolean_surfaceshaderNG_convert_boolean_surfaceshaderstdlib_ng.mtlx -
                            ND_extract_color3NG_extract_color3stdlib_ng.mtlx -
                            ND_extract_color4NG_extract_color4stdlib_ng.mtlx -
                            ND_extract_vector2NG_extract_vector2stdlib_ng.mtlx -
                            ND_extract_vector3NG_extract_vector3stdlib_ng.mtlx -
                            ND_extract_vector4NG_extract_vector4stdlib_ng.mtlx
                            ND_separate2_vector2NG_separate2_vector2stdlib_ng.mtlx
                            ND_separate3_color3NG_separate3_color3stdlib_ng.mtlx
                            ND_separate3_vector3NG_separate3_vector3stdlib_ng.mtlx @@ -2202,7 +2323,7 @@ -
                            541 shaders: genglsl +
                            542 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2215,6 +2336,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
                            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -2750,7 +2872,7 @@ -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -2760,6 +2882,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -3313,7 +3436,7 @@ -
                            540 shaders: genosl +
                            541 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -3323,6 +3446,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
                            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -3968,10 +4092,10 @@ ### Implementation Comparison -First library implementation count: 2934 -Second library implementation count: 2169 +First library implementation count: 3030 +Second library implementation count: 2172 -
                            765 implementations added +
                            858 implementations added @@ -4002,6 +4126,10 @@ Second library implementation count: 2169 + + + + @@ -4168,6 +4296,26 @@ Second library implementation count: 2169 + + + + + + + + + + + + + + + + + + + + @@ -4211,6 +4359,42 @@ Second library implementation count: 2169 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4226,6 +4410,30 @@ Second library implementation count: 2169 + + + + + + + + + + + + + + + + + + + + + + + + @@ -4238,6 +4446,30 @@ Second library implementation count: 2169 + + + + + + + + + + + + + + + + + + + + + + + + @@ -4511,6 +4743,10 @@ Second library implementation count: 2169 + + + + @@ -4536,47 +4772,28 @@ Second library implementation count: 2169 + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -4744,11 +4961,11 @@ Second library implementation count: 2169 -
                            1080 implementations modified +
                            1089 implementations modified
                            Name Node Category Node Type
                            IM_add_color4_genmsl add color4
                            IM_add_edf_genmsl add EDF
                            IM_add_float_genmsl add float
                            IM_add_integer_genglsl add integer
                            IM_add_integer_genmdl add integer
                            IM_add_integer_genmsl add integer
                            IM_add_integer_genosl add integer
                            IM_add_matrix33FA_genmsl add matrix33
                            IM_add_matrix33_genmsl add matrix33
                            IM_add_matrix44FA_genmsl add matrix44
                            IM_exp_vector2_genmsl exp vector2
                            IM_exp_vector3_genmsl exp vector3
                            IM_exp_vector4_genmsl exp vector4
                            IM_extract_color3_genglsl extract float
                            IM_extract_color3_genmdl extract float
                            IM_extract_color3_genmsl extract float
                            IM_extract_color3_genosl extract float
                            IM_extract_color4_genglsl extract float
                            IM_extract_color4_genmdl extract float
                            IM_extract_color4_genmsl extract float
                            IM_extract_color4_genosl extract float
                            IM_extract_vector2_genglsl extract float
                            IM_extract_vector2_genmdl extract float
                            IM_extract_vector2_genmsl extract float
                            IM_extract_vector2_genosl extract float
                            IM_extract_vector3_genglsl extract float
                            IM_extract_vector3_genmdl extract float
                            IM_extract_vector3_genmsl extract float
                            IM_extract_vector3_genosl extract float
                            IM_extract_vector4_genglsl extract float
                            IM_extract_vector4_genmdl extract float
                            IM_extract_vector4_genmsl extract float
                            IM_extract_vector4_genosl extract float
                            IM_floor_color3_genmsl floor color3
                            IM_floor_color4_genmsl floor color4
                            IM_floor_float_genmsl floor float
                            IM_ifequal_floatB_genmsl ifequal float
                            IM_ifequal_floatI_genmsl ifequal float
                            IM_ifequal_float_genmsl ifequal float
                            IM_ifequal_integerB_genglsl ifequal integer
                            IM_ifequal_integerB_genmdl ifequal integer
                            IM_ifequal_integerB_genmsl ifequal integer
                            IM_ifequal_integerB_genosl ifequal integer
                            IM_ifequal_integerI_genglsl ifequal integer
                            IM_ifequal_integerI_genmdl ifequal integer
                            IM_ifequal_integerI_genmsl ifequal integer
                            IM_ifequal_integerI_genosl ifequal integer
                            IM_ifequal_integer_genglsl ifequal integer
                            IM_ifequal_integer_genmdl ifequal integer
                            IM_ifequal_integer_genmsl ifequal integer
                            IM_ifequal_integer_genosl ifequal integer
                            IM_ifequal_matrix33B_genglsl ifequal matrix33
                            IM_ifequal_matrix33B_genmdl ifequal matrix33
                            IM_ifequal_matrix33B_genmsl ifequal matrix33
                            IM_ifequal_matrix33B_genosl ifequal matrix33
                            IM_ifequal_matrix33I_genglsl ifequal matrix33
                            IM_ifequal_matrix33I_genmdl ifequal matrix33
                            IM_ifequal_matrix33I_genmsl ifequal matrix33
                            IM_ifequal_matrix33I_genosl ifequal matrix33
                            IM_ifequal_matrix33_genglsl ifequal matrix33
                            IM_ifequal_matrix33_genmdl ifequal matrix33
                            IM_ifequal_matrix33_genmsl ifequal matrix33
                            IM_ifequal_matrix33_genosl ifequal matrix33
                            IM_ifequal_matrix44B_genglsl ifequal matrix44
                            IM_ifequal_matrix44B_genmdl ifequal matrix44
                            IM_ifequal_matrix44B_genmsl ifequal matrix44
                            IM_ifequal_matrix44B_genosl ifequal matrix44
                            IM_ifequal_matrix44I_genglsl ifequal matrix44
                            IM_ifequal_matrix44I_genmdl ifequal matrix44
                            IM_ifequal_matrix44I_genmsl ifequal matrix44
                            IM_ifequal_matrix44I_genosl ifequal matrix44
                            IM_ifequal_matrix44_genglsl ifequal matrix44
                            IM_ifequal_matrix44_genmdl ifequal matrix44
                            IM_ifequal_matrix44_genmsl ifequal matrix44
                            IM_ifequal_matrix44_genosl ifequal matrix44
                            IM_ifequal_vector2B_genmsl ifequal vector2
                            IM_ifequal_vector2I_genmsl ifequal vector2
                            IM_ifequal_vector2_genmsl ifequal vector2
                            IM_ifgreater_color4_genmsl ifgreater color4
                            IM_ifgreater_floatI_genmsl ifgreater float
                            IM_ifgreater_float_genmsl ifgreater float
                            IM_ifgreater_integerI_genglsl ifgreater integer
                            IM_ifgreater_integerI_genmdl ifgreater integer
                            IM_ifgreater_integerI_genmsl ifgreater integer
                            IM_ifgreater_integerI_genosl ifgreater integer
                            IM_ifgreater_integer_genglsl ifgreater integer
                            IM_ifgreater_integer_genmdl ifgreater integer
                            IM_ifgreater_integer_genmsl ifgreater integer
                            IM_ifgreater_integer_genosl ifgreater integer
                            IM_ifgreater_matrix33I_genglsl ifgreater matrix33
                            IM_ifgreater_matrix33I_genmdl ifgreater matrix33
                            IM_ifgreater_matrix33I_genmsl ifgreater matrix33
                            IM_ifgreater_matrix33I_genosl ifgreater matrix33
                            IM_ifgreater_matrix33_genglsl ifgreater matrix33
                            IM_ifgreater_matrix33_genmdl ifgreater matrix33
                            IM_ifgreater_matrix33_genmsl ifgreater matrix33
                            IM_ifgreater_matrix33_genosl ifgreater matrix33
                            IM_ifgreater_matrix44I_genglsl ifgreater matrix44
                            IM_ifgreater_matrix44I_genmdl ifgreater matrix44
                            IM_ifgreater_matrix44I_genmsl ifgreater matrix44
                            IM_ifgreater_matrix44I_genosl ifgreater matrix44
                            IM_ifgreater_matrix44_genglsl ifgreater matrix44
                            IM_ifgreater_matrix44_genmdl ifgreater matrix44
                            IM_ifgreater_matrix44_genmsl ifgreater matrix44
                            IM_ifgreater_matrix44_genosl ifgreater matrix44
                            IM_ifgreater_vector2I_genmsl ifgreater vector2
                            IM_ifgreater_vector2_genmsl ifgreater vector2
                            IM_ifgreater_vector3I_genmsl ifgreater vector3
                            IM_ifgreatereq_color4_genmsl ifgreatereq color4
                            IM_ifgreatereq_floatI_genmsl ifgreatereq float
                            IM_ifgreatereq_float_genmsl ifgreatereq float
                            IM_ifgreatereq_integerI_genglsl ifgreatereq integer
                            IM_ifgreatereq_integerI_genmdl ifgreatereq integer
                            IM_ifgreatereq_integerI_genmsl ifgreatereq integer
                            IM_ifgreatereq_integerI_genosl ifgreatereq integer
                            IM_ifgreatereq_integer_genglsl ifgreatereq integer
                            IM_ifgreatereq_integer_genmdl ifgreatereq integer
                            IM_ifgreatereq_integer_genmsl ifgreatereq integer
                            IM_ifgreatereq_integer_genosl ifgreatereq integer
                            IM_ifgreatereq_matrix33I_genglsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genmdl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genmsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genosl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genglsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genmdl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genmsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genosl ifgreatereq matrix33
                            IM_ifgreatereq_matrix44I_genglsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genmdl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genmsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genosl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genglsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genmdl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genmsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genosl ifgreatereq matrix44
                            IM_ifgreatereq_vector2I_genmsl ifgreatereq vector2
                            IM_ifgreatereq_vector2_genmsl ifgreatereq vector2
                            IM_ifgreatereq_vector3I_genmsl ifgreatereq vector3
                            IM_subtract_color4FA_genmsl subtract color4
                            IM_subtract_color4_genmsl subtract color4
                            IM_subtract_float_genmsl subtract float
                            IM_subtract_integer_genglsl subtract integer
                            IM_subtract_integer_genmdl subtract integer
                            IM_subtract_integer_genmsl subtract integer
                            IM_subtract_integer_genosl subtract integer
                            IM_subtract_matrix33FA_genmsl subtract matrix33
                            IM_subtract_matrix33_genmsl subtract matrix33
                            IM_subtract_matrix44FA_genmsl subtract matrix44
                            IM_switch_color4_genmsl switch color4
                            IM_switch_floatI_genmsl switch float
                            IM_switch_float_genmsl switch float
                            IM_switch_matrix33I_genglsl switch matrix33
                            IM_switch_matrix33I_genmdl switch matrix33
                            IM_switch_matrix33I_genmsl switch matrix33
                            IM_switch_matrix33I_genosl switch matrix33
                            IM_switch_matrix33_genglsl switch matrix33
                            IM_switch_matrix33_genmdl switch matrix33
                            IM_switch_matrix33_genmsl switch matrix33
                            IM_switch_matrix33_genosl switch matrix33
                            IM_switch_matrix44I_genglsl switch matrix44
                            IM_switch_matrix44I_genmdl switch matrix44
                            IM_switch_matrix44I_genmsl switch matrix44
                            IM_switch_matrix44I_genosl switch matrix44
                            IM_switch_matrix44_genglsl switch matrix44
                            IM_switch_matrix44_genmdl switch matrix44
                            IM_switch_matrix44_genmsl switch matrix44
                            IM_switch_matrix44_genosl switch matrix44
                            IM_switch_vector2I_genmsl switch vector2
                            IM_switch_vector2_genmsl switch vector2
                            IM_switch_vector3I_genmsl switch vector3
                            IM_switch_vector3_genmsl switch vector3
                            IM_switch_vector4I_genmsl switch vector4
                            IM_switch_vector4_genmsl switch vector4
                            IM_swizzle_color3_color3_genmsl swizzle color3
                            IM_swizzle_color3_color4_genmsl swizzle color4
                            IM_swizzle_color3_float_genmsl swizzle float
                            IM_swizzle_color3_vector2_genmsl swizzle vector2
                            IM_swizzle_color3_vector3_genmsl swizzle vector3
                            IM_swizzle_color3_vector4_genmsl swizzle vector4
                            IM_swizzle_color4_color3_genmsl swizzle color3
                            IM_swizzle_color4_color4_genmsl swizzle color4
                            IM_swizzle_color4_float_genmsl swizzle float
                            IM_swizzle_color4_vector2_genmsl swizzle vector2
                            IM_swizzle_color4_vector3_genmsl swizzle vector3
                            IM_swizzle_color4_vector4_genmsl swizzle vector4
                            IM_swizzle_float_color3_genmsl swizzle color3
                            IM_swizzle_float_color4_genmsl swizzle color4
                            IM_swizzle_float_vector2_genmsl swizzle vector2
                            IM_swizzle_float_vector3_genmsl swizzle vector3
                            IM_swizzle_float_vector4_genmsl swizzle vector4
                            IM_swizzle_vector2_color3_genmsl swizzle color3
                            IM_swizzle_vector2_color4_genmsl swizzle color4
                            IM_swizzle_vector2_float_genmsl swizzle float
                            IM_swizzle_vector2_vector2_genmsl swizzle vector2
                            IM_swizzle_vector2_vector3_genmsl swizzle vector3
                            IM_swizzle_vector2_vector4_genmsl swizzle vector4
                            IM_swizzle_vector3_color3_genmsl swizzle color3
                            IM_swizzle_vector3_color4_genmsl swizzle color4
                            IM_swizzle_vector3_float_genmsl swizzle float
                            IM_swizzle_vector3_vector2_genmsl swizzle vector2
                            IM_swizzle_vector3_vector3_genmsl swizzle vector3
                            IM_swizzle_vector3_vector4_genmsl swizzle vector4
                            IM_swizzle_vector4_color3_genmsl swizzle color3
                            IM_swizzle_vector4_color4_genmsl swizzle color4
                            IM_swizzle_vector4_float_genmsl swizzle float
                            IM_swizzle_vector4_vector2_genmsl swizzle vector2
                            IM_swizzle_vector4_vector3_genmsl swizzle vector3
                            IM_swizzle_vector4_vector4_genmsl swizzle vector4
                            IM_tan_float_genmsl tan float
                            IM_tan_vector2_genmsl tan vector2
                            IM_tan_vector3_genmsl tan vector3
                            - + @@ -4780,7 +4997,7 @@ Second library implementation count: 2169 - + @@ -4791,7 +5008,7 @@ Second library implementation count: 2169 - + @@ -4828,20 +5045,24 @@ Second library implementation count: 2169 - - - - - - - - + + + + + + + + + + + + - + @@ -4896,8 +5117,8 @@ Second library implementation count: 2169 - - + + @@ -4940,8 +5161,8 @@ Second library implementation count: 2169 - - + + @@ -5067,8 +5288,8 @@ Second library implementation count: 2169 - - + + @@ -5368,7 +5589,7 @@ Second library implementation count: 2169 - + @@ -5376,7 +5597,7 @@ Second library implementation count: 2169 - + @@ -5417,10 +5638,10 @@ Second library implementation count: 2169 - + - + @@ -5431,10 +5652,10 @@ Second library implementation count: 2169 - + - + @@ -5487,7 +5708,7 @@ Second library implementation count: 2169 - + @@ -5635,7 +5856,7 @@ Second library implementation count: 2169 - + @@ -5717,7 +5938,7 @@ Second library implementation count: 2169 - + @@ -5748,19 +5969,19 @@ Second library implementation count: 2169 - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -5798,14 +6019,14 @@ Second library implementation count: 2169 - + - + @@ -5822,6 +6043,11 @@ Second library implementation count: 2169 + + + + + diff --git a/resources/mtlx_1381_vs_1382.md b/resources/mtlx_1381_vs_1382.md index c598c639..600187da 100644 --- a/resources/mtlx_1381_vs_1382.md +++ b/resources/mtlx_1381_vs_1382.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 675 first library definitions from 38 files. Version 1.39.0 +- Loaded 676 first library definitions from 38 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.2']. Search path: "" -- Loaded 662 second library definitions from 26 files. Version 1.39 +- Loaded 663 second library definitions from 26 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.1']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 675 nodedefs. -* Second library has 662 nodedefs +* First library has 676 nodedefs. +* Second library has 663 nodedefs
                            13 node definitions added. (Sorted by category)
                            Name Change
                            IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 28 ) to ( 33 )
                            - divide /div_ior removed from IMP_UsdPreviewSurface_surfaceshader
                            - clamp /opacity_clamped removed from IMP_UsdPreviewSurface_surfaceshader
                            - subtract /inverse_metalness add to IMP_UsdPreviewSurface_surfaceshader
                            - mix /diffuse_bsdf_weight add to IMP_UsdPreviewSurface_surfaceshader
                            - divide /R add to IMP_UsdPreviewSurface_surfaceshader
                            - multiply /R_sq add to IMP_UsdPreviewSurface_surfaceshader
                            - mix /specular_color_metallic add to IMP_UsdPreviewSurface_surfaceshader
                            - multiply /specular_color_metallic_R_sq add to IMP_UsdPreviewSurface_surfaceshader
                            - convert /coat_F0 add to IMP_UsdPreviewSurface_surfaceshader
                            - attribute: value=( 1 ) removed from: weight
                            - attribute: nodename=( diffuse_bsdf_weight ) added to: weight
                            - Number of children on: transmission_bsdf changed from ( 5 ) to ( 6 )
                            - input /roughness added to IMP_UsdPreviewSurface_surfaceshader/transmission_bsdf. Value=( 0.0, 0.0 )
                            - Category changed on: F0 from mix to multiply
                            - attribute: type changed on F0 from ( float ) to ( color3 )
                            - Number of children on: F0 changed from ( 2 ) to ( 3 )
                            - input /in1 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /in2 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /fg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /bg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /mix added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - attribute: channels=( rrr ) removed from: color0
                            - attribute: value=( 1, 1, 1 ) removed from: color90
                            - attribute: nodename=( specular_color_metallic ) added to: color90
                            - Category changed on: coat_dielectric_bsdf from generalized_schlick_bsdf to dielectric_bsdf
                            - input /tint removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                            - input /ior removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1.5 )
                            - input /color0 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( )
                            - input /color90 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                            - Category changed on: cutout_opacity from ifgreatereq to ifgreater
                            - attribute: nodename=( opacity_clamped ) removed from: value1
                            - attribute: interfacename=( opacity ) added to: value1
                            IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 29 ) to ( 33 )
                            - divide /div_ior removed from IMP_UsdPreviewSurface_surfaceshader
                            - convert /swizzle removed from IMP_UsdPreviewSurface_surfaceshader
                            - clamp /opacity_clamped removed from IMP_UsdPreviewSurface_surfaceshader
                            - subtract /inverse_metalness add to IMP_UsdPreviewSurface_surfaceshader
                            - mix /diffuse_bsdf_weight add to IMP_UsdPreviewSurface_surfaceshader
                            - divide /R add to IMP_UsdPreviewSurface_surfaceshader
                            - multiply /R_sq add to IMP_UsdPreviewSurface_surfaceshader
                            - mix /specular_color_metallic add to IMP_UsdPreviewSurface_surfaceshader
                            - multiply /specular_color_metallic_R_sq add to IMP_UsdPreviewSurface_surfaceshader
                            - convert /coat_F0 add to IMP_UsdPreviewSurface_surfaceshader
                            - attribute: value=( 1 ) removed from: weight
                            - attribute: nodename=( diffuse_bsdf_weight ) added to: weight
                            - Number of children on: transmission_bsdf changed from ( 5 ) to ( 6 )
                            - input /roughness added to IMP_UsdPreviewSurface_surfaceshader/transmission_bsdf. Value=( 0.0, 0.0 )
                            - Category changed on: F0 from mix to multiply
                            - attribute: type changed on F0 from ( float ) to ( color3 )
                            - Number of children on: F0 changed from ( 2 ) to ( 3 )
                            - input /in1 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /in2 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /fg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /bg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /mix added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - attribute: nodename changed on color0 from ( swizzle ) to ( F0 )
                            - attribute: value=( 1, 1, 1 ) removed from: color90
                            - attribute: nodename=( specular_color_metallic ) added to: color90
                            - Category changed on: coat_dielectric_bsdf from generalized_schlick_bsdf to dielectric_bsdf
                            - input /tint removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                            - input /ior removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1.5 )
                            - input /color0 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( )
                            - input /color90 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                            - Category changed on: cutout_opacity from ifgreatereq to ifgreater
                            - attribute: nodename=( opacity_clamped ) removed from: value1
                            - attribute: interfacename=( opacity ) added to: value1
                            IMP_UsdPrimvarReader_boolean - Number of children on: primvar changed from ( 1 ) to ( 2 )
                            - input /default added to IMP_UsdPrimvarReader_boolean/primvar. Value=( )
                            IMP_UsdPrimvarReader_float - Number of children on: primvar changed from ( 1 ) to ( 2 )
                            - input /default added to IMP_UsdPrimvarReader_float/primvar. Value=( )
                            IMP_UsdPrimvarReader_integer - Number of children on: primvar changed from ( 1 ) to ( 2 )
                            - input /default added to IMP_UsdPrimvarReader_integer/primvar. Value=( )
                            IM_acos_vector4_genosl - attribute: file=( stdlib/genosl/mx_acos.inline ) removed from: IM_acos_vector4_genosl
                            - attribute: sourcecode=( acos({{in}}) ) added to: IM_acos_vector4_genosl
                            IM_add_bsdf_genglsl - attribute: file=( pbrlib/genglsl/mx_add_bsdf.glsl ) removed from: IM_add_bsdf_genglsl
                            - attribute: function=( mx_add_bsdf ) removed from: IM_add_bsdf_genglsl
                            IM_add_bsdf_genmdl - attribute: sourcecode changed on IM_add_bsdf_genmdl from ( {{in1}} ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_add_bsdf(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
                            IM_add_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_add.inline ) removed from: IM_add_bsdf_genosl
                            IM_add_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_add.inline ) removed from: IM_add_bsdf_genosl
                            - attribute: sourcecode=( ({{in1}} + {{in2}}) ) added to: IM_add_bsdf_genosl
                            IM_add_color3FA_genglsl - attribute: file=( stdlib/genglsl/mx_add.inline ) removed from: IM_add_color3FA_genglsl
                            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_color3FA_genglsl
                            IM_add_color3FA_genosl - attribute: file=( stdlib/genosl/mx_add.inline ) removed from: IM_add_color3FA_genosl
                            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_color3FA_genosl
                            IM_add_color3_genglsl - attribute: file=( stdlib/genglsl/mx_add.inline ) removed from: IM_add_color3_genglsl
                            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_color3_genglsl
                            IM_add_color4_genosl - attribute: file=( stdlib/genosl/mx_add.inline ) removed from: IM_add_color4_genosl
                            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_color4_genosl
                            IM_add_edf_genglsl - attribute: file=( pbrlib/genglsl/mx_add_edf.glsl ) removed from: IM_add_edf_genglsl
                            - attribute: function=( mx_add_edf ) removed from: IM_add_edf_genglsl
                            IM_add_edf_genmdl - attribute: sourcecode changed on IM_add_edf_genmdl from ( {{in2}} ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_add_edf(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
                            IM_add_edf_genosl - attribute: file=( pbrlib/genosl/mx_add.inline ) removed from: IM_add_edf_genosl
                            IM_add_edf_genosl - attribute: file=( pbrlib/genosl/mx_add.inline ) removed from: IM_add_edf_genosl
                            - attribute: sourcecode=( ({{in1}} + {{in2}}) ) added to: IM_add_edf_genosl
                            IM_add_float_genglsl - attribute: file=( stdlib/genglsl/mx_add.inline ) removed from: IM_add_float_genglsl
                            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_float_genglsl
                            IM_add_float_genosl - attribute: file=( stdlib/genosl/mx_add.inline ) removed from: IM_add_float_genosl
                            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_float_genosl
                            IM_add_matrix33FA_genglsl - attribute: file=( stdlib/genglsl/mx_add.inline ) removed from: IM_add_matrix33FA_genglsl
                            - attribute: sourcecode=( {{in1}} + {{in2}} ) added to: IM_add_matrix33FA_genglsl
                            IM_asin_vector3_genosl - attribute: file=( stdlib/genosl/mx_asin.inline ) removed from: IM_asin_vector3_genosl
                            - attribute: sourcecode=( asin({{in}}) ) added to: IM_asin_vector3_genosl
                            IM_asin_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_asin.inline ) removed from: IM_asin_vector4_genglsl
                            - attribute: sourcecode=( asin({{in}}) ) added to: IM_asin_vector4_genglsl
                            IM_asin_vector4_genosl - attribute: file=( stdlib/genosl/mx_asin.inline ) removed from: IM_asin_vector4_genosl
                            - attribute: sourcecode=( asin({{in}}) ) added to: IM_asin_vector4_genosl
                            IM_atan2_float_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_float_genglsl
                            - attribute: sourcecode=( atan({{in1}}, {{in2}}) ) added to: IM_atan2_float_genglsl
                            IM_atan2_float_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_float_genosl
                            - attribute: sourcecode=( atan2({{in1}},{{in2}}) ) added to: IM_atan2_float_genosl
                            IM_atan2_vector2_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector2_genglsl
                            - attribute: sourcecode=( atan({{in1}}, {{in2}}) ) added to: IM_atan2_vector2_genglsl
                            IM_atan2_vector2_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector2_genosl
                            - attribute: sourcecode=( atan2({{in1}},{{in2}}) ) added to: IM_atan2_vector2_genosl
                            IM_atan2_vector3_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector3_genglsl
                            - attribute: sourcecode=( atan({{in1}}, {{in2}}) ) added to: IM_atan2_vector3_genglsl
                            IM_atan2_vector3_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector3_genosl
                            - attribute: sourcecode=( atan2({{in1}},{{in2}}) ) added to: IM_atan2_vector3_genosl
                            IM_atan2_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector4_genglsl
                            - attribute: sourcecode=( atan({{in1}}, {{in2}}) ) added to: IM_atan2_vector4_genglsl
                            IM_atan2_vector4_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector4_genosl
                            - attribute: sourcecode=( atan2({{in1}},{{in2}}) ) added to: IM_atan2_vector4_genosl
                            IM_atan2_float_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_float_genglsl
                            - attribute: sourcecode=( atan({{iny}}, {{inx}}) ) added to: IM_atan2_float_genglsl
                            IM_atan2_float_genmdl - attribute: sourcecode changed on IM_atan2_float_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_float_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_float_genosl
                            - attribute: sourcecode=( atan2({{iny}},{{inx}}) ) added to: IM_atan2_float_genosl
                            IM_atan2_vector2_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector2_genglsl
                            - attribute: sourcecode=( atan({{iny}}, {{inx}}) ) added to: IM_atan2_vector2_genglsl
                            IM_atan2_vector2_genmdl - attribute: sourcecode changed on IM_atan2_vector2_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector2_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector2_genosl
                            - attribute: sourcecode=( atan2({{iny}},{{inx}}) ) added to: IM_atan2_vector2_genosl
                            IM_atan2_vector3_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector3_genglsl
                            - attribute: sourcecode=( atan({{iny}}, {{inx}}) ) added to: IM_atan2_vector3_genglsl
                            IM_atan2_vector3_genmdl - attribute: sourcecode changed on IM_atan2_vector3_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector3_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector3_genosl
                            - attribute: sourcecode=( atan2({{iny}},{{inx}}) ) added to: IM_atan2_vector3_genosl
                            IM_atan2_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_atan2.inline ) removed from: IM_atan2_vector4_genglsl
                            - attribute: sourcecode=( atan({{iny}}, {{inx}}) ) added to: IM_atan2_vector4_genglsl
                            IM_atan2_vector4_genmdl - attribute: sourcecode changed on IM_atan2_vector4_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector4_genosl - attribute: file=( stdlib/genosl/mx_atan2.inline ) removed from: IM_atan2_vector4_genosl
                            - attribute: sourcecode=( atan2({{iny}},{{inx}}) ) added to: IM_atan2_vector4_genosl
                            IM_bitangent_vector3_genmdl - attribute: sourcecode changed on IM_bitangent_vector3_genmdl from ( mx::stdlib::mx_bitangent_vector3(mxp_space:{{space}}, mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_bitangent_vector3(mxp_space:{{space}}, mxp_index:{{index}}) )
                            IM_bitangent_vector3_genosl - attribute: file=( stdlib/genosl/mx_bitangent_vector3.inline ) removed from: IM_bitangent_vector3_genosl
                            - attribute: sourcecode=( transform({{space}}, normalize(dPdv)) ) added to: IM_bitangent_vector3_genosl
                            IM_blackbody_genmdl - attribute: sourcecode changed on IM_blackbody_genmdl from ( mx::pbrlib::mx_blackbody(mxp_temperature:{{temperature}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_blackbody(mxp_temperature:{{temperature}}) )
                            IM_burley_diffuse_bsdf_genglsl - attribute: file changed on IM_burley_diffuse_bsdf_genglsl from ( pbrlib/genglsl/mx_burley_diffuse_bsdf.glsl ) to ( mx_burley_diffuse_bsdf.glsl )
                            IM_burley_diffuse_bsdf_genmdl - attribute: sourcecode changed on IM_burley_diffuse_bsdf_genmdl from ( mx::pbrlib::mx_burley_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_burley_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}) )
                            IM_burley_diffuse_bsdf_genosl - attribute: file changed on IM_burley_diffuse_bsdf_genosl from ( pbrlib/genosl/mx_burley_diffuse_bsdf.osl ) to ( legacy/mx_burley_diffuse_bsdf.osl )
                            IM_burley_diffuse_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_burley_diffuse_bsdf.osl ) removed from: IM_burley_diffuse_bsdf_genosl
                            - attribute: function=( mx_burley_diffuse_bsdf ) removed from: IM_burley_diffuse_bsdf_genosl
                            - attribute: sourcecode=( {{weight}} * burley_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) added to: IM_burley_diffuse_bsdf_genosl
                            IM_burn_color3_genglsl - attribute: file changed on IM_burn_color3_genglsl from ( stdlib/genglsl/mx_burn_color3.glsl ) to ( mx_burn_color3.glsl )
                            IM_burn_color3_genmdl - attribute: sourcecode changed on IM_burn_color3_genmdl from ( mx::stdlib::mx_burn_color3({{fg}}, {{bg}}, {{mix}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_burn_color3({{fg}}, {{bg}}, {{mix}}) )
                            IM_burn_color3_genosl - attribute: file changed on IM_burn_color3_genosl from ( stdlib/genosl/mx_burn_color3.osl ) to ( mx_burn_color3.osl )
                            IM_clamp_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_clamp.inline ) removed from: IM_clamp_vector4_genglsl
                            - attribute: sourcecode=( clamp({{in}}, {{low}}, {{high}}) ) added to: IM_clamp_vector4_genglsl
                            IM_clamp_vector4_genosl - attribute: file=( stdlib/genosl/mx_clamp.inline ) removed from: IM_clamp_vector4_genosl
                            - attribute: sourcecode=( clamp({{in}}, {{low}}, {{high}}) ) added to: IM_clamp_vector4_genosl
                            IM_conductor_bsdf_genglsl - attribute: file changed on IM_conductor_bsdf_genglsl from ( pbrlib/genglsl/mx_conductor_bsdf.glsl ) to ( mx_conductor_bsdf.glsl )
                            IM_conductor_bsdf_genmdl - attribute: sourcecode changed on IM_conductor_bsdf_genmdl from ( mx::pbrlib::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) )
                            IM_conductor_bsdf_genosl - attribute: file changed on IM_conductor_bsdf_genosl from ( pbrlib/genosl/mx_conductor_bsdf.osl ) to ( legacy/mx_conductor_bsdf.osl )
                            IM_conductor_bsdf_genmdl - attribute: sourcecode changed on IM_conductor_bsdf_genmdl from ( mx::pbrlib::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}) )
                            IM_conductor_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_conductor_bsdf.osl ) removed from: IM_conductor_bsdf_genosl
                            - attribute: function=( mx_conductor_bsdf ) removed from: IM_conductor_bsdf_genosl
                            - attribute: sourcecode=( {{weight}} * conductor_bsdf({{normal}}, {{tangent}}, {{roughness}}.x, {{roughness}}.y, {{ior}}, {{extinction}}, {{distribution}}, "thinfilm_thickness", {{thinfilm_thickness}}, "thinfilm_ior", {{thinfilm_ior}}) ) added to: IM_conductor_bsdf_genosl
                            IM_conical_edf_genmdl - attribute: sourcecode changed on IM_conical_edf_genmdl from ( mx::pbrlib::mx_conical_edf(mxp_color:{{color}}, mxp_normal:{{normal}}, mxp_inner_angle:{{inner_angle}}, mxp_outer_angle:{{outer_angle}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conical_edf(mxp_color:{{color}}, mxp_normal:{{normal}}, mxp_inner_angle:{{inner_angle}}, mxp_outer_angle:{{outer_angle}}) )
                            IM_constant_boolean_genglsl - attribute: file=( stdlib/genglsl/mx_constant.inline ) removed from: IM_constant_boolean_genglsl
                            - attribute: sourcecode=( {{value}} ) added to: IM_constant_boolean_genglsl
                            IM_constant_boolean_genosl - attribute: file=( stdlib/genosl/mx_constant.inline ) removed from: IM_constant_boolean_genosl
                            - attribute: sourcecode=( {{value}} ) added to: IM_constant_boolean_genosl
                            IM_determinant_matrix44_genmdl - attribute: sourcecode changed on IM_determinant_matrix44_genmdl from ( mx::stdlib::mx_determinant_matrix44({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_determinant_matrix44({{in}}) )
                            IM_determinant_matrix44_genosl - attribute: file=( stdlib/genosl/mx_determinant.inline ) removed from: IM_determinant_matrix44_genosl
                            - attribute: sourcecode=( determinant({{in}}) ) added to: IM_determinant_matrix44_genosl
                            IM_dielectric_bsdf_genglsl - attribute: file changed on IM_dielectric_bsdf_genglsl from ( pbrlib/genglsl/mx_dielectric_bsdf.glsl ) to ( mx_dielectric_bsdf.glsl )
                            IM_dielectric_bsdf_genmdl - attribute: sourcecode changed on IM_dielectric_bsdf_genmdl from ( mx::pbrlib::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) )
                            IM_dielectric_bsdf_genosl - attribute: file changed on IM_dielectric_bsdf_genosl from ( pbrlib/genosl/mx_dielectric_bsdf.osl ) to ( legacy/mx_dielectric_bsdf.osl )
                            IM_dielectric_bsdf_genmdl - attribute: sourcecode changed on IM_dielectric_bsdf_genmdl from ( mx::pbrlib::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) )
                            IM_dielectric_bsdf_genosl - attribute: file changed on IM_dielectric_bsdf_genosl from ( pbrlib/genosl/mx_dielectric_bsdf.osl ) to ( mx_dielectric_bsdf.osl )
                            IM_difference_color3_genglsl - attribute: file=( stdlib/genglsl/mx_difference.inline ) removed from: IM_difference_color3_genglsl
                            - attribute: sourcecode=( ({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_difference_color3_genglsl
                            IM_difference_color3_genosl - attribute: file=( stdlib/genosl/mx_difference.inline ) removed from: IM_difference_color3_genosl
                            - attribute: sourcecode=( ({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_difference_color3_genosl
                            IM_difference_color4_genglsl - attribute: file=( stdlib/genglsl/mx_difference.inline ) removed from: IM_difference_color4_genglsl
                            - attribute: sourcecode=( ({{mix}}*abs({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_difference_color4_genglsl
                            IM_frame_float_genmdl - attribute: sourcecode changed on IM_frame_float_genmdl from ( mx::stdlib::mx_frame_float() ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_frame_float() )
                            IM_frame_float_genosl - attribute: file changed on IM_frame_float_genosl from ( stdlib/genosl/mx_frame_float.osl ) to ( mx_frame_float.osl )
                            IM_generalized_schlick_bsdf_genglsl - attribute: file changed on IM_generalized_schlick_bsdf_genglsl from ( pbrlib/genglsl/mx_generalized_schlick_bsdf.glsl ) to ( mx_generalized_schlick_bsdf.glsl )
                            IM_generalized_schlick_bsdf_genmdl - attribute: sourcecode changed on IM_generalized_schlick_bsdf_genmdl from ( mx::pbrlib::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) )
                            IM_generalized_schlick_bsdf_genosl - attribute: file changed on IM_generalized_schlick_bsdf_genosl from ( pbrlib/genosl/mx_generalized_schlick_bsdf.osl ) to ( legacy/mx_generalized_schlick_bsdf.osl )
                            IM_generalized_schlick_bsdf_genmdl - attribute: sourcecode changed on IM_generalized_schlick_bsdf_genmdl from ( mx::pbrlib::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) )
                            IM_generalized_schlick_bsdf_genosl - attribute: file changed on IM_generalized_schlick_bsdf_genosl from ( pbrlib/genosl/mx_generalized_schlick_bsdf.osl ) to ( mx_generalized_schlick_bsdf.osl )
                            IM_geomcolor_color3_genmdl - attribute: sourcecode changed on IM_geomcolor_color3_genmdl from ( mx::stdlib::mx_geomcolor_color3(mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_geomcolor_color3(mxp_index:{{index}}) )
                            IM_geomcolor_color3_genosl - attribute: file changed on IM_geomcolor_color3_genosl from ( stdlib/genosl/mx_geomcolor_color3.osl ) to ( mx_geomcolor_color3.osl )
                            IM_geomcolor_color4_genmdl - attribute: sourcecode changed on IM_geomcolor_color4_genmdl from ( mx::stdlib::mx_geomcolor_color4(mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_geomcolor_color4(mxp_index:{{index}}) )
                            IM_minus_float_genosl - attribute: file=( stdlib/genosl/mx_minus.inline ) removed from: IM_minus_float_genosl
                            - attribute: sourcecode=( ({{mix}}*({{bg}} - {{fg}})) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_minus_float_genosl
                            IM_mix_bsdf_genglsl - attribute: file=( pbrlib/genglsl/mx_mix_bsdf.glsl ) removed from: IM_mix_bsdf_genglsl
                            - attribute: function=( mx_mix_bsdf ) removed from: IM_mix_bsdf_genglsl
                            IM_mix_bsdf_genmdl - attribute: sourcecode changed on IM_mix_bsdf_genmdl from ( mx::pbrlib::mx_mix_bsdf(mxp_fg:{{fg}}, mxp_bg:{{bg}}, mxp_mix:{{mix}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_mix_bsdf(mxp_fg:{{fg}}, mxp_bg:{{bg}}, mxp_mix:{{mix}}) )
                            IM_mix_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_mix.inline ) removed from: IM_mix_bsdf_genosl
                            IM_mix_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_mix.inline ) removed from: IM_mix_bsdf_genosl
                            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_bsdf_genosl
                            IM_mix_color3_genglsl - attribute: file=( stdlib/genglsl/mx_mix.inline ) removed from: IM_mix_color3_genglsl
                            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_color3_genglsl
                            IM_mix_color3_genosl - attribute: file=( stdlib/genosl/mx_mix.inline ) removed from: IM_mix_color3_genosl
                            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_color3_genosl
                            IM_mix_color4_genglsl - attribute: file=( stdlib/genglsl/mx_mix.inline ) removed from: IM_mix_color4_genglsl
                            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_color4_genglsl
                            IM_mix_color4_genosl - attribute: file=( stdlib/genosl/mx_mix.inline ) removed from: IM_mix_color4_genosl
                            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_color4_genosl
                            IM_mix_edf_genglsl - attribute: file=( pbrlib/genglsl/mx_mix_edf.glsl ) removed from: IM_mix_edf_genglsl
                            - attribute: function=( mx_mix_edf ) removed from: IM_mix_edf_genglsl
                            IM_mix_edf_genmdl - attribute: sourcecode changed on IM_mix_edf_genmdl from ( mx::pbrlib::mx_mix_edf(mxp_fg:{{fg}}, mxp_bg:{{bg}}, mxp_mix:{{mix}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_mix_edf(mxp_fg:{{fg}}, mxp_bg:{{bg}}, mxp_mix:{{mix}}) )
                            IM_mix_edf_genosl - attribute: file=( pbrlib/genosl/mx_mix.inline ) removed from: IM_mix_edf_genosl
                            IM_mix_edf_genosl - attribute: file=( pbrlib/genosl/mx_mix.inline ) removed from: IM_mix_edf_genosl
                            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_edf_genosl
                            IM_mix_float_genglsl - attribute: file=( stdlib/genglsl/mx_mix.inline ) removed from: IM_mix_float_genglsl
                            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_float_genglsl
                            IM_mix_float_genosl - attribute: file=( stdlib/genosl/mx_mix.inline ) removed from: IM_mix_float_genosl
                            - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) added to: IM_mix_float_genosl
                            IM_mix_surfaceshader_genglsl - attribute: file changed on IM_mix_surfaceshader_genglsl from ( stdlib/genglsl/mx_mix_surfaceshader.glsl ) to ( mx_mix_surfaceshader.glsl )
                            IM_modulo_vector4_genosl - attribute: file=( stdlib/genosl/mx_modulo.inline ) removed from: IM_modulo_vector4_genosl
                            - attribute: sourcecode=( mod({{in1}}, {{in2}}) ) added to: IM_modulo_vector4_genosl
                            IM_multiply_bsdfC_genglsl - attribute: file=( pbrlib/genglsl/mx_multiply_bsdf_color.glsl ) removed from: IM_multiply_bsdfC_genglsl
                            - attribute: function=( mx_multiply_bsdf_color ) removed from: IM_multiply_bsdfC_genglsl
                            IM_multiply_bsdfC_genmdl - attribute: sourcecode changed on IM_multiply_bsdfC_genmdl from ( mx::pbrlib::mx_multiply_bsdf_color3(mxp_in1:{{in1}}, mxp_in2:{{in2}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_multiply_bsdf_color3(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
                            IM_multiply_bsdfC_genosl - attribute: file=( pbrlib/genosl/mx_multiply_bsdf.inline ) removed from: IM_multiply_bsdfC_genosl
                            IM_multiply_bsdfC_genosl - attribute: file=( pbrlib/genosl/mx_multiply_bsdf.inline ) removed from: IM_multiply_bsdfC_genosl
                            - attribute: sourcecode=( ({{in2}} * {{in1}}) ) added to: IM_multiply_bsdfC_genosl
                            IM_multiply_bsdfF_genglsl - attribute: file=( pbrlib/genglsl/mx_multiply_bsdf_float.glsl ) removed from: IM_multiply_bsdfF_genglsl
                            - attribute: function=( mx_multiply_bsdf_float ) removed from: IM_multiply_bsdfF_genglsl
                            IM_multiply_bsdfF_genmdl - attribute: sourcecode changed on IM_multiply_bsdfF_genmdl from ( mx::pbrlib::mx_multiply_bsdf_float(mxp_in1:{{in1}}, mxp_in2:{{in2}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_multiply_bsdf_float(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
                            IM_multiply_bsdfF_genosl - attribute: file=( pbrlib/genosl/mx_multiply_bsdf.inline ) removed from: IM_multiply_bsdfF_genosl
                            IM_multiply_bsdfF_genosl - attribute: file=( pbrlib/genosl/mx_multiply_bsdf.inline ) removed from: IM_multiply_bsdfF_genosl
                            - attribute: sourcecode=( ({{in2}} * {{in1}}) ) added to: IM_multiply_bsdfF_genosl
                            IM_multiply_color3FA_genglsl - attribute: file=( stdlib/genglsl/mx_multiply.inline ) removed from: IM_multiply_color3FA_genglsl
                            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_color3FA_genglsl
                            IM_multiply_color3FA_genosl - attribute: file=( stdlib/genosl/mx_multiply.inline ) removed from: IM_multiply_color3FA_genosl
                            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_color3FA_genosl
                            IM_multiply_color3_genglsl - attribute: file=( stdlib/genglsl/mx_multiply.inline ) removed from: IM_multiply_color3_genglsl
                            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_color3_genglsl
                            IM_multiply_color4_genosl - attribute: file=( stdlib/genosl/mx_multiply.inline ) removed from: IM_multiply_color4_genosl
                            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_color4_genosl
                            IM_multiply_edfC_genglsl - attribute: file=( pbrlib/genglsl/mx_multiply_edf_color.glsl ) removed from: IM_multiply_edfC_genglsl
                            - attribute: function=( mx_multiply_edf_color ) removed from: IM_multiply_edfC_genglsl
                            IM_multiply_edfC_genmdl - attribute: sourcecode changed on IM_multiply_edfC_genmdl from ( {{in1}} ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_multiply_edf_color3(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
                            IM_multiply_edfC_genosl - attribute: file=( pbrlib/genosl/mx_multiply_edf.inline ) removed from: IM_multiply_edfC_genosl
                            IM_multiply_edfC_genosl - attribute: file=( pbrlib/genosl/mx_multiply_edf.inline ) removed from: IM_multiply_edfC_genosl
                            - attribute: sourcecode=( ({{in2}} * {{in1}}) ) added to: IM_multiply_edfC_genosl
                            IM_multiply_edfF_genglsl - attribute: file=( pbrlib/genglsl/mx_multiply_edf_float.glsl ) removed from: IM_multiply_edfF_genglsl
                            - attribute: function=( mx_multiply_edf_float ) removed from: IM_multiply_edfF_genglsl
                            IM_multiply_edfF_genmdl - attribute: sourcecode changed on IM_multiply_edfF_genmdl from ( {{in1}} ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_multiply_edf_float(mxp_in1:{{in1}}, mxp_in2:{{in2}}) )
                            IM_multiply_edfF_genosl - attribute: file=( pbrlib/genosl/mx_multiply_edf.inline ) removed from: IM_multiply_edfF_genosl
                            IM_multiply_edfF_genosl - attribute: file=( pbrlib/genosl/mx_multiply_edf.inline ) removed from: IM_multiply_edfF_genosl
                            - attribute: sourcecode=( ({{in2}} * {{in1}}) ) added to: IM_multiply_edfF_genosl
                            IM_multiply_float_genglsl - attribute: file=( stdlib/genglsl/mx_multiply.inline ) removed from: IM_multiply_float_genglsl
                            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_float_genglsl
                            IM_multiply_float_genosl - attribute: file=( stdlib/genosl/mx_multiply.inline ) removed from: IM_multiply_float_genosl
                            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_float_genosl
                            IM_multiply_matrix33_genglsl - attribute: file=( stdlib/genglsl/mx_multiply.inline ) removed from: IM_multiply_matrix33_genglsl
                            - attribute: sourcecode=( {{in1}} * {{in2}} ) added to: IM_multiply_matrix33_genglsl
                            IM_normalize_vector4_genosl - attribute: file=( stdlib/genosl/mx_normalize.inline ) removed from: IM_normalize_vector4_genosl
                            - attribute: sourcecode=( normalize({{in}}) ) added to: IM_normalize_vector4_genosl
                            IM_oren_nayar_diffuse_bsdf_genglsl - attribute: file changed on IM_oren_nayar_diffuse_bsdf_genglsl from ( pbrlib/genglsl/mx_oren_nayar_diffuse_bsdf.glsl ) to ( mx_oren_nayar_diffuse_bsdf.glsl )
                            IM_oren_nayar_diffuse_bsdf_genmdl - attribute: sourcecode changed on IM_oren_nayar_diffuse_bsdf_genmdl from ( mx::pbrlib::mx_oren_nayar_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_oren_nayar_diffuse_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}) )
                            IM_oren_nayar_diffuse_bsdf_genosl - attribute: function=( mx_oren_nayar_diffuse_bsdf ) added to: IM_oren_nayar_diffuse_bsdf_genosl
                            - attribute: file changed on IM_oren_nayar_diffuse_bsdf_genosl from ( pbrlib/genosl/mx_oren_nayar_diffuse_bsdf.inline ) to ( legacy/mx_oren_nayar_diffuse_bsdf.osl )
                            IM_oren_nayar_diffuse_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_oren_nayar_diffuse_bsdf.inline ) removed from: IM_oren_nayar_diffuse_bsdf_genosl
                            - attribute: sourcecode=( {{weight}} * oren_nayar_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) added to: IM_oren_nayar_diffuse_bsdf_genosl
                            IM_out_color4_genglsl - attribute: file=( stdlib/genglsl/mx_out_color4.inline ) removed from: IM_out_color4_genglsl
                            - attribute: sourcecode=( ({{fg}}*(1.0-{{bg}}.a) * {{mix}}) + ({{bg}} * (1.0-{{mix}})); ) added to: IM_out_color4_genglsl
                            IM_out_color4_genmdl - attribute: sourcecode changed on IM_out_color4_genmdl from ( mx::stdlib::mx_out_color4({{fg}}, {{bg}}, {{mix}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_out_color4({{fg}}, {{bg}}, {{mix}}) )
                            IM_out_color4_genosl - attribute: file=( stdlib/genosl/mx_out.inline ) removed from: IM_out_color4_genosl
                            - attribute: sourcecode=( ({{fg}}*(1.0-{{bg}}.a) * {{mix}}) + ({{bg}} * (1.0-{{mix}})) ) added to: IM_out_color4_genosl
                            IM_screen_float_genosl - attribute: file=( stdlib/genosl/mx_screen.inline ) removed from: IM_screen_float_genosl
                            - attribute: sourcecode=( ({{mix}}*((1.0 - (1.0 - {{fg}}) * (1 - {{bg}})))) + ((1.0-{{mix}})*{{bg}}) ) added to: IM_screen_float_genosl
                            IM_sheen_bsdf_genglsl - attribute: file changed on IM_sheen_bsdf_genglsl from ( pbrlib/genglsl/mx_sheen_bsdf.glsl ) to ( mx_sheen_bsdf.glsl )
                            IM_sheen_bsdf_genmdl - attribute: sourcecode changed on IM_sheen_bsdf_genmdl from ( mx::pbrlib::mx_sheen_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_sheen_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_base:{{base}}) )
                            IM_sheen_bsdf_genosl - attribute: file changed on IM_sheen_bsdf_genosl from ( pbrlib/genosl/mx_sheen_bsdf.osl ) to ( legacy/mx_sheen_bsdf.osl )
                            IM_sheen_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_sheen_bsdf.osl ) removed from: IM_sheen_bsdf_genosl
                            - attribute: function=( mx_sheen_bsdf ) removed from: IM_sheen_bsdf_genosl
                            - attribute: sourcecode=( {{weight}} * sheen_bsdf({{normal}}, {{color}}, {{roughness}}) ) added to: IM_sheen_bsdf_genosl
                            IM_sign_color3_genglsl - attribute: file=( stdlib/genglsl/mx_sign.inline ) removed from: IM_sign_color3_genglsl
                            - attribute: sourcecode=( sign({{in}}) ) added to: IM_sign_color3_genglsl
                            IM_sign_color3_genmdl - attribute: sourcecode changed on IM_sign_color3_genmdl from ( mx::stdlib::mx_sign_color3({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_sign_color3({{in}}) )
                            IM_sign_color3_genosl - attribute: file=( stdlib/genosl/mx_sign.inline ) removed from: IM_sign_color3_genosl
                            - attribute: sourcecode=( sign({{in}}) ) added to: IM_sign_color3_genosl
                            IM_sqrt_vector4_genosl - attribute: file=( stdlib/genosl/mx_sqrt.inline ) removed from: IM_sqrt_vector4_genosl
                            - attribute: sourcecode=( sqrt({{in}}) ) added to: IM_sqrt_vector4_genosl
                            IM_subsurface_bsdf_genglsl - attribute: file changed on IM_subsurface_bsdf_genglsl from ( pbrlib/genglsl/mx_subsurface_bsdf.glsl ) to ( mx_subsurface_bsdf.glsl )
                            IM_subsurface_bsdf_genmdl - attribute: sourcecode changed on IM_subsurface_bsdf_genmdl from ( mx::pbrlib::mx_subsurface_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_radius:{{radius}}, mxp_anisotropy:{{anisotropy}}, mxp_normal:{{normal}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_subsurface_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_radius:{{radius}}, mxp_anisotropy:{{anisotropy}}, mxp_normal:{{normal}}) )
                            IM_subsurface_bsdf_genosl - attribute: file changed on IM_subsurface_bsdf_genosl from ( pbrlib/genosl/mx_subsurface_bsdf.osl ) to ( legacy/mx_subsurface_bsdf.osl )
                            IM_subsurface_bsdf_genosl - attribute: file changed on IM_subsurface_bsdf_genosl from ( pbrlib/genosl/mx_subsurface_bsdf.osl ) to ( mx_subsurface_bsdf.osl )
                            IM_subtract_color3FA_genglsl - attribute: file=( stdlib/genglsl/mx_subtract.inline ) removed from: IM_subtract_color3FA_genglsl
                            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_color3FA_genglsl
                            IM_subtract_color3FA_genosl - attribute: file=( stdlib/genosl/mx_subtract.inline ) removed from: IM_subtract_color3FA_genosl
                            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_color3FA_genosl
                            IM_subtract_color3_genglsl - attribute: file=( stdlib/genglsl/mx_subtract.inline ) removed from: IM_subtract_color3_genglsl
                            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_color3_genglsl
                            IM_subtract_vector4FA_genosl - attribute: file=( stdlib/genosl/mx_subtract.inline ) removed from: IM_subtract_vector4FA_genosl
                            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_vector4FA_genosl
                            IM_subtract_vector4_genglsl - attribute: file=( stdlib/genglsl/mx_subtract.inline ) removed from: IM_subtract_vector4_genglsl
                            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_vector4_genglsl
                            IM_subtract_vector4_genosl - attribute: file=( stdlib/genosl/mx_subtract.inline ) removed from: IM_subtract_vector4_genosl
                            - attribute: sourcecode=( {{in1}} - {{in2}} ) added to: IM_subtract_vector4_genosl
                            IM_surface_genosl - attribute: file changed on IM_surface_genosl from ( pbrlib/genosl/mx_surface.osl ) to ( legacy/mx_surface.osl )
                            IM_switch_color3I_genmdl - attribute: sourcecode changed on IM_switch_color3I_genmdl from ( mx::stdlib::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_color3_genmdl - attribute: sourcecode changed on IM_switch_color3_genmdl from ( mx::stdlib::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_color4I_genmdl - attribute: sourcecode changed on IM_switch_color4I_genmdl from ( mx::stdlib::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_color4_genmdl - attribute: sourcecode changed on IM_switch_color4_genmdl from ( mx::stdlib::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_floatI_genmdl - attribute: sourcecode changed on IM_switch_floatI_genmdl from ( mx::stdlib::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_float_genmdl - attribute: sourcecode changed on IM_switch_float_genmdl from ( mx::stdlib::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_vector2I_genmdl - attribute: sourcecode changed on IM_switch_vector2I_genmdl from ( mx::stdlib::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_vector2_genmdl - attribute: sourcecode changed on IM_switch_vector2_genmdl from ( mx::stdlib::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_vector3I_genmdl - attribute: sourcecode changed on IM_switch_vector3I_genmdl from ( mx::stdlib::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_vector3_genmdl - attribute: sourcecode changed on IM_switch_vector3_genmdl from ( mx::stdlib::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_vector4I_genmdl - attribute: sourcecode changed on IM_switch_vector4I_genmdl from ( mx::stdlib::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_switch_vector4_genmdl - attribute: sourcecode changed on IM_switch_vector4_genmdl from ( mx::stdlib::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) )
                            IM_surface_genosl - attribute: file changed on IM_surface_genosl from ( pbrlib/genosl/mx_surface.osl ) to ( mx_surface.osl )
                            IM_switch_color3I_genmdl - attribute: sourcecode changed on IM_switch_color3I_genmdl from ( mx::stdlib::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color3_genmdl - attribute: sourcecode changed on IM_switch_color3_genmdl from ( mx::stdlib::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color4I_genmdl - attribute: sourcecode changed on IM_switch_color4I_genmdl from ( mx::stdlib::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color4_genmdl - attribute: sourcecode changed on IM_switch_color4_genmdl from ( mx::stdlib::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_floatI_genmdl - attribute: sourcecode changed on IM_switch_floatI_genmdl from ( mx::stdlib::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_float_genmdl - attribute: sourcecode changed on IM_switch_float_genmdl from ( mx::stdlib::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector2I_genmdl - attribute: sourcecode changed on IM_switch_vector2I_genmdl from ( mx::stdlib::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector2_genmdl - attribute: sourcecode changed on IM_switch_vector2_genmdl from ( mx::stdlib::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector3I_genmdl - attribute: sourcecode changed on IM_switch_vector3I_genmdl from ( mx::stdlib::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector3_genmdl - attribute: sourcecode changed on IM_switch_vector3_genmdl from ( mx::stdlib::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector4I_genmdl - attribute: sourcecode changed on IM_switch_vector4I_genmdl from ( mx::stdlib::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector4_genmdl - attribute: sourcecode changed on IM_switch_vector4_genmdl from ( mx::stdlib::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_tan_float_genglsl - attribute: file=( stdlib/genglsl/mx_tan.inline ) removed from: IM_tan_float_genglsl
                            - attribute: sourcecode=( tan({{in}}) ) added to: IM_tan_float_genglsl
                            IM_tan_float_genosl - attribute: file=( stdlib/genosl/mx_tan.inline ) removed from: IM_tan_float_genosl
                            - attribute: sourcecode=( tan({{in}}) ) added to: IM_tan_float_genosl
                            IM_tan_vector2_genglsl - attribute: file=( stdlib/genglsl/mx_tan.inline ) removed from: IM_tan_vector2_genglsl
                            - attribute: sourcecode=( tan({{in}}) ) added to: IM_tan_vector2_genglsl
                            IM_transformvector_vector3_genosl - attribute: file=( stdlib/genosl/mx_transformvector.inline ) removed from: IM_transformvector_vector3_genosl
                            - attribute: sourcecode=( transform({{fromspace}}, {{tospace}}, {{in}}) ) added to: IM_transformvector_vector3_genosl
                            IM_translucent_bsdf_genglsl - attribute: file changed on IM_translucent_bsdf_genglsl from ( pbrlib/genglsl/mx_translucent_bsdf.glsl ) to ( mx_translucent_bsdf.glsl )
                            IM_translucent_bsdf_genmdl - attribute: sourcecode changed on IM_translucent_bsdf_genmdl from ( mx::pbrlib::mx_translucent_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_normal:{{normal}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_translucent_bsdf(mxp_weight:{{weight}}, mxp_color:{{color}}, mxp_normal:{{normal}}) )
                            IM_translucent_bsdf_genosl - attribute: function=( mx_translucent_bsdf ) added to: IM_translucent_bsdf_genosl
                            - attribute: file changed on IM_translucent_bsdf_genosl from ( pbrlib/genosl/mx_translucent_bsdf.inline ) to ( legacy/mx_translucent_bsdf.osl )
                            IM_translucent_bsdf_genosl - attribute: file=( pbrlib/genosl/mx_translucent_bsdf.inline ) removed from: IM_translucent_bsdf_genosl
                            - attribute: sourcecode=( {{weight}} * translucent_bsdf({{normal}}, {{color}}) ) added to: IM_translucent_bsdf_genosl
                            IM_transpose_matrix33_genglsl - attribute: file=( stdlib/genglsl/mx_transpose.inline ) removed from: IM_transpose_matrix33_genglsl
                            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix33_genglsl
                            IM_transpose_matrix33_genosl - attribute: file=( stdlib/genosl/mx_transpose.inline ) removed from: IM_transpose_matrix33_genosl
                            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix33_genosl
                            IM_transpose_matrix44_genglsl - attribute: file=( stdlib/genglsl/mx_transpose.inline ) removed from: IM_transpose_matrix44_genglsl
                            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix44_genglsl
                            IM_transpose_matrix44_genosl - attribute: file=( stdlib/genosl/mx_transpose.inline ) removed from: IM_transpose_matrix44_genosl
                            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix44_genosl
                            IM_uniform_edf_genglsl - attribute: file changed on IM_uniform_edf_genglsl from ( pbrlib/genglsl/mx_uniform_edf.glsl ) to ( mx_uniform_edf.glsl )
                            IM_uniform_edf_genmdl - attribute: sourcecode changed on IM_uniform_edf_genmdl from ( mx::pbrlib::mx_uniform_edf(mxp_color:{{color}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_uniform_edf(mxp_color:{{color}}) )
                            IM_uniform_edf_genosl - attribute: file=( pbrlib/genosl/mx_uniform_edf.inline ) removed from: IM_uniform_edf_genosl
                            - attribute: sourcecode=( {{color}} * emission() ) added to: IM_uniform_edf_genosl
                            IM_uniform_edf_genosl - attribute: file=( pbrlib/genosl/mx_uniform_edf.inline ) removed from: IM_uniform_edf_genosl
                            - attribute: sourcecode=( uniform_edf({{color}}) ) added to: IM_uniform_edf_genosl
                            IM_unpremult_color4_genglsl - attribute: file changed on IM_unpremult_color4_genglsl from ( stdlib/genglsl/mx_unpremult_color4.glsl ) to ( mx_unpremult_color4.glsl )
                            IM_unpremult_color4_genmdl - attribute: sourcecode changed on IM_unpremult_color4_genmdl from ( mx::stdlib::mx_unpremult_color4({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_unpremult_color4({{in}}) )
                            IM_unpremult_color4_genosl - attribute: file changed on IM_unpremult_color4_genosl from ( stdlib/genosl/mx_unpremult_color4.osl ) to ( mx_unpremult_color4.osl )
                            NG_range_vector3FA - Number of children on: N_clamp_vector3FA changed from ( 1 ) to ( 3 )
                            - input /low added to NG_range_vector3FA/N_clamp_vector3FA. Value=( )
                            - input /high added to NG_range_vector3FA/N_clamp_vector3FA. Value=( )
                            NG_range_vector4 - Number of children on: N_clamp_vector4 changed from ( 1 ) to ( 3 )
                            - input /low added to NG_range_vector4/N_clamp_vector4. Value=( )
                            - input /high added to NG_range_vector4/N_clamp_vector4. Value=( )
                            NG_range_vector4FA - Number of children on: N_clamp_vector4FA changed from ( 1 ) to ( 3 )
                            - input /low added to NG_range_vector4FA/N_clamp_vector4FA. Value=( )
                            - input /high added to NG_range_vector4FA/N_clamp_vector4FA. Value=( )
                            NG_separate2_vector2 - extract /N_x_vector2 removed from NG_separate2_vector2
                            - extract /N_y_vector2 removed from NG_separate2_vector2
                            - extract /N_extract_0 add to NG_separate2_vector2
                            - extract /N_extract_1 add to NG_separate2_vector2
                            - attribute: nodename changed on outx from ( N_x_vector2 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector2 ) to ( N_extract_1 )
                            NG_separate3_color3 - extract /N_r_color3 removed from NG_separate3_color3
                            - extract /N_g_color3 removed from NG_separate3_color3
                            - extract /N_b_color3 removed from NG_separate3_color3
                            - extract /N_extract_0 add to NG_separate3_color3
                            - extract /N_extract_1 add to NG_separate3_color3
                            - extract /N_extract_2 add to NG_separate3_color3
                            - attribute: nodename changed on outr from ( N_r_color3 ) to ( N_extract_0 )
                            - attribute: nodename changed on outg from ( N_g_color3 ) to ( N_extract_1 )
                            - attribute: nodename changed on outb from ( N_b_color3 ) to ( N_extract_2 )
                            NG_separate3_vector3 - extract /N_x_vector3 removed from NG_separate3_vector3
                            - extract /N_y_vector3 removed from NG_separate3_vector3
                            - extract /N_z_vector3 removed from NG_separate3_vector3
                            - extract /N_extract_0 add to NG_separate3_vector3
                            - extract /N_extract_1 add to NG_separate3_vector3
                            - extract /N_extract_2 add to NG_separate3_vector3
                            - attribute: nodename changed on outx from ( N_x_vector3 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector3 ) to ( N_extract_1 )
                            - attribute: nodename changed on outz from ( N_z_vector3 ) to ( N_extract_2 )
                            NG_separate4_color4 - extract /N_r_color4 removed from NG_separate4_color4
                            - extract /N_g_color4 removed from NG_separate4_color4
                            - extract /N_b_color4 removed from NG_separate4_color4
                            - extract /N_a_color4 removed from NG_separate4_color4
                            - extract /N_extract_0 add to NG_separate4_color4
                            - extract /N_extract_1 add to NG_separate4_color4
                            - extract /N_extract_2 add to NG_separate4_color4
                            - extract /N_extract_3 add to NG_separate4_color4
                            - attribute: nodename changed on outr from ( N_r_color4 ) to ( N_extract_0 )
                            - attribute: nodename changed on outg from ( N_g_color4 ) to ( N_extract_1 )
                            - attribute: nodename changed on outb from ( N_b_color4 ) to ( N_extract_2 )
                            - attribute: nodename changed on outa from ( N_a_color4 ) to ( N_extract_3 )
                            NG_separate4_vector4 - extract /N_x_vector4 removed from NG_separate4_vector4
                            - extract /N_y_vector4 removed from NG_separate4_vector4
                            - extract /N_z_vector4 removed from NG_separate4_vector4
                            - extract /N_w_vector4 removed from NG_separate4_vector4
                            - extract /N_extract_0 add to NG_separate4_vector4
                            - extract /N_extract_1 add to NG_separate4_vector4
                            - extract /N_extract_2 add to NG_separate4_vector4
                            - extract /N_extract_3 add to NG_separate4_vector4
                            - attribute: nodename changed on outx from ( N_x_vector4 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector4 ) to ( N_extract_1 )
                            - attribute: nodename changed on outz from ( N_z_vector4 ) to ( N_extract_2 )
                            - attribute: nodename changed on outw from ( N_w_vector4 ) to ( N_extract_3 )
                            NG_triplanarprojection_color3 - Number of children on: NG_triplanarprojection_color3 changed from ( 22 ) to ( 32 )
                            - normalize /N_norm_color3 removed from NG_triplanarprojection_color3
                            - dotproduct /N_dotX_color3 removed from NG_triplanarprojection_color3
                            - dotproduct /N_dotY_color3 removed from NG_triplanarprojection_color3
                            - dotproduct /N_dotZ_color3 removed from NG_triplanarprojection_color3
                            - absval /N_blendX_color3 removed from NG_triplanarprojection_color3
                            - absval /N_blendY_color3 removed from NG_triplanarprojection_color3
                            - absval /N_blendZ_color3 removed from NG_triplanarprojection_color3
                            - multiply /N_vecXY_invert_color3 add to NG_triplanarprojection_color3
                            - combine2 /N_vecXY_xUp_color3 add to NG_triplanarprojection_color3
                            - combine2 /N_vecXZ_xUp_color3 add to NG_triplanarprojection_color3
                            - combine2 /N_vecYZ_yUp_color3 add to NG_triplanarprojection_color3
                            - switch /N_upDirSwitchXY_color3 add to NG_triplanarprojection_color3
                            - switch /N_upDirSwitchXZ_color3 add to NG_triplanarprojection_color3
                            - switch /N_upDirSwitchYZ_color3 add to NG_triplanarprojection_color3
                            - normalize /N_norm_vector3 add to NG_triplanarprojection_color3
                            - absval /N_absN add to NG_triplanarprojection_color3
                            - dotproduct /N_dotN add to NG_triplanarprojection_color3
                            - divide /N_normalizeWeights add to NG_triplanarprojection_color3
                            - clamp /N_clampForPrecision add to NG_triplanarprojection_color3
                            - divide /N_oneOverBlend add to NG_triplanarprojection_color3
                            - power /N_blendPower add to NG_triplanarprojection_color3
                            - dotproduct /N_dotBlendedN add to NG_triplanarprojection_color3
                            - divide /N_normalizeBlendedWeights add to NG_triplanarprojection_color3
                            - separate3 /N_separateWeights add to NG_triplanarprojection_color3
                            - attribute: nodename changed on texcoord from ( N_vecYZ_color3 ) to ( N_upDirSwitchYZ_color3 )
                            - attribute: nodename changed on texcoord from ( N_vecXZ_color3 ) to ( N_upDirSwitchXZ_color3 )
                            - attribute: nodename changed on texcoord from ( N_vecXY_color3 ) to ( N_upDirSwitchXY_color3 )
                            - attribute: output=( outx ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendX_color3 ) to ( N_separateWeights )
                            - attribute: output=( outy ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendY_color3 ) to ( N_separateWeights )
                            - attribute: output=( outz ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendZ_color3 ) to ( N_separateWeights )
                            NG_triplanarprojection_color4 - Number of children on: NG_triplanarprojection_color4 changed from ( 22 ) to ( 32 )
                            - normalize /N_norm_color4 removed from NG_triplanarprojection_color4
                            - dotproduct /N_dotX_color4 removed from NG_triplanarprojection_color4
                            - dotproduct /N_dotY_color4 removed from NG_triplanarprojection_color4
                            - dotproduct /N_dotZ_color4 removed from NG_triplanarprojection_color4
                            - absval /N_blendX_color4 removed from NG_triplanarprojection_color4
                            - absval /N_blendY_color4 removed from NG_triplanarprojection_color4
                            - absval /N_blendZ_color4 removed from NG_triplanarprojection_color4
                            - multiply /N_vecXY_invert_color4 add to NG_triplanarprojection_color4
                            - combine2 /N_vecXY_xUp_color4 add to NG_triplanarprojection_color4
                            - combine2 /N_vecXZ_xUp_color4 add to NG_triplanarprojection_color4
                            - combine2 /N_vecYZ_yUp_color4 add to NG_triplanarprojection_color4
                            - switch /N_upDirSwitchXY_color4 add to NG_triplanarprojection_color4
                            - switch /N_upDirSwitchXZ_color4 add to NG_triplanarprojection_color4
                            - switch /N_upDirSwitchYZ_color4 add to NG_triplanarprojection_color4
                            - normalize /N_norm_vector3 add to NG_triplanarprojection_color4
                            - absval /N_absN add to NG_triplanarprojection_color4
                            - dotproduct /N_dotN add to NG_triplanarprojection_color4
                            - divide /N_normalizeWeights add to NG_triplanarprojection_color4
                            - clamp /N_clampForPrecision add to NG_triplanarprojection_color4
                            - divide /N_oneOverBlend add to NG_triplanarprojection_color4
                            - power /N_blendPower add to NG_triplanarprojection_color4
                            - dotproduct /N_dotBlendedN add to NG_triplanarprojection_color4
                            - divide /N_normalizeBlendedWeights add to NG_triplanarprojection_color4
                            - separate3 /N_separateWeights add to NG_triplanarprojection_color4
                            - attribute: nodename changed on texcoord from ( N_vecYZ_color4 ) to ( N_upDirSwitchYZ_color4 )
                            - attribute: nodename changed on texcoord from ( N_vecXZ_color4 ) to ( N_upDirSwitchXZ_color4 )
                            - attribute: nodename changed on texcoord from ( N_vecXY_color4 ) to ( N_upDirSwitchXY_color4 )
                            - attribute: output=( outx ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendX_color4 ) to ( N_separateWeights )
                            - attribute: output=( outy ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendY_color4 ) to ( N_separateWeights )
                            - attribute: output=( outz ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendZ_color4 ) to ( N_separateWeights )
                            NG_triplanarprojection_float - Number of children on: NG_triplanarprojection_float changed from ( 22 ) to ( 32 )
                            - normalize /N_norm_float removed from NG_triplanarprojection_float
                            - dotproduct /N_dotX_float removed from NG_triplanarprojection_float
                            - dotproduct /N_dotY_float removed from NG_triplanarprojection_float
                            - dotproduct /N_dotZ_float removed from NG_triplanarprojection_float
                            - absval /N_blendX_float removed from NG_triplanarprojection_float
                            - absval /N_blendY_float removed from NG_triplanarprojection_float
                            - absval /N_blendZ_float removed from NG_triplanarprojection_float
                            - multiply /N_vecXY_invert_float add to NG_triplanarprojection_float
                            - combine2 /N_vecXY_xUp_float add to NG_triplanarprojection_float
                            - combine2 /N_vecXZ_xUp_float add to NG_triplanarprojection_float
                            - combine2 /N_vecYZ_yUp_float add to NG_triplanarprojection_float
                            - switch /N_upDirSwitchXY_float add to NG_triplanarprojection_float
                            - switch /N_upDirSwitchXZ_float add to NG_triplanarprojection_float
                            - switch /N_upDirSwitchYZ_float add to NG_triplanarprojection_float
                            - normalize /N_norm_vector3 add to NG_triplanarprojection_float
                            - absval /N_absN add to NG_triplanarprojection_float
                            - dotproduct /N_dotN add to NG_triplanarprojection_float
                            - divide /N_normalizeWeights add to NG_triplanarprojection_float
                            - clamp /N_clampForPrecision add to NG_triplanarprojection_float
                            - divide /N_oneOverBlend add to NG_triplanarprojection_float
                            - power /N_blendPower add to NG_triplanarprojection_float
                            - dotproduct /N_dotBlendedN add to NG_triplanarprojection_float
                            - divide /N_normalizeBlendedWeights add to NG_triplanarprojection_float
                            - separate3 /N_separateWeights add to NG_triplanarprojection_float
                            - attribute: nodename changed on texcoord from ( N_vecYZ_float ) to ( N_upDirSwitchYZ_float )
                            - attribute: nodename changed on texcoord from ( N_vecXZ_float ) to ( N_upDirSwitchXZ_float )
                            - attribute: nodename changed on texcoord from ( N_vecXY_float ) to ( N_upDirSwitchXY_float )
                            - attribute: output=( outx ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendX_float ) to ( N_separateWeights )
                            - attribute: output=( outy ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendY_float ) to ( N_separateWeights )
                            - attribute: output=( outz ) added to: in2
                            - attribute: nodename changed on in2 from ( N_blendZ_float ) to ( N_separateWeights )
                            @@ -92,7 +92,7 @@ * Shader targets added: ['essl'] ##### First Library Definitions / Implementations -
                            541 shaders: genglsl +
                            542 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -105,6 +105,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
                            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -640,7 +641,7 @@ -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -650,6 +651,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1196,7 +1198,7 @@ -
                            540 shaders: genosl +
                            541 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1206,6 +1208,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
                            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -1869,7 +1872,7 @@ -
                            541 shaders: genglsl +
                            542 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -1882,6 +1885,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
                            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -2417,7 +2421,7 @@ -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -2427,6 +2431,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -2973,7 +2978,7 @@ -
                            540 shaders: genosl +
                            541 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2983,6 +2988,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
                            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -3628,8 +3634,8 @@ ### Implementation Comparison -First library implementation count: 2182 -Second library implementation count: 2169 +First library implementation count: 2185 +Second library implementation count: 2172
                            13 implementations added diff --git a/resources/mtlx_1382_vs_1383.md b/resources/mtlx_1382_vs_1383.md index ec61ca0e..65e77ed5 100644 --- a/resources/mtlx_1382_vs_1383.md +++ b/resources/mtlx_1382_vs_1383.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 677 first library definitions from 38 files. Version 1.39.0 +- Loaded 678 first library definitions from 38 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.3']. Search path: "" -- Loaded 675 second library definitions from 38 files. Version 1.39 +- Loaded 676 second library definitions from 38 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.2']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 677 nodedefs. -* Second library has 675 nodedefs +* First library has 678 nodedefs. +* Second library has 676 nodedefs
                            2 node definitions added. (Sorted by category) @@ -52,7 +52,7 @@ * Second library shader targets: *['essl', 'genglsl', 'genmdl', 'genosl']* ##### First Library Definitions / Implementations -
                            543 shaders: essl +
                            544 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -65,6 +65,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -602,7 +603,7 @@ -
                            543 shaders: genglsl +
                            544 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -615,6 +616,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -1152,7 +1154,7 @@ -
                            550 shaders: genmdl +
                            551 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1162,6 +1164,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1709,7 +1712,7 @@ -
                            542 shaders: genosl +
                            543 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1719,6 +1722,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -2377,7 +2381,7 @@ ##### Second Library Definitions / Implementations -
                            541 shaders: essl +
                            542 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2390,6 +2394,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
                            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -2925,7 +2930,7 @@ -
                            541 shaders: genglsl +
                            542 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2938,6 +2943,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx
                            ND_lightIM_light_genglslpbrlib_genglsl_impl.mtlx @@ -3473,7 +3479,7 @@ -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3483,6 +3489,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4029,7 +4036,7 @@ -
                            540 shaders: genosl +
                            541 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4039,6 +4046,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx
                            ND_displacement_floatIM_displacement_float_genoslpbrlib_genosl_impl.mtlx @@ -4697,8 +4705,8 @@ ### Implementation Comparison -First library implementation count: 2190 -Second library implementation count: 2182 +First library implementation count: 2193 +Second library implementation count: 2185
                            8 implementations added diff --git a/resources/mtlx_1383_vs_1384.md b/resources/mtlx_1383_vs_1384.md index b6a96e6f..54475e02 100644 --- a/resources/mtlx_1383_vs_1384.md +++ b/resources/mtlx_1383_vs_1384.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 679 first library definitions from 38 files. Version 1.39.0 +- Loaded 680 first library definitions from 38 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.4']. Search path: "" -- Loaded 677 second library definitions from 38 files. Version 1.39 +- Loaded 678 second library definitions from 38 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.3']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 679 nodedefs. -* Second library has 677 nodedefs +* First library has 680 nodedefs. +* Second library has 678 nodedefs
                            2 node definitions added. (Sorted by category) @@ -59,7 +59,7 @@ * Second library shader targets: *['essl', 'genglsl', 'genmdl', 'genosl']* ##### First Library Definitions / Implementations -
                            550 shaders: essl +
                            551 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -72,6 +72,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -616,7 +617,7 @@ -
                            550 shaders: genglsl +
                            551 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -629,6 +630,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -1173,7 +1175,7 @@ -
                            557 shaders: genmdl +
                            558 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1183,6 +1185,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1737,7 +1740,7 @@ -
                            549 shaders: genosl +
                            550 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1747,6 +1750,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -2387,7 +2391,7 @@ ##### Second Library Definitions / Implementations -
                            543 shaders: essl +
                            544 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2400,6 +2404,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -2937,7 +2942,7 @@ -
                            543 shaders: genglsl +
                            544 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2950,6 +2955,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3487,7 +3493,7 @@ -
                            550 shaders: genmdl +
                            551 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3497,6 +3503,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4044,7 +4051,7 @@ -
                            542 shaders: genosl +
                            543 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4054,6 +4061,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -4714,8 +4722,8 @@ ### Implementation Comparison -First library implementation count: 2211 -Second library implementation count: 2189 +First library implementation count: 2214 +Second library implementation count: 2192
                            22 implementations added diff --git a/resources/mtlx_1384_vs_1385.md b/resources/mtlx_1384_vs_1385.md index c210f2ff..0d44af49 100644 --- a/resources/mtlx_1384_vs_1385.md +++ b/resources/mtlx_1384_vs_1385.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 680 first library definitions from 38 files. Version 1.39.0 +- Loaded 681 first library definitions from 38 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.5']. Search path: "" -- Loaded 679 second library definitions from 38 files. Version 1.39 +- Loaded 680 second library definitions from 38 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.4']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 680 nodedefs. -* Second library has 679 nodedefs +* First library has 681 nodedefs. +* Second library has 680 nodedefs
                            1 node definitions added. (Sorted by category) @@ -108,7 +108,7 @@ * Second library shader targets: *['essl', 'genglsl', 'genmdl', 'genosl']* ##### First Library Definitions / Implementations -
                            553 shaders: essl +
                            554 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -121,6 +121,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -668,7 +669,7 @@ -
                            553 shaders: genglsl +
                            554 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -681,6 +682,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -1228,7 +1230,7 @@ -
                            558 shaders: genmdl +
                            559 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1238,6 +1240,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1793,7 +1796,7 @@ -
                            550 shaders: genosl +
                            551 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1803,6 +1806,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -2445,7 +2449,7 @@ ##### Second Library Definitions / Implementations -
                            550 shaders: essl +
                            551 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2458,6 +2462,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3002,7 +3007,7 @@ -
                            550 shaders: genglsl +
                            551 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3015,6 +3020,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3559,7 +3565,7 @@ -
                            557 shaders: genmdl +
                            558 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3569,6 +3575,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4123,7 +4130,7 @@ -
                            549 shaders: genosl +
                            550 shaders: genosl - +
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4133,6 +4140,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -4775,8 +4783,8 @@ ### Implementation Comparison -First library implementation count: 1748 -Second library implementation count: 1741 +First library implementation count: 1751 +Second library implementation count: 1744
                            7 implementations added @@ -5617,7 +5625,7 @@ Second library implementation count: 1741
                            IM_worleynoise3d_vector2_genosl - attribute: file changed on IM_worleynoise3d_vector2_genosl from ( libraries/stdlib/genosl/mx_worleynoise3d_vector2.osl ) to ( mx_worleynoise3d_vector2.osl )
                            IM_worleynoise3d_vector3_genglsl - attribute: file changed on IM_worleynoise3d_vector3_genglsl from ( libraries/stdlib/genglsl/mx_worleynoise3d_vector3.glsl ) to ( mx_worleynoise3d_vector3.glsl )
                            IM_worleynoise3d_vector3_genosl - attribute: file changed on IM_worleynoise3d_vector3_genosl from ( libraries/stdlib/genosl/mx_worleynoise3d_vector3.osl ) to ( mx_worleynoise3d_vector3.osl )
                            NG_standard_surface_surfaceshader_100 - layer /specular_layer_with_thin_film removed from NG_standard_surface_surfaceshader_100
                            - multiply /metalness_mix_attenuated removed from NG_standard_surface_surfaceshader_100
                            - layer /thin_film_layer add to NG_standard_surface_surfaceshader_100
                            - multiply /thin_film_layer_attenuated add to NG_standard_surface_surfaceshader_100
                            - Number of children on: metal_bsdf changed from ( 7 ) to ( 9 )
                            - input /thinfilm_thickness added to NG_standard_surface_surfaceshader_100/metal_bsdf. Value=( )
                            - input /thinfilm_ior added to NG_standard_surface_surfaceshader_100/metal_bsdf. Value=( )
                            - attribute: nodename changed on base from ( metalness_mix_attenuated ) to ( thin_film_layer_attenuated )
                            NG_standard_surface_surfaceshader_100 - multiply /metalness_mix_attenuated removed from NG_standard_surface_surfaceshader_100
                            - multiply /thin_film_layer_attenuated add to NG_standard_surface_surfaceshader_100
                            - Number of children on: metal_bsdf changed from ( 7 ) to ( 9 )
                            - input /thinfilm_thickness added to NG_standard_surface_surfaceshader_100/metal_bsdf. Value=( )
                            - input /thinfilm_ior added to NG_standard_surface_surfaceshader_100/metal_bsdf. Value=( )
                            - attribute: nodename changed on base from ( metalness_mix_attenuated ) to ( thin_film_layer_attenuated )
                            diff --git a/resources/mtlx_1385_vs_1386.md b/resources/mtlx_1385_vs_1386.md index 752a6e3c..2161235a 100644 --- a/resources/mtlx_1385_vs_1386.md +++ b/resources/mtlx_1385_vs_1386.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 689 first library definitions from 39 files. Version 1.39.0 +- Loaded 690 first library definitions from 39 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.6']. Search path: "" -- Loaded 680 second library definitions from 38 files. Version 1.39 +- Loaded 681 second library definitions from 38 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.5']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 689 nodedefs. -* Second library has 680 nodedefs +* First library has 690 nodedefs. +* Second library has 681 nodedefs
                            9 node definitions removed @@ -102,7 +102,7 @@ * Second library shader targets: *['essl', 'genglsl', 'genmdl', 'genosl']* ##### First Library Definitions / Implementations -
                            555 shaders: essl +
                            556 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -115,6 +115,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -664,7 +665,7 @@ -
                            555 shaders: genglsl +
                            556 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -677,6 +678,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -1226,7 +1228,7 @@ -
                            560 shaders: genmdl +
                            561 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1236,6 +1238,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1793,7 +1796,7 @@ -
                            552 shaders: genosl +
                            553 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1803,6 +1806,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -2460,7 +2464,7 @@ ##### Second Library Definitions / Implementations -
                            553 shaders: essl +
                            554 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2473,6 +2477,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3020,7 +3025,7 @@ -
                            553 shaders: genglsl +
                            554 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3033,6 +3038,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3580,7 +3586,7 @@ -
                            558 shaders: genmdl +
                            559 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3590,6 +3596,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4145,7 +4152,7 @@ -
                            550 shaders: genosl +
                            551 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4155,6 +4162,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -4799,8 +4807,8 @@ ### Implementation Comparison -First library implementation count: 1775 -Second library implementation count: 1747 +First library implementation count: 1778 +Second library implementation count: 1750
                            28 implementations added @@ -4842,8 +4850,8 @@ Second library implementation count: 1747 - - + + @@ -4863,7 +4871,7 @@ Second library implementation count: 1747 - +
                            Name Change
                            IMPL_gltf_pbr_surfaceshader - Number of children on: IMPL_gltf_pbr_surfaceshader changed from ( 40 ) to ( 52 )
                            - oren_nayar_diffuse_bsdf /tf_diffuse_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - dielectric_bsdf /tf_transmission_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - generalized_schlick_bsdf /tf_reflection_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - mix /tf_transmission_mix add to IMPL_gltf_pbr_surfaceshader
                            - layer /tf_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - thin_film_bsdf /dielectric_thinfilm_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - layer /iridescent_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - mix /mix_iridescent_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - generalized_schlick_bsdf /tf_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - thin_film_bsdf /metal_thinfilm_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - layer /iridescent_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - mix /mix_iridescent_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - attribute: nodename changed on bg from ( dielectric_bsdf ) to ( mix_iridescent_dielectric_bsdf )
                            - attribute: nodename changed on fg from ( metal_bsdf ) to ( mix_iridescent_metal_bsdf )
                            IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 28 ) to ( 34 )
                            - divide /div_ior removed from IMP_UsdPreviewSurface_surfaceshader
                            - subtract /inverse_metalness add to IMP_UsdPreviewSurface_surfaceshader
                            - mix /diffuse_bsdf_weight add to IMP_UsdPreviewSurface_surfaceshader
                            - divide /R add to IMP_UsdPreviewSurface_surfaceshader
                            - multiply /R_sq add to IMP_UsdPreviewSurface_surfaceshader
                            - mix /specular_color_metallic add to IMP_UsdPreviewSurface_surfaceshader
                            - multiply /specular_color_metallic_R_sq add to IMP_UsdPreviewSurface_surfaceshader
                            - convert /coat_F0 add to IMP_UsdPreviewSurface_surfaceshader
                            - attribute: value=( 1 ) removed from: weight
                            - attribute: nodename=( diffuse_bsdf_weight ) added to: weight
                            - Category changed on: F0 from mix to multiply
                            - attribute: type changed on F0 from ( float ) to ( color3 )
                            - Number of children on: F0 changed from ( 2 ) to ( 3 )
                            - input /in1 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /in2 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /fg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /bg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /mix added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - attribute: channels=( rrr ) removed from: color0
                            - attribute: value=( 1, 1, 1 ) removed from: color90
                            - attribute: interfacename=( specularColor ) added to: color90
                            - Category changed on: coat_dielectric_bsdf from generalized_schlick_bsdf to dielectric_bsdf
                            - input /tint removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                            - input /ior removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1.5 )
                            - input /color0 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( )
                            - input /color90 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                            IMPL_gltf_pbr_surfaceshader - Number of children on: IMPL_gltf_pbr_surfaceshader changed from ( 40 ) to ( 48 )
                            - oren_nayar_diffuse_bsdf /tf_diffuse_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - dielectric_bsdf /tf_transmission_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - generalized_schlick_bsdf /tf_reflection_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - mix /tf_transmission_mix add to IMPL_gltf_pbr_surfaceshader
                            - layer /tf_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - mix /mix_iridescent_dielectric_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - generalized_schlick_bsdf /tf_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - mix /mix_iridescent_metal_bsdf add to IMPL_gltf_pbr_surfaceshader
                            - attribute: nodename changed on bg from ( dielectric_bsdf ) to ( mix_iridescent_dielectric_bsdf )
                            - attribute: nodename changed on fg from ( metal_bsdf ) to ( mix_iridescent_metal_bsdf )
                            IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 29 ) to ( 34 )
                            - divide /div_ior removed from IMP_UsdPreviewSurface_surfaceshader
                            - convert /swizzle removed from IMP_UsdPreviewSurface_surfaceshader
                            - subtract /inverse_metalness add to IMP_UsdPreviewSurface_surfaceshader
                            - mix /diffuse_bsdf_weight add to IMP_UsdPreviewSurface_surfaceshader
                            - divide /R add to IMP_UsdPreviewSurface_surfaceshader
                            - multiply /R_sq add to IMP_UsdPreviewSurface_surfaceshader
                            - mix /specular_color_metallic add to IMP_UsdPreviewSurface_surfaceshader
                            - multiply /specular_color_metallic_R_sq add to IMP_UsdPreviewSurface_surfaceshader
                            - convert /coat_F0 add to IMP_UsdPreviewSurface_surfaceshader
                            - attribute: value=( 1 ) removed from: weight
                            - attribute: nodename=( diffuse_bsdf_weight ) added to: weight
                            - Category changed on: F0 from mix to multiply
                            - attribute: type changed on F0 from ( float ) to ( color3 )
                            - Number of children on: F0 changed from ( 2 ) to ( 3 )
                            - input /in1 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /in2 removed from IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /fg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /bg added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - input /mix added to IMP_UsdPreviewSurface_surfaceshader/F0. Value=( )
                            - attribute: nodename changed on color0 from ( swizzle ) to ( F0 )
                            - attribute: value=( 1, 1, 1 ) removed from: color90
                            - attribute: interfacename=( specularColor ) added to: color90
                            - Category changed on: coat_dielectric_bsdf from generalized_schlick_bsdf to dielectric_bsdf
                            - input /tint removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                            - input /ior removed from IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1.5 )
                            - input /color0 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( )
                            - input /color90 added to IMP_UsdPreviewSurface_surfaceshader/coat_dielectric_bsdf. Value=( 1, 1, 1 )
                            IM_add_bsdf_genosl - attribute: sourcecode=( ({{in1}} + {{in2}}) ) added to: IM_add_bsdf_genosl
                            IM_add_edf_genosl - attribute: sourcecode=( ({{in1}} + {{in2}}) ) added to: IM_add_edf_genosl
                            IM_burley_diffuse_bsdf_genosl - attribute: file=( mx_burley_diffuse_bsdf.osl ) removed from: IM_burley_diffuse_bsdf_genosl
                            - attribute: function=( mx_burley_diffuse_bsdf ) removed from: IM_burley_diffuse_bsdf_genosl
                            - attribute: sourcecode=( {{weight}} * burley_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) added to: IM_burley_diffuse_bsdf_genosl
                            IM_uniform_edf_genosl - attribute: file=( mx_uniform_edf.inline ) removed from: IM_uniform_edf_genosl
                            - attribute: sourcecode=( uniform_edf({{color}}) ) added to: IM_uniform_edf_genosl
                            NG_place2d_vector2 - Number of children on: NG_place2d_vector2 changed from ( 6 ) to ( 11 )
                            - subtract /N_applyoffset2 add to NG_place2d_vector2
                            - rotate2d /N_applyrot2 add to NG_place2d_vector2
                            - divide /N_applyscale2 add to NG_place2d_vector2
                            - add /N_addpivot2 add to NG_place2d_vector2
                            - switch /N_switch_operationorder add to NG_place2d_vector2
                            - attribute: nodename changed on out from ( N_addpivot ) to ( N_switch_operationorder )
                            NG_range_color4 - Number of children on: NG_range_color4 changed from ( 11 ) to ( 10 )
                            - input /value1 removed from NG_range_color4. Value=( )
                            NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 50 ) to ( 56 )
                            - add /transmission_roughness_add add to NG_standard_surface_surfaceshader_100
                            - clamp /transmission_roughness_clamped add to NG_standard_surface_surfaceshader_100
                            - mix /coat_affected_transmission_roughness add to NG_standard_surface_surfaceshader_100
                            - roughness_anisotropy /transmission_roughness add to NG_standard_surface_surfaceshader_100
                            - max /base_color_nonnegative add to NG_standard_surface_surfaceshader_100
                            - max /subsurface_color_nonnegative add to NG_standard_surface_surfaceshader_100
                            - attribute: interfacename=( base_color ) removed from: in1
                            - attribute: nodename=( base_color_nonnegative ) added to: in1
                            - attribute: interfacename=( subsurface_color ) removed from: in1
                            - attribute: nodename=( subsurface_color_nonnegative ) added to: in1
                            - attribute: nodename changed on roughness from ( main_roughness ) to ( transmission_roughness )
                            NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 49 ) to ( 55 )
                            - add /transmission_roughness_add add to NG_standard_surface_surfaceshader_100
                            - clamp /transmission_roughness_clamped add to NG_standard_surface_surfaceshader_100
                            - mix /coat_affected_transmission_roughness add to NG_standard_surface_surfaceshader_100
                            - roughness_anisotropy /transmission_roughness add to NG_standard_surface_surfaceshader_100
                            - max /base_color_nonnegative add to NG_standard_surface_surfaceshader_100
                            - max /subsurface_color_nonnegative add to NG_standard_surface_surfaceshader_100
                            - attribute: interfacename=( base_color ) removed from: in1
                            - attribute: nodename=( base_color_nonnegative ) added to: in1
                            - attribute: interfacename=( subsurface_color ) removed from: in1
                            - attribute: nodename=( subsurface_color_nonnegative ) added to: in1
                            - attribute: nodename changed on roughness from ( main_roughness ) to ( transmission_roughness )
                            diff --git a/resources/mtlx_1386_vs_1387.md b/resources/mtlx_1386_vs_1387.md index 0e335aa6..043bb75a 100644 --- a/resources/mtlx_1386_vs_1387.md +++ b/resources/mtlx_1386_vs_1387.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 698 first library definitions from 45 files. Version 1.39.0 +- Loaded 699 first library definitions from 45 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.7']. Search path: "" -- Loaded 689 second library definitions from 39 files. Version 1.39 +- Loaded 690 second library definitions from 39 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.6']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 698 nodedefs. -* Second library has 689 nodedefs +* First library has 699 nodedefs. +* Second library has 690 nodedefs
                            9 node definitions added. (Sorted by category) @@ -171,7 +171,7 @@ * Shader targets added: ['genmsl'] ##### First Library Definitions / Implementations -
                            556 shaders: essl +
                            557 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -184,6 +184,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -734,7 +735,7 @@ -
                            556 shaders: genglsl +
                            557 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -747,6 +748,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -1297,7 +1299,7 @@ -
                            564 shaders: genmdl +
                            565 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1307,6 +1309,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1868,7 +1871,7 @@ -
                            553 shaders: genosl +
                            554 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -1878,6 +1881,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -2544,7 +2548,7 @@ ##### Second Library Definitions / Implementations -
                            555 shaders: essl +
                            556 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -2557,6 +2561,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3106,7 +3111,7 @@ -
                            555 shaders: genglsl +
                            556 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3119,6 +3124,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_surfaceIM_surface_genglslpbrlib_genglsl_impl.mtlx @@ -3668,7 +3674,7 @@ -
                            560 shaders: genmdl +
                            561 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -3678,6 +3684,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4242,7 +4249,7 @@ -
                            552 shaders: genosl +
                            553 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -4252,6 +4259,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx
                            ND_surfaceIM_surface_genoslpbrlib_genosl_impl.mtlx @@ -4911,10 +4919,10 @@ ### Implementation Comparison -First library implementation count: 2335 -Second library implementation count: 1766 +First library implementation count: 2339 +Second library implementation count: 1769 -
                            569 implementations added +
                            570 implementations added @@ -5460,6 +5468,7 @@ Second library implementation count: 1766 + @@ -6184,8 +6193,8 @@ Second library implementation count: 1766 - - + +
                            Name Node Category Node Type
                            IM_tangent_vector3_genmsl tangent vector3
                            IM_texcoord_vector2_genmsl texcoord vector2
                            IM_texcoord_vector3_genmsl texcoord vector3
                            IM_thin_film_bsdf_genmsl thin_film_bsdf BSDF
                            IM_time_float_genmsl time float
                            IM_transformmatrix_vector2M3_genmsl transformmatrix vector2
                            IM_transformmatrix_vector3M4_genmsl transformmatrix vector3
                            IM_transpose_matrix44_genosl - attribute: file=( mx_transpose.inline ) removed from: IM_transpose_matrix44_genosl
                            - attribute: sourcecode=( transpose({{in}}) ) added to: IM_transpose_matrix44_genosl
                            NG_gltf_colorimage - attribute: uniform=( true ) added to: uvindex
                            NG_gltf_iridescence_thickness_float_1_0 - attribute: uniform=( true ) added to: uvindex
                            NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 56 ) to ( 61 )
                            - mix /coat_emission_attenuation removed from NG_standard_surface_surfaceshader_100
                            - multiply /emission_weight_attenuated removed from NG_standard_surface_surfaceshader_100
                            - subtract /one_minus_coat_ior add to NG_standard_surface_surfaceshader_100
                            - add /one_plus_coat_ior add to NG_standard_surface_surfaceshader_100
                            - divide /coat_ior_to_F0_sqrt add to NG_standard_surface_surfaceshader_100
                            - multiply /coat_ior_to_F0 add to NG_standard_surface_surfaceshader_100
                            - multiply /coat_tinted_emission_edf add to NG_standard_surface_surfaceshader_100
                            - generalized_schlick_edf /coat_emission_edf add to NG_standard_surface_surfaceshader_100
                            - mix /blended_coat_emission_edf add to NG_standard_surface_surfaceshader_100
                            - attribute: nodename changed on color from ( emission_weight_attenuated ) to ( emission_weight )
                            - attribute: nodename changed on edf from ( emission_edf ) to ( blended_coat_emission_edf )
                            NG_standard_surface_to_gltf_pbr - Number of children on: NG_standard_surface_to_gltf_pbr changed from ( 31 ) to ( 29 )
                            - dot /emissive_strength removed from NG_standard_surface_to_gltf_pbr
                            - output /emissive_strength_out removed from NG_standard_surface_to_gltf_pbr. Value=( )
                            - Category changed on: sheen_roughness from ifgreater to dot
                            - Number of children on: sheen_roughness changed from ( 1 ) to ( 4 )
                            - input /in removed from NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                            - input /value1 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                            - input /value2 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( 0 )
                            - input /in1 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                            - input /in2 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( 0 )
                            - Category changed on: emissive from multiply to dot
                            - Number of children on: emissive changed from ( 1 ) to ( 2 )
                            - input /in removed from NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                            - input /in1 added to NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                            - input /in2 added to NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                            NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 55 ) to ( 61 )
                            - mix /coat_emission_attenuation removed from NG_standard_surface_surfaceshader_100
                            - multiply /emission_weight_attenuated removed from NG_standard_surface_surfaceshader_100
                            - subtract /one_minus_coat_ior add to NG_standard_surface_surfaceshader_100
                            - add /one_plus_coat_ior add to NG_standard_surface_surfaceshader_100
                            - divide /coat_ior_to_F0_sqrt add to NG_standard_surface_surfaceshader_100
                            - multiply /coat_ior_to_F0 add to NG_standard_surface_surfaceshader_100
                            - multiply /coat_tinted_emission_edf add to NG_standard_surface_surfaceshader_100
                            - generalized_schlick_edf /coat_emission_edf add to NG_standard_surface_surfaceshader_100
                            - mix /blended_coat_emission_edf add to NG_standard_surface_surfaceshader_100
                            - extract /swizzle2 add to NG_standard_surface_surfaceshader_100
                            - attribute: nodename changed on color from ( emission_weight_attenuated ) to ( emission_weight )
                            - Category changed on: swizzle from convert to extract
                            - attribute: type changed on swizzle from ( float ) to ( color3 )
                            - Number of children on: swizzle changed from ( 2 ) to ( 1 )
                            - input /index removed from NG_standard_surface_surfaceshader_100/swizzle. Value=( 0 )
                            - attribute: type changed on in from ( color3 ) to ( float )
                            - attribute: nodename changed on in from ( opacity_luminance ) to ( coat_ior_to_F0 )
                            - attribute: nodename changed on edf from ( emission_edf ) to ( blended_coat_emission_edf )
                            - attribute: nodename changed on opacity from ( swizzle ) to ( swizzle2 )
                            NG_standard_surface_to_gltf_pbr - Number of children on: NG_standard_surface_to_gltf_pbr changed from ( 34 ) to ( 32 )
                            - dot /emissive_strength removed from NG_standard_surface_to_gltf_pbr
                            - output /emissive_strength_out removed from NG_standard_surface_to_gltf_pbr. Value=( )
                            - Category changed on: sheen_roughness from ifgreater to dot
                            - Number of children on: sheen_roughness changed from ( 1 ) to ( 4 )
                            - input /in removed from NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                            - input /value1 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                            - input /value2 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( 0 )
                            - input /in1 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( )
                            - input /in2 added to NG_standard_surface_to_gltf_pbr/sheen_roughness. Value=( 0 )
                            - Category changed on: emissive from multiply to dot
                            - Number of children on: emissive changed from ( 1 ) to ( 2 )
                            - input /in removed from NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                            - input /in1 added to NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                            - input /in2 added to NG_standard_surface_to_gltf_pbr/emissive. Value=( )
                            diff --git a/resources/mtlx_1387_vs_1388.md b/resources/mtlx_1387_vs_1388.md index 80a23d00..0ecef253 100644 --- a/resources/mtlx_1387_vs_1388.md +++ b/resources/mtlx_1387_vs_1388.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 738 first library definitions from 39 files. Version 1.39.0 +- Loaded 739 first library definitions from 39 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.8']. Search path: "" -- Loaded 698 second library definitions from 45 files. Version 1.39 +- Loaded 699 second library definitions from 45 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.7']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 738 nodedefs. -* Second library has 698 nodedefs +* First library has 739 nodedefs. +* Second library has 699 nodedefs
                            40 node definitions added. (Sorted by category) @@ -161,7 +161,7 @@ * Second library shader targets: *['essl', 'genglsl', 'genmdl', 'genmsl', 'genosl']* ##### First Library Definitions / Implementations -
                            559 shaders: essl +
                            560 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -174,6 +174,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -727,7 +728,7 @@ -
                            559 shaders: genglsl +
                            560 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -740,6 +741,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -1293,7 +1295,7 @@ -
                            568 shaders: genmdl +
                            569 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1303,6 +1305,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1868,7 +1871,7 @@ -
                            558 shaders: genmsl +
                            559 shaders: genmsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -1881,6 +1884,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -2433,7 +2437,7 @@ -
                            556 shaders: genosl +
                            557 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2443,6 +2447,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -3150,7 +3155,7 @@ ##### Second Library Definitions / Implementations -
                            556 shaders: essl +
                            557 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3163,6 +3168,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -3713,7 +3719,7 @@ -
                            556 shaders: genglsl +
                            557 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3726,6 +3732,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -4276,7 +4283,7 @@ -
                            564 shaders: genmdl +
                            565 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -4286,6 +4293,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4847,7 +4855,7 @@ -
                            555 shaders: genmsl +
                            556 shaders: genmsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -4860,6 +4868,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -5409,7 +5418,7 @@ -
                            553 shaders: genosl +
                            554 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -5419,6 +5428,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -6087,8 +6097,8 @@ ### Implementation Comparison -First library implementation count: 2386 -Second library implementation count: 2335 +First library implementation count: 2390 +Second library implementation count: 2339
                            51 implementations added @@ -6153,7 +6163,7 @@ Second library implementation count: 2335 - + diff --git a/resources/mtlx_1388_vs_1389.md b/resources/mtlx_1388_vs_1389.md index 109c4cc9..901eb040 100644 --- a/resources/mtlx_1388_vs_1389.md +++ b/resources/mtlx_1388_vs_1389.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 765 first library definitions from 45 files. Version 1.39.0 +- Loaded 766 first library definitions from 45 files. Version 1.39.0 - First library location: ['../../resources/libraries_1.38.9']. Search path: "" -- Loaded 738 second library definitions from 39 files. Version 1.39 +- Loaded 739 second library definitions from 39 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.8']. Search path: "" @@ -14,8 +14,8 @@ ### Node Definition Comparison -* First library has 765 nodedefs. -* Second library has 738 nodedefs +* First library has 766 nodedefs. +* Second library has 739 nodedefs
                            27 node definitions added. (Sorted by category)
                            Name Change
                            IMPL_gltf_pbr_surfaceshader - Number of children on: IMPL_gltf_pbr_surfaceshader changed from ( 52 ) to ( 51 )
                            - oren_nayar_diffuse_bsdf /tf_diffuse_bsdf removed from IMPL_gltf_pbr_surfaceshader
                            - attribute: nodename changed on bg from ( tf_diffuse_bsdf ) to ( diffuse_bsdf )
                            IMPL_gltf_pbr_surfaceshader - Number of children on: IMPL_gltf_pbr_surfaceshader changed from ( 48 ) to ( 47 )
                            - oren_nayar_diffuse_bsdf /tf_diffuse_bsdf removed from IMPL_gltf_pbr_surfaceshader
                            - attribute: nodename changed on bg from ( tf_diffuse_bsdf ) to ( diffuse_bsdf )
                            IMP_UsdPreviewSurface_surfaceshader - Number of children on: IMP_UsdPreviewSurface_surfaceshader changed from ( 34 ) to ( 33 )
                            - clamp /opacity_clamped removed from IMP_UsdPreviewSurface_surfaceshader
                            - attribute: nodename=( opacity_clamped ) removed from: value1
                            - attribute: interfacename=( opacity ) added to: value1
                            NG_NG_gltf_image_color3_color3_1_0 - Number of children on: NG_NG_gltf_image_color3_color3_1_0 changed from ( 8 ) to ( 7 )
                            - texcoord /texcoord1 removed from NG_NG_gltf_image_color3_color3_1_0
                            - attribute: nodename=( texcoord1 ) removed from: texcoord
                            - attribute: interfacename=( texcoord ) added to: texcoord
                            NG_gltf_colorimage - Number of children on: NG_gltf_colorimage changed from ( 9 ) to ( 8 )
                            - texcoord /texcoord1 removed from NG_gltf_colorimage
                            - input /uvindex removed from NG_gltf_colorimage/image. Value=( )
                            - input /texcoord added to NG_gltf_colorimage/image. Value=( )
                            @@ -90,7 +90,7 @@ * Second library shader targets: *['essl', 'genglsl', 'genmdl', 'genmsl', 'genosl']* ##### First Library Definitions / Implementations -
                            540 shaders: essl +
                            541 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -104,6 +104,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -637,7 +638,7 @@ -
                            540 shaders: genglsl +
                            541 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -651,6 +652,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -1184,7 +1186,7 @@ -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genmdlnprlib_genmdl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1195,6 +1197,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -1740,7 +1743,7 @@ -
                            539 shaders: genmsl +
                            540 shaders: genmsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -1754,6 +1757,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -2286,7 +2290,7 @@ -
                            537 shaders: genosl +
                            538 shaders: genosl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genoslnprlib_genosl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2297,6 +2301,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -3030,7 +3035,7 @@ ##### Second Library Definitions / Implementations -
                            559 shaders: essl +
                            560 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3043,6 +3048,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -3596,7 +3602,7 @@ -
                            559 shaders: genglsl +
                            560 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3609,6 +3615,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -4162,7 +4169,7 @@ -
                            568 shaders: genmdl +
                            569 shaders: genmdl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -4172,6 +4179,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4737,7 +4745,7 @@ -
                            558 shaders: genmsl +
                            559 shaders: genmsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -4750,6 +4758,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -5302,7 +5311,7 @@ -
                            556 shaders: genosl +
                            557 shaders: genosl
                            DefinitionImplementationFile
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_burley_diffuse_bsdfIM_burley_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -5312,6 +5321,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -6021,8 +6031,8 @@ ### Implementation Comparison -First library implementation count: 2484 -Second library implementation count: 2386 +First library implementation count: 2488 +Second library implementation count: 2390
                            98 implementations added @@ -6130,7 +6140,7 @@ Second library implementation count: 2386
                            -
                            246 implementations modified +
                            247 implementations modified @@ -6360,6 +6370,7 @@ Second library implementation count: 2386 + @@ -6379,7 +6390,7 @@ Second library implementation count: 2386 - +
                            Name Change
                            IM_tangent_vector3_genmdl - attribute: sourcecode changed on IM_tangent_vector3_genmdl from ( mx::stdlib::mx_tangent_vector3(mxp_space:{{space}}, mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_tangent_vector3(mxp_space:{{space}}, mxp_index:{{index}}) )
                            IM_texcoord_vector2_genmdl - attribute: sourcecode changed on IM_texcoord_vector2_genmdl from ( mx::stdlib::mx_texcoord_vector2(mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_texcoord_vector2(mxp_index:{{index}}) )
                            IM_texcoord_vector3_genmdl - attribute: sourcecode changed on IM_texcoord_vector3_genmdl from ( mx::stdlib::mx_texcoord_vector3(mxp_index:{{index}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_texcoord_vector3(mxp_index:{{index}}) )
                            IM_thin_film_bsdf_genmdl - attribute: sourcecode changed on IM_thin_film_bsdf_genmdl from ( mx::pbrlib::mx_thin_film_bsdf(mxp_thickness:{{thickness}}, mxp_ior:{{ior}}, mxp_base:{{base}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_thin_film_bsdf(mxp_thickness:{{thickness}}, mxp_ior:{{ior}}, mxp_base:{{base}}) )
                            IM_thin_surface_genmdl - attribute: sourcecode changed on IM_thin_surface_genmdl from ( mx::pbrlib::mx_thin_surface(mxp_front_bsdf:{{front_bsdf}}, mxp_front_edf:{{front_edf}}, mxp_back_bsdf:{{back_bsdf}}, mxp_back_edf:{{back_edf}}, mxp_opacity:{{opacity}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_thin_surface(mxp_front_bsdf:{{front_bsdf}}, mxp_front_edf:{{front_edf}}, mxp_back_bsdf:{{back_bsdf}}, mxp_back_edf:{{back_edf}}, mxp_opacity:{{opacity}}) )
                            IM_time_float_genmdl - attribute: sourcecode changed on IM_time_float_genmdl from ( mx::stdlib::mx_time_float() ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_time_float() )
                            IM_transformmatrix_vector2M3_genmdl - attribute: sourcecode changed on IM_transformmatrix_vector2M3_genmdl from ( mx::stdlib::mx_transformmatrix_vector2M3({{in}}, {{mat}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_transformmatrix_vector2M3({{in}}, {{mat}}) )
                            IM_worleynoise3d_float_genmdl - attribute: sourcecode changed on IM_worleynoise3d_float_genmdl from ( mx::stdlib::mx_worleynoise3d_float(mxp_position:{{position}}, mxp_jitter:{{jitter}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_worleynoise3d_float(mxp_position:{{position}}, mxp_jitter:{{jitter}}) )
                            IM_worleynoise3d_vector2_genmdl - attribute: sourcecode changed on IM_worleynoise3d_vector2_genmdl from ( mx::stdlib::mx_worleynoise3d_float2(mxp_position:{{position}}, mxp_jitter:{{jitter}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_worleynoise3d_float2(mxp_position:{{position}}, mxp_jitter:{{jitter}}) )
                            IM_worleynoise3d_vector3_genmdl - attribute: sourcecode changed on IM_worleynoise3d_vector3_genmdl from ( mx::stdlib::mx_worleynoise3d_float3(mxp_position:{{position}}, mxp_jitter:{{jitter}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_worleynoise3d_float3(mxp_position:{{position}}, mxp_jitter:{{jitter}}) )
                            NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 61 ) to ( 62 )
                            - subtract /one_minus_coat_ior_to_F0 add to NG_standard_surface_surfaceshader_100
                            - attribute: value=( 1.0, 1.0, 1.0 ) removed from: color0
                            - attribute: nodename=( one_minus_coat_ior_to_F0 ) added to: color0
                            - attribute: channels=( rrr ) added to: color0
                            - attribute: nodename=( coat_ior_to_F0 ) removed from: color90
                            - attribute: channels=( rrr ) removed from: color90
                            - attribute: value=( 0.0, 0.0, 0.0 ) added to: color90
                            NG_standard_surface_surfaceshader_100 - Number of children on: NG_standard_surface_surfaceshader_100 changed from ( 61 ) to ( 62 )
                            - subtract /one_minus_coat_ior_to_F0 add to NG_standard_surface_surfaceshader_100
                            - attribute: nodename changed on in from ( coat_ior_to_F0 ) to ( one_minus_coat_ior_to_F0 )
                            - attribute: value=( 1.0, 1.0, 1.0 ) removed from: color0
                            - attribute: nodename=( swizzle ) added to: color0
                            - attribute: nodename=( swizzle ) removed from: color90
                            - attribute: value=( 0.0, 0.0, 0.0 ) added to: color90
                            diff --git a/resources/mtlx_1389_vs_1390.md b/resources/mtlx_1389_vs_1390.md index acc23cb9..168e99e6 100644 --- a/resources/mtlx_1389_vs_1390.md +++ b/resources/mtlx_1389_vs_1390.md @@ -4,9 +4,9 @@ ## MaterialX Library Comparison ### Libraries Loaded -- Loaded 766 first library definitions from 46 files. Version 1.39.0 +- Loaded 742 first library definitions from 46 files. Version 1.39.0 - First library location: ['../../pymaterialx/python/MaterialX/libraries']. Search path: "" -- Loaded 765 second library definitions from 45 files. Version 1.39 +- Loaded 766 second library definitions from 45 files. Version 1.39 - Second library location: ['../../resources/libraries_1.38.9']. Search path: "" @@ -14,13 +14,102 @@ ### Node Definition Comparison -* First library has 766 nodedefs. -* Second library has 765 nodedefs -
                            1 node definitions added. (Sorted by category) +* First library has 742 nodedefs. +* Second library has 766 nodedefs +
                            53 node definitions removed + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            Name Category
                            ND_arrayappend_color3_color3array arrayappend
                            ND_arrayappend_color3array_color3array arrayappend
                            ND_arrayappend_color4_color4array arrayappend
                            ND_arrayappend_color4array_color4array arrayappend
                            ND_arrayappend_float_floatarray arrayappend
                            ND_arrayappend_floatarray_floatarray arrayappend
                            ND_arrayappend_integer_integerarray arrayappend
                            ND_arrayappend_integerarray_integerarray arrayappend
                            ND_arrayappend_string_stringarray arrayappend
                            ND_arrayappend_stringarray_stringarray arrayappend
                            ND_arrayappend_vector2_vector2array arrayappend
                            ND_arrayappend_vector2array_vector2array arrayappend
                            ND_arrayappend_vector3_vector3array arrayappend
                            ND_arrayappend_vector3array_vector3array arrayappend
                            ND_arrayappend_vector4_vector4array arrayappend
                            ND_arrayappend_vector4array_vector4array arrayappend
                            ND_normalmap normalmap
                            ND_swizzle_color3_color3 swizzle
                            ND_swizzle_color3_color4 swizzle
                            ND_swizzle_color3_float swizzle
                            ND_swizzle_color3_vector2 swizzle
                            ND_swizzle_color3_vector3 swizzle
                            ND_swizzle_color3_vector4 swizzle
                            ND_swizzle_color4_color3 swizzle
                            ND_swizzle_color4_color4 swizzle
                            ND_swizzle_color4_float swizzle
                            ND_swizzle_color4_vector2 swizzle
                            ND_swizzle_color4_vector3 swizzle
                            ND_swizzle_color4_vector4 swizzle
                            ND_swizzle_float_color3 swizzle
                            ND_swizzle_float_color4 swizzle
                            ND_swizzle_float_vector2 swizzle
                            ND_swizzle_float_vector3 swizzle
                            ND_swizzle_float_vector4 swizzle
                            ND_swizzle_vector2_color3 swizzle
                            ND_swizzle_vector2_color4 swizzle
                            ND_swizzle_vector2_float swizzle
                            ND_swizzle_vector2_vector2 swizzle
                            ND_swizzle_vector2_vector3 swizzle
                            ND_swizzle_vector2_vector4 swizzle
                            ND_swizzle_vector3_color3 swizzle
                            ND_swizzle_vector3_color4 swizzle
                            ND_swizzle_vector3_float swizzle
                            ND_swizzle_vector3_vector2 swizzle
                            ND_swizzle_vector3_vector3 swizzle
                            ND_swizzle_vector3_vector4 swizzle
                            ND_swizzle_vector4_color3 swizzle
                            ND_swizzle_vector4_color4 swizzle
                            ND_swizzle_vector4_float swizzle
                            ND_swizzle_vector4_vector2 swizzle
                            ND_swizzle_vector4_vector3 swizzle
                            ND_swizzle_vector4_vector4 swizzle
                            ND_thin_film_bsdf thin_film_bsdf
                            + +
                            + +
                            29 node definitions added. (Sorted by category) + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            Name Category NodeGroup
                            ND_add_integer add math
                            ND_ifequal_integer ifequal conditional
                            ND_ifequal_matrix33 ifequal conditional
                            ND_ifequal_matrix44 ifequal conditional
                            ND_ifequal_integerI ifequal conditional
                            ND_ifequal_matrix33I ifequal conditional
                            ND_ifequal_matrix44I ifequal conditional
                            ND_ifequal_integerB ifequal conditional
                            ND_ifequal_matrix33B ifequal conditional
                            ND_ifequal_matrix44B ifequal conditional
                            ND_ifgreater_integer ifgreater conditional
                            ND_ifgreater_matrix33 ifgreater conditional
                            ND_ifgreater_matrix44 ifgreater conditional
                            ND_ifgreater_integerI ifgreater conditional
                            ND_ifgreater_matrix33I ifgreater conditional
                            ND_ifgreater_matrix44I ifgreater conditional
                            ND_ifgreatereq_integer ifgreatereq conditional
                            ND_ifgreatereq_matrix33 ifgreatereq conditional
                            ND_ifgreatereq_matrix44 ifgreatereq conditional
                            ND_ifgreatereq_integerI ifgreatereq conditional
                            ND_ifgreatereq_matrix33I ifgreatereq conditional
                            ND_ifgreatereq_matrix44I ifgreatereq conditional
                            ND_normalmap_float normalmap math
                            ND_open_pbr_surface_surfaceshader open_pbr_surface pbr
                            ND_subtract_integer subtract math
                            ND_switch_matrix33 switch conditional
                            ND_switch_matrix44 switch conditional
                            ND_switch_matrix33I switch conditional
                            ND_switch_matrix44I switch conditional
                            @@ -36,13 +125,73 @@ -
                            1 definitions modified +
                            21 definitions modified - + + + + + + + + + - Number of children on: ND_switch_color3 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_color3. Value=( 0.0, 0.0, 0.0 )
                            + + + + + + + + + + + +
                            Name Change
                            ND_standard_surface_to_gltf_pbr +
                            ND_dielectric_bsdf + + - Number of children on: ND_dielectric_bsdf changed from ( 9 ) to ( 11 )
                            - input /thinfilm_thickness added to ND_dielectric_bsdf. Value=( 0 )
                            - input /thinfilm_ior added to ND_dielectric_bsdf. Value=( 1.5 )
                            ND_conductor_bsdf + + - Number of children on: ND_conductor_bsdf changed from ( 8 ) to ( 10 )
                            - input /thinfilm_thickness added to ND_conductor_bsdf. Value=( 0 )
                            - input /thinfilm_ior added to ND_conductor_bsdf. Value=( 1.5 )
                            ND_generalized_schlick_bsdf + + - Number of children on: ND_generalized_schlick_bsdf changed from ( 10 ) to ( 13 )
                            - input /color82 added to ND_generalized_schlick_bsdf. Value=( 1.0, 1.0, 1.0 )
                            - input /thinfilm_thickness added to ND_generalized_schlick_bsdf. Value=( 0 )
                            - input /thinfilm_ior added to ND_generalized_schlick_bsdf. Value=( 1.5 )
                            ND_atan2_float + + - input /in1 removed from ND_atan2_float. Value=( 0.0 )
                            - input /in2 removed from ND_atan2_float. Value=( 1.0 )
                            - input /iny added to ND_atan2_float. Value=( 0.0 )
                            - input /inx added to ND_atan2_float. Value=( 1.0 )
                            ND_atan2_vector2 + + - input /in1 removed from ND_atan2_vector2. Value=( 1.0, 1.0 )
                            - input /in2 removed from ND_atan2_vector2. Value=( 0.0, 0.0 )
                            - input /iny added to ND_atan2_vector2. Value=( 1.0, 1.0 )
                            - input /inx added to ND_atan2_vector2. Value=( 0.0, 0.0 )
                            ND_atan2_vector3 + + - input /in1 removed from ND_atan2_vector3. Value=( 1.0, 1.0, 1.0 )
                            - input /in2 removed from ND_atan2_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /iny added to ND_atan2_vector3. Value=( 1.0, 1.0, 1.0 )
                            - input /inx added to ND_atan2_vector3. Value=( 0.0, 0.0, 0.0 )
                            ND_atan2_vector4 + + - input /in1 removed from ND_atan2_vector4. Value=( 1.0, 1.0, 1.0, 1.0 )
                            - input /in2 removed from ND_atan2_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /iny added to ND_atan2_vector4. Value=( 1.0, 1.0, 1.0, 1.0 )
                            - input /inx added to ND_atan2_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_switch_float + + - Number of children on: ND_switch_float changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_float. Value=( 0.0 )
                            - input /in7 added to ND_switch_float. Value=( 0.0 )
                            - input /in8 added to ND_switch_float. Value=( 0.0 )
                            - input /in9 added to ND_switch_float. Value=( 0.0 )
                            - input /in10 added to ND_switch_float. Value=( 0.0 )
                            ND_switch_color3 - - Number of children on: ND_standard_surface_to_gltf_pbr changed from ( 26 ) to ( 28 )
                            - input /normal added to ND_standard_surface_to_gltf_pbr. Value=( 1, 1, 1 )
                            - output /normal_out added to ND_standard_surface_to_gltf_pbr. Value=( )
                            ND_switch_color4 + + - Number of children on: ND_switch_color4 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_color4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_switch_vector2 + + - Number of children on: ND_switch_vector2 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector2. Value=( 0.0, 0.0 )
                            ND_switch_vector3 + + - Number of children on: ND_switch_vector3 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector3. Value=( 0.0, 0.0, 0.0 )
                            ND_switch_vector4 + + - Number of children on: ND_switch_vector4 changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector4. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_switch_floatI + + - Number of children on: ND_switch_floatI changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_floatI. Value=( 0.0 )
                            - input /in7 added to ND_switch_floatI. Value=( 0.0 )
                            - input /in8 added to ND_switch_floatI. Value=( 0.0 )
                            - input /in9 added to ND_switch_floatI. Value=( 0.0 )
                            - input /in10 added to ND_switch_floatI. Value=( 0.0 )
                            ND_switch_color3I + + - Number of children on: ND_switch_color3I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_color3I. Value=( 0.0, 0.0, 0.0 )
                            ND_switch_color4I + + - Number of children on: ND_switch_color4I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_color4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_switch_vector2I + + - Number of children on: ND_switch_vector2I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector2I. Value=( 0.0, 0.0 )
                            ND_switch_vector3I + + - Number of children on: ND_switch_vector3I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector3I. Value=( 0.0, 0.0, 0.0 )
                            ND_switch_vector4I + + - Number of children on: ND_switch_vector4I changed from ( 7 ) to ( 12 )
                            - input /in6 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in7 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in8 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in9 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            - input /in10 added to ND_switch_vector4I. Value=( 0.0, 0.0, 0.0, 0.0 )
                            ND_creatematrix_vector3_matrix44 + + - attribute: default changed on out from ( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0 ) to ( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 )
                            ND_creatematrix_vector4_matrix44 + + - attribute: default changed on out from ( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0 ) to ( 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 )
                            @@ -57,7 +206,7 @@ * Second library shader targets: *['essl', 'genglsl', 'genmdl', 'genmsl', 'genosl']* ##### First Library Definitions / Implementations -
                            540 shaders: essl +
                            537 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -177,6 +326,7 @@
                            ND_frame_floatIM_frame_float_genglslstdlib_genglsl_impl.mtlx
                            ND_time_floatIM_time_float_genglslstdlib_genglsl_impl.mtlx
                            ND_add_floatIM_add_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_add_integerIM_add_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color3IM_add_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color4IM_add_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genglslstdlib_genglsl_impl.mtlx @@ -192,6 +342,7 @@
                            ND_add_matrix33FAIM_add_matrix33FA_genglslstdlib_genglsl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genglslstdlib_genglsl_impl.mtlx @@ -384,7 +535,7 @@
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genglslstdlib_genglsl_impl.mtlx @@ -460,59 +611,84 @@
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIM_switch_float_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genglslstdlib_genglsl_impl.mtlx @@ -530,41 +706,6 @@
                            ND_convert_color4_color3IM_convert_color4_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genglslstdlib_genglsl_impl.mtlx @@ -576,6 +717,11 @@
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_floatIM_blur_float_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genglslstdlib_genglsl_impl.mtlx @@ -604,7 +750,7 @@ -
                            540 shaders: genglsl +
                            537 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -724,6 +870,7 @@
                            ND_frame_floatIM_frame_float_genglslstdlib_genglsl_impl.mtlx
                            ND_time_floatIM_time_float_genglslstdlib_genglsl_impl.mtlx
                            ND_add_floatIM_add_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_add_integerIM_add_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color3IM_add_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_add_color4IM_add_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genglslstdlib_genglsl_impl.mtlx @@ -739,6 +886,7 @@
                            ND_add_matrix33FAIM_add_matrix33FA_genglslstdlib_genglsl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genglslstdlib_genglsl_impl.mtlx @@ -931,7 +1079,7 @@
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genglslstdlib_genglsl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genglslstdlib_genglsl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genglslstdlib_genglsl_impl.mtlx @@ -1007,59 +1155,84 @@
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genglslstdlib_genglsl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genglslstdlib_genglsl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIM_switch_float_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genglslstdlib_genglsl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genglslstdlib_genglsl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genglslstdlib_genglsl_impl.mtlx @@ -1077,41 +1250,6 @@
                            ND_convert_color4_color3IM_convert_color4_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genglslstdlib_genglsl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genglslstdlib_genglsl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genglslstdlib_genglsl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genglslstdlib_genglsl_impl.mtlx @@ -1123,6 +1261,11 @@
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genglslstdlib_genglsl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genglslstdlib_genglsl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_floatIM_blur_float_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genglslstdlib_genglsl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genglslstdlib_genglsl_impl.mtlx @@ -1151,7 +1294,7 @@ -
                            549 shaders: genmdl +
                            546 shaders: genmdl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genmdlnprlib_genmdl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -1278,6 +1421,7 @@
                            ND_frame_floatIM_frame_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_time_floatIM_time_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_floatIM_add_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_add_integerIM_add_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_color3IM_add_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_color4IM_add_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1293,6 +1437,7 @@
                            ND_add_matrix33FAIM_add_matrix33FA_genmdlstdlib_genmdl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1485,7 +1630,7 @@
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genmdlstdlib_genmdl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genmdlstdlib_genmdl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genmdlstdlib_genmdl_impl.mtlx @@ -1563,59 +1708,84 @@
                            ND_mix_displacementshaderIM_mix_displacementshader_genmdlstdlib_genmdl_impl.mtlx
                            ND_mix_volumeshaderIM_mix_volumeshader_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genmdlstdlib_genmdl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genmdlstdlib_genmdl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_floatIM_switch_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genmdlstdlib_genmdl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genmdlstdlib_genmdl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genmdlstdlib_genmdl_impl.mtlx @@ -1633,41 +1803,6 @@
                            ND_convert_color4_color3IM_convert_color4_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genmdlstdlib_genmdl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genmdlstdlib_genmdl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genmdlstdlib_genmdl_impl.mtlx @@ -1679,6 +1814,11 @@
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genmdlstdlib_genmdl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genmdlstdlib_genmdl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genmdlstdlib_genmdl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_floatIM_blur_float_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genmdlstdlib_genmdl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genmdlstdlib_genmdl_impl.mtlx @@ -1707,7 +1847,7 @@ -
                            539 shaders: genmsl +
                            536 shaders: genmsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -1826,6 +1966,7 @@
                            ND_frame_floatIM_frame_float_genmslstdlib_genmsl_impl.mtlx
                            ND_time_floatIM_time_float_genmslstdlib_genmsl_impl.mtlx
                            ND_add_floatIM_add_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_add_integerIM_add_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_add_color3IM_add_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_add_color4IM_add_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genmslstdlib_genmsl_impl.mtlx @@ -1841,6 +1982,7 @@
                            ND_add_matrix33FAIM_add_matrix33FA_genmslstdlib_genmsl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genmslstdlib_genmsl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genmslstdlib_genmsl_impl.mtlx @@ -2033,7 +2175,7 @@
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genmslstdlib_genmsl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genmslstdlib_genmsl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genmslstdlib_genmsl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genmslstdlib_genmsl_impl.mtlx @@ -2109,59 +2251,84 @@
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genmslstdlib_genmsl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genmslstdlib_genmsl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genmslstdlib_genmsl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_floatIM_switch_float_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genmslstdlib_genmsl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genmslstdlib_genmsl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genmslstdlib_genmsl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genmslstdlib_genmsl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genmslstdlib_genmsl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genmslstdlib_genmsl_impl.mtlx @@ -2179,41 +2346,6 @@
                            ND_convert_color4_color3IM_convert_color4_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genmslstdlib_genmsl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genmslstdlib_genmsl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genmslstdlib_genmsl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genmslstdlib_genmsl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genmslstdlib_genmsl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genmslstdlib_genmsl_impl.mtlx @@ -2225,6 +2357,11 @@
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genmslstdlib_genmsl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genmslstdlib_genmsl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genmslstdlib_genmsl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genmslstdlib_genmsl_impl.mtlx
                            ND_blur_floatIM_blur_float_genmslstdlib_genmsl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genmslstdlib_genmsl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genmslstdlib_genmsl_impl.mtlx @@ -2253,7 +2390,7 @@ -
                            537 shaders: genosl +
                            534 shaders: genosl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genoslnprlib_genosl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -2370,6 +2507,7 @@
                            ND_frame_floatIM_frame_float_genoslstdlib_genosl_impl.mtlx
                            ND_time_floatIM_time_float_genoslstdlib_genosl_impl.mtlx
                            ND_add_floatIM_add_float_genoslstdlib_genosl_impl.mtlx +
                            ND_add_integerIM_add_integer_genoslstdlib_genosl_impl.mtlx
                            ND_add_color3IM_add_color3_genoslstdlib_genosl_impl.mtlx
                            ND_add_color4IM_add_color4_genoslstdlib_genosl_impl.mtlx
                            ND_add_vector2IM_add_vector2_genoslstdlib_genosl_impl.mtlx @@ -2385,6 +2523,7 @@
                            ND_add_matrix33FAIM_add_matrix33FA_genoslstdlib_genosl_impl.mtlx
                            ND_add_matrix44FAIM_add_matrix44FA_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_floatIM_subtract_float_genoslstdlib_genosl_impl.mtlx +
                            ND_subtract_integerIM_subtract_integer_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_color3IM_subtract_color3_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_color4IM_subtract_color4_genoslstdlib_genosl_impl.mtlx
                            ND_subtract_vector2IM_subtract_vector2_genoslstdlib_genosl_impl.mtlx @@ -2577,7 +2716,7 @@
                            ND_transformmatrix_vector3IM_transformmatrix_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_transformmatrix_vector3M4IM_transformmatrix_vector3M4_genoslstdlib_genosl_impl.mtlx
                            ND_transformmatrix_vector4IM_transformmatrix_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_normalmapIM_normalmap_float_genoslstdlib_genosl_impl.mtlx +
                            ND_normalmap_floatIM_normalmap_float_genoslstdlib_genosl_impl.mtlx
                            ND_normalmap_vector2IM_normalmap_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_transpose_matrix33IM_transpose_matrix33_genoslstdlib_genosl_impl.mtlx
                            ND_transpose_matrix44IM_transpose_matrix44_genoslstdlib_genosl_impl.mtlx @@ -2653,59 +2792,84 @@
                            ND_mix_vector4_vector4IM_mix_vector4_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_mix_surfaceshaderIM_mix_surfaceshader_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_floatIM_ifgreater_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_integerIM_ifgreater_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color3IM_ifgreater_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color4IM_ifgreater_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector2IM_ifgreater_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector3IM_ifgreater_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector4IM_ifgreater_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix33IM_ifgreater_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix44IM_ifgreater_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_floatIIM_ifgreater_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_integerIIM_ifgreater_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color3IIM_ifgreater_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_color4IIM_ifgreater_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector2IIM_ifgreater_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector3IIM_ifgreater_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreater_vector4IIM_ifgreater_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix33IIM_ifgreater_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreater_matrix44IIM_ifgreater_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_floatIM_ifgreatereq_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_integerIM_ifgreatereq_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color3IM_ifgreatereq_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color4IM_ifgreatereq_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector2IM_ifgreatereq_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector3IM_ifgreatereq_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector4IM_ifgreatereq_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix33IM_ifgreatereq_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix44IM_ifgreatereq_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_floatIIM_ifgreatereq_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_integerIIM_ifgreatereq_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color3IIM_ifgreatereq_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_color4IIM_ifgreatereq_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector2IIM_ifgreatereq_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector3IIM_ifgreatereq_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifgreatereq_vector4IIM_ifgreatereq_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix33IIM_ifgreatereq_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifgreatereq_matrix44IIM_ifgreatereq_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatIM_ifequal_float_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerIM_ifequal_integer_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3IM_ifequal_color3_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4IM_ifequal_color4_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2IM_ifequal_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3IM_ifequal_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4IM_ifequal_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33IM_ifequal_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44IM_ifequal_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatIIM_ifequal_floatI_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerIIM_ifequal_integerI_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3IIM_ifequal_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4IIM_ifequal_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2IIM_ifequal_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3IIM_ifequal_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4IIM_ifequal_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33IIM_ifequal_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44IIM_ifequal_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_floatBIM_ifequal_floatB_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_integerBIM_ifequal_integerB_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color3BIM_ifequal_color3B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_color4BIM_ifequal_color4B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector2BIM_ifequal_vector2B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector3BIM_ifequal_vector3B_genoslstdlib_genosl_impl.mtlx
                            ND_ifequal_vector4BIM_ifequal_vector4B_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix33BIM_ifequal_matrix33B_genoslstdlib_genosl_impl.mtlx +
                            ND_ifequal_matrix44BIM_ifequal_matrix44B_genoslstdlib_genosl_impl.mtlx
                            ND_switch_floatIM_switch_float_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color3IM_switch_color3_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color4IM_switch_color4_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector2IM_switch_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector3IM_switch_vector3_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector4IM_switch_vector4_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix33IM_switch_matrix33_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix44IM_switch_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_switch_floatIIM_switch_floatI_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color3IIM_switch_color3I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_color4IIM_switch_color4I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector2IIM_switch_vector2I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector3IIM_switch_vector3I_genoslstdlib_genosl_impl.mtlx
                            ND_switch_vector4IIM_switch_vector4I_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix33IIM_switch_matrix33I_genoslstdlib_genosl_impl.mtlx +
                            ND_switch_matrix44IIM_switch_matrix44I_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_color3IM_convert_float_color3_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_color4IM_convert_float_color4_genoslstdlib_genosl_impl.mtlx
                            ND_convert_float_vector2IM_convert_float_vector2_genoslstdlib_genosl_impl.mtlx @@ -2723,41 +2887,6 @@
                            ND_convert_color4_color3IM_convert_color4_color3_genoslstdlib_genosl_impl.mtlx
                            ND_convert_boolean_floatIM_convert_boolean_float_genoslstdlib_genosl_impl.mtlx
                            ND_convert_integer_floatIM_convert_integer_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_color3IM_swizzle_float_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_color4IM_swizzle_float_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector2IM_swizzle_float_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector3IM_swizzle_float_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_float_vector4IM_swizzle_float_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_floatIM_swizzle_color3_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_color3IM_swizzle_color3_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_color4IM_swizzle_color3_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector2IM_swizzle_color3_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector3IM_swizzle_color3_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color3_vector4IM_swizzle_color3_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_floatIM_swizzle_color4_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_color3IM_swizzle_color4_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_color4IM_swizzle_color4_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector2IM_swizzle_color4_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector3IM_swizzle_color4_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_color4_vector4IM_swizzle_color4_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_floatIM_swizzle_vector2_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_color3IM_swizzle_vector2_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_color4IM_swizzle_vector2_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector2IM_swizzle_vector2_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector3IM_swizzle_vector2_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector2_vector4IM_swizzle_vector2_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_floatIM_swizzle_vector3_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_color3IM_swizzle_vector3_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_color4IM_swizzle_vector3_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector2IM_swizzle_vector3_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector3IM_swizzle_vector3_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector3_vector4IM_swizzle_vector3_vector4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_floatIM_swizzle_vector4_float_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_color3IM_swizzle_vector4_color3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_color4IM_swizzle_vector4_color4_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector2IM_swizzle_vector4_vector2_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector3IM_swizzle_vector4_vector3_genoslstdlib_genosl_impl.mtlx -
                            ND_swizzle_vector4_vector4IM_swizzle_vector4_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_vector2IM_combine2_vector2_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_color4CFIM_combine2_color4CF_genoslstdlib_genosl_impl.mtlx
                            ND_combine2_vector4VFIM_combine2_vector4VF_genoslstdlib_genosl_impl.mtlx @@ -2769,6 +2898,11 @@
                            ND_creatematrix_vector3_matrix33IM_creatematrix_vector3_matrix33_genoslstdlib_genosl_impl.mtlx
                            ND_creatematrix_vector3_matrix44IM_creatematrix_vector3_matrix44_genoslstdlib_genosl_impl.mtlx
                            ND_creatematrix_vector4_matrix44IM_creatematrix_vector4_matrix44_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_color3IM_extract_color3_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_color4IM_extract_color4_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector2IM_extract_vector2_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector3IM_extract_vector3_genoslstdlib_genosl_impl.mtlx +
                            ND_extract_vector4IM_extract_vector4_genoslstdlib_genosl_impl.mtlx
                            ND_blur_floatIM_blur_float_genoslstdlib_genosl_impl.mtlx
                            ND_blur_color3IM_blur_color3_genoslstdlib_genosl_impl.mtlx
                            ND_blur_color4IM_blur_color4_genoslstdlib_genosl_impl.mtlx @@ -2797,7 +2931,7 @@ -
                            190 node graphs +
                            185 node graphs
                            DefinitionNodeGraphFile
                            ND_disney_brdf_2012_surfaceIM_disney_brdf_2012_surface_brdf_explorerdisney_brdf_2012.mtlx
                            ND_disney_bsdf_2015_surfaceIM_disney_bsdf_2015_surface_pbrtdisney_brdf_2015.mtlx @@ -2979,11 +3113,6 @@
                            ND_convert_vector4_surfaceshaderNG_convert_vector4_surfaceshaderstdlib_ng.mtlx
                            ND_convert_integer_surfaceshaderNG_convert_integer_surfaceshaderstdlib_ng.mtlx
                            ND_convert_boolean_surfaceshaderNG_convert_boolean_surfaceshaderstdlib_ng.mtlx -
                            ND_extract_color3NG_extract_color3stdlib_ng.mtlx -
                            ND_extract_color4NG_extract_color4stdlib_ng.mtlx -
                            ND_extract_vector2NG_extract_vector2stdlib_ng.mtlx -
                            ND_extract_vector3NG_extract_vector3stdlib_ng.mtlx -
                            ND_extract_vector4NG_extract_vector4stdlib_ng.mtlx
                            ND_separate2_vector2NG_separate2_vector2stdlib_ng.mtlx
                            ND_separate3_color3NG_separate3_color3stdlib_ng.mtlx
                            ND_separate3_vector3NG_separate3_vector3stdlib_ng.mtlx @@ -2998,7 +3127,7 @@ ##### Second Library Definitions / Implementations -
                            540 shaders: essl +
                            541 shaders: essl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3012,6 +3141,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -3545,7 +3675,7 @@ -
                            540 shaders: genglsl +
                            541 shaders: genglsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genglsllights_genglsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genglsllights_genglsl_impl.mtlx @@ -3559,6 +3689,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genglslpbrlib_genglsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genglslpbrlib_genglsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genglslpbrlib_genglsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genglslpbrlib_genglsl_impl.mtlx @@ -4092,7 +4223,7 @@ -
                            549 shaders: genmdl +
                            550 shaders: genmdl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genmdlnprlib_genmdl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genmdlpbrlib_genmdl_impl.mtlx @@ -4103,6 +4234,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmdlpbrlib_genmdl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_conical_edfIM_conical_edf_genmdlpbrlib_genmdl_impl.mtlx
                            ND_measured_edfIM_measured_edf_genmdlpbrlib_genmdl_impl.mtlx @@ -4648,7 +4780,7 @@ -
                            539 shaders: genmsl +
                            540 shaders: genmsl
                            DefinitionImplementationFile
                            ND_point_lightIM_point_light_genmsllights_genmsl_impl.mtlx
                            ND_directional_lightIM_directional_light_genmsllights_genmsl_impl.mtlx @@ -4662,6 +4794,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genmslpbrlib_genmsl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genmslpbrlib_genmsl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genmslpbrlib_genmsl_impl.mtlx
                            ND_surfaceIM_surface_genmslpbrlib_genmsl_impl.mtlx @@ -5194,7 +5327,7 @@ -
                            537 shaders: genosl +
                            538 shaders: genosl
                            DefinitionImplementationFile
                            ND_viewdirection_vector3IM_viewdirection_vector3_genoslnprlib_genosl_impl.mtlx
                            ND_oren_nayar_diffuse_bsdfIM_oren_nayar_diffuse_bsdf_genoslpbrlib_genosl_impl.mtlx @@ -5205,6 +5338,7 @@
                            ND_generalized_schlick_bsdfIM_generalized_schlick_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_subsurface_bsdfIM_subsurface_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_sheen_bsdfIM_sheen_bsdf_genoslpbrlib_genosl_impl.mtlx +
                            ND_thin_film_bsdfIM_thin_film_bsdf_genoslpbrlib_genosl_impl.mtlx
                            ND_uniform_edfIM_uniform_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_generalized_schlick_edfIM_generalized_schlick_edf_genoslpbrlib_genosl_impl.mtlx
                            ND_anisotropic_vdfIM_anisotropic_vdf_genoslpbrlib_genosl_impl.mtlx @@ -5940,43 +6074,195 @@ ### Implementation Comparison -First library implementation count: 2357 -Second library implementation count: 2356 +First library implementation count: 2489 +Second library implementation count: 2360 -
                            1 implementations added +
                            129 implementations added + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            Name Node Category Node Type
                            IM_add_integer_genglsl add integer
                            IM_add_integer_genmdl add integer
                            IM_add_integer_genmsl add integer
                            IM_add_integer_genosl add integer
                            IM_extract_color3_genglsl extract float
                            IM_extract_color3_genmdl extract float
                            IM_extract_color3_genmsl extract float
                            IM_extract_color3_genosl extract float
                            IM_extract_color4_genglsl extract float
                            IM_extract_color4_genmdl extract float
                            IM_extract_color4_genmsl extract float
                            IM_extract_color4_genosl extract float
                            IM_extract_vector2_genglsl extract float
                            IM_extract_vector2_genmdl extract float
                            IM_extract_vector2_genmsl extract float
                            IM_extract_vector2_genosl extract float
                            IM_extract_vector3_genglsl extract float
                            IM_extract_vector3_genmdl extract float
                            IM_extract_vector3_genmsl extract float
                            IM_extract_vector3_genosl extract float
                            IM_extract_vector4_genglsl extract float
                            IM_extract_vector4_genmdl extract float
                            IM_extract_vector4_genmsl extract float
                            IM_extract_vector4_genosl extract float
                            IM_ifequal_integerB_genglsl ifequal integer
                            IM_ifequal_integerB_genmdl ifequal integer
                            IM_ifequal_integerB_genmsl ifequal integer
                            IM_ifequal_integerB_genosl ifequal integer
                            IM_ifequal_integerI_genglsl ifequal integer
                            IM_ifequal_integerI_genmdl ifequal integer
                            IM_ifequal_integerI_genmsl ifequal integer
                            IM_ifequal_integerI_genosl ifequal integer
                            IM_ifequal_integer_genglsl ifequal integer
                            IM_ifequal_integer_genmdl ifequal integer
                            IM_ifequal_integer_genmsl ifequal integer
                            IM_ifequal_integer_genosl ifequal integer
                            IM_ifequal_matrix33B_genglsl ifequal matrix33
                            IM_ifequal_matrix33B_genmdl ifequal matrix33
                            IM_ifequal_matrix33B_genmsl ifequal matrix33
                            IM_ifequal_matrix33B_genosl ifequal matrix33
                            IM_ifequal_matrix33I_genglsl ifequal matrix33
                            IM_ifequal_matrix33I_genmdl ifequal matrix33
                            IM_ifequal_matrix33I_genmsl ifequal matrix33
                            IM_ifequal_matrix33I_genosl ifequal matrix33
                            IM_ifequal_matrix33_genglsl ifequal matrix33
                            IM_ifequal_matrix33_genmdl ifequal matrix33
                            IM_ifequal_matrix33_genmsl ifequal matrix33
                            IM_ifequal_matrix33_genosl ifequal matrix33
                            IM_ifequal_matrix44B_genglsl ifequal matrix44
                            IM_ifequal_matrix44B_genmdl ifequal matrix44
                            IM_ifequal_matrix44B_genmsl ifequal matrix44
                            IM_ifequal_matrix44B_genosl ifequal matrix44
                            IM_ifequal_matrix44I_genglsl ifequal matrix44
                            IM_ifequal_matrix44I_genmdl ifequal matrix44
                            IM_ifequal_matrix44I_genmsl ifequal matrix44
                            IM_ifequal_matrix44I_genosl ifequal matrix44
                            IM_ifequal_matrix44_genglsl ifequal matrix44
                            IM_ifequal_matrix44_genmdl ifequal matrix44
                            IM_ifequal_matrix44_genmsl ifequal matrix44
                            IM_ifequal_matrix44_genosl ifequal matrix44
                            IM_ifgreater_integerI_genglsl ifgreater integer
                            IM_ifgreater_integerI_genmdl ifgreater integer
                            IM_ifgreater_integerI_genmsl ifgreater integer
                            IM_ifgreater_integerI_genosl ifgreater integer
                            IM_ifgreater_integer_genglsl ifgreater integer
                            IM_ifgreater_integer_genmdl ifgreater integer
                            IM_ifgreater_integer_genmsl ifgreater integer
                            IM_ifgreater_integer_genosl ifgreater integer
                            IM_ifgreater_matrix33I_genglsl ifgreater matrix33
                            IM_ifgreater_matrix33I_genmdl ifgreater matrix33
                            IM_ifgreater_matrix33I_genmsl ifgreater matrix33
                            IM_ifgreater_matrix33I_genosl ifgreater matrix33
                            IM_ifgreater_matrix33_genglsl ifgreater matrix33
                            IM_ifgreater_matrix33_genmdl ifgreater matrix33
                            IM_ifgreater_matrix33_genmsl ifgreater matrix33
                            IM_ifgreater_matrix33_genosl ifgreater matrix33
                            IM_ifgreater_matrix44I_genglsl ifgreater matrix44
                            IM_ifgreater_matrix44I_genmdl ifgreater matrix44
                            IM_ifgreater_matrix44I_genmsl ifgreater matrix44
                            IM_ifgreater_matrix44I_genosl ifgreater matrix44
                            IM_ifgreater_matrix44_genglsl ifgreater matrix44
                            IM_ifgreater_matrix44_genmdl ifgreater matrix44
                            IM_ifgreater_matrix44_genmsl ifgreater matrix44
                            IM_ifgreater_matrix44_genosl ifgreater matrix44
                            IM_ifgreatereq_integerI_genglsl ifgreatereq integer
                            IM_ifgreatereq_integerI_genmdl ifgreatereq integer
                            IM_ifgreatereq_integerI_genmsl ifgreatereq integer
                            IM_ifgreatereq_integerI_genosl ifgreatereq integer
                            IM_ifgreatereq_integer_genglsl ifgreatereq integer
                            IM_ifgreatereq_integer_genmdl ifgreatereq integer
                            IM_ifgreatereq_integer_genmsl ifgreatereq integer
                            IM_ifgreatereq_integer_genosl ifgreatereq integer
                            IM_ifgreatereq_matrix33I_genglsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genmdl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genmsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33I_genosl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genglsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genmdl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genmsl ifgreatereq matrix33
                            IM_ifgreatereq_matrix33_genosl ifgreatereq matrix33
                            IM_ifgreatereq_matrix44I_genglsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genmdl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genmsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44I_genosl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genglsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genmdl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genmsl ifgreatereq matrix44
                            IM_ifgreatereq_matrix44_genosl ifgreatereq matrix44
                            IM_subtract_integer_genglsl subtract integer
                            IM_subtract_integer_genmdl subtract integer
                            IM_subtract_integer_genmsl subtract integer
                            IM_subtract_integer_genosl subtract integer
                            IM_switch_matrix33I_genglsl switch matrix33
                            IM_switch_matrix33I_genmdl switch matrix33
                            IM_switch_matrix33I_genmsl switch matrix33
                            IM_switch_matrix33I_genosl switch matrix33
                            IM_switch_matrix33_genglsl switch matrix33
                            IM_switch_matrix33_genmdl switch matrix33
                            IM_switch_matrix33_genmsl switch matrix33
                            IM_switch_matrix33_genosl switch matrix33
                            IM_switch_matrix44I_genglsl switch matrix44
                            IM_switch_matrix44I_genmdl switch matrix44
                            IM_switch_matrix44I_genmsl switch matrix44
                            IM_switch_matrix44I_genosl switch matrix44
                            IM_switch_matrix44_genglsl switch matrix44
                            IM_switch_matrix44_genmdl switch matrix44
                            IM_switch_matrix44_genmsl switch matrix44
                            IM_switch_matrix44_genosl switch matrix44
                            NG_open_pbr_surface_surfaceshader open_pbr_surface surfaceshader
                            -
                            21 implementations modified +
                            45 implementations modified - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                            Name Change
                            IM_add_bsdf_genosl - attribute: sourcecode=( ({{in1}} + {{in2}}) ) removed from: IM_add_bsdf_genosl
                            IM_add_edf_genosl - attribute: sourcecode=( ({{in1}} + {{in2}}) ) removed from: IM_add_edf_genosl
                            IM_anisotropic_vdf_genosl - attribute: file changed on IM_anisotropic_vdf_genosl from ( mx_anisotropic_vdf.osl ) to ( legacy/mx_anisotropic_vdf.osl )
                            IM_burley_diffuse_bsdf_genosl - attribute: sourcecode=( {{weight}} * burley_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) removed from: IM_burley_diffuse_bsdf_genosl
                            - attribute: file=( legacy/mx_burley_diffuse_bsdf.osl ) added to: IM_burley_diffuse_bsdf_genosl
                            - attribute: function=( mx_burley_diffuse_bsdf ) added to: IM_burley_diffuse_bsdf_genosl
                            IM_conductor_bsdf_genosl - attribute: sourcecode=( {{weight}} * conductor_bsdf({{normal}}, {{tangent}}, {{roughness}}.x, {{roughness}}.y, {{ior}}, {{extinction}}, {{distribution}}) ) removed from: IM_conductor_bsdf_genosl
                            - attribute: file=( legacy/mx_conductor_bsdf.osl ) added to: IM_conductor_bsdf_genosl
                            - attribute: function=( mx_conductor_bsdf ) added to: IM_conductor_bsdf_genosl
                            IM_dielectric_bsdf_genosl - attribute: file changed on IM_dielectric_bsdf_genosl from ( mx_dielectric_bsdf.osl ) to ( legacy/mx_dielectric_bsdf.osl )
                            IM_generalized_schlick_bsdf_genosl - attribute: file changed on IM_generalized_schlick_bsdf_genosl from ( mx_generalized_schlick_bsdf.osl ) to ( legacy/mx_generalized_schlick_bsdf.osl )
                            IM_mix_bsdf_genosl - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) removed from: IM_mix_bsdf_genosl
                            IM_mix_edf_genosl - attribute: sourcecode=( mix({{bg}}, {{fg}}, {{mix}}) ) removed from: IM_mix_edf_genosl
                            IM_multiply_bsdfC_genosl - attribute: sourcecode=( ({{in2}} * {{in1}}) ) removed from: IM_multiply_bsdfC_genosl
                            IM_multiply_bsdfF_genosl - attribute: sourcecode=( ({{in2}} * {{in1}}) ) removed from: IM_multiply_bsdfF_genosl
                            IM_multiply_edfC_genosl - attribute: sourcecode=( ({{in2}} * {{in1}}) ) removed from: IM_multiply_edfC_genosl
                            IM_multiply_edfF_genosl - attribute: sourcecode=( ({{in2}} * {{in1}}) ) removed from: IM_multiply_edfF_genosl
                            IM_oren_nayar_diffuse_bsdf_genosl - attribute: sourcecode=( {{weight}} * oren_nayar_diffuse_bsdf({{normal}}, {{color}}, {{roughness}}) ) removed from: IM_oren_nayar_diffuse_bsdf_genosl
                            - attribute: file=( legacy/mx_oren_nayar_diffuse_bsdf.osl ) added to: IM_oren_nayar_diffuse_bsdf_genosl
                            - attribute: function=( mx_oren_nayar_diffuse_bsdf ) added to: IM_oren_nayar_diffuse_bsdf_genosl
                            IM_sheen_bsdf_genosl - attribute: sourcecode=( {{weight}} * sheen_bsdf({{normal}}, {{color}}, {{roughness}}) ) removed from: IM_sheen_bsdf_genosl
                            - attribute: file=( legacy/mx_sheen_bsdf.osl ) added to: IM_sheen_bsdf_genosl
                            - attribute: function=( mx_sheen_bsdf ) added to: IM_sheen_bsdf_genosl
                            IM_subsurface_bsdf_genosl - attribute: file changed on IM_subsurface_bsdf_genosl from ( mx_subsurface_bsdf.osl ) to ( legacy/mx_subsurface_bsdf.osl )
                            IM_surface_genosl - attribute: file changed on IM_surface_genosl from ( mx_surface.osl ) to ( legacy/mx_surface.osl )
                            IM_translucent_bsdf_genosl - attribute: sourcecode=( {{weight}} * translucent_bsdf({{normal}}, {{color}}) ) removed from: IM_translucent_bsdf_genosl
                            - attribute: file=( legacy/mx_translucent_bsdf.osl ) added to: IM_translucent_bsdf_genosl
                            - attribute: function=( mx_translucent_bsdf ) added to: IM_translucent_bsdf_genosl
                            IM_uniform_edf_genosl - attribute: sourcecode changed on IM_uniform_edf_genosl from ( uniform_edf({{color}}) ) to ( {{color}} * emission() )
                            NG_gooch_shade - Number of children on: normal changed from ( 1 ) to ( 0 )
                            - input /space removed from NG_gooch_shade/normal. Value=( world )
                            - Number of children on: viewdir changed from ( 1 ) to ( 0 )
                            - input /space removed from NG_gooch_shade/viewdir. Value=( world )
                            NG_standard_surface_to_gltf_pbr - Number of children on: NG_standard_surface_to_gltf_pbr changed from ( 29 ) to ( 31 )
                            - ifgreater /sheen_roughness removed from NG_standard_surface_to_gltf_pbr
                            - dot /normal add to NG_standard_surface_to_gltf_pbr
                            - ifgreater /sheen_roughness1 add to NG_standard_surface_to_gltf_pbr
                            - output /normal_out added to NG_standard_surface_to_gltf_pbr. Value=( )
                            - attribute: nodename changed on sheen_roughness_out from ( sheen_roughness ) to ( sheen_roughness1 )
                            IM_atan2_float_genglsl - attribute: sourcecode changed on IM_atan2_float_genglsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_float_genmdl - attribute: sourcecode changed on IM_atan2_float_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_float_genmsl - attribute: sourcecode changed on IM_atan2_float_genmsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_float_genosl - attribute: sourcecode changed on IM_atan2_float_genosl from ( atan2({{in1}},{{in2}}) ) to ( atan2({{iny}},{{inx}}) )
                            IM_atan2_vector2_genglsl - attribute: sourcecode changed on IM_atan2_vector2_genglsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector2_genmdl - attribute: sourcecode changed on IM_atan2_vector2_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector2_genmsl - attribute: sourcecode changed on IM_atan2_vector2_genmsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector2_genosl - attribute: sourcecode changed on IM_atan2_vector2_genosl from ( atan2({{in1}},{{in2}}) ) to ( atan2({{iny}},{{inx}}) )
                            IM_atan2_vector3_genglsl - attribute: sourcecode changed on IM_atan2_vector3_genglsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector3_genmdl - attribute: sourcecode changed on IM_atan2_vector3_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector3_genmsl - attribute: sourcecode changed on IM_atan2_vector3_genmsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector3_genosl - attribute: sourcecode changed on IM_atan2_vector3_genosl from ( atan2({{in1}},{{in2}}) ) to ( atan2({{iny}},{{inx}}) )
                            IM_atan2_vector4_genglsl - attribute: sourcecode changed on IM_atan2_vector4_genglsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector4_genmdl - attribute: sourcecode changed on IM_atan2_vector4_genmdl from ( math::atan2({{in1}}, {{in2}}) ) to ( math::atan2({{iny}}, {{inx}}) )
                            IM_atan2_vector4_genmsl - attribute: sourcecode changed on IM_atan2_vector4_genmsl from ( atan({{in1}}, {{in2}}) ) to ( atan({{iny}}, {{inx}}) )
                            IM_atan2_vector4_genosl - attribute: sourcecode changed on IM_atan2_vector4_genosl from ( atan2({{in1}},{{in2}}) ) to ( atan2({{iny}},{{inx}}) )
                            IM_conductor_bsdf_genmdl - attribute: sourcecode changed on IM_conductor_bsdf_genmdl from ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_conductor_bsdf(mxp_weight:{{weight}}, mxp_ior:{{ior}}, mxp_extinction:{{extinction}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}) )
                            IM_conductor_bsdf_genosl - attribute: sourcecode changed on IM_conductor_bsdf_genosl from ( {{weight}} * conductor_bsdf({{normal}}, {{tangent}}, {{roughness}}.x, {{roughness}}.y, {{ior}}, {{extinction}}, {{distribution}}) ) to ( {{weight}} * conductor_bsdf({{normal}}, {{tangent}}, {{roughness}}.x, {{roughness}}.y, {{ior}}, {{extinction}}, {{distribution}}, "thinfilm_thickness", {{thinfilm_thickness}}, "thinfilm_ior", {{thinfilm_ior}}) )
                            IM_dielectric_bsdf_genmdl - attribute: sourcecode changed on IM_dielectric_bsdf_genmdl from ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_dielectric_bsdf(mxp_weight:{{weight}}, mxp_tint:{{tint}}, mxp_ior:{{ior}}, mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) )
                            IM_generalized_schlick_bsdf_genmdl - attribute: sourcecode changed on IM_generalized_schlick_bsdf_genmdl from ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}) ) to ( materialx::pbrlib_{{MDL_VERSION_SUFFIX}}::mx_generalized_schlick_bsdf(mxp_weight:{{weight}}, mxp_color0:{{color0}}, mxp_color90:{{color90}}, mxp_exponent:{{exponent}},mxp_roughness:{{roughness}}, mxp_thinfilm_thickness:{{thinfilm_thickness}}, mxp_thinfilm_ior:{{thinfilm_ior}}, mxp_normal:{{normal}}, mxp_tangent:{{tangent}}, mxp_distribution:{{distribution}}, mxp_scatter_mode:{{scatter_mode}}, mxp_base:{{base}}) )
                            IM_normalmap_float_genglsl - attribute: nodedef changed on IM_normalmap_float_genglsl from ( ND_normalmap ) to ( ND_normalmap_float )
                            IM_normalmap_float_genmdl - attribute: nodedef changed on IM_normalmap_float_genmdl from ( ND_normalmap ) to ( ND_normalmap_float )
                            IM_normalmap_float_genmsl - attribute: nodedef changed on IM_normalmap_float_genmsl from ( ND_normalmap ) to ( ND_normalmap_float )
                            IM_normalmap_float_genosl - attribute: nodedef changed on IM_normalmap_float_genosl from ( ND_normalmap ) to ( ND_normalmap_float )
                            IM_round_color3_genmdl - attribute: sourcecode changed on IM_round_color3_genmdl from ( mx::stdlib::mx_round_color3({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_round_color3({{in}}) )
                            IM_round_color4_genmdl - attribute: sourcecode changed on IM_round_color4_genmdl from ( mx::stdlib::mx_round_color4({{in}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_round_color4({{in}}) )
                            IM_switch_color3I_genmdl - attribute: sourcecode changed on IM_switch_color3I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color3_genmdl - attribute: sourcecode changed on IM_switch_color3_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color4I_genmdl - attribute: sourcecode changed on IM_switch_color4I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_color4_genmdl - attribute: sourcecode changed on IM_switch_color4_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_color4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_floatI_genmdl - attribute: sourcecode changed on IM_switch_floatI_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_floatI({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_float_genmdl - attribute: sourcecode changed on IM_switch_float_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_float({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector2I_genmdl - attribute: sourcecode changed on IM_switch_vector2I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector2_genmdl - attribute: sourcecode changed on IM_switch_vector2_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector2({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector3I_genmdl - attribute: sourcecode changed on IM_switch_vector3I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector3_genmdl - attribute: sourcecode changed on IM_switch_vector3_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector3({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector4I_genmdl - attribute: sourcecode changed on IM_switch_vector4I_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4I({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            IM_switch_vector4_genmdl - attribute: sourcecode changed on IM_switch_vector4_genmdl from ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{which}}) ) to ( materialx::stdlib_{{MDL_VERSION_SUFFIX}}::mx_switch_vector4({{in1}}, {{in2}}, {{in3}}, {{in4}}, {{in5}}, {{in6}}, {{in7}}, {{in8}}, {{in9}}, {{in10}}, {{which}}) )
                            NG_overlay_color3 - attribute: nodedef=( ND_separate3_color3 ) removed from: N_split_color3_fg
                            - attribute: nodedef=( ND_separate3_color3 ) removed from: N_split_color3_bg
                            NG_overlay_color4 - attribute: nodedef=( ND_separate4_color4 ) removed from: N_split_fg
                            - attribute: nodedef=( ND_separate4_color4 ) removed from: N_split_bg
                            NG_separate2_vector2 - extract /N_x_vector2 removed from NG_separate2_vector2
                            - extract /N_y_vector2 removed from NG_separate2_vector2
                            - extract /N_extract_0 add to NG_separate2_vector2
                            - extract /N_extract_1 add to NG_separate2_vector2
                            - attribute: nodename changed on outx from ( N_x_vector2 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector2 ) to ( N_extract_1 )
                            NG_separate3_color3 - extract /N_r_color3 removed from NG_separate3_color3
                            - extract /N_g_color3 removed from NG_separate3_color3
                            - extract /N_b_color3 removed from NG_separate3_color3
                            - extract /N_extract_0 add to NG_separate3_color3
                            - extract /N_extract_1 add to NG_separate3_color3
                            - extract /N_extract_2 add to NG_separate3_color3
                            - attribute: nodename changed on outr from ( N_r_color3 ) to ( N_extract_0 )
                            - attribute: nodename changed on outg from ( N_g_color3 ) to ( N_extract_1 )
                            - attribute: nodename changed on outb from ( N_b_color3 ) to ( N_extract_2 )
                            NG_separate3_vector3 - extract /N_x_vector3 removed from NG_separate3_vector3
                            - extract /N_y_vector3 removed from NG_separate3_vector3
                            - extract /N_z_vector3 removed from NG_separate3_vector3
                            - extract /N_extract_0 add to NG_separate3_vector3
                            - extract /N_extract_1 add to NG_separate3_vector3
                            - extract /N_extract_2 add to NG_separate3_vector3
                            - attribute: nodename changed on outx from ( N_x_vector3 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector3 ) to ( N_extract_1 )
                            - attribute: nodename changed on outz from ( N_z_vector3 ) to ( N_extract_2 )
                            NG_separate4_color4 - extract /N_r_color4 removed from NG_separate4_color4
                            - extract /N_g_color4 removed from NG_separate4_color4
                            - extract /N_b_color4 removed from NG_separate4_color4
                            - extract /N_a_color4 removed from NG_separate4_color4
                            - extract /N_extract_0 add to NG_separate4_color4
                            - extract /N_extract_1 add to NG_separate4_color4
                            - extract /N_extract_2 add to NG_separate4_color4
                            - extract /N_extract_3 add to NG_separate4_color4
                            - attribute: nodename changed on outr from ( N_r_color4 ) to ( N_extract_0 )
                            - attribute: nodename changed on outg from ( N_g_color4 ) to ( N_extract_1 )
                            - attribute: nodename changed on outb from ( N_b_color4 ) to ( N_extract_2 )
                            - attribute: nodename changed on outa from ( N_a_color4 ) to ( N_extract_3 )
                            NG_separate4_vector4 - extract /N_x_vector4 removed from NG_separate4_vector4
                            - extract /N_y_vector4 removed from NG_separate4_vector4
                            - extract /N_z_vector4 removed from NG_separate4_vector4
                            - extract /N_w_vector4 removed from NG_separate4_vector4
                            - extract /N_extract_0 add to NG_separate4_vector4
                            - extract /N_extract_1 add to NG_separate4_vector4
                            - extract /N_extract_2 add to NG_separate4_vector4
                            - extract /N_extract_3 add to NG_separate4_vector4
                            - attribute: nodename changed on outx from ( N_x_vector4 ) to ( N_extract_0 )
                            - attribute: nodename changed on outy from ( N_y_vector4 ) to ( N_extract_1 )
                            - attribute: nodename changed on outz from ( N_z_vector4 ) to ( N_extract_2 )
                            - attribute: nodename changed on outw from ( N_w_vector4 ) to ( N_extract_3 )